Use getColonyTileLocationLabel in RRP.

This commit is contained in:
Michael Pope 2015-07-31 14:53:39 +09:30
parent f483359f49
commit f96926ad03
2 changed files with 10 additions and 14 deletions

View File

@ -3160,16 +3160,14 @@ report.production.update=Update
# ReportRequirementsPanel
report.requirements.badAssignment=%colony% has a %expert% currently working as %expertWork%, while a %nonExpert% is working as %nonExpertWork%. Production would be greater if the colonists swapped jobs.
report.requirements.canTrainExperts={{plural:2|%unit%}} can be trained at
report.requirements.exploreTile=%type% to the %direction% of %colony% would benefit from exploration.
report.requirements.exploreTile=%location% would benefit from exploration.
report.requirements.met=All requirements are met.
report.requirements.missingGoods=%colony% is producing %goods%, but requires more %input%.
report.requirements.misusedExperts=There are {{plural:2|%unit%}} not working as %work% present at
report.requirements.noExpert=%colony% is producing %goods%, but has no %unit%.
report.requirements.tile.clearForest=%type% to the %direction% of %colony% would benefit from clearing.
report.requirements.tile.clearForest.center=%colony% would benefit from clearing its tile.
report.requirements.tile.plow=%type% to the %direction% of %colony% would benefit from plowing.
report.requirements.tile.plow.center=%colony% would benefit from plowing its tile.
report.requirements.tile.road=%type% to the %direction% of %colony% would benefit from road building.
report.requirements.tile.clearForest=%location% would benefit from clearing.
report.requirements.tile.plow=%location% would benefit from plowing.
report.requirements.tile.road=%location% would benefit from road building.
#report.requirements.tile.road.center can not happen
report.requirements.severalExperts=Several {{plural:2|%unit%}} are present at
report.requirements.surplus=A surplus of %goods% is being produced at

View File

@ -196,7 +196,6 @@ public final class ReportRequirementsPanel extends ReportPanel {
} else {
String key = "report.requirements.tile."
+ tis.tileImprovementType.getSuffix();
if (tis.tile == colony.getTile()) key += ".center";
if (Messages.containsKey(key)) {
addTileWarning(doc, colony, key, tis.tile);
}
@ -220,12 +219,9 @@ public final class ReportRequirementsPanel extends ReportPanel {
private void addTileWarning(StyledDocument doc, Colony colony,
String messageId, Tile tile) {
if (messageId == null || !Messages.containsKey(messageId)) return;
// TODO-post-0.11.4-release: migrate to using Tile.getColonyTileLocationLabel()
Direction direction = colony.getTile().getDirection(tile);
StringTemplate t = StringTemplate.template(messageId)
.addNamed("%type%", tile.getType())
.addName("%colony%", colony.getName());
if (direction != null) t.addNamed("%direction%", direction);
.addStringTemplate("%location%",
tile.getColonyTileLocationLabel(colony));
try {
doc.insertString(doc.getLength(), "\n\n" + Messages.message(t),
doc.getStyle("regular"));
@ -234,7 +230,8 @@ public final class ReportRequirementsPanel extends ReportPanel {
}
}
private void addBadAssignmentWarning(StyledDocument doc, Colony colony, Unit expert, Unit nonExpert) {
private void addBadAssignmentWarning(StyledDocument doc, Colony colony,
Unit expert, Unit nonExpert) {
GoodsType expertGoods = expert.getWorkType();
GoodsType nonExpertGoods = nonExpert.getWorkType();
String colonyName = colony.getName();
@ -257,7 +254,8 @@ public final class ReportRequirementsPanel extends ReportPanel {
}
}
private void addExpertWarning(StyledDocument doc, Colony c, GoodsType goodsType, UnitType workType) {
private void addExpertWarning(StyledDocument doc, Colony c,
GoodsType goodsType, UnitType workType) {
String newMessage = Messages.message(StringTemplate
.template("report.requirements.noExpert")
.addName("%colony%", c.getName())