Permalink
Browse files

Window title now updates with the user's player name.

  • Loading branch information...
1 parent b178d0e commit de722db889e31a5ed564ba5eab4647e82fce0ad0 @jwien001 committed May 7, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/liarsdice/LiarsDice.java
@@ -190,6 +190,7 @@ public void resetToMainMenu() {
actionPanel.add(hostButton);
actionPanel.add(joinButton);
messagePanel.setText("LIAR'S DICE");
+ frame.setTitle("Liar's Dice");
for (PlayerPanel p : playerPanels) {
p.setData(null, null);
p.repaint();
@@ -269,10 +270,13 @@ public void chatMessage(String msg) {
@Override
public synchronized void gameUpdate() {
GameState state = client.getGameState();
+
+ frame.setTitle("Liar's Dice - " + client.getName());
if (!state.allReady()) {
chatPanel.setVisible(true);
- actionPanel.add(quitButton);
+ if (quitButton.getParent() != actionPanel)
+ actionPanel.add(quitButton);
//TODO Add Ready button
messagePanel.setText("Waiting for more players...\nPress Ready to start the game.\nThe game will begin when all players are ready.");
}

0 comments on commit de722db

Please sign in to comment.