lock endTurnButton when player needs to roll dice

This commit is contained in:
Johannes Schmelz 2024-12-03 00:29:27 +01:00
parent 9e88353bd5
commit cb0788e44c
2 changed files with 2 additions and 2 deletions

View File

@ -192,6 +192,7 @@ public class Toolbar extends Dialog implements GameEventListener {
diceButton.setPreferredSize(new Vector3f(200, 50, 0)); diceButton.setPreferredSize(new Vector3f(200, 50, 0));
diceButton.addClickCommands(s -> ifTopDialog(() -> { diceButton.addClickCommands(s -> ifTopDialog(() -> {
diceButton.setEnabled(false); diceButton.setEnabled(false);
endTurnButton.setEnabled(true);
startDiceAnimation(); startDiceAnimation();
app.getGameLogic().send(new RollDice()); app.getGameLogic().send(new RollDice());
app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().playSound(Sound.BUTTON);
@ -409,7 +410,7 @@ public class Toolbar extends Dialog implements GameEventListener {
diceButton.setEnabled(enabled); diceButton.setEnabled(enabled);
tradeButton.setEnabled(enabled); tradeButton.setEnabled(enabled);
propertyMenuButton.setEnabled(enabled); propertyMenuButton.setEnabled(enabled);
endTurnButton.setEnabled(enabled); endTurnButton.setEnabled(false);
} }
/** /**

View File

@ -333,7 +333,6 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker {
@Override @Override
public void received(NextPlayerTurn msg) { public void received(NextPlayerTurn msg) {
notifyListeners(new ButtonStatusEvent(true)); notifyListeners(new ButtonStatusEvent(true));
setState(new ActiveState(this));
} }
@Override @Override