mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-04-17 12:40:59 +02:00
Compare commits
No commits in common. "160873e2ccc7127974f8a84b322c033c4572a741" and "bafc3f1db656f5331eadb125018f56e83ed26f4b" have entirely different histories.
160873e2cc
...
bafc3f1db6
@ -1,66 +0,0 @@
|
|||||||
package pp.monopoly.client;
|
|
||||||
|
|
||||||
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.SimpleDialog;
|
|
||||||
|
|
||||||
public class LoserPopUp extends SimpleDialog {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private final NetworkSupport network;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new NetworkDialog.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param network The NetworkSupport instance to be used for network operations.
|
|
||||||
*/
|
|
||||||
public LoserPopUp( NetworkSupport network) {
|
|
||||||
super(network.getApp().getDialogManager());
|
|
||||||
this.network = network;
|
|
||||||
initializeDialog();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the dialog with input fields and connection buttons.
|
|
||||||
*/
|
|
||||||
private void initializeDialog() {
|
|
||||||
final MonopolyApp hallo = network.getApp();
|
|
||||||
Container inputContainer = new Container();
|
|
||||||
|
|
||||||
// Titel und Eingabefelder für Host und Port
|
|
||||||
inputContainer.addChild(new Label("Schade, du hast leider verloren!"));
|
|
||||||
inputContainer.addChild(new Label("Die nächste Runde wird besser!"));
|
|
||||||
|
|
||||||
Label imageLabel = new Label("");
|
|
||||||
TextureKey key = new TextureKey("Pictures/MonopolyLoser.png", true);
|
|
||||||
Texture texture = hallo.getAssetManager().loadTexture(key);
|
|
||||||
IconComponent icon = new IconComponent(texture.toString()); // Icon mit Textur erstellen
|
|
||||||
icon.setIconSize(new Vector2f(155f, 120f)); // 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 -> hallo.closeApp());
|
|
||||||
inputContainer.setLocalTranslation(300,500,0);
|
|
||||||
hallo.getGuiNode().attachChild(inputContainer);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
|||||||
package pp.monopoly.client;
|
|
||||||
|
|
||||||
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.SimpleDialog;
|
|
||||||
|
|
||||||
public class WinnerPopUp extends SimpleDialog {
|
|
||||||
|
|
||||||
private final NetworkSupport network;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new NetworkDialog.
|
|
||||||
*
|
|
||||||
* @param network The NetworkSupport instance to be used for network operations.
|
|
||||||
*/
|
|
||||||
public WinnerPopUp(NetworkSupport network) {
|
|
||||||
super(network.getApp().getDialogManager());
|
|
||||||
this.network = network;
|
|
||||||
initializeDialog();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes the dialog with input fields and connection buttons.
|
|
||||||
*/
|
|
||||||
private void initializeDialog() {
|
|
||||||
final MonopolyApp appp = network.getApp();
|
|
||||||
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/MonopolyWinner.png", true);
|
|
||||||
Texture texture = appp.getAssetManager().loadTexture(key);
|
|
||||||
IconComponent icon = new IconComponent(texture.toString()); // Icon mit Textur erstellen
|
|
||||||
icon.setIconSize(new Vector2f(150f, 100f)); // 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 -> appp.closeApp());
|
|
||||||
inputContainer.setLocalTranslation(300, 500, 0);
|
|
||||||
appp.getGuiNode().attachChild(inputContainer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 260 KiB |
Binary file not shown.
Before Width: | Height: | Size: 409 KiB |
Loading…
Reference in New Issue
Block a user