Compare commits

...

7 Commits

Author SHA1 Message Date
Johannes Schmelz
93386fa77a Merge branch 'gui' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02 into gui 2024-12-09 05:32:16 +01:00
Johannes Schmelz
6cdf0eee53 disable buttons when having to pause one round 2024-12-09 05:32:11 +01:00
Yvonne Schmidt
b6803c562c recolored selection containers 2024-12-09 05:31:22 +01:00
Johannes Schmelz
38699ac07a added App icon 2024-12-09 05:23:52 +01:00
Luca Puderbach
f396ef52f2 Merge branch 'gui' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02 into gui 2024-12-09 05:15:14 +01:00
Luca Puderbach
73bf147817 uniman2 2024-12-09 05:15:10 +01:00
Yvonne Schmidt
80f9054add recolored selection containers 2024-12-09 04:56:28 +01:00
12 changed files with 36 additions and 11 deletions

View File

@ -101,6 +101,13 @@ selector("label-Text", "pp") {
color = buttonEnabledColor
}
selector("label-player", "pp") {
insets = new Insets3f(2, 2, 2, 2)
font = font("Interface/Fonts/Metropolis/Metropolis-Bold-32.fnt")
fontSize = 20
color = buttonEnabledColor
}
selector("label-account", "pp") {
insets = new Insets3f(2, 2, 2, 2)
fontSize = 25

View File

@ -15,6 +15,9 @@ import java.lang.System.Logger.Level;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.logging.LogManager;
import java.awt.Image;
import javax.imageio.ImageIO;
import com.jme3.app.DebugKeysAppState;
import com.jme3.app.SimpleApplication;
@ -169,6 +172,12 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
private AppSettings makeSettings() {
final AppSettings settings = new AppSettings(true);
settings.setTitle(lookup("monopoly.name"));
try {
settings.setIcons(new Image[]{ImageIO.read(new File("src/main/resources/icons/Uniman.png"))});
}
catch (IOException e) {
LOGGER.log(Level.ERROR, e.getMessage());
}
settings.setResolution(config.getResolutionWidth(), config.getResolutionHeight());
settings.setFullscreen(config.fullScreen());
settings.setUseRetinaFrameBuffer(config.useRetinaFrameBuffer());

View File

@ -510,7 +510,8 @@ public class Toolbar extends Dialog implements GameEventListener {
if (player.getId() != app.getId()) {
Label playerLabel = new Label(
player.getName() + ": " + player.getAccountBalance() + " EUR",
new ElementId("label-Text")
new ElementId("label-player")
);
playerLabel.setColor(Player.getColor(player.getId()).getColor());
overviewContainer.addChild(playerLabel);

View File

@ -77,7 +77,7 @@ public class BuyHouse extends Dialog {
backgroundContainer.setPreferredSize(buyHouseContainer.getPreferredSize().addLocal(padding, padding, 0));
// Title
Label title = buyHouseContainer.addChild(new Label("Gebäude Kaufen", new ElementId("warning-Bold")));
Label title = buyHouseContainer.addChild(new Label("Gebäude Kaufen", new ElementId("label-Bold")));
title.setFontSize(48);
title.setColor(ColorRGBA.Black);
@ -145,7 +145,7 @@ public class BuyHouse extends Dialog {
private Container createPropertyDropdown() {
Container dropdownContainer = new Container(new SpringGridLayout(Axis.Y, Axis.X));
dropdownContainer.setPreferredSize(new Vector3f(300, 200, 0));
dropdownContainer.setBackground(new QuadBackgroundComponent(ColorRGBA.Orange));
dropdownContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f)));
VersionedList<String> propertyOptions = new VersionedList<>();
List<BuildingProperty> playerProperties = getPlayerProperties();
@ -164,6 +164,7 @@ public class BuyHouse extends Dialog {
// Initialize the selection display here
selectionDisplay = new Label("");
selectionDisplay.setPreferredSize(new Vector3f(300, 30, 0));
selectionDisplay.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
dropdownContainer.addChild(selectionDisplay); // Add it to the dropdown container
// Set initial selection

View File

@ -82,7 +82,7 @@ public class RepayMortage extends Dialog {
backgroundContainer.setPreferredSize(repayMortageContainer.getPreferredSize().addLocal(padding, padding, 0));
// Titel
Label title = repayMortageContainer.addChild(new Label( "Hypothek Abbezahlen", new ElementId("warining-Bold")));
Label title = repayMortageContainer.addChild(new Label( "Hypothek Abbezahlen", new ElementId("label-Bold")));
title.setFontSize(48);
title.setColor(ColorRGBA.Black);
@ -97,7 +97,7 @@ public class RepayMortage extends Dialog {
upContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
middleContainer.setPreferredSize(new Vector3f(100, 150, 0));
middleContainer.setBackground(new QuadBackgroundComponent(ColorRGBA.Orange));
middleContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f)));
middleContainer.addChild(createPropertyDropdown());
@ -149,7 +149,7 @@ public class RepayMortage extends Dialog {
private Container createPropertyDropdown() {
Container dropdownContainer = new Container(new SpringGridLayout(Axis.Y, Axis.X));
dropdownContainer.setPreferredSize(new Vector3f(300, 200, 0));
dropdownContainer.setBackground(new QuadBackgroundComponent(ColorRGBA.Orange));
dropdownContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f)));
VersionedList<String> propertyOptions = new VersionedList<>();
List<PropertyField> playerProperties = getPlayerProperties();
@ -168,6 +168,7 @@ public class RepayMortage extends Dialog {
// Initialize the selection display here
selectionDisplay = new Label(""); // Create TextField for displaying selections
selectionDisplay.setPreferredSize(new Vector3f(300, 30, 0));
selectionDisplay.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
dropdownContainer.addChild(selectionDisplay); // Add it to the dropdown container
// Set initial selection

View File

@ -82,7 +82,7 @@ public class SellHouse extends Dialog {
backgroundContainer.setPreferredSize(sellhouseContainer.getPreferredSize().addLocal(padding, padding, 0));
// Titel
Label title = sellhouseContainer.addChild(new Label( "Gebäude Abreißen", new ElementId("warining-Bold")));
Label title = sellhouseContainer.addChild(new Label( "Gebäude Abreißen", new ElementId("label-Bold")));
title.setFontSize(48);
title.setColor(ColorRGBA.Black);
@ -155,7 +155,7 @@ public class SellHouse extends Dialog {
private Container createPropertyDropdown() {
Container dropdownContainer = new Container(new SpringGridLayout(Axis.Y, Axis.X));
dropdownContainer.setPreferredSize(new Vector3f(300, 200, 0));
dropdownContainer.setBackground(new QuadBackgroundComponent(ColorRGBA.Orange));
dropdownContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f)));
VersionedList<String> propertyOptions = new VersionedList<>();
List<BuildingProperty> playerProperties = getPlayerProperties();
@ -174,6 +174,7 @@ public class SellHouse extends Dialog {
// Initialize the selection display here
selectionDisplay = new Label("");
selectionDisplay.setPreferredSize(new Vector3f(300, 30, 0));
selectionDisplay.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
dropdownContainer.addChild(selectionDisplay); // Add it to the dropdown container
// Set initial selection

View File

@ -83,7 +83,7 @@ public class TakeMortage extends Dialog {
backgroundContainer.setPreferredSize(takeMortageContainer.getPreferredSize().addLocal(padding, padding, 0));
// Titel
Label title = takeMortageContainer.addChild(new Label( "Hypothek aufnehmen", new ElementId("warining-Bold")));
Label title = takeMortageContainer.addChild(new Label( "Hypothek aufnehmen", new ElementId("label-Bold")));
title.setFontSize(48);
title.setColor(ColorRGBA.Black);
@ -150,7 +150,7 @@ public class TakeMortage extends Dialog {
private Container createPropertyDropdown() {
Container dropdownContainer = new Container(new SpringGridLayout(Axis.Y, Axis.X));
dropdownContainer.setPreferredSize(new Vector3f(300, 200, 0));
dropdownContainer.setBackground(new QuadBackgroundComponent(ColorRGBA.Orange));
dropdownContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f)));
VersionedList<String> propertyOptions = new VersionedList<>();
List<PropertyField> playerProperties = getPlayerProperties();
@ -174,6 +174,7 @@ public class TakeMortage extends Dialog {
// Initialize the selection display here
selectionDisplay = new Label(""); // Create TextField for displaying selections
selectionDisplay.setPreferredSize(new Vector3f(300, 30, 0));
selectionDisplay.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f)));
dropdownContainer.addChild(selectionDisplay); // Add it to the dropdown container
// Set initial selection

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

View File

@ -310,6 +310,8 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker {
} else if(msg.getKeyWord().equals("ReceivedRent")) {
playSound(Sound.MONEY_COLLECTED);
notifyListeners(new PopUpEvent("ReceivedRent", msg));
} else if (msg.getKeyWord().equals("aussetzen")) {
notifyListeners(new ButtonStatusEvent(false));
}
}

View File

@ -85,7 +85,7 @@ public class ServerGameLogic implements ClientInterpreter {
* @param player the Player to whom the message is sent
* @param msg the ServerMessage to send
*/
void send(Player player, ServerMessage msg) {
public void send(Player player, ServerMessage msg) {
if (player != null && msg != null) {
serverSender.send(player.getId(), msg);
LOGGER.log(Level.DEBUG, "Message sent to player {0}: {1}", player.getName(), msg.getClass().getSimpleName());

View File

@ -8,6 +8,7 @@ import java.util.Queue;
import pp.monopoly.game.server.Player;
import pp.monopoly.message.client.EndTurn;
import pp.monopoly.message.server.NotificationMessage;
public class DeckHelper{
@ -258,6 +259,7 @@ public class DeckHelper{
private void rueckstuferantrag(Player player) {
player.getHandler().getLogic().received(new EndTurn(), player.getId());
player.getHandler().getLogic().send(player, new NotificationMessage("aussetzen"));
}
private void hausfeierSturz(Player player) {