Skip to content

Commit

Permalink
Step 1: Give @TheVikingWarrior an example of how to translate toolsta…
Browse files Browse the repository at this point in the history
…tion tool descriptions
  • Loading branch information
bonii-xx committed Oct 22, 2014
1 parent f1d0481 commit ffcd7f2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
5 changes: 5 additions & 0 deletions resources/assets/tinker/lang/en_US.lang
Expand Up @@ -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
14 changes: 8 additions & 6 deletions src/main/java/tconstruct/tools/ToolProxyClient.java
Expand Up @@ -8,6 +8,7 @@
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;
Expand Down Expand Up @@ -396,12 +397,7 @@ void addStencilButton (int xButton, int yButton, int index)
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",
Expand All @@ -410,6 +406,12 @@ void addStencilButton (int xButton, int yButton, int index)

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]);
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/tconstruct/tools/gui/ToolStationGui.java
Expand Up @@ -120,7 +120,15 @@ protected void actionPerformed (GuiButton button)
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)
Expand Down

0 comments on commit ffcd7f2

Please sign in to comment.