added reset option

This commit is contained in:
Lucas Pleß 2012-06-22 01:57:15 +02:00
parent 85a0d61a51
commit 2214dcc0c0
1 changed files with 9 additions and 1 deletions

View File

@ -81,6 +81,7 @@ public class MainFrame extends JFrame {
JScrollPane listScroller = new JScrollPane(jListWall); JScrollPane listScroller = new JScrollPane(jListWall);
Vector<String> states = new Vector<String>(); Vector<String> states = new Vector<String>();
states.add("-> reset game");
states.add("IDLE"); states.add("IDLE");
states.add("ENTERED_ROOM"); states.add("ENTERED_ROOM");
states.add("TABLE_GAME_ONE"); states.add("TABLE_GAME_ONE");
@ -90,6 +91,7 @@ public class MainFrame extends JFrame {
states.add("TABLE_GAME_FIVE"); states.add("TABLE_GAME_FIVE");
states.add("TABLE_GAME_SIX"); states.add("TABLE_GAME_SIX");
states.add("TABLE_GAME_DONE"); states.add("TABLE_GAME_DONE");
states.add("TABLE_GAME_WRONG");
states.add("ROKET_STARTED"); states.add("ROKET_STARTED");
states.add("ROKET_DONE"); states.add("ROKET_DONE");
states.add("NEUTRAL"); states.add("NEUTRAL");
@ -105,7 +107,13 @@ public class MainFrame extends JFrame {
ListModel dlm = jListStates.getModel(); ListModel dlm = jListStates.getModel();
Object item = dlm.getElementAt(index); Object item = dlm.getElementAt(index);
jListStates.ensureIndexIsVisible(index); jListStates.ensureIndexIsVisible(index);
if (irc != null) irc.say(">state " + item); if (irc != null) {
if("-> reset game".contentEquals(item.toString())) {
irc.say(">reset");
} else {
irc.say(">state " + item);
}
}
} }
} }
}); });