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 takeMortgageButton = new Button("Hypothek aufnehmen"); | ||||||
|     private final Button payMortgageButton = new Button("Hypothek bezahlen"); |     private final Button payMortgageButton = new Button("Hypothek bezahlen"); | ||||||
|     private final Button overviewButton = new Button("Übersicht"); |     private final Button overviewButton = new Button("Übersicht"); | ||||||
|     private Geometry background; |  | ||||||
|  |  | ||||||
|     public BuildingAdminMenu(MonopolyApp app) { |     public BuildingAdminMenu(MonopolyApp app) { | ||||||
|         super(app.getDialogManager()); |         super(app.getDialogManager()); | ||||||
| @@ -43,7 +42,7 @@ public class BuildingAdminMenu extends Dialog { | |||||||
|         // Add content |         // Add content | ||||||
|         mainContainer.addChild(createContent()); |         mainContainer.addChild(createContent()); | ||||||
|         // Attach main container to GUI node |         // Attach main container to GUI node | ||||||
|         attachChild(mainContainer); |         app.getGuiNode().attachChild(mainContainer); | ||||||
|         mainContainer.setLocalTranslation( |         mainContainer.setLocalTranslation( | ||||||
|                 (app.getCamera().getWidth() - mainContainer.getPreferredSize().x) / 2, |                 (app.getCamera().getWidth() - mainContainer.getPreferredSize().x) / 2, | ||||||
|                 (app.getCamera().getHeight() + mainContainer.getPreferredSize().y) / 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.setPreferredSize(new Vector3f(200, 50, 0)); | ||||||
|         overviewButton.addClickCommands(s -> ifTopDialog(() -> { |         overviewButton.addClickCommands(s -> ifTopDialog(() -> { | ||||||
|             app.getGameLogic().playSound(Sound.BUTTON); |             app.getGameLogic().playSound(Sound.BUTTON); | ||||||
|             new PropertyOverviewMenu(app).open(); |  | ||||||
|         })); |         })); | ||||||
|         overviewColumn.addChild(overviewButton); |         overviewColumn.addChild(overviewButton); | ||||||
|  |  | ||||||
| @@ -147,23 +145,29 @@ public class BuildingAdminMenu extends Dialog { | |||||||
|     private void addBackgroundImage() { |     private void addBackgroundImage() { | ||||||
|         Texture backgroundImage = app.getAssetManager().loadTexture("Pictures/unibw-Bib2.png"); |         Texture backgroundImage = app.getAssetManager().loadTexture("Pictures/unibw-Bib2.png"); | ||||||
|         Quad quad = new Quad(app.getCamera().getWidth(), app.getCamera().getHeight()); |         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"); |         Material backgroundMaterial = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); | ||||||
|         backgroundMaterial.setTexture("ColorMap", backgroundImage); |         backgroundMaterial.setTexture("ColorMap", backgroundImage); | ||||||
|         background.setMaterial(backgroundMaterial); |         background.setMaterial(backgroundMaterial); | ||||||
|         background.setLocalTranslation(0, 0, 6); // Position behind other GUI elements |         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 |     @Override | ||||||
|     public void escape() { |     public void escape() { | ||||||
|         new SettingsMenu(app).open(); |         handleBack(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public void close() { |     public void update(float delta) { | ||||||
|         detachChild(background); |         // Periodic updates if necessary | ||||||
|         detachChild(mainContainer); |  | ||||||
|         super.close(); |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
		Reference in New Issue
	
	Block a user