Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .gitignore | 6 +-
- data/base/client-options.xml | 4 +
- data/rules/classic/resources.properties | 87 +++++++++++++++------
- .../order-buttons/disabled/toggle_fog_of_war.png | Bin 0 -> 2833 bytes
- .../disabled/toggle_fog_of_war_no.png | Bin 0 -> 2833 bytes
- .../disabled/toggle_view_politics.png | Bin 0 -> 2833 bytes
- .../highlighted/toggle_fog_of_war.png | Bin 0 -> 3916 bytes
- .../highlighted/toggle_fog_of_war_no.png | Bin 0 -> 4132 bytes
- .../highlighted/toggle_view_economic.png | Bin 0 -> 3551 bytes
- .../highlighted/toggle_view_politics.png | Bin 0 -> 3926 bytes
- .../ui/order-buttons/normal/toggle_fog_of_war.png | Bin 0 -> 3826 bytes
- .../order-buttons/normal/toggle_fog_of_war_no.png | Bin 0 -> 3858 bytes
- .../order-buttons/normal/toggle_view_economic.png | Bin 0 -> 3394 bytes
- .../order-buttons/normal/toggle_view_politics.png | Bin 0 -> 3405 bytes
- .../ui/order-buttons/pressed/toggle_fog_of_war.png | Bin 0 -> 3826 bytes
- .../order-buttons/pressed/toggle_fog_of_war_no.png | Bin 0 -> 3858 bytes
- .../order-buttons/pressed/toggle_view_economic.png | Bin 0 -> 3394 bytes
- .../order-buttons/pressed/toggle_view_politics.png | Bin 0 -> 3405 bytes
- data/strings/FreeColMessages.properties | 16 +++-
- src/net/sf/freecol/client/ClientOptions.java | 18 +++++
- src/net/sf/freecol/client/gui/GUI.java | 10 +++
- .../freecol/client/gui/action/ActionManager.java | 4 +
- .../gui/action/MiniMapToggleFogOfWarAction.java | 74 ++++++++++++++++++
- .../client/gui/action/MiniMapToggleViewAction.java | 73 +++++++++++++++++
- .../client/gui/panel/CornerMapControls.java | 4 +
- .../sf/freecol/client/gui/panel/MapControls.java | 29 ++++++-
- src/net/sf/freecol/client/gui/panel/MiniMap.java | 59 ++++++++++++--
- 27 files changed, 348 insertions(+), 36 deletions(-)
- diff --git a/.gitignore b/.gitignore
- index 06c44c6..f1b4fba 100644
- --- a/.gitignore
- +++ b/.gitignore
- @@ -8,4 +8,8 @@ FreeCol.log
- FreeCol.jar
- src/MANIFEST.MF
- build/
- -doc/specification_*.html
- \ No newline at end of file
- +doc/specification_*.html
- +/data/rules/classic/resources/images/ui/order-buttons/disabled/toggle_fog_of_war.png
- +/data/rules/classic/resources/images/ui/order-buttons/disabled/toggle_fog_of_war_no.png
- +/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_fog_of_war.png
- +/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_fog_of_war_no.png
- diff --git a/data/base/client-options.xml b/data/base/client-options.xml
- index c4a58e8..e60089c 100644
- --- a/data/base/client-options.xml
- +++ b/data/base/client-options.xml
- @@ -65,6 +65,10 @@
- <booleanOption id="model.option.smoothRendering" defaultValue="false"/>
- <!-- Option to disable end turn grey background. -->
- <booleanOption id="model.option.disableGrayLayer" defaultValue="false"/>
- + <!-- If selected: Draws the fog of war on the minimap. -->
- + <booleanOption id="model.option.miniMapToggleFogOfWar" defaultValue="true"/>
- + <!-- If selected: Draws the borders on the minimap. -->
- + <booleanOption id="model.option.miniMapToggleBorders" defaultValue="true"/>
- <!-- The color to fill in around the actual map on the minimap. -->
- <selectOption id="model.option.color.background" defaultValue="0" localizedLabels="true">
- <selectValue label="clientOptions.minimap.color.background.black" value="0"/>
- diff --git a/data/rules/classic/resources.properties b/data/rules/classic/resources.properties
- index 794a01a..5d1c6dd 100644
- --- a/data/rules/classic/resources.properties
- +++ b/data/rules/classic/resources.properties
- @@ -39,6 +39,10 @@ orderButton.normal.build=resources/images/ui/order-buttons/normal/build.png
- orderButton.normal.disband=resources/images/ui/order-buttons/normal/disband.png
- orderButton.normal.zoom_in=resources/images/ui/order-buttons/normal/zoom_in.png
- orderButton.normal.zoom_out=resources/images/ui/order-buttons/normal/zoom_out.png
- +orderButton.normal.toggle_fog_of_war=resources/images/ui/order-buttons/normal/toggle_fog_of_war.png
- +orderButton.normal.toggle_fog_of_war_no=resources/images/ui/order-buttons/normal/toggle_fog_of_war_no.png
- +orderButton.normal.toggle_view_politics=resources/images/ui/order-buttons/normal/toggle_view_politics.png
- +orderButton.normal.toggle_view_economic=resources/images/ui/order-buttons/normal/toggle_view_economic.png
- orderButton.highlighted.wait=resources/images/ui/order-buttons/highlighted/wait.png
- orderButton.highlighted.done=resources/images/ui/order-buttons/highlighted/done.png
- orderButton.highlighted.fortify=resources/images/ui/order-buttons/highlighted/fortify.png
- @@ -50,6 +54,10 @@ orderButton.highlighted.build=resources/images/ui/order-buttons/highlighted/buil
- orderButton.highlighted.disband=resources/images/ui/order-buttons/highlighted/disband.png
- orderButton.highlighted.zoom_in=resources/images/ui/order-buttons/highlighted/zoom_in.png
- orderButton.highlighted.zoom_out=resources/images/ui/order-buttons/highlighted/zoom_out.png
- +orderButton.highlighted.toggle_fog_of_war=resources/images/ui/order-buttons/highlighted/toggle_fog_of_war.png
- +orderButton.highlighted.toggle_fog_of_war_no=resources/images/ui/order-buttons/highlighted/toggle_fog_of_war_no.png
- +orderButton.highlighted.toggle_view_politics=resources/images/ui/order-buttons/highlighted/toggle_view_politics.png
- +orderButton.highlighted.toggle_view_economic=resources/images/ui/order-buttons/highlighted/toggle_view_economic.png
- orderButton.pressed.wait=resources/images/ui/order-buttons/pressed/wait.png
- orderButton.pressed.done=resources/images/ui/order-buttons/pressed/done.png
- orderButton.pressed.fortify=resources/images/ui/order-buttons/pressed/fortify.png
- @@ -61,6 +69,10 @@ orderButton.pressed.build=resources/images/ui/order-buttons/pressed/build.png
- orderButton.pressed.disband=resources/images/ui/order-buttons/pressed/disband.png
- orderButton.pressed.zoom_in=resources/images/ui/order-buttons/pressed/zoom_in.png
- orderButton.pressed.zoom_out=resources/images/ui/order-buttons/pressed/zoom_out.png
- +orderButton.pressed.toggle_fog_of_war=resources/images/ui/order-buttons/pressed/toggle_fog_of_war.png
- +orderButton.pressed.toggle_fog_of_war_no=resources/images/ui/order-buttons/pressed/toggle_fog_of_war_no.png
- +orderButton.pressed.toggle_view_politics=resources/images/ui/order-buttons/pressed/toggle_view_politics.png
- +orderButton.pressed.toggle_view_economic=resources/images/ui/order-buttons/pressed/toggle_view_economic.png
- orderButton.disabled.wait=resources/images/ui/order-buttons/disabled/wait.png
- orderButton.disabled.done=resources/images/ui/order-buttons/disabled/done.png
- orderButton.disabled.fortify=resources/images/ui/order-buttons/disabled/fortify.png
- @@ -72,6 +84,10 @@ orderButton.disabled.build=resources/images/ui/order-buttons/disabled/build.png
- orderButton.disabled.disband=resources/images/ui/order-buttons/disabled/disband.png
- orderButton.disabled.zoom_in=resources/images/ui/order-buttons/disabled/zoom_in.png
- orderButton.disabled.zoom_out=resources/images/ui/order-buttons/disabled/zoom_out.png
- +orderButton.disabled.toggle_fog_of_war=resources/images/ui/order-buttons/disabled/toggle_fog_of_war.png
- +orderButton.disabled.toggle_fog_of_war_no=resources/images/ui/order-buttons/disabled/toggle_fog_of_war_no.png
- +orderButton.disabled.toggle_view_politics=resources/images/ui/order-buttons/disabled/toggle_view_politics.png
- +orderButton.disabled.toggle_view_economic=resources/images/ui/order-buttons/disabled/toggle_view_economic.png
- # Video
- Opening.video=resources/video/freecol-opening.video.ogg
- @@ -642,29 +658,54 @@ model.foundingFather.juanDeSepulveda.image=resources/images/foundingFathers/juan
- # National Colors are in the spec
- # Tiles
- -model.tile.plains.color=urn:color:0x24801f
- -model.tile.grassland.color=urn:color:0x24801f
- -model.tile.prairie.color=urn:color:0x24801f
- -model.tile.savannah.color=urn:color:0x24801f
- -model.tile.marsh.color=urn:color:0x24803d
- -model.tile.swamp.color=urn:color:0x24803d
- -model.tile.desert.color=urn:color:0x63732b
- -model.tile.tundra.color=urn:color:0x639e5e
- -model.tile.mixedForest.color=urn:color:0x24731f
- -model.tile.coniferForest.color=urn:color:0x24731f
- -model.tile.broadleafForest.color=urn:color:0x24731f
- -model.tile.tropicalForest.color=urn:color:0x24731f
- -model.tile.wetlandForest.color=urn:color:0x24731f
- -model.tile.rainForest.color=urn:color:0x24731f
- -model.tile.scrubForest.color=urn:color:0x24731f
- -model.tile.borealForest.color=urn:color:0x24731f
- -model.tile.hills.color=urn:color:0x708052
- -model.tile.mountains.color=urn:color:0x577352
- -model.tile.arctic.color=urn:color:0xffffff
- -model.tile.ocean.color=urn:color:0x600000ff
- -model.tile.lake.color=urn:color:0x46436d
- -model.tile.highSeas.color=urn:color:0x300000ff
- -model.tile.greatRiver.color=urn:color:0x555187
- +model.tile.plains.economicColor=urn:color:0x24801f
- +model.tile.grassland.economicColor=urn:color:0x24801f
- +model.tile.prairie.economicColor=urn:color:0x24801f
- +model.tile.savannah.economicColor=urn:color:0x24801f
- +model.tile.marsh.economicColor=urn:color:0x24803d
- +model.tile.swamp.economicColor=urn:color:0x24803d
- +model.tile.desert.economicColor=urn:color:0x63732b
- +model.tile.tundra.economicColor=urn:color:0x639e5e
- +model.tile.mixedForest.economicColor=urn:color:0x24731f
- +model.tile.coniferForest.economicColor=urn:color:0x24731f
- +model.tile.broadleafForest.economicColor=urn:color:0x24731f
- +model.tile.tropicalForest.economicColor=urn:color:0x24731f
- +model.tile.wetlandForest.economicColor=urn:color:0x24731f
- +model.tile.rainForest.economicColor=urn:color:0x24731f
- +model.tile.scrubForest.economicColor=urn:color:0x24731f
- +model.tile.borealForest.economicColor=urn:color:0x24731f
- +model.tile.hills.economicColor=urn:color:0x708052
- +model.tile.mountains.economicColor=urn:color:0x577352
- +model.tile.arctic.economicColor=urn:color:0xffffff
- +model.tile.ocean.economicColor=urn:color:0x600000ff
- +model.tile.lake.economicColor=urn:color:0x46436d
- +model.tile.highSeas.economicColor=urn:color:0x300000ff
- +model.tile.greatRiver.economicColor=urn:color:0x555187
- +
- +model.tile.plains.politicsColor=urn:color:0x24801f
- +model.tile.grassland.politicsColor=urn:color:0x24801f
- +model.tile.prairie.politicsColor=urn:color:0x24801f
- +model.tile.savannah.politicsColor=urn:color:0x24801f
- +model.tile.marsh.politicsColor=urn:color:0x24801f
- +model.tile.swamp.politicsColor=urn:color:0x24801f
- +model.tile.desert.politicsColor=urn:color:0x24801f
- +model.tile.tundra.politicsColor=urn:color:0x24801f
- +model.tile.mixedForest.politicsColor=urn:color:0x24801f
- +model.tile.coniferForest.politicsColor=urn:color:0x24801f
- +model.tile.broadleafForest.politicsColor=urn:color:0x24801f
- +model.tile.tropicalForest.politicsColor=urn:color:0x24801f
- +model.tile.wetlandForest.politicsColor=urn:color:0x24801f
- +model.tile.rainForest.politicsColor=urn:color:0x24801f
- +model.tile.scrubForest.politicsColor=urn:color:0x24801f
- +model.tile.borealForest.politicsColor=urn:color:0x24801f
- +model.tile.hills.politicsColor=urn:color:0x24801f
- +model.tile.mountains.politicsColor=urn:color:0x24801f
- +model.tile.arctic.politicsColor=urn:color:0x24801f
- +model.tile.ocean.politicsColor=urn:color:0x9696f2
- +model.tile.lake.politicsColor=urn:color:0x9696f2
- +model.tile.highSeas.politicsColor=urn:color:0x44446e
- +model.tile.greatRiver.politicsColor=urn:color:0x9696f2
- +
- model.tile.arctic.center0.image=resources/images/terrain/arctic/center0.png
- model.tile.arctic.center1.image=resources/images/terrain/arctic/center1.png
- model.tile.arctic.border_N_even.image=resources/images/terrain/arctic/border_N_even.png
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/disabled/toggle_fog_of_war.png b/data/rules/classic/resources/images/ui/order-buttons/disabled/toggle_fog_of_war.png
- new file mode 100644
- index 0000000..5a66c4f
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/disabled/toggle_fog_of_war.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/disabled/toggle_fog_of_war_no.png b/data/rules/classic/resources/images/ui/order-buttons/disabled/toggle_fog_of_war_no.png
- new file mode 100644
- index 0000000..5a66c4f
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/disabled/toggle_fog_of_war_no.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/disabled/toggle_view_politics.png b/data/rules/classic/resources/images/ui/order-buttons/disabled/toggle_view_politics.png
- new file mode 100644
- index 0000000..5a66c4f
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/disabled/toggle_view_politics.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_fog_of_war.png b/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_fog_of_war.png
- new file mode 100644
- index 0000000..a79d951
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_fog_of_war.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_fog_of_war_no.png b/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_fog_of_war_no.png
- new file mode 100644
- index 0000000..f34db58
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_fog_of_war_no.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_view_economic.png b/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_view_economic.png
- new file mode 100644
- index 0000000..4f33e3a
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_view_economic.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_view_politics.png b/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_view_politics.png
- new file mode 100644
- index 0000000..58a1ed7
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/highlighted/toggle_view_politics.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/normal/toggle_fog_of_war.png b/data/rules/classic/resources/images/ui/order-buttons/normal/toggle_fog_of_war.png
- new file mode 100644
- index 0000000..7ff9e75
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/normal/toggle_fog_of_war.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/normal/toggle_fog_of_war_no.png b/data/rules/classic/resources/images/ui/order-buttons/normal/toggle_fog_of_war_no.png
- new file mode 100644
- index 0000000..dd02aca
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/normal/toggle_fog_of_war_no.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/normal/toggle_view_economic.png b/data/rules/classic/resources/images/ui/order-buttons/normal/toggle_view_economic.png
- new file mode 100644
- index 0000000..04277ae
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/normal/toggle_view_economic.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/normal/toggle_view_politics.png b/data/rules/classic/resources/images/ui/order-buttons/normal/toggle_view_politics.png
- new file mode 100644
- index 0000000..d2d8f5b
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/normal/toggle_view_politics.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/pressed/toggle_fog_of_war.png b/data/rules/classic/resources/images/ui/order-buttons/pressed/toggle_fog_of_war.png
- new file mode 100644
- index 0000000..7ff9e75
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/pressed/toggle_fog_of_war.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/pressed/toggle_fog_of_war_no.png b/data/rules/classic/resources/images/ui/order-buttons/pressed/toggle_fog_of_war_no.png
- new file mode 100644
- index 0000000..dd02aca
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/pressed/toggle_fog_of_war_no.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/pressed/toggle_view_economic.png b/data/rules/classic/resources/images/ui/order-buttons/pressed/toggle_view_economic.png
- new file mode 100644
- index 0000000..04277ae
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/pressed/toggle_view_economic.png differ
- diff --git a/data/rules/classic/resources/images/ui/order-buttons/pressed/toggle_view_politics.png b/data/rules/classic/resources/images/ui/order-buttons/pressed/toggle_view_politics.png
- new file mode 100644
- index 0000000..d2d8f5b
- Binary files /dev/null and b/data/rules/classic/resources/images/ui/order-buttons/pressed/toggle_view_politics.png differ
- diff --git a/data/strings/FreeColMessages.properties b/data/strings/FreeColMessages.properties
- index 5c79173..ac531fc 100644
- --- a/data/strings/FreeColMessages.properties
- +++ b/data/strings/FreeColMessages.properties
- @@ -341,9 +341,9 @@ menuBar.report=Report
- menuBar.statusLine=Score: %score% | Gold: %gold% | Tax: %tax%% | Year: %year%
- findSettlementDialog.name=Find Settlement
- -findSettlementDialog.displayAll=Find all settlements
- -findSettlementDialog.displayOnlyNatives=Find only native settlements
- -findSettlementDialog.displayOnlyEuropean=Find only European settlements
- +findSettlementDialog.displayAll=Find all settlement
- +findSettlementDialog.displayOnlyNatives=Find only settlement native
- +findSettlementDialog.displayOnlyEuropean=Find only settlement european
- metaServer.couldNotConnect=Sorry, could not connect to the meta-server. Please try again later.
- metaServer.communicationError=There was an error while communicating with the meta-server. Please try again later.
- @@ -820,6 +820,10 @@ model.option.defaultZoomLevel.name=Default zoom level
- model.option.defaultZoomLevel.shortDescription=Which default zoom level the minimap uses.
- model.option.color.background.name=Background Color
- model.option.color.background.shortDescription=When the minimap is fully zoomed-out, this color surrounds the map and fog-of-war.
- +model.option.miniMapToggleBorders.name=Toogle borders on the minimap
- +model.option.miniMapToggleBorders.shortDescription=If selected: Draws the borders on the minimap.
- +model.option.miniMapToggleFogOfWar.name=Toogle fog of war on the minimap
- +model.option.miniMapToggleFogOfWar.shortDescription=If selected: Draws the fog of war on the minimap.
- clientOptions.minimap.color.background.black=Black
- clientOptions.minimap.color.background.gray.dark.very=Very Dark Gray
- clientOptions.minimap.color.background.gray.dark=Dark Gray
- @@ -1103,10 +1107,10 @@ indianDemand.food.no=Alas, our warehouses are empty.
- indianDemand.gold.text=The colonists of %colony% have committed innumerable atrocities against the %nation%. Now we demand %amount% gold in reparation.
- indianDemand.gold.yes=Accept
- indianDemand.gold.no=Begone, thieves!
- +
- indianDemand.other.text=The colonists of %colony% have committed innumerable atrocities against the %nation%. Now we demand %amount% %goods% in reparation.
- indianDemand.other.yes=Accept
- indianDemand.other.no=Begone, thieves!
- -
- exploreLostCityRumour.text=Really explore the ruins of a lost city?
- exploreMoundsRumour.text=You discover some strange mounds. Do you really want to explore them?
- exploreLostCityRumour.yes=What could go wrong?
- @@ -1488,6 +1492,10 @@ miniMapZoomOutAction.name=Zoom out MiniMap
- miniMapZoomOutAction.accelerator=control MINUS
- miniMapZoomOutAction.secondary.name=Zoom out MiniMap (secondary)
- miniMapZoomOutAction.secondary.accelerator=control SUBTRACT
- +miniMapToggleBordersAction.name=Toggle the view between political and economic
- +miniMapToggleBordersAction.secondary.name=Toggle the view between political and economic (secondary)
- +miniMapToggleFogOfWarAction.name=Toggle fog of war
- +miniMapToggleFogOfWarAction.secondary.name=Toggle fog of war (secondary)
- moveAction.E.accelerator=NUMPAD6
- moveAction.E.name=Move East
- moveAction.E.secondary.accelerator=RIGHT
- diff --git a/src/net/sf/freecol/client/ClientOptions.java b/src/net/sf/freecol/client/ClientOptions.java
- index faa2d98..d87e19f 100644
- --- a/src/net/sf/freecol/client/ClientOptions.java
- +++ b/src/net/sf/freecol/client/ClientOptions.java
- @@ -232,6 +232,18 @@ public class ClientOptions extends OptionGroup {
- = "model.option.disableGrayLayer";
- /**
- + * If selected: Draws the borders on the minimap.
- + */
- + public static final String MINIMAP_TOGGLE_BORDERS
- + = "model.option.miniMapToggleBorders";
- +
- + /**
- + * If selected: Draws the fog of war on the minimap.
- + */
- + public static final String MINIMAP_TOGGLE_FOG_OF_WAR
- + = "model.option.miniMapToggleFogOfWar";
- +
- + /**
- * The color to fill in around the actual map on the
- * minimap. Typically only visible when the minimap is at full
- * zoom-out, but at the default 'black' you can't differentiate
- @@ -846,6 +858,12 @@ public class ClientOptions extends OptionGroup {
- addBooleanOption(REMEMBER_PANEL_SIZES,
- "clientOptions.gui", true);
- // end @compat 0.10.7
- + // @compact 0.10.8
- + addBooleanOption(MINIMAP_TOGGLE_BORDERS,
- + "clientOptions.gui", true);
- + addBooleanOption(MINIMAP_TOGGLE_FOG_OF_WAR,
- + "clientOptions.gui", true);
- + // end @compact 0.10.8
- }
- private void addBooleanOption(String id, String gr, boolean val) {
- diff --git a/src/net/sf/freecol/client/gui/GUI.java b/src/net/sf/freecol/client/gui/GUI.java
- index 8e7a186..11f9975 100644
- --- a/src/net/sf/freecol/client/gui/GUI.java
- +++ b/src/net/sf/freecol/client/gui/GUI.java
- @@ -999,6 +999,16 @@ public class GUI {
- public boolean canZoomOutMapControls() {
- return mapControls != null && mapControls.canZoomOutMapControls();
- }
- +
- + public void miniMapToggleViewControls() {
- + if (mapControls == null) return;
- + mapControls.toggleView();
- + }
- +
- + public void miniMapToggleFogOfWarControls() {
- + if (mapControls == null) return;
- + mapControls.toogleFogOfWar();
- + }
- // Trivial delegations to Canvas
- diff --git a/src/net/sf/freecol/client/gui/action/ActionManager.java b/src/net/sf/freecol/client/gui/action/ActionManager.java
- index 474ecb2..0e6e759 100644
- --- a/src/net/sf/freecol/client/gui/action/ActionManager.java
- +++ b/src/net/sf/freecol/client/gui/action/ActionManager.java
- @@ -100,6 +100,10 @@ public class ActionManager extends OptionGroup {
- add(new LoadAction(freeColClient));
- add(new MapControlsAction(freeColClient));
- add(new MapEditorAction(freeColClient));
- + add(new MiniMapToggleViewAction(freeColClient));
- + add(new MiniMapToggleViewAction(freeColClient, true));
- + add(new MiniMapToggleFogOfWarAction(freeColClient));
- + add(new MiniMapToggleFogOfWarAction(freeColClient, true));
- add(new MiniMapZoomInAction(freeColClient));
- add(new MiniMapZoomInAction(freeColClient, true));
- add(new MiniMapZoomOutAction(freeColClient));
- diff --git a/src/net/sf/freecol/client/gui/action/MiniMapToggleFogOfWarAction.java b/src/net/sf/freecol/client/gui/action/MiniMapToggleFogOfWarAction.java
- new file mode 100644
- index 0000000..12b62b3
- --- /dev/null
- +++ b/src/net/sf/freecol/client/gui/action/MiniMapToggleFogOfWarAction.java
- @@ -0,0 +1,74 @@
- +/**
- + * Copyright (C) 2002-2013 The FreeCol Team
- + *
- + * This file is part of FreeCol.
- + *
- + * FreeCol is free software: you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation, either version 2 of the License, or
- + * (at your option) any later version.
- + *
- + * FreeCol is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with FreeCol. If not, see <http://www.gnu.org/licenses/>.
- + */
- +
- +package net.sf.freecol.client.gui.action;
- +
- +import java.awt.event.ActionEvent;
- +import net.sf.freecol.client.ClientOptions;
- +
- +import net.sf.freecol.client.FreeColClient;
- +
- +
- +/**
- + * An action for enable/disable fog of war in on the minimap.
- + */
- +public class MiniMapToggleFogOfWarAction extends MapboardAction {
- +
- + public static final String id = "miniMapToggleFogOfWarAction";
- +
- +
- + /**
- + * Creates a new <code>MiniMapToggleFogAction</code>.
- + *
- + * @param freeColClient The <code>FreeColClient</code> for the game.
- + */
- + public MiniMapToggleFogOfWarAction(FreeColClient freeColClient) {
- + super(freeColClient, id);
- +
- + addImageIcons("toggle_fog_of_war");
- + }
- +
- + /**
- + * Creates a new <code>MiniMapToggleFogAction</code>.
- + *
- + * @param freeColClient The <code>FreeColClient</code> for the game.
- + * @param b a <code>boolean</code> value
- + */
- + public MiniMapToggleFogOfWarAction(FreeColClient freeColClient, boolean b) {
- + super(freeColClient, id + ".secondary");
- +
- + addImageIcons("toggle_fog_of_war");
- + }
- +
- + // Interface ActionListener
- +
- + /**
- + * {@inheritDoc}
- + */
- + public void actionPerformed(ActionEvent e) {
- + getGUI().miniMapToggleFogOfWarControls();
- +
- + if (freeColClient.getClientOptions().getBoolean(ClientOptions.MINIMAP_TOGGLE_FOG_OF_WAR)) {
- + addImageIcons("toggle_fog_of_war");
- + } else {
- + addImageIcons("toggle_fog_of_war_no");
- + }
- + }
- +}
- +
- diff --git a/src/net/sf/freecol/client/gui/action/MiniMapToggleViewAction.java b/src/net/sf/freecol/client/gui/action/MiniMapToggleViewAction.java
- new file mode 100644
- index 0000000..770767e
- --- /dev/null
- +++ b/src/net/sf/freecol/client/gui/action/MiniMapToggleViewAction.java
- @@ -0,0 +1,73 @@
- +/**
- + * Copyright (C) 2002-2013 The FreeCol Team
- + *
- + * This file is part of FreeCol.
- + *
- + * FreeCol is free software: you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation, either version 2 of the License, or
- + * (at your option) any later version.
- + *
- + * FreeCol is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with FreeCol. If not, see <http://www.gnu.org/licenses/>.
- + */
- +
- +package net.sf.freecol.client.gui.action;
- +
- +import java.awt.event.ActionEvent;
- +import net.sf.freecol.client.ClientOptions;
- +
- +import net.sf.freecol.client.FreeColClient;
- +
- +
- +/**
- + * Change view in on the minimap.
- + */
- +public class MiniMapToggleViewAction extends MapboardAction {
- +
- + public static final String id = "miniMapToggleBordersAction";
- +
- +
- + /**
- + * Creates a new <code>MiniMapToggleViewAction</code>.
- + *
- + * @param freeColClient The <code>FreeColClient</code> for the game.
- + */
- + public MiniMapToggleViewAction(FreeColClient freeColClient) {
- + super(freeColClient, id);
- +
- + addImageIcons("toggle_view_politics");
- + }
- +
- + /**
- + * Creates a new <code>MiniMapToggleViewAction</code>.
- + *
- + * @param freeColClient The <code>FreeColClient</code> for the game.
- + * @param b a <code>boolean</code> value
- + */
- + public MiniMapToggleViewAction(FreeColClient freeColClient, boolean b) {
- + super(freeColClient, id + ".secondary");
- +
- + addImageIcons("toggle_view_politics");
- + }
- +
- + // Interface ActionListener
- +
- + /**
- + * {@inheritDoc}
- + */
- + public void actionPerformed(ActionEvent e) {
- + getGUI().miniMapToggleViewControls();
- +
- + if (freeColClient.getClientOptions().getBoolean(ClientOptions.MINIMAP_TOGGLE_BORDERS)) {
- + addImageIcons("toggle_view_politics");
- + } else {
- + addImageIcons("toggle_view_economic");
- + }
- + }
- +}
- diff --git a/src/net/sf/freecol/client/gui/panel/CornerMapControls.java b/src/net/sf/freecol/client/gui/panel/CornerMapControls.java
- index 2227eb0..c08ddd6 100644
- --- a/src/net/sf/freecol/client/gui/panel/CornerMapControls.java
- +++ b/src/net/sf/freecol/client/gui/panel/CornerMapControls.java
- @@ -113,6 +113,8 @@ public final class CornerMapControls extends MapControls {
- miniMapPanel.setLayout(null);
- miniMap.setSize(MAP_WIDTH, MAP_HEIGHT);
- // Add buttons:
- + miniMapPanel.add(miniMapToggleBorders);
- + miniMapPanel.add(miniMapToggleFogOfWarButton);
- miniMapPanel.add(miniMapZoomInButton);
- miniMapPanel.add(miniMapZoomOutButton);
- miniMapPanel.add(miniMap);
- @@ -125,6 +127,8 @@ public final class CornerMapControls extends MapControls {
- // TODO-LATER: The values below should be specified by a
- // skin-configuration-file.
- miniMap.setLocation(38, 75);
- + miniMapToggleBorders.setLocation(4,114);
- + miniMapToggleFogOfWarButton.setLocation(4, 144);
- miniMapZoomInButton.setLocation(4, 174);
- miniMapZoomOutButton.setLocation(264, 174);
- } else {
- diff --git a/src/net/sf/freecol/client/gui/panel/MapControls.java b/src/net/sf/freecol/client/gui/panel/MapControls.java
- index c8b8e4e..7aa5121 100644
- --- a/src/net/sf/freecol/client/gui/panel/MapControls.java
- +++ b/src/net/sf/freecol/client/gui/panel/MapControls.java
- @@ -23,6 +23,8 @@ import java.util.ArrayList;
- import java.util.List;
- import javax.swing.JLayeredPane;
- +import net.sf.freecol.client.ClientOptions;
- +import static net.sf.freecol.client.ClientOptions.MINIMAP_TOGGLE_FOG_OF_WAR;
- import net.sf.freecol.client.FreeColClient;
- import net.sf.freecol.client.gui.Canvas;
- @@ -32,6 +34,8 @@ import net.sf.freecol.client.gui.action.BuildColonyAction;
- import net.sf.freecol.client.gui.action.DisbandUnitAction;
- import net.sf.freecol.client.gui.action.FortifyAction;
- import net.sf.freecol.client.gui.action.FreeColAction;
- +import net.sf.freecol.client.gui.action.MiniMapToggleViewAction;
- +import net.sf.freecol.client.gui.action.MiniMapToggleFogOfWarAction;
- import net.sf.freecol.client.gui.action.MiniMapZoomInAction;
- import net.sf.freecol.client.gui.action.MiniMapZoomOutAction;
- import net.sf.freecol.client.gui.action.SentryAction;
- @@ -64,6 +68,8 @@ public abstract class MapControls {
- protected final FreeColClient freeColClient;
- protected final InfoPanel infoPanel;
- protected MiniMap miniMap;
- + protected final UnitButton miniMapToggleBorders;
- + protected final UnitButton miniMapToggleFogOfWarButton;
- protected final UnitButton miniMapZoomOutButton;
- protected final UnitButton miniMapZoomInButton;
- protected final List<UnitButton> unitButtons;
- @@ -103,10 +109,13 @@ public abstract class MapControls {
- unitButtons.add(new UnitButton(am, BuildColonyAction.id));
- unitButtons.add(new UnitButton(am, DisbandUnitAction.id));
- }
- -
- + miniMapToggleBorders = new UnitButton(am, MiniMapToggleViewAction.id);
- + miniMapToggleFogOfWarButton = new UnitButton(am, MiniMapToggleFogOfWarAction.id);
- miniMapZoomOutButton = new UnitButton(am, MiniMapZoomOutAction.id);
- miniMapZoomInButton = new UnitButton(am, MiniMapZoomInAction.id);
- + miniMapToggleBorders.setFocusable(false);
- + miniMapToggleFogOfWarButton.setFocusable(false);
- miniMapZoomOutButton.setFocusable(false);
- miniMapZoomInButton.setFocusable(false);
- @@ -187,5 +196,23 @@ public abstract class MapControls {
- miniMap.zoomOut();
- repaint();
- }
- +
- + public void toggleView() {
- + if (freeColClient.getClientOptions().getBoolean(ClientOptions.MINIMAP_TOGGLE_BORDERS)) {
- + miniMap.setToogleBordersOption(false);
- + } else {
- + miniMap.setToogleBordersOption(true);
- + }
- + repaint();
- + }
- +
- + public void toogleFogOfWar() {
- + if (freeColClient.getClientOptions().getBoolean(ClientOptions.MINIMAP_TOGGLE_FOG_OF_WAR)) {
- + miniMap.setToogleFogOfWarOption(false);
- + } else {
- + miniMap.setToogleFogOfWarOption(true);
- + }
- + repaint();
- + }
- }
- diff --git a/src/net/sf/freecol/client/gui/panel/MiniMap.java b/src/net/sf/freecol/client/gui/panel/MiniMap.java
- index d7232e8..6b5daa9 100644
- --- a/src/net/sf/freecol/client/gui/panel/MiniMap.java
- +++ b/src/net/sf/freecol/client/gui/panel/MiniMap.java
- @@ -34,10 +34,18 @@ import javax.swing.JPanel;
- import javax.swing.event.MouseInputListener;
- import net.sf.freecol.client.ClientOptions;
- +import static net.sf.freecol.client.ClientOptions.MINIMAP_TOGGLE_BORDERS;
- +import static net.sf.freecol.client.ClientOptions.MINIMAP_TOGGLE_FOG_OF_WAR;
- import net.sf.freecol.client.FreeColClient;
- import net.sf.freecol.client.gui.GUI;
- import net.sf.freecol.client.gui.ImageLibrary;
- +import net.sf.freecol.client.gui.MapViewer;
- import net.sf.freecol.common.model.Map;
- +import static net.sf.freecol.common.model.Map.Direction.N;
- +import static net.sf.freecol.common.model.Map.Direction.E;
- +import static net.sf.freecol.common.model.Map.Direction.S;
- +import static net.sf.freecol.common.model.Map.Direction.W;
- +import net.sf.freecol.common.model.Player;
- import net.sf.freecol.common.model.Tile;
- import net.sf.freecol.common.model.TileType;
- import net.sf.freecol.common.model.Unit;
- @@ -158,7 +166,14 @@ public final class MiniMap extends JPanel implements MouseInputListener {
- freeColClient.getClientOptions().setInteger(ClientOptions.DEFAULT_MINIMAP_ZOOM, zoom);
- }
- -
- + public void setToogleBordersOption(boolean toggle) {
- + freeColClient.getClientOptions().setBoolean(MINIMAP_TOGGLE_BORDERS, toggle);
- + }
- +
- + public void setToogleFogOfWarOption(boolean toggle) {
- + freeColClient.getClientOptions().setBoolean(MINIMAP_TOGGLE_FOG_OF_WAR, toggle);
- + }
- +
- /**
- * Paints this component.
- * @param graphics The <code>Graphics</code> context in which
- @@ -175,11 +190,15 @@ public final class MiniMap extends JPanel implements MouseInputListener {
- paintMap(graphics);
- }
- - private Color getMinimapColor(TileType type) {
- - return ResourceManager.getColor(type.getId() + ".color");
- + private Color getMinimapEconomicColor(TileType type) {
- + return ResourceManager.getColor(type.getId() + ".economicColor");
- }
- -
- + private Color getMinimapPoliticsColor(TileType type) {
- + return ResourceManager.getColor(type.getId() + ".politicsColor");
- + }
- +
- +
- /**
- * Paints a representation of the mapboard onto this component.
- * @param graphics The <code>Graphics</code> context in which
- @@ -265,12 +284,18 @@ public final class MiniMap extends JPanel implements MouseInputListener {
- tilePath.lineTo(halfWidth, tileHeight);
- tilePath.lineTo(0, halfHeight);
- tilePath.closePath();
- +
- GeneralPath settlementPath = new GeneralPath(tilePath);
- settlementPath.transform(AffineTransform.getScaleInstance(0.7, 0.7));
- settlementPath.transform(AffineTransform.getTranslateInstance(0.15 * tileWidth, 0.15 * tileHeight));
- +
- GeneralPath unitPath = new GeneralPath(tilePath);
- unitPath.transform(AffineTransform.getScaleInstance(0.5, 0.5));
- unitPath.transform(AffineTransform.getTranslateInstance(0.25 * tileWidth, 0.25 * tileHeight));
- +
- + GeneralPath paintFull = new GeneralPath(tilePath);
- + paintFull.transform(AffineTransform.getScaleInstance(1, 1));;
- +
- g.setStroke(new BasicStroke(1f));
- AffineTransform baseTransform = g.getTransform();
- @@ -291,8 +316,21 @@ public final class MiniMap extends JPanel implements MouseInputListener {
- for (int column = firstColumn; column <= lastColumn; column++) {
- Tile tile = map.getTile(column, row);
- if (tile.isExplored()) {
- - g.setColor(getMinimapColor(tile.getType()));
- - g.fill(tilePath);
- + if (freeColClient.getClientOptions().getBoolean(ClientOptions.MINIMAP_TOGGLE_BORDERS)) {
- + g.setColor(getMinimapPoliticsColor(tile.getType()));
- + g.fill(tilePath);
- +
- + if (tile.getOwner() != null) {
- + Color nationOwner = tile.getOwner().getNationColor();
- + Color colorTransparent =
- + new Color(nationOwner.getRed(), nationOwner.getGreen(), nationOwner.getBlue(), 100);
- + g.setColor(colorTransparent);
- + g.fill(paintFull);
- + }
- + } else {
- + g.setColor(getMinimapEconomicColor(tile.getType()));
- + g.fill(tilePath);
- + }
- if (!tile.hasSettlement()) {
- Unit unit = tile.getFirstUnit();
- if (unit != null) {
- @@ -307,7 +345,14 @@ public final class MiniMap extends JPanel implements MouseInputListener {
- g.setColor(tile.getSettlement().getOwner().getNationColor());
- g.fill(settlementPath);
- }
- - }
- + if (!freeColClient.getMyPlayer().canSee(tile)
- + && freeColClient.getClientOptions().getBoolean(ClientOptions.MINIMAP_TOGGLE_FOG_OF_WAR)) {
- + Color blackTransparent = new Color(0, 0, 0, 100);
- + g.setColor(blackTransparent);
- + g.fill(paintFull);
- + }
- +
- + }
- g.translate(tileWidth, 0);
- }
- g.setTransform(rowTransform);
Add Comment
Please, Sign In to add comment