This commit is contained in:
Daniel Grigencha
2024-12-01 23:27:50 +01:00
2 changed files with 5 additions and 0 deletions

View File

@@ -60,6 +60,8 @@ private void handleLobby(Notification notification) {
if (notification instanceof TskSelectNotification n) { if (notification instanceof TskSelectNotification n) {
lobbyView.setTaken(n.getColor(), true, n.isSelf(), n.getName()); lobbyView.setTaken(n.getColor(), true, n.isSelf(), n.getName());
lobbyView.setTaken(n.getColor(), true, false, n.getName()); lobbyView.setTaken(n.getColor(), true, false, n.getName());
} else if (notification instanceof StartDialogNotification) {
app.enter(MdgaState.MAIN);
} else if (notification instanceof TskUnselectNotification n) { } else if (notification instanceof TskUnselectNotification n) {
lobbyView.setTaken(n.getColor(), false, false, null); lobbyView.setTaken(n.getColor(), false, false, null);
} else if(notification instanceof LobbyReadyNotification lobbyReadyNotification) { } else if(notification instanceof LobbyReadyNotification lobbyReadyNotification) {

View File

@@ -12,6 +12,7 @@
import pp.mdga.message.server.UpdateReadyMessage; import pp.mdga.message.server.UpdateReadyMessage;
import pp.mdga.message.server.UpdateTSKMessage; import pp.mdga.message.server.UpdateTSKMessage;
import pp.mdga.notification.LobbyReadyNotification; import pp.mdga.notification.LobbyReadyNotification;
import pp.mdga.notification.StartDialogNotification;
import pp.mdga.notification.TskSelectNotification; import pp.mdga.notification.TskSelectNotification;
import pp.mdga.notification.TskUnselectNotification; import pp.mdga.notification.TskUnselectNotification;
@@ -36,6 +37,7 @@ public void exit() {
@Override @Override
public void selectLeave() { public void selectLeave() {
parent.setState(parent.getStartDialog()); parent.setState(parent.getStartDialog());
logic.addNotification(new StartDialogNotification());
logic.send(new LeaveGameMessage()); logic.send(new LeaveGameMessage());
} }
@@ -72,6 +74,7 @@ public void selectStart(){
@Override @Override
public void received(ServerStartGameMessage msg){ public void received(ServerStartGameMessage msg){
parent.startGame(); parent.startGame();
} }