mirror of https://github.com/FreeCol/freecol.git
Merge pull request #2 from FreeCol/ticket/ir222
Create preference option to show region naming dialog
This commit is contained in:
commit
bb2700d530
|
@ -210,6 +210,9 @@
|
|||
<!-- Show the warnings about poor choice of tile worker. -->
|
||||
<booleanOption id="model.option.guiShowNotBestTile"
|
||||
defaultValue="true"/>
|
||||
<!-- Show the Region Naming dialog -->
|
||||
<booleanOption id="model.option.guiShowRegionNaming"
|
||||
defaultValue="true"/>
|
||||
<!-- Type of colony report. -->
|
||||
<selectOption id="model.option.colonyReport"
|
||||
defaultValue="0" localizedLabels="true">
|
||||
|
|
|
@ -1131,6 +1131,8 @@ model.option.guiShowPreCombat.name=Pre-combat analysis
|
|||
model.option.guiShowPreCombat.shortDescription=Determines whether to show the pre-combat analysis.
|
||||
model.option.guiShowNotBestTile.name=Not best tile
|
||||
model.option.guiShowNotBestTile.shortDescription=Determines whether to warn about units not working on the best available tile.
|
||||
model.option.guiShowRegionNaming.name=Region naming
|
||||
model.option.guiShowRegionNaming.shortDescription=Display the Region Naming Dialog while exploring.
|
||||
model.option.colonyReport.name=Colony Report
|
||||
model.option.colonyReport.shortDescription=A summary of activity in each colony.
|
||||
clientOptions.messages.colonyReport.classic.name=Classic
|
||||
|
|
|
@ -290,6 +290,9 @@ public class ClientOptions extends OptionGroup {
|
|||
public static final String SHOW_NOT_BEST_TILE
|
||||
= "model.option.guiShowNotBestTile";
|
||||
|
||||
public static final String SHOW_REGION_NAMING
|
||||
= "model.option.guiShowRegionNaming";
|
||||
|
||||
/** Option for selecting the compact colony report. */
|
||||
public static final String COLONY_REPORT
|
||||
= "model.option.colonyReport";
|
||||
|
@ -733,6 +736,11 @@ public class ClientOptions extends OptionGroup {
|
|||
+ " option", e);
|
||||
}
|
||||
// end @compat 0.11.3
|
||||
|
||||
// @compat 0.11.6
|
||||
addBooleanOption(SHOW_REGION_NAMING,
|
||||
"clientOptions.messages", true);
|
||||
// end @compat 0.11.6
|
||||
}
|
||||
|
||||
private void addBooleanOption(String id, String gr, boolean val) {
|
||||
|
|
|
@ -4201,12 +4201,17 @@ public final class InGameController extends FreeColClientHolder {
|
|||
}
|
||||
newRegionName(region, tile, unit, name);
|
||||
} else {
|
||||
if (getClientOptions().getBoolean(ClientOptions.SHOW_REGION_NAMING)) {
|
||||
getGUI().showNamingDialog(StringTemplate
|
||||
.template("nameRegion.text")
|
||||
.addStringTemplate("%type%", region.getLabel()),
|
||||
name, unit,
|
||||
(String n) -> newRegionName(region, tile, unit,
|
||||
(n == null || n.isEmpty()) ? name : n));
|
||||
} else {
|
||||
newRegionName(region, tile, unit, name);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue