mirror of
				https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
				synced 2025-10-31 17:59:03 +01:00 
			
		
		
		
	fixed BuildingAdminMenu
This commit is contained in:
		| @@ -24,7 +24,6 @@ public class BuildingAdminMenu extends Dialog { | ||||
|     private final Button takeMortgageButton = new Button("Hypothek aufnehmen"); | ||||
|     private final Button payMortgageButton = new Button("Hypothek bezahlen"); | ||||
|     private final Button overviewButton = new Button("Übersicht"); | ||||
|     private Geometry background; | ||||
|  | ||||
|     public BuildingAdminMenu(MonopolyApp app) { | ||||
|         super(app.getDialogManager()); | ||||
| @@ -43,7 +42,7 @@ public class BuildingAdminMenu extends Dialog { | ||||
|         // Add content | ||||
|         mainContainer.addChild(createContent()); | ||||
|         // Attach main container to GUI node | ||||
|         attachChild(mainContainer); | ||||
|         app.getGuiNode().attachChild(mainContainer); | ||||
|         mainContainer.setLocalTranslation( | ||||
|                 (app.getCamera().getWidth() - mainContainer.getPreferredSize().x) / 2, | ||||
|                 (app.getCamera().getHeight() + mainContainer.getPreferredSize().y) / 2, | ||||
| @@ -82,7 +81,6 @@ public class BuildingAdminMenu extends Dialog { | ||||
|         overviewButton.setPreferredSize(new Vector3f(200, 50, 0)); | ||||
|         overviewButton.addClickCommands(s -> ifTopDialog(() -> { | ||||
|             app.getGameLogic().playSound(Sound.BUTTON); | ||||
|             new PropertyOverviewMenu(app).open(); | ||||
|         })); | ||||
|         overviewColumn.addChild(overviewButton); | ||||
|  | ||||
| @@ -147,23 +145,29 @@ public class BuildingAdminMenu extends Dialog { | ||||
|     private void addBackgroundImage() { | ||||
|         Texture backgroundImage = app.getAssetManager().loadTexture("Pictures/unibw-Bib2.png"); | ||||
|         Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); | ||||
|         background = new Geometry("Background", quad); | ||||
|         Geometry background = new Geometry("Background", quad); | ||||
|         Material backgroundMaterial = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); | ||||
|         backgroundMaterial.setTexture("ColorMap", backgroundImage); | ||||
|         background.setMaterial(backgroundMaterial); | ||||
|         background.setLocalTranslation(0, 0, 6); // Position behind other GUI elements | ||||
|         attachChild(background); | ||||
|         app.getGuiNode().attachChild(background); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Handles the "Zurück" action. | ||||
|      */ | ||||
|     private void handleBack() { | ||||
|         app.getGameLogic().playSound(Sound.BUTTON); | ||||
|         close(); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void escape() { | ||||
|         new SettingsMenu(app).open(); | ||||
|         handleBack(); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void close() { | ||||
|         detachChild(background); | ||||
|         detachChild(mainContainer); | ||||
|         super.close(); | ||||
|     public void update(float delta) { | ||||
|         // Periodic updates if necessary | ||||
|     } | ||||
| } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user