mirror of
				https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
				synced 2025-10-31 05:41:51 +01:00 
			
		
		
		
	GulagInfo renamed
This commit is contained in:
		| @@ -9,10 +9,6 @@ import com.simsilica.lemur.style.ElementId; | |||||||
| import pp.dialog.Dialog; | import pp.dialog.Dialog; | ||||||
| import pp.monopoly.client.MonopolyApp; | import pp.monopoly.client.MonopolyApp; | ||||||
| import pp.monopoly.client.gui.SettingsMenu; | import pp.monopoly.client.gui.SettingsMenu; | ||||||
| import pp.monopoly.client.gui.TradeMenu; |  | ||||||
| import pp.monopoly.message.client.TradeResponse; |  | ||||||
| import pp.monopoly.model.TradeHandler; |  | ||||||
| import pp.monopoly.model.fields.PropertyField; |  | ||||||
| import pp.monopoly.notification.Sound; | import pp.monopoly.notification.Sound; | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -20,7 +16,7 @@ import pp.monopoly.notification.Sound; | |||||||
|  */ |  */ | ||||||
| public class GulagInfo extends Dialog { | public class GulagInfo extends Dialog { | ||||||
|     private final MonopolyApp app; |     private final MonopolyApp app; | ||||||
|     private final Container confirmTradeContainer; |     private final Container gulagInfoContainer; | ||||||
|     private final Container backgroundContainer; |     private final Container backgroundContainer; | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -34,19 +30,19 @@ public class GulagInfo extends Dialog { | |||||||
|         attachChild(backgroundContainer); |         attachChild(backgroundContainer); | ||||||
|  |  | ||||||
|         // Hauptcontainer für das Bestätigungspopup |         // Hauptcontainer für das Bestätigungspopup | ||||||
|         confirmTradeContainer = new Container(); |         gulagInfoContainer = new Container(); | ||||||
|  |  | ||||||
|         float padding = 10; // Passt den backgroundContainer an die Größe des confirmTradeContainer an |         float padding = 10; // Passt den backgroundContainer an die Größe des confirmTradeContainer an | ||||||
|         backgroundContainer.setPreferredSize(confirmTradeContainer.getPreferredSize().addLocal(padding, padding, 0)); |         backgroundContainer.setPreferredSize(gulagInfoContainer.getPreferredSize().addLocal(padding, padding, 0)); | ||||||
|          |          | ||||||
|         // Titel |         // Titel | ||||||
|         Label title = confirmTradeContainer.addChild(new Label( "Gulag", new ElementId("warning-title"))); |         Label title = gulagInfoContainer.addChild(new Label( "Gulag", new ElementId("warning-title"))); | ||||||
|         title.setFontSize(48); |         title.setFontSize(48); | ||||||
|         title.setColor(ColorRGBA.Black); |         title.setColor(ColorRGBA.Black); | ||||||
|  |  | ||||||
|         // Text, der auf der Karte steht |         // Text, der auf der Karte steht | ||||||
|         // Die Werte werden dem Handel entnommen (Iwas auch immer da dann ist) |         // Die Werte werden dem Handel entnommen (Iwas auch immer da dann ist) | ||||||
|         Container propertyValuesContainer = confirmTradeContainer.addChild(new Container()); |         Container propertyValuesContainer = gulagInfoContainer.addChild(new Container()); | ||||||
|         propertyValuesContainer.addChild(new Label("„Du sitzt im Gefänginis und kommst nicht raus ...", new ElementId("label-Text"))); |         propertyValuesContainer.addChild(new Label("„Du sitzt im Gefänginis und kommst nicht raus ...", new ElementId("label-Text"))); | ||||||
|         propertyValuesContainer.addChild(new Label("Es sei denn, du ...", new ElementId("label-Text")));// Leerzeile |         propertyValuesContainer.addChild(new Label("Es sei denn, du ...", new ElementId("label-Text")));// Leerzeile | ||||||
|         propertyValuesContainer.addChild(new Label("", new ElementId("label-Text"))); |         propertyValuesContainer.addChild(new Label("", new ElementId("label-Text"))); | ||||||
| @@ -64,42 +60,42 @@ public class GulagInfo extends Dialog { | |||||||
|  |  | ||||||
|  |  | ||||||
|         // Bezahlen-Button |         // Bezahlen-Button | ||||||
|         Button negotiateButton = confirmTradeContainer.addChild(new Button("Bestechungsgeld bezahlen", new ElementId("button"))); |         Button payButton = gulagInfoContainer.addChild(new Button("Bestechungsgeld bezahlen", new ElementId("button"))); | ||||||
|         negotiateButton.setFontSize(32); |         payButton.setFontSize(32); | ||||||
|         negotiateButton.addClickCommands(s -> ifTopDialog( () -> { |         payButton.addClickCommands(s -> ifTopDialog( () -> { | ||||||
|             app.getGameLogic().playSound(Sound.BUTTON); |             app.getGameLogic().playSound(Sound.BUTTON); | ||||||
|             close(); |             close(); | ||||||
|         })); |         })); | ||||||
|         // Ereigniskarte-Button |         // Ereigniskarte-Button | ||||||
|         Button confirmButton = confirmTradeContainer.addChild(new Button("Ereigniskarte nutzen", new ElementId("button"))); |         Button eventCardButton = gulagInfoContainer.addChild(new Button("Ereigniskarte nutzen", new ElementId("button"))); | ||||||
|         confirmButton.setFontSize(32); |         eventCardButton.setFontSize(32); | ||||||
|         confirmButton.addClickCommands(s -> ifTopDialog( () -> { |         eventCardButton.addClickCommands(s -> ifTopDialog( () -> { | ||||||
|             app.getGameLogic().playSound(Sound.BUTTON); |             app.getGameLogic().playSound(Sound.BUTTON); | ||||||
|             close(); |             close(); | ||||||
|         })); |         })); | ||||||
|         // Schließen-Button |         // Schließen-Button | ||||||
|         Button declineButton = confirmTradeContainer.addChild(new Button("Schließen", new ElementId("button"))); |         Button closeButton = gulagInfoContainer.addChild(new Button("Schließen", new ElementId("button"))); | ||||||
|         declineButton.setFontSize(32); |         closeButton.setFontSize(32); | ||||||
|         declineButton.addClickCommands(s -> ifTopDialog(() -> { |         closeButton.addClickCommands(s -> ifTopDialog(() -> { | ||||||
|             app.getGameLogic().playSound(Sound.BUTTON); |             app.getGameLogic().playSound(Sound.BUTTON); | ||||||
|             close(); |             close(); | ||||||
|         })); |         })); | ||||||
|  |  | ||||||
|         // Zentriere das Menü |         // Zentriere das Menü | ||||||
|         confirmTradeContainer.setLocalTranslation( |         gulagInfoContainer.setLocalTranslation( | ||||||
|             (app.getCamera().getWidth() - confirmTradeContainer.getPreferredSize().x) / 2, |             (app.getCamera().getWidth() - gulagInfoContainer.getPreferredSize().x) / 2, | ||||||
|             (app.getCamera().getHeight() + confirmTradeContainer.getPreferredSize().y) / 2, |             (app.getCamera().getHeight() + gulagInfoContainer.getPreferredSize().y) / 2, | ||||||
|             8 |             8 | ||||||
|         ); |         ); | ||||||
|  |  | ||||||
|         // Zentriere das Menü |         // Zentriere das Menü | ||||||
|         backgroundContainer.setLocalTranslation( |         backgroundContainer.setLocalTranslation( | ||||||
|                 (app.getCamera().getWidth() - confirmTradeContainer.getPreferredSize().x - padding) / 2, |                 (app.getCamera().getWidth() - gulagInfoContainer.getPreferredSize().x - padding) / 2, | ||||||
|                 (app.getCamera().getHeight() + confirmTradeContainer.getPreferredSize().y+ padding) / 2, |                 (app.getCamera().getHeight() + gulagInfoContainer.getPreferredSize().y+ padding) / 2, | ||||||
|                 7 |                 7 | ||||||
|         ); |         ); | ||||||
|  |  | ||||||
|         app.getGuiNode().attachChild(confirmTradeContainer); |         app.getGuiNode().attachChild(gulagInfoContainer); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
| @@ -107,7 +103,7 @@ public class GulagInfo extends Dialog { | |||||||
|      */ |      */ | ||||||
|     @Override |     @Override | ||||||
|     public void close() { |     public void close() { | ||||||
|         app.getGuiNode().detachChild(confirmTradeContainer);  // Entferne das Menü |         app.getGuiNode().detachChild(gulagInfoContainer);  // Entferne das Menü | ||||||
|         app.getGuiNode().detachChild(backgroundContainer); //Entfernt Rand |         app.getGuiNode().detachChild(backgroundContainer); //Entfernt Rand | ||||||
|         super.close(); |         super.close(); | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user