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. |