diff --git a/resources/assets/tinker/lang/en_US.lang b/resources/assets/tinker/lang/en_US.lang index c514c616..19761a2b 100644 --- a/resources/assets/tinker/lang/en_US.lang +++ b/resources/assets/tinker/lang/en_US.lang @@ -855,3 +855,8 @@ tool.arrow=Arrow tool.kingslimeprefix=King Slime # Specific localization like materials #tool.shovel.kingslime=Regret + + +gui.toolstation.repair.title=Repair and Modification +gui.toolstation.repair.desc=The main way to repair or change your tools. Place a tool and a material on the left to get started. +gui.toolstation.pickaxe.desc=The Pickaxe is a precise mining tool. It is effective on stone and ores.\n\nRequired parts:\n- Pickaxe Head\n- Tool Binding\n- Handle \ No newline at end of file diff --git a/src/main/java/tconstruct/tools/ToolProxyClient.java b/src/main/java/tconstruct/tools/ToolProxyClient.java index c51cdff7..06cab492 100644 --- a/src/main/java/tconstruct/tools/ToolProxyClient.java +++ b/src/main/java/tconstruct/tools/ToolProxyClient.java @@ -8,6 +8,7 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.*; import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.event.sound.SoundLoadEvent; @@ -396,12 +397,7 @@ public class ToolProxyClient extends ToolProxyCommon new int[] { 7, 0, 13, 13 }, new int[] { 3, 3, 13, 13 } // Chisel }; - static String[] toolNames = { "Repair and Modification", "Pickaxe", "Shovel", "Hatchet", - // "Lumber Axe", - // "Ice Axe", - "Mattock", "Broadsword", "Longsword", "Rapier", "Dagger", "Frying Pan", "Battlesign", "Chisel" }; - - static String[] toolDescriptions = { "The main way to repair or change your tools. Place a tool and a material on the left to get started.", "The Pickaxe is a precise mining tool. It is effective on stone and ores.\n\nRequired parts:\n- Pickaxe Head\n- Tool Binding\n- Handle", "The Shovel is a precise digging tool. It is effective on dirt, sand, and snow.\n\nRequired parts:\n- Shovel Head\n- Handle", "The Hatchet is a basic chopping tool. It is effective on wood and leaves.\n\nRequired parts:\n- Axe Head\n- Handle", + static String[] toolDescriptions = { "gui.toolstation.repair.desc", "gui.toolstation.pickaxe.desc", "The Shovel is a precise digging tool. It is effective on dirt, sand, and snow.\n\nRequired parts:\n- Shovel Head\n- Handle", "The Hatchet is a basic chopping tool. It is effective on wood and leaves.\n\nRequired parts:\n- Axe Head\n- Handle", // "The Lumber Axe is a broad chopping tool. It harvests wood in a wide range and can fell entire trees.\n\nRequired parts:\n- Broad Axe Head\n- Handle", // "The Ice Axe is a tool for harvesting ice, mining, and attacking foes.\n\nSpecial Ability:\n- Wall Climb\nNatural Ability:\n- Ice Harvest\nDamage: Moderate\n\nRequired parts:\n- Pickaxe Head\n- Spike\n- Handle", "The Cutter Mattock is a versatile farming tool. It is effective on wood, dirt, and plants.\n\nSpecial Ability: Hoe\n\nRequired parts:\n- Axe Head\n- Shovel Head\n- Handle", "The Broadsword is a defensive weapon. Blocking cuts damage in half.\n\nSpecial Ability: Block\nDamage: Moderate\nDurability: High\n\nRequired parts:\n- Sword Blade\n- Wide Guard\n- Handle", "The Longsword is an offensive weapon. It is often used for charging into battle at full speed.\n\nNatural Ability:\n- Charge Boost\nSpecial Ability: Lunge\n\nDamage: Moderate\nDurability: Moderate", "The Rapier is a special weapon that relies on quick strikes to defeat foes.\n\nNatural Abilities:\n- Armor Pierce\n- Quick Strike\n- Charge Boost\nSpecial Ability:\n- Backpedal\n\nDamage: Low\nDurability: Low", "The Dagger is a short blade that can be thrown.\n\nSpecial Ability:\n- Throw Item\n\nDamage: Low\nDurability: Moderate\n\nRequired parts:\n- Knife Blade\n- Crossbar\n- Handle", "The Frying is a heavy weapon that uses sheer weight to stun foes.\n\nSpecial Ability: Block\nNatural Ability: Heavy\nShift+rClick: Place Frying Pan\nDamage: Low\nDurability: High\n\nRequired parts:\n- Pan\n- Handle", @@ -410,6 +406,12 @@ public class ToolProxyClient extends ToolProxyCommon void addToolButtons () { + // has to be in here so TinkerTools.tool is already initialized + final String[] toolNames = {StatCollector.translateToLocal("gui.toolstation.repair.title"), TinkerTools.pickaxe.getLocalizedToolName(), "Shovel", "Hatchet", + // "Lumber Axe", + // "Ice Axe", + "Mattock", "Broadsword", "Longsword", "Rapier", "Dagger", "Frying Pan", "Battlesign", "Chisel" }; + for (int i = 0; i < toolNames.length; i++) { addToolButton(itemIcons[i][0], itemIcons[i][1], itemIcons[i][2], iconCoords[i * 2], iconCoords[i * 2 + 1], toolNames[i], toolDescriptions[i]); diff --git a/src/main/java/tconstruct/tools/gui/ToolStationGui.java b/src/main/java/tconstruct/tools/gui/ToolStationGui.java index f7770bd2..72726167 100644 --- a/src/main/java/tconstruct/tools/gui/ToolStationGui.java +++ b/src/main/java/tconstruct/tools/gui/ToolStationGui.java @@ -120,7 +120,15 @@ public class ToolStationGui extends GuiContainer implements INEIGuiHandler iconX = element.iconsX; iconY = element.iconsY; title = "\u00A7n" + element.title; - body = element.body; + body = StatCollector.translateToLocal(element.body); + if(body != null) { + int i; + // for some really weird reason replaceAll doesn't find "\\n", but indexOf does. We have to replace manually. + while((i = body.indexOf("\\n")) >= 0) + { + body = body.substring(0, i) + '\n' + body.substring(i+2); + } + } } void setSlotType (int type)