mirror of
				https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
				synced 2025-11-04 06:56:14 +01:00 
			
		
		
		
	Merge branch 'gui' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02 into gui
This commit is contained in:
		@@ -405,3 +405,44 @@ selector("button-clear", "pp") { playerColor ->
 | 
			
		||||
    textHAlignment = HAlignment.Center // Text-Zentrierung
 | 
			
		||||
    textVAlignment = VAlignment.Center // Text-Zentrierung
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def enabledCommandToolbar2= new Command<Button>() {
 | 
			
		||||
    void execute(Button source) {
 | 
			
		||||
        if (source.isEnabled()){
 | 
			
		||||
            source.setColor(ColorRGBA.White)
 | 
			
		||||
            def orangeBackground = new QuadBackgroundComponent(color(1, 0.5, 0, 1)); // Orange background
 | 
			
		||||
            source.setBackground(orangeBackground);
 | 
			
		||||
        } else{
 | 
			
		||||
            source.setColor(ColorRGBA.White)
 | 
			
		||||
            def grayBackground = new QuadBackgroundComponent(ColorRGBA.Gray); // Gray background
 | 
			
		||||
            source.setBackground(grayBackground);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
def stdButtonCommandsToolbar2 =[
 | 
			
		||||
        (ButtonAction.Down)    : [pressedCommand],
 | 
			
		||||
        (ButtonAction.Up)      : [pressedCommand],
 | 
			
		||||
        (ButtonAction.Enabled) : [enabledCommandToolbar2],
 | 
			
		||||
        (ButtonAction.Disabled): [enabledCommandToolbar2]
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
selector("button-toolbar2", "pp") {
 | 
			
		||||
    def outerBackground = new QuadBackgroundComponent(color(1, 0.5, 0, 1)) // Orange border
 | 
			
		||||
    def innerBackground = new QuadBackgroundComponent(buttonBgColor) // Inner button background
 | 
			
		||||
 | 
			
		||||
    // Apply the outer border as the main background
 | 
			
		||||
    background = outerBackground
 | 
			
		||||
 | 
			
		||||
    // Use insets to create a margin/padding effect for the inner background
 | 
			
		||||
    insets = new Insets3f(3, 3, 3, 3) // Adjust the border thickness
 | 
			
		||||
    textHAlignment = HAlignment.Center
 | 
			
		||||
    textVAlignment = VAlignment.Center
 | 
			
		||||
    buttonCommands = stdButtonCommandsToolbar2
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -91,8 +91,8 @@ public class StartMenu extends Dialog {
 | 
			
		||||
        QuadBackgroundComponent unibwBackground = new QuadBackgroundComponent(unibwTexture);
 | 
			
		||||
        unibwContainer.setBackground(unibwBackground);
 | 
			
		||||
 | 
			
		||||
        float unibwWidth = 512;
 | 
			
		||||
        float unibwHeight = 128;
 | 
			
		||||
        float unibwWidth = 662;
 | 
			
		||||
        float unibwHeight = 180;
 | 
			
		||||
        unibwContainer.setPreferredSize(new Vector3f(unibwWidth, unibwHeight, 0));
 | 
			
		||||
 | 
			
		||||
        unibwContainer.setLocalTranslation(new Vector3f(
 | 
			
		||||
 
 | 
			
		||||
@@ -73,7 +73,7 @@ public class Bankrupt extends Dialog implements PopupDialog {
 | 
			
		||||
    private void createBankruptContainer() {
 | 
			
		||||
        bankruptContainer = new Container();
 | 
			
		||||
        bankruptContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f)));
 | 
			
		||||
        bankruptContainer.setPreferredSize(new Vector3f(550, 250, 10));
 | 
			
		||||
        bankruptContainer.setPreferredSize(new Vector3f(550, 350, 10));
 | 
			
		||||
 | 
			
		||||
        // Title
 | 
			
		||||
        Label title = bankruptContainer.addChild(new Label("Vorsicht!", new ElementId("warning-title")));
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,7 @@
 | 
			
		||||
package pp.monopoly.client.gui.popups;
 | 
			
		||||
 | 
			
		||||
import com.jme3.math.ColorRGBA;
 | 
			
		||||
import com.jme3.math.Vector3f;
 | 
			
		||||
import com.simsilica.lemur.Button;
 | 
			
		||||
import com.simsilica.lemur.Container;
 | 
			
		||||
import com.simsilica.lemur.Label;
 | 
			
		||||
@@ -41,6 +42,7 @@ public class BuildingPropertyCard extends Dialog implements PopupDialog {
 | 
			
		||||
        buildingPropertyContainer = new Container();
 | 
			
		||||
        buildingPropertyContainer.setBackground(new QuadBackgroundComponent(field.getColor().getColor()));
 | 
			
		||||
        addContentToContainer(buildingPropertyContainer, field);
 | 
			
		||||
        buildingPropertyContainer.setPreferredSize(new Vector3f(360,420,1));
 | 
			
		||||
 | 
			
		||||
        // Create the background container
 | 
			
		||||
        backgroundContainer = new Container();
 | 
			
		||||
@@ -50,6 +52,9 @@ public class BuildingPropertyCard extends Dialog implements PopupDialog {
 | 
			
		||||
        float padding = 10f;
 | 
			
		||||
        backgroundContainer.setPreferredSize(buildingPropertyContainer.getPreferredSize().addLocal(padding, padding, 0));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        System.out.println(backgroundContainer.getPreferredSize());
 | 
			
		||||
 | 
			
		||||
        // Position the containers
 | 
			
		||||
        centerContainers(padding);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,6 @@ import com.simsilica.lemur.Button;
 | 
			
		||||
import com.simsilica.lemur.Container;
 | 
			
		||||
import com.simsilica.lemur.Label;
 | 
			
		||||
import com.simsilica.lemur.Selector;
 | 
			
		||||
import com.simsilica.lemur.TextField;
 | 
			
		||||
import com.simsilica.lemur.component.QuadBackgroundComponent;
 | 
			
		||||
import com.simsilica.lemur.component.SpringGridLayout;
 | 
			
		||||
import com.simsilica.lemur.core.VersionedList;
 | 
			
		||||
@@ -125,13 +124,13 @@ public class BuyHouse extends Dialog {
 | 
			
		||||
        buyHouseContainer.setLocalTranslation(
 | 
			
		||||
                (app.getCamera().getWidth() - buyHouseContainer.getPreferredSize().x) / 2,
 | 
			
		||||
                (app.getCamera().getHeight() + buyHouseContainer.getPreferredSize().y) / 2,
 | 
			
		||||
                8
 | 
			
		||||
                9
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        backgroundContainer.setLocalTranslation(
 | 
			
		||||
                (app.getCamera().getWidth() - buyHouseContainer.getPreferredSize().x - padding) / 2,
 | 
			
		||||
                (app.getCamera().getHeight() + buyHouseContainer.getPreferredSize().y + padding) / 2,
 | 
			
		||||
                7
 | 
			
		||||
                8
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        app.getGuiNode().attachChild(buyHouseContainer);
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@ package pp.monopoly.client.gui.popups;
 | 
			
		||||
import com.jme3.material.Material;
 | 
			
		||||
import com.jme3.material.RenderState.BlendMode;
 | 
			
		||||
import com.jme3.math.ColorRGBA;
 | 
			
		||||
import com.jme3.math.Vector3f;
 | 
			
		||||
import com.jme3.scene.Geometry;
 | 
			
		||||
import com.jme3.scene.shape.Quad;
 | 
			
		||||
import com.simsilica.lemur.Button;
 | 
			
		||||
@@ -72,6 +73,7 @@ public class FoodFieldCard extends Dialog implements PopupDialog {
 | 
			
		||||
    private void createBackgroundContainer() {
 | 
			
		||||
        backgroundContainer = new Container();
 | 
			
		||||
        backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Light gray background
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -82,6 +84,7 @@ public class FoodFieldCard extends Dialog implements PopupDialog {
 | 
			
		||||
    private void createFoodFieldContainer(FoodField field) {
 | 
			
		||||
        foodFieldContainer = new Container();
 | 
			
		||||
        foodFieldContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.1f, 0.1f, 0.1f, 0.9f)));
 | 
			
		||||
        foodFieldContainer.setPreferredSize(new Vector3f(360,420,1));
 | 
			
		||||
 | 
			
		||||
        // Title
 | 
			
		||||
        Label title = foodFieldContainer.addChild(new Label(field.getName(), new ElementId("label-Bold")));
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,7 @@
 | 
			
		||||
package pp.monopoly.client.gui.popups;
 | 
			
		||||
 | 
			
		||||
import com.jme3.math.ColorRGBA;
 | 
			
		||||
import com.jme3.math.Vector3f;
 | 
			
		||||
import com.simsilica.lemur.Button;
 | 
			
		||||
import com.simsilica.lemur.Container;
 | 
			
		||||
import com.simsilica.lemur.Label;
 | 
			
		||||
@@ -52,6 +53,7 @@ public class GateFieldCard extends Dialog implements PopupDialog {
 | 
			
		||||
    private void createBackgroundContainer() {
 | 
			
		||||
        backgroundContainer = new Container();
 | 
			
		||||
        backgroundContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.8657f, 0.8735f, 0.8892f, 1.0f))); // Light gray background
 | 
			
		||||
        gateFieldContainer.setPreferredSize(new Vector3f(360,420,1));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -93,7 +93,7 @@ public class GulagInfo extends Dialog implements PopupDialog {
 | 
			
		||||
        }));
 | 
			
		||||
 | 
			
		||||
        // Use Jail-Free Card Button
 | 
			
		||||
        Button eventCardButton = gulagInfoContainer.addChild(new Button("Ereigniskarte nutzen", new ElementId("button")));
 | 
			
		||||
        Button eventCardButton = gulagInfoContainer.addChild(new Button("Ereigniskarte nutzen", new ElementId("button-toolbar2")));
 | 
			
		||||
        eventCardButton.setFontSize(32);
 | 
			
		||||
        eventCardButton.addClickCommands(s -> ifTopDialog(() -> {
 | 
			
		||||
            app.getGameLogic().playSound(Sound.BUTTON);
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,6 @@ import com.simsilica.lemur.Button;
 | 
			
		||||
import com.simsilica.lemur.Container;
 | 
			
		||||
import com.simsilica.lemur.Label;
 | 
			
		||||
import com.simsilica.lemur.Selector;
 | 
			
		||||
import com.simsilica.lemur.TextField;
 | 
			
		||||
import com.simsilica.lemur.component.QuadBackgroundComponent;
 | 
			
		||||
import com.simsilica.lemur.component.SpringGridLayout;
 | 
			
		||||
import com.simsilica.lemur.core.VersionedList;
 | 
			
		||||
@@ -128,14 +127,14 @@ public class RepayMortage extends Dialog {
 | 
			
		||||
        repayMortageContainer.setLocalTranslation(
 | 
			
		||||
            (app.getCamera().getWidth() - repayMortageContainer.getPreferredSize().x) / 2,
 | 
			
		||||
            (app.getCamera().getHeight() + repayMortageContainer.getPreferredSize().y) / 2,
 | 
			
		||||
            8
 | 
			
		||||
            9
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        // Zentriere das Popup
 | 
			
		||||
        backgroundContainer.setLocalTranslation(
 | 
			
		||||
                (app.getCamera().getWidth() - repayMortageContainer.getPreferredSize().x - padding) / 2,
 | 
			
		||||
                (app.getCamera().getHeight() + repayMortageContainer.getPreferredSize().y+ padding) / 2,
 | 
			
		||||
                7
 | 
			
		||||
                8
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        app.getGuiNode().attachChild(repayMortageContainer);
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,6 @@ import com.simsilica.lemur.Button;
 | 
			
		||||
import com.simsilica.lemur.Container;
 | 
			
		||||
import com.simsilica.lemur.Label;
 | 
			
		||||
import com.simsilica.lemur.Selector;
 | 
			
		||||
import com.simsilica.lemur.TextField;
 | 
			
		||||
import com.simsilica.lemur.component.QuadBackgroundComponent;
 | 
			
		||||
import com.simsilica.lemur.component.SpringGridLayout;
 | 
			
		||||
import com.simsilica.lemur.core.VersionedList;
 | 
			
		||||
@@ -128,14 +127,14 @@ public class SellHouse extends Dialog {
 | 
			
		||||
        sellhouseContainer.setLocalTranslation(
 | 
			
		||||
            (app.getCamera().getWidth() - sellhouseContainer.getPreferredSize().x) / 2,
 | 
			
		||||
            (app.getCamera().getHeight() + sellhouseContainer.getPreferredSize().y) / 2,
 | 
			
		||||
            8
 | 
			
		||||
            9
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        // Zentriere das Popup
 | 
			
		||||
        backgroundContainer.setLocalTranslation(
 | 
			
		||||
                (app.getCamera().getWidth() - sellhouseContainer.getPreferredSize().x - padding) / 2,
 | 
			
		||||
                (app.getCamera().getHeight() + sellhouseContainer.getPreferredSize().y+ padding) / 2,
 | 
			
		||||
                7
 | 
			
		||||
                8
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        app.getGuiNode().attachChild(sellhouseContainer);
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,6 @@ import com.simsilica.lemur.Button;
 | 
			
		||||
import com.simsilica.lemur.Container;
 | 
			
		||||
import com.simsilica.lemur.Label;
 | 
			
		||||
import com.simsilica.lemur.Selector;
 | 
			
		||||
import com.simsilica.lemur.TextField;
 | 
			
		||||
import com.simsilica.lemur.component.QuadBackgroundComponent;
 | 
			
		||||
import com.simsilica.lemur.component.SpringGridLayout;
 | 
			
		||||
import com.simsilica.lemur.core.VersionedList;
 | 
			
		||||
@@ -129,14 +128,14 @@ public class TakeMortage extends Dialog {
 | 
			
		||||
        takeMortageContainer.setLocalTranslation(
 | 
			
		||||
            (app.getCamera().getWidth() - takeMortageContainer.getPreferredSize().x) / 2,
 | 
			
		||||
            (app.getCamera().getHeight() + takeMortageContainer.getPreferredSize().y) / 2,
 | 
			
		||||
            8
 | 
			
		||||
            9
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        // Zentriere das Popup
 | 
			
		||||
        backgroundContainer.setLocalTranslation(
 | 
			
		||||
                (app.getCamera().getWidth() - takeMortageContainer.getPreferredSize().x - padding) / 2,
 | 
			
		||||
                (app.getCamera().getHeight() + takeMortageContainer.getPreferredSize().y+ padding) / 2,
 | 
			
		||||
                7
 | 
			
		||||
                8
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        app.getGuiNode().attachChild(takeMortageContainer);
 | 
			
		||||
 
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 1.8 MiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 1.6 MiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 1.6 MiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 1.7 MiB  | 
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user