mirror of
				https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
				synced 2025-11-04 13:56:22 +01:00 
			
		
		
		
	winner popup
This commit is contained in:
		@@ -0,0 +1,56 @@
 | 
				
			|||||||
 | 
					package pp.monopoly.client.gui.popups;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.jme3.asset.TextureKey;
 | 
				
			||||||
 | 
					import com.jme3.math.Vector2f;
 | 
				
			||||||
 | 
					import com.jme3.texture.Texture;
 | 
				
			||||||
 | 
					import com.simsilica.lemur.Button;
 | 
				
			||||||
 | 
					import com.simsilica.lemur.Container;
 | 
				
			||||||
 | 
					import com.simsilica.lemur.Label;
 | 
				
			||||||
 | 
					import com.simsilica.lemur.component.IconComponent;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import pp.dialog.Dialog;
 | 
				
			||||||
 | 
					import pp.monopoly.client.MonopolyApp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					public class WinnerPopUp extends Dialog {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final MonopolyApp app;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Constructs a new NetworkDialog.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param app The NetworkSupport instance to be used for network operations.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public WinnerPopUp(MonopolyApp app) {
 | 
				
			||||||
 | 
					        super(app.getDialogManager());
 | 
				
			||||||
 | 
					        this.app = app;
 | 
				
			||||||
 | 
					        initializeDialog();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Initializes the dialog with input fields and connection buttons.
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    private void initializeDialog() {
 | 
				
			||||||
 | 
					        Container inputContainer = new Container();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Titel und Eingabefelder für Host und Port
 | 
				
			||||||
 | 
					        inputContainer.addChild(new Label("Herlichen Glückwunsch!"));
 | 
				
			||||||
 | 
					        inputContainer.addChild(new Label("Du,bist der Monopoly Champion!!!"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Label imageLabel = new Label("");
 | 
				
			||||||
 | 
					        // TextureKey key = new TextureKey("Pictures/MonopolyLoser.png", false);
 | 
				
			||||||
 | 
					        // Texture texture = app.getAssetManager().loadTexture(key);
 | 
				
			||||||
 | 
					        IconComponent icon = new IconComponent("Pictures/MonopolyWinner.png"); // Icon mit Textur erstellen
 | 
				
			||||||
 | 
					        icon.setIconScale(1); // Skalierung des Bildes
 | 
				
			||||||
 | 
					        imageLabel.setIcon(icon);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Setze das Icon im Label
 | 
				
			||||||
 | 
					        inputContainer.addChild(imageLabel);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Button cancelButton = inputContainer.addChild(new Button("Spiel beenden"));
 | 
				
			||||||
 | 
					        cancelButton.addClickCommands(source -> ifTopDialog(app::closeApp));
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        inputContainer.setLocalTranslation(300, 800, 0);
 | 
				
			||||||
 | 
					        app.getGuiNode().attachChild(inputContainer);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 409 KiB  | 
		Reference in New Issue
	
	Block a user