From: Stefan F. <ste...@us...> - 2012-05-30 12:00:37
|
rails/game/MapManager.java | 38 ++++++++++++++++++++++++++-- rails/ui/swing/elements/NonModalDialog.java | 1 readme.txt | 16 ++++++++--- version.number | 2 - 4 files changed, 49 insertions(+), 8 deletions(-) New commits: commit 9304a2d80b3af79420ee214fc2d3699d35f8cffc Author: Stefan Frey <ste...@we...> Date: Wed May 30 13:13:25 2012 +0200 preparations for 1.7.5 release diff --git a/readme.txt b/readme.txt index 37d3ce1..c74b11d 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -Rails release 1.7.4: +Rails release 1.7.5: A new maintenance release for Rails 1.x series @@ -6,9 +6,15 @@ This release fixes several recent bugs. Contributors: Erik Vos, Stefan Frey -Bugs reported by James Romano, Mike Bourke, Volker Schnell +Bugs reported by John David Galt, Mike Bourke, Phil Davies + +New: +1856: Alternate Trains variant added +1856: Alternate Destinations variant added (not fully implemented yet) List of bugs fixed: -- 18EU Hamburg red-to-red bonus calculation incorrect -- Fixed exception in Map panel scrolling -- In 1835 Companies with a fixed start price postpone laying the current price token until floating time. +Phase extra info is reported in report window (e.g. Civil War in 18TN) +Tokens on map are updated after undo/redo +Fixed non-modal dialog bug during loading game +1835: preventing selling double non-president shares in parts. +1835: fixed 1835 hex distance calculation bug diff --git a/version.number b/version.number index fdf5bc6..905b3b7 100644 --- a/version.number +++ b/version.number @@ -1,5 +1,5 @@ #Property file that contains version number and the develop indicator -version=1.7.4 +version=1.7.5 # the following string "@DEVELOP@ is replaced by an empty string in the release version # this is done automatically by ant develop=@DEVELOP@ \ No newline at end of file commit 1e3e6ead6ded8d295f450ea127b118910155cdb6 Author: Erik Vos <eri...@xs...> Date: Mon May 28 15:28:49 2012 +0200 Fixed non-modal dialog bug during loading game. Non-modal dialogs try to center location on the 'parent' window, but centering fails if the parent is not visible. It is now also set visible beforehand.(cherry picked from commit 3429f9f58e6993b09c89f7f56fd4a7230ef1ede9) diff --git a/rails/ui/swing/elements/NonModalDialog.java b/rails/ui/swing/elements/NonModalDialog.java index 36d8581..15a3b37 100644 --- a/rails/ui/swing/elements/NonModalDialog.java +++ b/rails/ui/swing/elements/NonModalDialog.java @@ -83,6 +83,7 @@ public abstract class NonModalDialog extends JDialog implements ActionListener { pack(); // Center on owner + window.setVisible(true); // Window must be visible to find its location! int x = (int) window.getLocationOnScreen().getX() + (window.getWidth() - getWidth()) / 2; int y = (int) window.getLocationOnScreen().getY() commit 9e8781e4e46b8e641adb1022f659dd8f0742521b Author: Erik Vos <eri...@xs...> Date: Mon May 28 12:55:02 2012 +0200 Fixed 1835 hex distance calculation bug. Impassable hex sides are no longer disregarded.(cherry picked from commit 1210bffe332f0f978f828b2e7e38e77cc7267cc4) diff --git a/rails/game/MapManager.java b/rails/game/MapManager.java index dcd9cad..6cd4307 100644 --- a/rails/game/MapManager.java +++ b/rails/game/MapManager.java @@ -325,6 +325,40 @@ public class MapManager implements ConfigurableComponentI { } } + /** Return the hex adjacent to a given hex in a particular direction. + * Return null if that hex does not exist. + * @param hex The hex object for which an adjacent one is searched. + * @param orientation The direction where to look (values 0-5); + * @return The found MapHex object, or null. + */ + public MapHex getAdjacentHex (MapHex hex, int orientation) { + + int x = hex.getX(); + int y = hex.getY(); + int xx = getAdjacentX (x, y, orientation); + int yy = getAdjacentY (x, y, orientation); + + if (xx >= minX && xx <= maxX && yy >= minY && yy <= maxY) { + return hexes[xx][yy]; // null if undefined + } + return null; //outside the map border + } + + /** Return a List of all hexes adjacent to a given hex. + * @param hex The hex object for which all adjacent hexes are searched. + * @return The found list of MapHex objects. Can be empty, not null. + */ + public List<MapHex> getAdjacentHexes (MapHex hex) { + + List<MapHex> adjacentHexes = new ArrayList<MapHex> (); + MapHex adjacentHex; + + for (int i=0; i<6; i++) { + if ((adjacentHex = getAdjacentHex (hex, i)) != null) adjacentHexes.add(adjacentHex); + } + return adjacentHexes; + } + /** * @return Returns the currentTileOrientation. */ @@ -443,7 +477,7 @@ public class MapManager implements ConfigurableComponentI { distances.get(hex1).put(hex2, depth); } - for (MapHex hex3 : hex2.getNeighbors()) { + for (MapHex hex3 : getAdjacentHexes(hex2)) { if (hex3 == null) continue; if (distances.get(hex1).get(hex3) == null) { calculateHexDistances (hex1, hex3, depth+1); @@ -494,7 +528,7 @@ public class MapManager implements ConfigurableComponentI { public int getMapXOffset() { return mapXOffset; } - + public int getMapYOffset() { return mapYOffset; } |