From: <ste...@us...> - 2010-08-13 16:30:26
|
Revision: 1386 http://rails.svn.sourceforge.net/rails/?rev=1386&view=rev Author: stefanfrey Date: 2010-08-13 16:30:20 +0000 (Fri, 13 Aug 2010) Log Message: ----------- Fixed problem with UI init at start of new game Modified Paths: -------------- trunk/18xx/rails/ui/swing/GameSetupWindow.java trunk/18xx/rails/ui/swing/GameUIManager.java Modified: trunk/18xx/rails/ui/swing/GameSetupWindow.java =================================================================== --- trunk/18xx/rails/ui/swing/GameSetupWindow.java 2010-08-13 16:03:47 UTC (rev 1385) +++ trunk/18xx/rails/ui/swing/GameSetupWindow.java 2010-08-13 16:30:20 UTC (rev 1386) @@ -416,7 +416,7 @@ System.exit(-1); } startGameUIManager (game); - gameUIManager.gameUIInit(); + gameUIManager.gameUIInit(true); // true indicates new game } this.setVisible(false); // XXX: At some point we should destroy this Modified: trunk/18xx/rails/ui/swing/GameUIManager.java =================================================================== --- trunk/18xx/rails/ui/swing/GameUIManager.java 2010-08-13 16:03:47 UTC (rev 1385) +++ trunk/18xx/rails/ui/swing/GameUIManager.java 2010-08-13 16:30:20 UTC (rev 1386) @@ -146,7 +146,7 @@ } - public void gameUIInit() { + public void gameUIInit(boolean newGame) { imageLoader = new ImageLoader(); stockChart = new StockChart(this); @@ -176,8 +176,10 @@ System.exit(1); } - // uncommented by sfy on 13/08/10 to avoid double revenue calculation -// updateUI(); + // removed for reloaded games to avoid double revenue calculation + if (newGame) { + updateUI(); + } reportWindow.scrollDown(); @@ -187,7 +189,7 @@ } public void startLoadedGame() { - gameUIInit(); + gameUIInit(false); // false indicates reload processOnServer(new NullAction(NullAction.START_GAME)); statusWindow.setGameActions(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2010-10-28 18:57:49
|
Revision: 1455 http://rails.svn.sourceforge.net/rails/?rev=1455&view=rev Author: evos Date: 2010-10-28 18:57:43 +0000 (Thu, 28 Oct 2010) Log Message: ----------- Final fix of the map display problem when a game is started via RunGame with a saved file parameter. Modified Paths: -------------- trunk/18xx/rails/ui/swing/StartRoundWindow.java trunk/18xx/rails/ui/swing/StatusWindow.java trunk/18xx/rails/ui/swing/StockChart.java trunk/18xx/rails/ui/swing/hexmap/GUIHex.java trunk/18xx/rails/ui/swing/hexmap/HexMap.java Modified: trunk/18xx/rails/ui/swing/StartRoundWindow.java =================================================================== --- trunk/18xx/rails/ui/swing/StartRoundWindow.java 2010-10-27 21:54:11 UTC (rev 1454) +++ trunk/18xx/rails/ui/swing/StartRoundWindow.java 2010-10-28 18:57:43 UTC (rev 1455) @@ -158,7 +158,7 @@ gbc = new GridBagConstraints(); players = gameUIManager.getGameManager().getPlayers().toArray(new Player[0]); - np = GameManager.getInstance().getNumberOfPlayers(); + np = gameUIManager.getGameManager().getNumberOfPlayers(); packet = round.getStartPacket(); crossIndex = new int[packet.getNumberOfItems()]; @@ -185,8 +185,8 @@ requestFocus(); addKeyListener(this); - + pack(); } @@ -692,7 +692,7 @@ b.append("<br>").append(condition); } } - + } if (item.getSecondary() != null) { b.append("<br><b>Also contains:</b><br>"); Modified: trunk/18xx/rails/ui/swing/StatusWindow.java =================================================================== --- trunk/18xx/rails/ui/swing/StatusWindow.java 2010-10-27 21:54:11 UTC (rev 1454) +++ trunk/18xx/rails/ui/swing/StatusWindow.java 2010-10-28 18:57:43 UTC (rev 1455) @@ -3,12 +3,8 @@ import java.awt.BorderLayout; import java.awt.Color; -//import java.awt.GraphicsConfiguration; -//import java.awt.Rectangle; import java.awt.event.*; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; +import java.util.*; import javax.swing.*; @@ -17,10 +13,8 @@ import rails.common.GuiDef; import rails.game.*; import rails.game.action.*; -import rails.game.correct.*; -import rails.ui.swing.elements.ActionButton; -import rails.ui.swing.elements.ActionMenuItem; -import rails.ui.swing.elements.ActionCheckBoxMenuItem; +import rails.game.correct.CorrectionModeAction; +import rails.ui.swing.elements.*; import rails.util.Config; import rails.util.LocalText; @@ -93,7 +87,7 @@ Logger.getLogger(StatusWindow.class.getPackage().getName()); // GraphicsConfiguration graphicsConfiguration; - + // public StatusWindow(GraphicsConfiguration gc) { // super(gc); // this.graphicsConfiguration = gc; @@ -175,7 +169,7 @@ menuItem.setMnemonic(KeyEvent.VK_R); menuItem.addActionListener(this); optMenu.add(menuItem); - + // new config menu only for non legacy configgfiles if (!Config.isLegacyConfigFile()) { menuItem = new JCheckBoxMenuItem(LocalText.getText("CONFIG")); @@ -354,18 +348,18 @@ } } } - + public void setCorrectionMenu() { // Update the correction menu correctionMenu.removeAll(); correctionMenu.setEnabled(false); - // currently only shows CorrectionModeActions + // currently only shows CorrectionModeActions List<CorrectionModeAction> corrections = possibleActions.getType(CorrectionModeAction.class); - - + + if (corrections != null && !corrections.isEmpty()) { for (CorrectionModeAction a : corrections) { ActionCheckBoxMenuItem item = new ActionCheckBoxMenuItem ( @@ -379,7 +373,7 @@ correctionMenu.setEnabled(true); } } - + public boolean setupFor(RoundI round) { currentRound = round; @@ -397,14 +391,14 @@ // correction actions always possible return gameStatus.initCashCorrectionActions(); - + } public void updateStatus() { - if (!(currentRound instanceof StockRound || currentRound instanceof EndOfGameRound)) + if (!(currentRound instanceof StockRound || currentRound instanceof EndOfGameRound)) return; - + // Moved here from StatusWindow_1856. It's getting generic... if (possibleActions.contains(DiscardTrain.class)) { immediateAction = possibleActions.getType(DiscardTrain.class).get(0); @@ -537,7 +531,7 @@ } if (currentRound instanceof EndOfGameRound) endOfGame(); - + pack(); toFront(); @@ -703,50 +697,50 @@ // setVisible(true); // gameUIManager.reportWindow.setVisible(true); // gameUIManager.stockChart.setVisible(true); - + setTitle(LocalText.getText("EoGTitle")); // Enable Passbutton passButton.setEnabled(true); passButton.setText(LocalText.getText("END_OF_GAME_CLOSE_ALL_WINDOWS")); - + gameUIManager.orWindow.finish(); } public Player getCurrentPlayer () { return gameUIManager.getCurrentPlayer(); } - + public void endOfGameReport() { - GameManagerI gm = GameManager.getInstance(); - - if (gm.getGameOverReportedUI()) + GameManagerI gm = gameUIManager.getGameManager(); + + if (gm.getGameOverReportedUI()) return; else gm.setGameOverReportedUI(true); - + JOptionPane.showMessageDialog(this, LocalText.getText("EoGPressButton"), LocalText.getText("EoGFinalRanking"), JOptionPane.PLAIN_MESSAGE ); - + // show game report line by line - List<String> gameReport = GameManager.getInstance().getGameReport(); + List<String> gameReport = gm.getGameReport(); Collections.reverse(gameReport); - + StringBuilder report = new StringBuilder(); for (String s:gameReport) { report.insert(0, s + "\n"); - JOptionPane.showMessageDialog(this, + JOptionPane.showMessageDialog(this, report, LocalText.getText("EoGFinalRanking"), JOptionPane.PLAIN_MESSAGE ); } } - + public void keyReleased(KeyEvent e) {} public void keyPressed(KeyEvent e) { Modified: trunk/18xx/rails/ui/swing/StockChart.java =================================================================== --- trunk/18xx/rails/ui/swing/StockChart.java 2010-10-27 21:54:11 UTC (rev 1454) +++ trunk/18xx/rails/ui/swing/StockChart.java 2010-10-28 18:57:43 UTC (rev 1455) @@ -6,7 +6,6 @@ import javax.swing.*; -import rails.game.GameManager; import rails.game.StockSpaceI; import rails.ui.swing.elements.GUIStockSpace; @@ -108,7 +107,7 @@ public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_F1) { - HelpWindow.displayHelp(GameManager.getInstance().getHelp()); + HelpWindow.displayHelp(gameUIManager.getGameManager().getHelp()); e.consume(); } } Modified: trunk/18xx/rails/ui/swing/hexmap/GUIHex.java =================================================================== --- trunk/18xx/rails/ui/swing/hexmap/GUIHex.java 2010-10-27 21:54:11 UTC (rev 1454) +++ trunk/18xx/rails/ui/swing/hexmap/GUIHex.java 2010-10-28 18:57:43 UTC (rev 1455) @@ -411,7 +411,9 @@ if (getHexModel().isBlockedForTileLays()) { List<PrivateCompanyI> privates = - GameManager.getInstance().getCompanyManager().getAllPrivateCompanies(); + //GameManager.getInstance().getCompanyManager().getAllPrivateCompanies(); + hexMap.getOrUIManager().getGameUIManager().getGameManager() + .getCompanyManager().getAllPrivateCompanies(); for (PrivateCompanyI p : privates) { List<MapHex> blocked = p.getBlockedHexes(); if (blocked != null) { Modified: trunk/18xx/rails/ui/swing/hexmap/HexMap.java =================================================================== --- trunk/18xx/rails/ui/swing/hexmap/HexMap.java 2010-10-27 21:54:11 UTC (rev 1454) +++ trunk/18xx/rails/ui/swing/hexmap/HexMap.java 2010-10-28 18:57:43 UTC (rev 1455) @@ -540,7 +540,10 @@ return mapManager; } - public void mouseClicked(MouseEvent arg0) { + public ORUIManager getOrUIManager() { + return orUIManager; + } + public void mouseClicked(MouseEvent arg0) { Point point = arg0.getPoint(); GUIHex clickedHex = getHexContainingPoint(point); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2010-12-25 21:33:19
|
Revision: 1467 http://rails.svn.sourceforge.net/rails/?rev=1467&view=rev Author: evos Date: 2010-12-25 21:33:13 +0000 (Sat, 25 Dec 2010) Log Message: ----------- Fixed ReportWindow Modified Paths: -------------- trunk/18xx/rails/ui/swing/AbstractReportWindow.java trunk/18xx/rails/ui/swing/ReportWindow.java trunk/18xx/rails/ui/swing/ReportWindowDynamic.java Modified: trunk/18xx/rails/ui/swing/AbstractReportWindow.java =================================================================== --- trunk/18xx/rails/ui/swing/AbstractReportWindow.java 2010-12-25 21:12:39 UTC (rev 1466) +++ trunk/18xx/rails/ui/swing/AbstractReportWindow.java 2010-12-25 21:33:13 UTC (rev 1467) @@ -1,7 +1,7 @@ package rails.ui.swing; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; +import java.awt.Rectangle; +import java.awt.event.*; import javax.swing.JFrame; @@ -10,10 +10,16 @@ public abstract class AbstractReportWindow extends JFrame { private static final long serialVersionUID = 1L; - + + protected GameUIManager gameUIManager; + // can be set to false, than it cannot be closed protected boolean closeable = true; + public AbstractReportWindow (GameUIManager gameUIManager) { + this.gameUIManager = gameUIManager; + } + public void init() { setSize(400, 400); setLocation(600, 400); @@ -29,12 +35,29 @@ frame.dispose(); } }); - + final GameUIManager guiMgr = gameUIManager; + addComponentListener(new ComponentAdapter() { + @Override + public void componentMoved(ComponentEvent e) { + guiMgr.getWindowSettings().set(frame); + } + @Override + public void componentResized(ComponentEvent e) { + guiMgr.getWindowSettings().set(frame); + } + }); + + WindowSettings ws = gameUIManager.getWindowSettings(); + Rectangle bounds = ws.getBounds(this); + if (bounds.x != -1 && bounds.y != -1) setLocation(bounds.getLocation()); + if (bounds.width != -1 && bounds.height != -1) setSize(bounds.getSize()); + ws.set(frame); + setVisible("yes".equalsIgnoreCase(Config.get("report.window.open"))); } - + public abstract void updateLog(); - + public abstract void scrollDown(); } \ No newline at end of file Modified: trunk/18xx/rails/ui/swing/ReportWindow.java =================================================================== --- trunk/18xx/rails/ui/swing/ReportWindow.java 2010-12-25 21:12:39 UTC (rev 1466) +++ trunk/18xx/rails/ui/swing/ReportWindow.java 2010-12-25 21:33:13 UTC (rev 1467) @@ -31,7 +31,6 @@ private JMenuItem saveItem, loadItem, printItem; private JMenuItem findItem, findBackItem, findNextItem, findPrevItem; - private GameUIManager gameUIManager; private GameManagerI gameManager; private String reportDirectory = Config.get("report.directory"); @@ -52,8 +51,8 @@ public ReportWindow(GameUIManager gameUIManager) { + super(gameUIManager); messageWindow = this; - this.gameUIManager = gameUIManager; this.gameManager = gameUIManager.getGameManager(); reportText = new JTextArea(); @@ -156,24 +155,6 @@ // default report window settings super.init(); - final JFrame frame = this; - final GameUIManager guiMgr = gameUIManager; - addComponentListener(new ComponentAdapter() { - @Override - public void componentMoved(ComponentEvent e) { - guiMgr.getWindowSettings().set(frame); - } - @Override - public void componentResized(ComponentEvent e) { - guiMgr.getWindowSettings().set(frame); - } - }); - - WindowSettings ws = gameUIManager.getWindowSettings(); - Rectangle bounds = ws.getBounds(this); - if (bounds.x != -1 && bounds.y != -1) setLocation(bounds.getLocation()); - if (bounds.width != -1 && bounds.height != -1) setSize(bounds.getSize()); - ws.set(frame); } /* (non-Javadoc) Modified: trunk/18xx/rails/ui/swing/ReportWindowDynamic.java =================================================================== --- trunk/18xx/rails/ui/swing/ReportWindowDynamic.java 2010-12-25 21:12:39 UTC (rev 1466) +++ trunk/18xx/rails/ui/swing/ReportWindowDynamic.java 2010-12-25 21:33:13 UTC (rev 1467) @@ -1,22 +1,13 @@ package rails.ui.swing; import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.EventQueue; import java.awt.Font; -import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.net.URL; import java.util.List; -import javax.swing.JButton; -import javax.swing.JEditorPane; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.UIManager; +import javax.swing.*; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import javax.swing.text.BadLocationException; @@ -38,36 +29,34 @@ public class ReportWindowDynamic extends AbstractReportWindow implements ActionListener, HyperlinkListener { private static final long serialVersionUID = 1L; - private GameUIManager gameUIManager; - private JLabel message; - + private JScrollPane reportPane; private JEditorPane editorPane; - + private JPanel buttonPanel; private ActionButton forwardButton; private ActionButton backwardButton; private JButton returnButton; private JButton playFromHereButton; private JButton commentButton; - + private boolean timeWarpMode; - + protected static Logger log = Logger.getLogger(ReportWindowDynamic.class.getPackage().getName()); public ReportWindowDynamic(GameUIManager gameUIManager) { - super(); - this.gameUIManager = gameUIManager; + super(gameUIManager); init(); } + @Override public void init() { super.init(); setLayout(new BorderLayout()); - + JPanel messagePanel = new JPanel(); messagePanel.setLayout(new BorderLayout()); @@ -75,7 +64,7 @@ message.setText( LocalText.getText("REPORT_TIMEWARP_ACTIVE")); message.setHorizontalAlignment(JLabel.CENTER); messagePanel.add(message, "North"); - + JPanel timeWarpButtons = new JPanel(); returnButton = new JButton(LocalText.getText("REPORT_LEAVE_TIMEWARP")); returnButton.addActionListener( @@ -98,7 +87,7 @@ timeWarpButtons.add(playFromHereButton); messagePanel.add(timeWarpButtons, "South"); add(messagePanel, "North"); - + editorPane = new JEditorPane(); editorPane.setEditable(false); editorPane.setContentType("text/html"); @@ -115,10 +104,10 @@ reportPane = new JScrollPane(editorPane); add(reportPane, "Center"); - + buttonPanel = new JPanel(); add(buttonPanel, "South"); - + backwardButton = new ActionButton(LocalText.getText("REPORT_MOVE_BACKWARD")); backwardButton.addActionListener(this); buttonPanel.add(backwardButton); @@ -126,8 +115,8 @@ forwardButton = new ActionButton(LocalText.getText("REPORT_MOVE_FORWARD")); forwardButton.addActionListener(this); buttonPanel.add(forwardButton); - - + + commentButton = new JButton(LocalText.getText("REPORT_COMMENT")); commentButton.addActionListener( new ActionListener() { @@ -150,15 +139,15 @@ } ); buttonPanel.add(commentButton); - + } - + @Override public void updateLog() { - // set the content of the pane to the current + // set the content of the pane to the current editorPane.setText(ReportBuffer.getReportItems()); scrollDown(); - + forwardButton.setEnabled(false); backwardButton.setEnabled(false); @@ -173,7 +162,7 @@ backwardButton.setEnabled(true); break; case GameAction.FORCED_UNDO: - if (undoFlag) break; // only activate forced undo, if no other undo available + if (undoFlag) break; // only activate forced undo, if no other undo available backwardButton.setPossibleAction(action); backwardButton.setEnabled(true); break; @@ -191,7 +180,7 @@ public void scrollDown() { // only set caret if visible if (!this.isVisible()) return; - + // find the active message in the parsed html code (not identical to the position in the html string) // thus the message indicator is used int caretPosition; @@ -206,7 +195,7 @@ editorPane.setCaretPosition(caretPositionStore); } } - + public void actionPerformed(ActionEvent e) { ActionButton button = (ActionButton)e.getSource(); GameAction action = (GameAction)button.getPossibleActions().get(0); @@ -215,8 +204,8 @@ activateTimeWarp(); } } - - + + gameUIManager.processOnServer(action); } @@ -235,7 +224,7 @@ private void gotoLastIndex() { gotoIndex(gameUIManager.getGameManager().getMoveStack().size()); } - + private void gotoIndex(int index) { MoveStack stack = gameUIManager.getGameManager().getMoveStack(); int currentIndex = stack.getIndex(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2010-12-30 10:12:48
|
Revision: 1469 http://rails.svn.sourceforge.net/rails/?rev=1469&view=rev Author: evos Date: 2010-12-30 10:12:42 +0000 (Thu, 30 Dec 2010) Log Message: ----------- Added system property to define windows settings directories. Added ability to create a default settings file. Modified Paths: -------------- trunk/18xx/rails/ui/swing/StockChart.java trunk/18xx/rails/ui/swing/WindowSettings.java Modified: trunk/18xx/rails/ui/swing/StockChart.java =================================================================== --- trunk/18xx/rails/ui/swing/StockChart.java 2010-12-25 21:34:13 UTC (rev 1468) +++ trunk/18xx/rails/ui/swing/StockChart.java 2010-12-30 10:12:42 UTC (rev 1469) @@ -57,7 +57,8 @@ WindowSettings ws = gameUIManager.getWindowSettings(); Rectangle bounds = ws.getBounds(this); if (bounds.x != -1 && bounds.y != -1) setLocation(bounds.getLocation()); - if (bounds.width != -1 && bounds.height != -1) setSize(bounds.getSize()); + if (bounds.width != -1 && bounds.height != -1 + && !ws.isDefaultUsed()) setSize(bounds.getSize()); ws.set(frame); } Modified: trunk/18xx/rails/ui/swing/WindowSettings.java =================================================================== --- trunk/18xx/rails/ui/swing/WindowSettings.java 2010-12-25 21:34:13 UTC (rev 1468) +++ trunk/18xx/rails/ui/swing/WindowSettings.java 2010-12-30 10:12:42 UTC (rev 1469) @@ -14,6 +14,8 @@ private Map<String, Rectangle> settings = new HashMap<String, Rectangle>(); private String filepath; + private String defaultpath; + private boolean defaultUsed = false; private static final String settingsfilename = "settings_xxxx.rails_ini"; @@ -21,8 +23,10 @@ Logger.getLogger(WindowSettings.class.getPackage().getName()); public WindowSettings (String gameName) { - String directory = Config.get("save.directory"); - filepath = directory + File.separator + settingsfilename.replace("xxxx", gameName); + String directory = System.getProperty("settings.directory"); + if (directory == null) directory = Config.get("save.directory"); + defaultpath = directory + File.separator + settingsfilename; + filepath = defaultpath.replace("xxxx", gameName); } private Rectangle rectangle (String windowName) { @@ -40,11 +44,26 @@ return rectangle (w.getClass().getSimpleName()); } + public boolean isDefaultUsed() { + return defaultUsed; + } + public void load () { + FileReader file; + try { + file = new FileReader (filepath); + } catch (FileNotFoundException e1) { + try { + file = new FileReader (defaultpath); + } catch (FileNotFoundException e2) { + return; + } + defaultUsed = true; + } BufferedReader in; try { - in = new BufferedReader (new FileReader (filepath)); + in = new BufferedReader (file); String line; String[] fields; int v; @@ -62,9 +81,6 @@ } } in.close(); - } catch (FileNotFoundException e) { - // No problem - return; } catch (Exception e) { log.error ("Error while loading "+filepath, e); } @@ -103,7 +119,7 @@ } out.close(); } catch (Exception e) { - + log.error ("Exception while saving window settings", e); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2011-04-06 22:14:00
|
Revision: 1514 http://rails.svn.sourceforge.net/rails/?rev=1514&view=rev Author: evos Date: 2011-04-06 22:13:54 +0000 (Wed, 06 Apr 2011) Log Message: ----------- AutoSave/Load improvements for the OR Window Modified Paths: -------------- trunk/18xx/rails/ui/swing/GameUIManager.java trunk/18xx/rails/ui/swing/ORPanel.java trunk/18xx/rails/ui/swing/ORUIManager.java Modified: trunk/18xx/rails/ui/swing/GameUIManager.java =================================================================== --- trunk/18xx/rails/ui/swing/GameUIManager.java 2011-04-06 22:12:31 UTC (rev 1513) +++ trunk/18xx/rails/ui/swing/GameUIManager.java 2011-04-06 22:13:54 UTC (rev 1514) @@ -711,6 +711,11 @@ log.debug("Autosaving to "+lastSavedFilename); processOnServer (saveAction); + saveAutoSavedFilename (lastSavedFilename); + } + + protected void saveAutoSavedFilename (String lastSavedFilename) { + try { File f = new File (lastSavedFilenameFilepath); PrintWriter out = new PrintWriter (new FileWriter (f)); @@ -909,6 +914,7 @@ if (gameWasLoaded) { autoSaveLoadInitialized = true; lastSavedFilenameFilepath = saveDirectory + "/" + savePrefix + ".last_rails"; + saveAutoSavedFilename (lastSavedFilename); } if (autoLoadPoller != null && autoSaveLoadStatus != AutoLoadPoller.OFF Modified: trunk/18xx/rails/ui/swing/ORPanel.java =================================================================== --- trunk/18xx/rails/ui/swing/ORPanel.java 2011-04-06 22:12:31 UTC (rev 1513) +++ trunk/18xx/rails/ui/swing/ORPanel.java 2011-04-06 22:13:54 UTC (rev 1514) @@ -746,6 +746,8 @@ ((ActionMenuItem)item).clearPossibleActions(); } } + undoButton.setEnabled(false); + } public void resetORCompanyTurn(int orCompIndex) { Modified: trunk/18xx/rails/ui/swing/ORUIManager.java =================================================================== --- trunk/18xx/rails/ui/swing/ORUIManager.java 2011-04-06 22:12:31 UTC (rev 1513) +++ trunk/18xx/rails/ui/swing/ORUIManager.java 2011-04-06 22:13:54 UTC (rev 1514) @@ -1457,8 +1457,6 @@ messagePanel.setMessage(null); - if (!myTurn) return; - if (actionToComplete != null) { log.debug("ExecutedAction: " + actionToComplete); } @@ -1480,6 +1478,8 @@ orPanel.initORCompanyTurn(orComp, orCompIndex); + if (!myTurn) return; + privatesCanBeBoughtNow = possibleActions.contains(BuyPrivate.class); orPanel.initPrivateBuying(privatesCanBeBoughtNow); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |