Compare commits

..

No commits in common. "a6944aa6e36f9c7b778d211c93f695108920cd95" and "160873e2ccc7127974f8a84b322c033c4572a741" have entirely different histories.

9 changed files with 34 additions and 42 deletions

View File

@ -1,18 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="MonopolyApp (Mac)" type="Application" factoryName="Application"
singleton="false">
<option name="MAIN_CLASS_NAME" value="pp.monopoly.client.MonopolyApp"/>
<module name="Projekte.monopoly.client.main"/>
<option name="VM_PARAMETERS" value="-XstartOnFirstThread"/>
<option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$"/>
<extension name="coverage">
<pattern>
<option name="PATTERN" value="pp.monopoly.client.*"/>
<option name="ENABLED" value="true"/>
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true"/>
</method>
</configuration>
</component>

View File

@ -1,4 +1,4 @@
package pp.monopoly.client.gui.popups; package pp.monopoly.client;
import com.jme3.asset.TextureKey; import com.jme3.asset.TextureKey;
import com.jme3.math.Vector2f; import com.jme3.math.Vector2f;
@ -7,22 +7,26 @@ import com.simsilica.lemur.Button;
import com.simsilica.lemur.Container; import com.simsilica.lemur.Container;
import com.simsilica.lemur.Label; import com.simsilica.lemur.Label;
import com.simsilica.lemur.component.IconComponent; import com.simsilica.lemur.component.IconComponent;
import pp.dialog.SimpleDialog;
import pp.dialog.Dialog; public class LoserPopUp extends SimpleDialog {
import pp.monopoly.client.MonopolyApp;
public class LoserPopUp extends Dialog {
private final MonopolyApp app;
private final NetworkSupport network;
/** /**
* Constructs a new NetworkDialog. * Constructs a new NetworkDialog.
* *
*
* @param network The NetworkSupport instance to be used for network operations. * @param network The NetworkSupport instance to be used for network operations.
*/ */
public LoserPopUp(MonopolyApp app) { public LoserPopUp( NetworkSupport network) {
super(app.getDialogManager()); super(network.getApp().getDialogManager());
this.app = app; this.network = network;
initializeDialog(); initializeDialog();
} }
@ -30,6 +34,7 @@ public class LoserPopUp extends Dialog {
* Initializes the dialog with input fields and connection buttons. * Initializes the dialog with input fields and connection buttons.
*/ */
private void initializeDialog() { private void initializeDialog() {
final MonopolyApp hallo = network.getApp();
Container inputContainer = new Container(); Container inputContainer = new Container();
// Titel und Eingabefelder für Host und Port // Titel und Eingabefelder für Host und Port
@ -38,18 +43,24 @@ public class LoserPopUp extends Dialog {
Label imageLabel = new Label(""); Label imageLabel = new Label("");
TextureKey key = new TextureKey("Pictures/MonopolyLoser.png", true); TextureKey key = new TextureKey("Pictures/MonopolyLoser.png", true);
Texture texture = app.getAssetManager().loadTexture(key); Texture texture = hallo.getAssetManager().loadTexture(key);
IconComponent icon = new IconComponent(texture.toString()); // Icon mit Textur erstellen IconComponent icon = new IconComponent(texture.toString()); // Icon mit Textur erstellen
icon.setIconSize(new Vector2f(155f, 120f)); // Skalierung des Bildes icon.setIconSize(new Vector2f(155f, 120f)); // Skalierung des Bildes
imageLabel.setIcon(icon); // Setze das Icon im Label imageLabel.setIcon(icon); // Setze das Icon im Label
inputContainer.addChild(imageLabel); inputContainer.addChild(imageLabel);
Button cancelButton = inputContainer.addChild(new Button("Spiel beenden")); Button cancelButton = inputContainer.addChild(new Button("Spiel beenden"));
cancelButton.addClickCommands(source -> ifTopDialog(app::closeApp)); cancelButton.addClickCommands(source -> hallo.closeApp());
inputContainer.setLocalTranslation(300,500,0); inputContainer.setLocalTranslation(300,500,0);
attachChild(inputContainer); hallo.getGuiNode().attachChild(inputContainer);
} }
} }

View File

@ -1,4 +1,4 @@
package pp.monopoly.client.gui.popups; package pp.monopoly.client;
import com.jme3.asset.TextureKey; import com.jme3.asset.TextureKey;
import com.jme3.math.Vector2f; import com.jme3.math.Vector2f;
@ -7,22 +7,20 @@ import com.simsilica.lemur.Button;
import com.simsilica.lemur.Container; import com.simsilica.lemur.Container;
import com.simsilica.lemur.Label; import com.simsilica.lemur.Label;
import com.simsilica.lemur.component.IconComponent; import com.simsilica.lemur.component.IconComponent;
import pp.dialog.SimpleDialog;
import pp.dialog.Dialog; public class WinnerPopUp extends SimpleDialog {
import pp.monopoly.client.MonopolyApp;
public class WinnerPopUp extends Dialog { private final NetworkSupport network;
private final MonopolyApp app;
/** /**
* Constructs a new NetworkDialog. * Constructs a new NetworkDialog.
* *
* @param app The NetworkSupport instance to be used for network operations. * @param network The NetworkSupport instance to be used for network operations.
*/ */
public WinnerPopUp(MonopolyApp app) { public WinnerPopUp(NetworkSupport network) {
super(app.getDialogManager()); super(network.getApp().getDialogManager());
this.app = app; this.network = network;
initializeDialog(); initializeDialog();
} }
@ -30,6 +28,7 @@ public class WinnerPopUp extends Dialog {
* Initializes the dialog with input fields and connection buttons. * Initializes the dialog with input fields and connection buttons.
*/ */
private void initializeDialog() { private void initializeDialog() {
final MonopolyApp appp = network.getApp();
Container inputContainer = new Container(); Container inputContainer = new Container();
// Titel und Eingabefelder für Host und Port // Titel und Eingabefelder für Host und Port
@ -38,7 +37,7 @@ public class WinnerPopUp extends Dialog {
Label imageLabel = new Label(""); Label imageLabel = new Label("");
TextureKey key = new TextureKey("Pictures/MonopolyWinner.png", true); TextureKey key = new TextureKey("Pictures/MonopolyWinner.png", true);
Texture texture = app.getAssetManager().loadTexture(key); Texture texture = appp.getAssetManager().loadTexture(key);
IconComponent icon = new IconComponent(texture.toString()); // Icon mit Textur erstellen IconComponent icon = new IconComponent(texture.toString()); // Icon mit Textur erstellen
icon.setIconSize(new Vector2f(150f, 100f)); // Skalierung des Bildes icon.setIconSize(new Vector2f(150f, 100f)); // Skalierung des Bildes
imageLabel.setIcon(icon); imageLabel.setIcon(icon);
@ -48,9 +47,9 @@ public class WinnerPopUp extends Dialog {
inputContainer.addChild(imageLabel); inputContainer.addChild(imageLabel);
Button cancelButton = inputContainer.addChild(new Button("Spiel beenden")); Button cancelButton = inputContainer.addChild(new Button("Spiel beenden"));
cancelButton.addClickCommands(source -> ifTopDialog(app::closeApp)); cancelButton.addClickCommands(source -> appp.closeApp());
inputContainer.setLocalTranslation(300, 500, 0); inputContainer.setLocalTranslation(300, 500, 0);
attachChild(inputContainer); appp.getGuiNode().attachChild(inputContainer);
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB