mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-29 03:09:46 +01:00
fixed Buttons
This commit is contained in:
parent
b1ed571950
commit
853c32a5b8
@ -12,7 +12,11 @@ import java.lang.System.Logger.Level;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import com.jme3.material.Material;
|
||||
import com.jme3.math.Vector3f;
|
||||
import com.jme3.scene.Geometry;
|
||||
import com.jme3.scene.shape.Quad;
|
||||
import com.jme3.texture.Texture;
|
||||
import com.simsilica.lemur.Button;
|
||||
import com.simsilica.lemur.Container;
|
||||
import com.simsilica.lemur.Label;
|
||||
@ -60,6 +64,21 @@ public class CreateGameMenu extends Dialog {
|
||||
port.setSingleLine(true);
|
||||
|
||||
final MonopolyApp app = network.getApp();
|
||||
|
||||
int screenWidth = app.getContext().getSettings().getWidth();
|
||||
int screenHeight = app.getContext().getSettings().getHeight();
|
||||
|
||||
// Set up the background image
|
||||
Texture backgroundImage = app.getAssetManager().loadTexture("Pictures/unibw-Bib2.png");
|
||||
Quad quad = new Quad(screenWidth, screenHeight);
|
||||
Geometry background = new Geometry("Background", quad);
|
||||
Material backgroundMaterial = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
|
||||
backgroundMaterial.setTexture("ColorMap", backgroundImage);
|
||||
background.setMaterial(backgroundMaterial);
|
||||
background.setLocalTranslation(0, 0, -1); // Ensure it is behind other GUI elements
|
||||
app.getGuiNode().attachChild(background);
|
||||
|
||||
|
||||
final Container input = new Container(new SpringGridLayout());
|
||||
input.addChild(new Label(lookup("host.name") + ": "));
|
||||
input.addChild(host, 1);
|
||||
@ -72,6 +91,7 @@ public class CreateGameMenu extends Dialog {
|
||||
cancelButton.addClickCommands(source -> close());
|
||||
addChild(cancelButton);
|
||||
cancelButton.addClickCommands(s -> ifTopDialog(() -> {
|
||||
this.close();
|
||||
new StartMenu(app);
|
||||
app.getGameLogic().playSound(Sound.BUTTON);
|
||||
}));
|
||||
@ -86,7 +106,7 @@ public class CreateGameMenu extends Dialog {
|
||||
joinButton.setPreferredSize(new Vector3f(120, 40, 0));
|
||||
addChild(joinButton);
|
||||
joinButton.addClickCommands(s -> ifTopDialog(() -> {
|
||||
app.connect();
|
||||
connect();
|
||||
app.getGameLogic().playSound(Sound.BUTTON);
|
||||
}));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user