mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-04-12 07:41:07 +02:00
Compare commits
5 Commits
315739646c
...
0a34751825
Author | SHA1 | Date | |
---|---|---|---|
|
0a34751825 | ||
|
996bc0118a | ||
|
bbcb12c131 | ||
|
1969afc58f | ||
|
ad0c432102 |
@ -405,3 +405,44 @@ selector("button-clear", "pp") { playerColor ->
|
|||||||
textHAlignment = HAlignment.Center // Text-Zentrierung
|
textHAlignment = HAlignment.Center // Text-Zentrierung
|
||||||
textVAlignment = VAlignment.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);
|
QuadBackgroundComponent unibwBackground = new QuadBackgroundComponent(unibwTexture);
|
||||||
unibwContainer.setBackground(unibwBackground);
|
unibwContainer.setBackground(unibwBackground);
|
||||||
|
|
||||||
float unibwWidth = 512;
|
float unibwWidth = 662;
|
||||||
float unibwHeight = 128;
|
float unibwHeight = 180;
|
||||||
unibwContainer.setPreferredSize(new Vector3f(unibwWidth, unibwHeight, 0));
|
unibwContainer.setPreferredSize(new Vector3f(unibwWidth, unibwHeight, 0));
|
||||||
|
|
||||||
unibwContainer.setLocalTranslation(new Vector3f(
|
unibwContainer.setLocalTranslation(new Vector3f(
|
||||||
|
@ -125,13 +125,13 @@ public class BuyHouse extends Dialog {
|
|||||||
buyHouseContainer.setLocalTranslation(
|
buyHouseContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - buyHouseContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - buyHouseContainer.getPreferredSize().x) / 2,
|
||||||
(app.getCamera().getHeight() + buyHouseContainer.getPreferredSize().y) / 2,
|
(app.getCamera().getHeight() + buyHouseContainer.getPreferredSize().y) / 2,
|
||||||
8
|
9
|
||||||
);
|
);
|
||||||
|
|
||||||
backgroundContainer.setLocalTranslation(
|
backgroundContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - buyHouseContainer.getPreferredSize().x - padding) / 2,
|
(app.getCamera().getWidth() - buyHouseContainer.getPreferredSize().x - padding) / 2,
|
||||||
(app.getCamera().getHeight() + buyHouseContainer.getPreferredSize().y + padding) / 2,
|
(app.getCamera().getHeight() + buyHouseContainer.getPreferredSize().y + padding) / 2,
|
||||||
7
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
app.getGuiNode().attachChild(buyHouseContainer);
|
app.getGuiNode().attachChild(buyHouseContainer);
|
||||||
|
@ -93,7 +93,7 @@ public class GulagInfo extends Dialog implements PopupDialog {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// Use Jail-Free Card Button
|
// 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.setFontSize(32);
|
||||||
eventCardButton.addClickCommands(s -> ifTopDialog(() -> {
|
eventCardButton.addClickCommands(s -> ifTopDialog(() -> {
|
||||||
app.getGameLogic().playSound(Sound.BUTTON);
|
app.getGameLogic().playSound(Sound.BUTTON);
|
||||||
|
@ -128,14 +128,14 @@ public class RepayMortage extends Dialog {
|
|||||||
repayMortageContainer.setLocalTranslation(
|
repayMortageContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - repayMortageContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - repayMortageContainer.getPreferredSize().x) / 2,
|
||||||
(app.getCamera().getHeight() + repayMortageContainer.getPreferredSize().y) / 2,
|
(app.getCamera().getHeight() + repayMortageContainer.getPreferredSize().y) / 2,
|
||||||
8
|
9
|
||||||
);
|
);
|
||||||
|
|
||||||
// Zentriere das Popup
|
// Zentriere das Popup
|
||||||
backgroundContainer.setLocalTranslation(
|
backgroundContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - repayMortageContainer.getPreferredSize().x - padding) / 2,
|
(app.getCamera().getWidth() - repayMortageContainer.getPreferredSize().x - padding) / 2,
|
||||||
(app.getCamera().getHeight() + repayMortageContainer.getPreferredSize().y+ padding) / 2,
|
(app.getCamera().getHeight() + repayMortageContainer.getPreferredSize().y+ padding) / 2,
|
||||||
7
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
app.getGuiNode().attachChild(repayMortageContainer);
|
app.getGuiNode().attachChild(repayMortageContainer);
|
||||||
|
@ -128,14 +128,14 @@ public class SellHouse extends Dialog {
|
|||||||
sellhouseContainer.setLocalTranslation(
|
sellhouseContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - sellhouseContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - sellhouseContainer.getPreferredSize().x) / 2,
|
||||||
(app.getCamera().getHeight() + sellhouseContainer.getPreferredSize().y) / 2,
|
(app.getCamera().getHeight() + sellhouseContainer.getPreferredSize().y) / 2,
|
||||||
8
|
9
|
||||||
);
|
);
|
||||||
|
|
||||||
// Zentriere das Popup
|
// Zentriere das Popup
|
||||||
backgroundContainer.setLocalTranslation(
|
backgroundContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - sellhouseContainer.getPreferredSize().x - padding) / 2,
|
(app.getCamera().getWidth() - sellhouseContainer.getPreferredSize().x - padding) / 2,
|
||||||
(app.getCamera().getHeight() + sellhouseContainer.getPreferredSize().y+ padding) / 2,
|
(app.getCamera().getHeight() + sellhouseContainer.getPreferredSize().y+ padding) / 2,
|
||||||
7
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
app.getGuiNode().attachChild(sellhouseContainer);
|
app.getGuiNode().attachChild(sellhouseContainer);
|
||||||
|
@ -129,14 +129,14 @@ public class TakeMortage extends Dialog {
|
|||||||
takeMortageContainer.setLocalTranslation(
|
takeMortageContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - takeMortageContainer.getPreferredSize().x) / 2,
|
(app.getCamera().getWidth() - takeMortageContainer.getPreferredSize().x) / 2,
|
||||||
(app.getCamera().getHeight() + takeMortageContainer.getPreferredSize().y) / 2,
|
(app.getCamera().getHeight() + takeMortageContainer.getPreferredSize().y) / 2,
|
||||||
8
|
9
|
||||||
);
|
);
|
||||||
|
|
||||||
// Zentriere das Popup
|
// Zentriere das Popup
|
||||||
backgroundContainer.setLocalTranslation(
|
backgroundContainer.setLocalTranslation(
|
||||||
(app.getCamera().getWidth() - takeMortageContainer.getPreferredSize().x - padding) / 2,
|
(app.getCamera().getWidth() - takeMortageContainer.getPreferredSize().x - padding) / 2,
|
||||||
(app.getCamera().getHeight() + takeMortageContainer.getPreferredSize().y+ padding) / 2,
|
(app.getCamera().getHeight() + takeMortageContainer.getPreferredSize().y+ padding) / 2,
|
||||||
7
|
8
|
||||||
);
|
);
|
||||||
|
|
||||||
app.getGuiNode().attachChild(takeMortageContainer);
|
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.
Loading…
Reference in New Issue
Block a user