mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 13:09:53 +00:00
books will be fully translatable once someone does the .lang files
This commit is contained in:
1 parent
5f962eabf0
commit
c029bd8eef
6 files changed
+94
-129
No files matched your search
@@ -5,6 +5,7 @@ import mantle.lib.client.MantleClientRegistry;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
@@ -31,11 +32,14 @@ public class BlockCastPage extends BookPage
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localWidth, int localHeight)
|
||||
public void renderContentLayer (int localWidth, int localHeight, boolean isTranslatable)
|
||||
{
|
||||
if (text != null)
|
||||
{
|
||||
if (isTranslatable)
|
||||
text = StatCollector.translateToLocal(text);
|
||||
manual.fonts.drawString("\u00a7n" + text, localWidth + 70, localHeight + 4, 0);
|
||||
|
||||
}
|
||||
GL11.glScalef(2f, 2f, 2f);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
@@ -52,7 +56,10 @@ public class BlockCastPage extends BookPage
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
manual.fonts.drawString("Ingredients:", localWidth + 120, localHeight + 32, 0);
|
||||
String ingr = new String("Ingredients");
|
||||
if (isTranslatable)
|
||||
ingr = StatCollector.translateToLocal(ingr);
|
||||
manual.fonts.drawString( ingr + ":", localWidth + 120, localHeight + 32, 0);
|
||||
manual.fonts.drawString("- " + icons[1].getDisplayName(), localWidth + 120, localHeight + 42, 0);
|
||||
if (icons[2] != null)
|
||||
manual.fonts.drawString("- " + icons[2].getDisplayName(), localWidth + 120, localHeight + 50, 0);
|
||||
|
||||
@@ -4,6 +4,7 @@ import mantle.client.pages.BookPage;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
@@ -54,14 +55,55 @@ public class MaterialPage extends BookPage
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localWidth, int localHeight)
|
||||
public void renderContentLayer (int localWidth, int localHeight, boolean isTranslatable)
|
||||
{
|
||||
String mat = new String("Material");
|
||||
String shard = new String("Shard");
|
||||
String rod = new String("Rod");
|
||||
String durability = new String("Durability");
|
||||
String handleModifier = new String("Handle Modifier");
|
||||
String fullToolDurability = new String("Full Tool Durability");
|
||||
String miningSpeed = new String("Mining Speed");
|
||||
String miningLevel = new String("Mining Level");
|
||||
String baseAttack = new String("Base Attack");
|
||||
String heart_ = new String("Heart");
|
||||
String hearts = new String("Hearts");
|
||||
String materialTrait = new String("Material Trait");
|
||||
String extraMod = new String("+1 Modifiers");
|
||||
String traitReinforced = new String("Material Trait: Reinforced");
|
||||
String reinforcedLevel = new String("Reinforced level");
|
||||
String stoneboundLevel = new String("Stonebound level");
|
||||
String splinteringLevel = new String("Splintering level");
|
||||
|
||||
if (isTranslatable)
|
||||
{
|
||||
title = StatCollector.translateToLocal(title);
|
||||
iconText = StatCollector.translateToLocal(iconText);
|
||||
mat = StatCollector.translateToLocal(mat);
|
||||
shard = StatCollector.translateToLocal(shard);
|
||||
rod = StatCollector.translateToLocal(rod);
|
||||
durability = StatCollector.translateToLocal(durability);
|
||||
handleModifier = StatCollector.translateToLocal(handleModifier);
|
||||
fullToolDurability = StatCollector.translateToLocal(fullToolDurability);
|
||||
miningSpeed = StatCollector.translateToLocal(miningSpeed);
|
||||
miningLevel = StatCollector.translateToLocal(miningLevel);
|
||||
baseAttack = StatCollector.translateToLocal(baseAttack);
|
||||
heart_ = StatCollector.translateToLocal(heart_);
|
||||
hearts = StatCollector.translateToLocal(hearts);
|
||||
materialTrait = StatCollector.translateToLocal(materialTrait);
|
||||
extraMod = StatCollector.translateToLocal(extraMod);
|
||||
traitReinforced = StatCollector.translateToLocal(traitReinforced);
|
||||
reinforcedLevel = StatCollector.translateToLocal(reinforcedLevel);
|
||||
stoneboundLevel = StatCollector.translateToLocal(stoneboundLevel);
|
||||
splinteringLevel = StatCollector.translateToLocal(splinteringLevel);
|
||||
|
||||
}
|
||||
manual.fonts.drawString("\u00a7n" + title, localWidth + 70, localHeight + 4, 0);
|
||||
manual.fonts.drawSplitString(iconText, localWidth, localHeight + 16, 178, 0);
|
||||
|
||||
manual.fonts.drawString("Material: ", localWidth + 108, localHeight + 40, 0);
|
||||
manual.fonts.drawString("Shard: ", localWidth + 108, localHeight + 72, 0);
|
||||
manual.fonts.drawString("Rod: ", localWidth + 108, localHeight + 104, 0);
|
||||
manual.fonts.drawString(mat + ": ", localWidth + 108, localHeight + 40, 0);
|
||||
manual.fonts.drawString(shard + ": ", localWidth + 108, localHeight + 72, 0);
|
||||
manual.fonts.drawString(rod + ": ", localWidth + 108, localHeight + 104, 0);
|
||||
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
@@ -75,61 +117,67 @@ public class MaterialPage extends BookPage
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
String icon = icons[1].getTooltip(manual.getMC().thePlayer, false).get((0)).toString();
|
||||
if (isTranslatable)
|
||||
icon = StatCollector.translateToLocal(icon);
|
||||
int iconOffset = icon.length() > 12 ? 0 : 3;
|
||||
manual.fonts.drawSplitString(icon, localWidth + 128, localHeight + 50 + iconOffset, 52, 0);
|
||||
|
||||
if (icons[2] != null)
|
||||
{
|
||||
icon = icons[2].getTooltip(manual.getMC().thePlayer, false).get((0)).toString();
|
||||
if (isTranslatable)
|
||||
icon = StatCollector.translateToLocal(icon);
|
||||
iconOffset = icon.length() > 12 ? 0 : 3;
|
||||
manual.fonts.drawSplitString(icons[2].getTooltip(manual.getMC().thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 82 + iconOffset, 52, 0);
|
||||
}
|
||||
if (icons[3] != null)
|
||||
{
|
||||
icon = icons[3].getTooltip(manual.getMC().thePlayer, false).get((0)).toString();
|
||||
if (isTranslatable)
|
||||
icon = StatCollector.translateToLocal(icon);
|
||||
iconOffset = icon.length() > 12 ? 0 : 3;
|
||||
manual.fonts.drawSplitString(icons[3].getTooltip(manual.getMC().thePlayer, false).get((0)).toString(), localWidth + 128, localHeight + 114 + iconOffset, 52, 0);
|
||||
}
|
||||
|
||||
manual.fonts.drawString("Durability: " + material.durability(), localWidth, localHeight + 40, 0);
|
||||
manual.fonts.drawString("Handle Modifier: " + material.handleDurability() + "x", localWidth, localHeight + 50, 0);
|
||||
manual.fonts.drawString("Full Tool Durability: " + (int) (material.durability() * material.handleDurability()), localWidth, localHeight + 60, 0);
|
||||
manual.fonts.drawString(durability + ": " + material.durability(), localWidth, localHeight + 40, 0);
|
||||
manual.fonts.drawString(handleModifier + ": " + material.handleDurability() + "x", localWidth, localHeight + 50, 0);
|
||||
manual.fonts.drawString(fullToolDurability+ ": " + (int) (material.durability() * material.handleDurability()), localWidth, localHeight + 60, 0);
|
||||
|
||||
manual.fonts.drawString("Mining Speed: " + material.toolSpeed() / 100f, localWidth, localHeight + 80, 0);
|
||||
manual.fonts.drawString("Mining Level: " + material.harvestLevel() + " (" + PartCrafterGui.getHarvestLevelName(material.harvestLevel()) + ")", localWidth, localHeight + 90, 0);
|
||||
manual.fonts.drawString(miningSpeed + ": " + material.toolSpeed() / 100f, localWidth, localHeight + 80, 0);
|
||||
manual.fonts.drawString(miningLevel + ": " + material.harvestLevel() + " (" + PartCrafterGui.getHarvestLevelName(material.harvestLevel()) + ")", localWidth, localHeight + 90, 0);
|
||||
int attack = material.attack();
|
||||
String heart = attack == 2 ? " Heart" : " Hearts";
|
||||
String heart = attack == 2 ? " " + heart_ : " " + hearts;
|
||||
if (attack % 2 == 0)
|
||||
manual.fonts.drawString("Base Attack: " + material.attack() / 2 + heart, localWidth, localHeight + 100, 0);
|
||||
manual.fonts.drawString(baseAttack + ": " + material.attack() / 2 + heart, localWidth, localHeight + 100, 0);
|
||||
else
|
||||
manual.fonts.drawString("Base Attack: " + material.attack() / 2f + heart, localWidth, localHeight + 100, 0);
|
||||
manual.fonts.drawString(baseAttack + ": " + material.attack() / 2f + heart, localWidth, localHeight + 100, 0);
|
||||
|
||||
int offset = 0;
|
||||
String ability = material.ability();
|
||||
if (!ability.equals(""))
|
||||
{
|
||||
manual.fonts.drawString("Material Trait: " + material.ability(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
manual.fonts.drawString(materialTrait + ": " + material.ability(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
offset++;
|
||||
if (ability.equals("Writable"))
|
||||
manual.fonts.drawString("+1 Modifiers", localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
manual.fonts.drawString(extraMod, localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
}
|
||||
|
||||
if (material.reinforced() > 0)
|
||||
{
|
||||
manual.fonts.drawString("Material Trait: Reinforced", localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
manual.fonts.drawString(traitReinforced, localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
offset++;
|
||||
manual.fonts.drawString("Reinforced level: " + material.reinforced(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
manual.fonts.drawString(reinforcedLevel + ": " + material.reinforced(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
offset++;
|
||||
}
|
||||
|
||||
if (material.shoddy() > 0)
|
||||
{
|
||||
manual.fonts.drawString("Stonebound level: " + material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
manual.fonts.drawString(stoneboundLevel + ": " + material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
offset++;
|
||||
}
|
||||
else if (material.shoddy() < 0)
|
||||
{
|
||||
manual.fonts.drawString("Splintering level: " + -material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
manual.fonts.drawString(splinteringLevel + ": " + -material.shoddy(), localWidth, localHeight + 120 + 10 * offset, 0);
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import mantle.lib.client.MantleClientRegistry;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
@@ -31,9 +32,12 @@ public class ModifierPage extends BookPage
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localWidth, int localHeight)
|
||||
public void renderContentLayer (int localWidth, int localHeight, boolean isTranslatable)
|
||||
{
|
||||
manual.fonts.drawString("\u00a7nTool Station", localWidth + 60, localHeight + 4, 0);
|
||||
String tStation = new String("Tool Station");
|
||||
if (isTranslatable)
|
||||
tStation = StatCollector.translateToLocal(tStation);
|
||||
manual.fonts.drawString("\u00a7n" + tStation, localWidth + 60, localHeight + 4, 0);
|
||||
GL11.glScalef(2f, 2f, 2f);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
|
||||
@@ -4,6 +4,7 @@ import mantle.client.pages.BookPage;
|
||||
import mantle.lib.client.MantleClientRegistry;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
@@ -49,14 +50,23 @@ public class ToolPage extends BookPage
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localWidth, int localHeight)
|
||||
public void renderContentLayer (int localWidth, int localHeight, boolean isTranslatable)
|
||||
{
|
||||
String cParts = new String("Crafting Parts");
|
||||
if (isTranslatable)
|
||||
{
|
||||
title = StatCollector.translateToLocal(title);
|
||||
iconText[0] = StatCollector.translateToLocal(iconText[0]);
|
||||
iconText[1] = StatCollector.translateToLocal(iconText[1]);
|
||||
cParts = StatCollector.translateToLocal(cParts);
|
||||
}
|
||||
|
||||
manual.fonts.drawString("\u00a7n" + title, localWidth + 70, localHeight + 4, 0);
|
||||
manual.fonts.drawSplitString(iconText[0], localWidth, localHeight + 16, 178, 0);
|
||||
int size = iconText[0].length() / 48;
|
||||
manual.fonts.drawSplitString(iconText[1], localWidth, localHeight + 28 + 10 * size, 118, 0);
|
||||
|
||||
manual.fonts.drawString("Crafting Parts: ", localWidth + 124, localHeight + 28 + 10 * size, 0);
|
||||
manual.fonts.drawString(cParts + ": ", localWidth + 124, localHeight + 28 + 10 * size, 0);
|
||||
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
|
||||
Reference in new issue
Block a user