From: Mark J S. <kr...@us...> - 2008-11-30 16:10:42
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19297/18xx/rails/ui/swing Modified Files: ORUIManager.java Log Message: Update to only display the Select Station For Token Dialog if there is more than one city where the token can be placed Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ORUIManager.java 29 Nov 2008 20:01:33 -0000 1.20 --- ORUIManager.java 30 Nov 2008 16:10:35 -0000 1.21 *************** *** 618,629 **** return; } ! String selected = ! (String) JOptionPane.showInputDialog(orWindow, ! LocalText.getText("SelectStationForToken"), ! LocalText.getText("WhichStation"), ! JOptionPane.PLAIN_MESSAGE, null, ! prompts.toArray(), prompts.get(0)); ! if (selected == null) return; ! station = promptToCityMap.get(selected).getNumber(); } --- 618,634 ---- return; } ! // If more than one City to choose from, ask the player. Otherwise use Element zero (first) for the station. ! if (prompts.size() > 1) { ! String selected = ! (String) JOptionPane.showInputDialog(orWindow, ! LocalText.getText("SelectStationForToken"), ! LocalText.getText("WhichStation"), ! JOptionPane.PLAIN_MESSAGE, null, ! prompts.toArray(), prompts.get(0)); ! if (selected == null) return; ! station = promptToCityMap.get(selected).getNumber(); ! } else { ! station = promptToCityMap.get(prompts.toArray() [0]).getNumber(); ! } } *************** *** 682,694 **** continue; } ! String selected = ! (String) JOptionPane.showInputDialog(orWindow, ! LocalText.getText("SelectStationForToken"), ! LocalText.getText("WhichStation"), ! JOptionPane.PLAIN_MESSAGE, null, ! prompts.toArray(), prompts.get(0)); ! if (selected == null) return; ! action.addRelayBaseToken(company.getName(), promptToCityMap.get(selected)); ! } } } --- 687,703 ---- continue; } ! if (prompts.size () > 1) { ! String selected = ! (String) JOptionPane.showInputDialog(orWindow, ! LocalText.getText("SelectStationForToken"), ! LocalText.getText("WhichStation"), ! JOptionPane.PLAIN_MESSAGE, null, ! prompts.toArray(), prompts.get(0)); ! if (selected == null) return; ! action.addRelayBaseToken(company.getName(), promptToCityMap.get(selected)); ! } else { ! action.addRelayBaseToken(company.getName(), promptToCityMap.get(prompts.toArray() [0])); ! } ! } } } |