diff options
author | GWYOG <jjn1jjn2@163.com> | 2016-11-07 20:25:26 +0800 |
---|---|---|
committer | GWYOG <jjn1jjn2@163.com> | 2016-11-07 20:25:26 +0800 |
commit | efb446e212ccb7ff67e392eb46605117564aa235 (patch) | |
tree | 4a4623547f447d0339328535944d915620394a8b /src/main/java/pers/gwyog | |
parent | 10f86d028093566285f9500da84961c86c8552a1 (diff) | |
download | GT5-Unofficial-efb446e212ccb7ff67e392eb46605117564aa235.tar.gz GT5-Unofficial-efb446e212ccb7ff67e392eb46605117564aa235.tar.bz2 GT5-Unofficial-efb446e212ccb7ff67e392eb46605117564aa235.zip |
Add I18n support for GT5's custom vein/asteroid
Diffstat (limited to 'src/main/java/pers/gwyog')
-rw-r--r-- | src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginAsteroidStat.java | 9 | ||||
-rw-r--r-- | src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginVeinStat.java | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginAsteroidStat.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginAsteroidStat.java index acc00c01ef..9cdc5e7108 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginAsteroidStat.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginAsteroidStat.java @@ -56,7 +56,7 @@ public class PluginAsteroidStat extends PluginBase { public void drawExtras(int recipe) { CachedAsteroidStatRecipe crecipe = (CachedAsteroidStatRecipe) this.arecipes.get(recipe); OreLayerWrapper oreLayer = GTOreLayerHelper.mapOreLayerWrapper.get(crecipe.veinName); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + I18n.format("gtnop." + oreLayer.veinName) + I18n.format("gtnop.ore.asteroid.name"), 2, 18, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedAsteroidName(oreLayer.veinName), 2, 18, 0x404040, false); GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidPrimary") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.primaryMeta)), 2, 31, 0x404040, false); GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidSecondary") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.secondaryMeta)), 2, 44, 0x404040, false); GuiDraw.drawString(I18n.format("gtnop.gui.nei.asteroidBetween") + ": " + GT_LanguageManager.getTranslation(getGTOreUnlocalizedName(oreLayer.betweenMeta)), 2, 57, 0x404040, false); @@ -80,6 +80,13 @@ public class PluginAsteroidStat extends PluginBase { return worldNameTranslatedAsteroid; } + public String getLocalizedAsteroidName(String unlocalizedName) { + if (unlocalizedName.startsWith("ore.mix.custom.")) + return I18n.format("gtnop.ore.custom.name") + I18n.format("gtnop.ore.asteroid.name") + unlocalizedName.substring(15); + else + return I18n.format("gtnop." + unlocalizedName) + I18n.format("gtnop.ore.asteroid.name"); + } + @Override public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equals(getOutputId())) { diff --git a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginVeinStat.java b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginVeinStat.java index 8182233c9b..e2b43cf482 100644 --- a/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginVeinStat.java +++ b/src/main/java/pers/gwyog/gtneioreplugin/plugin/PluginVeinStat.java @@ -115,7 +115,7 @@ public class PluginVeinStat extends PluginBase { public void drawExtras(int recipe) { CachedVeinStatRecipe crecipe = (CachedVeinStatRecipe) this.arecipes.get(recipe); OreLayerWrapper oreLayer = GTOreLayerHelper.mapOreLayerWrapper.get(crecipe.veinName); - GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + I18n.format("gtnop." + oreLayer.veinName) + I18n.format("gtnop.ore.vein.name"), 2, 18, 0x404040, false); + GuiDraw.drawString(I18n.format("gtnop.gui.nei.veinName") + ": " + getLocalizedVeinName(oreLayer.veinName), 2, 18, 0x404040, false); GuiDraw.drawString(I18n.format("gtnop.gui.nei.primaryOre") + ": " + getGTOreLocalizedName(oreLayer.primaryMeta), 2, 31, 0x404040, false); GuiDraw.drawString(I18n.format("gtnop.gui.nei.secondaryOre") + ": " + getGTOreLocalizedName(oreLayer.secondaryMeta), 2, 44, 0x404040, false); GuiDraw.drawString(I18n.format("gtnop.gui.nei.betweenOre") + ": " + getGTOreLocalizedName(oreLayer.betweenMeta), 2, 57, 0x404040, false); @@ -127,6 +127,13 @@ public class PluginVeinStat extends PluginBase { GuiDraw.drawStringR(EnumChatFormatting.BOLD + I18n.format("gtnop.gui.nei.seeAll"), getGuiWidth()-3, 5, 0x404040, false); } + public String getLocalizedVeinName(String unlocalizedName) { + if (unlocalizedName.startsWith("ore.mix.custom.")) + return I18n.format("gtnop.ore.custom.name") + I18n.format("gtnop.ore.vein.name") + unlocalizedName.substring(15); + else + return I18n.format("gtnop." + unlocalizedName) + I18n.format("gtnop.ore.vein.name"); + } + @Override public String getOutputId() { return "GTOrePluginVein"; |