mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 04:32:26 +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();
|
||||
|
||||
@@ -5,16 +5,12 @@ import java.util.List;
|
||||
|
||||
import mantle.crash.CallableSuppConfig;
|
||||
import mantle.crash.CallableUnsuppConfig;
|
||||
import net.minecraft.client.gui.GuiMainMenu;
|
||||
import net.minecraftforge.client.event.GuiOpenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import tconstruct.TConstruct;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.ICrashCallable;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class EnvironmentChecks
|
||||
{
|
||||
@@ -73,17 +69,4 @@ public class EnvironmentChecks
|
||||
return "";
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void openMainMenu (GuiOpenEvent event)
|
||||
{
|
||||
if (event.gui instanceof GuiMainMenu)
|
||||
{
|
||||
if (incompatibilities.size() > 0)
|
||||
{
|
||||
event.gui = new EnvironmentGui(event.gui, incompatibilities);
|
||||
}
|
||||
MinecraftForge.EVENT_BUS.unregister(instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
package tconstruct.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.world.storage.ISaveFormat;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class EnvironmentGui extends GuiScreen
|
||||
{
|
||||
private GuiScreen parentGuiScreen;
|
||||
//private GuiTextField theGuiTextField;
|
||||
private final List<String> mods;
|
||||
StringBuilder builder = new StringBuilder();
|
||||
int count = 0;
|
||||
|
||||
public EnvironmentGui(GuiScreen par1GuiScreen, List<String> modlist)
|
||||
{
|
||||
this.parentGuiScreen = par1GuiScreen;
|
||||
this.mods = modlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the buttons (and other controls) to the screen in question.
|
||||
*/
|
||||
public void initGui ()
|
||||
{
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
this.field_146292_n.clear();
|
||||
this.field_146292_n.add(new GuiButton(0, this.field_146294_l / 2 - 175, this.field_146295_m / 4 + 96 + 24, 350, 20, I18n.getStringParams("I accept responsibility for all cross-mod bugs in this modpack.")));
|
||||
this.field_146292_n.add(new GuiButton(1, this.field_146294_l / 2 - 175, this.field_146295_m / 4 + 120 + 24, 350, 20, I18n.getStringParams("I do not want to run these mods together. (Exits Minecraft)")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the screen is unloaded. Used to disable keyboard repeat events
|
||||
*/
|
||||
public void func_146281_b ()
|
||||
{
|
||||
Keyboard.enableRepeatEvents(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
|
||||
*/
|
||||
protected void func_146284_a (GuiButton button)
|
||||
{
|
||||
if (button.field_146124_l)
|
||||
{
|
||||
if (button.field_146127_k == 0)
|
||||
{
|
||||
count++;
|
||||
if (count >= mods.size())
|
||||
this.field_146297_k.func_147108_a(this.parentGuiScreen);
|
||||
}
|
||||
if (button.field_146127_k == 1)
|
||||
{
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the screen and all the components in it.
|
||||
*/
|
||||
public void drawScreen (int par1, int par2, float par3)
|
||||
{
|
||||
builder.setLength(0);
|
||||
this.func_146276_q_();
|
||||
String mod = mods.get(count);
|
||||
this.drawCenteredString(this.field_146289_q, I18n.getStringParams("Tinkers' Construct is not compatible with "+mod), this.field_146294_l / 2, 20, 0xFFFFFF);
|
||||
this.drawCenteredString(this.field_146289_q, I18n.getStringParams("The following reasons are given:"), this.field_146294_l / 2, 32, 0xFFFFFF);
|
||||
field_146289_q.drawSplitString(I18n.getStringParams(EnvironmentChecks.modCompatDetails(mod, false)), 20, 52, 400, 0xffffff);
|
||||
|
||||
this.drawCenteredString(this.field_146289_q, I18n.getStringParams("The Tinkers' Construct team will not accept bug reports with this mod installed."), this.field_146294_l / 2, 153, 0xFFFFFF);
|
||||
this.drawCenteredString(this.field_146289_q, I18n.getStringParams("We apologize for any inconvenience this may cause you."), this.field_146294_l / 2, 165, 0xFFFFFF);
|
||||
super.drawScreen(par1, par2, par3);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user