From: Erik V. <ev...@us...> - 2010-02-07 18:28:30
|
Update of /cvsroot/rails/18xx/rails/ui/swing In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31362/rails/ui/swing Modified Files: ORUIManager.java Log Message: Fixed home tokenlay on (green) OO tiles Index: ORUIManager.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/ORUIManager.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** ORUIManager.java 6 Feb 2010 23:48:25 -0000 1.52 --- ORUIManager.java 7 Feb 2010 18:28:22 -0000 1.53 *************** *** 1141,1153 **** orWindow.requestFocus(); - // Check first action. - // If it's to lay a home token, handle that here - LayBaseToken lbt = possibleActions.getType(LayBaseToken.class).get(0); - if (lbt.getType() == LayBaseToken.HOME_CITY) { - map.setSelectedHex(map.getHexByName(lbt.getChosenHex().getName())); - layBaseToken (lbt); - return; - } - // Include bonus tokens List<LayToken> possibleTokenLays = --- 1141,1144 ---- *************** *** 1276,1281 **** possibleActions.getType(LayToken.class); for (LayToken tAction : tokenActions) { SpecialTokenLay stl = tAction.getSpecialProperty(); ! orPanel.addSpecialAction(tAction, stl.toMenu()); } } --- 1267,1282 ---- possibleActions.getType(LayToken.class); for (LayToken tAction : tokenActions) { + + if (tAction instanceof LayBaseToken + && ((LayBaseToken)tAction).getType() == LayBaseToken.HOME_CITY) { + // Forced action: select home city + LayBaseToken lbt = (LayBaseToken)tAction; + map.setSelectedHex(map.getHexByName(lbt.getChosenHex().getName())); + layBaseToken (lbt); + return; + + } SpecialTokenLay stl = tAction.getSpecialProperty(); ! if (stl != null) orPanel.addSpecialAction(tAction, stl.toMenu()); } } |