mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 01:16:17 +01:00
Merge branch 'gui' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02 into gui
This commit is contained in:
commit
42fefb2899
@ -446,11 +446,21 @@ public class Toolbar extends Dialog implements GameEventListener {
|
|||||||
} + ".png";
|
} + ".png";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles dice roll events and updates the dice display.
|
||||||
|
*
|
||||||
|
* @param event the dice roll event containing dice values
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void receivedEvent(DiceRollEvent event) {
|
public void receivedEvent(DiceRollEvent event) {
|
||||||
latestDiceRollEvent = event;
|
latestDiceRollEvent = event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the player view by refreshing the player information displayed on the toolbar.
|
||||||
|
*
|
||||||
|
* @param event the update player view event
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void receivedEvent(UpdatePlayerView event) {
|
public void receivedEvent(UpdatePlayerView event) {
|
||||||
playerHandler = app.getGameLogic().getPlayerHandler();
|
playerHandler = app.getGameLogic().getPlayerHandler();
|
||||||
@ -499,6 +509,12 @@ public class Toolbar extends Dialog implements GameEventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the status of toolbar buttons based on the provided button status event.
|
||||||
|
* Disables or enables buttons such as trade, property menu, and end turn based on the player's turn status.
|
||||||
|
*
|
||||||
|
* @param event the button status event indicating whether the buttons should be enabled
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void receivedEvent(ButtonStatusEvent event) {
|
public void receivedEvent(ButtonStatusEvent event) {
|
||||||
boolean enabled = event.buttonsEnabled();
|
boolean enabled = event.buttonsEnabled();
|
||||||
@ -508,17 +524,26 @@ public class Toolbar extends Dialog implements GameEventListener {
|
|||||||
if (endTurnButton != null) endTurnButton.setEnabled(false);
|
if (endTurnButton != null) endTurnButton.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Closes the toolbar, detaching it from the GUI.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
app.getGuiNode().detachChild(toolbarContainer);
|
app.getGuiNode().detachChild(toolbarContainer);
|
||||||
super.close();
|
super.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens the settings menu when the escape key is pressed.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void escape() {
|
public void escape() {
|
||||||
new SettingsMenu(app).open();
|
new SettingsMenu(app).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the toolbar by refreshing player information.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
refreshPlayerView();
|
refreshPlayerView();
|
||||||
|
Loading…
Reference in New Issue
Block a user