mirror of
https://git.zelz.net/catfoolyou/Project164.git
synced 2025-12-14 08:47:40 +00:00
Fixed fontrenderer
This commit is contained in:
@@ -13,7 +13,7 @@ class CallableClientProfiler implements Callable
|
||||
|
||||
public String callClientProfilerInfo()
|
||||
{
|
||||
return Minecraft.func_142024_b(this.theMinecraft).getCurrentLanguage().toString();
|
||||
return "en_US";
|
||||
}
|
||||
|
||||
public Object call()
|
||||
|
||||
@@ -3,69 +3,62 @@ package net.minecraft.src;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class ChatAllowedCharacters
|
||||
{
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
|
||||
public class ChatAllowedCharacters {
|
||||
/**
|
||||
* This String have the characters allowed in any text drawing of minecraft.
|
||||
*/
|
||||
public static final String allowedCharacters = getAllowedCharacters();
|
||||
public static String allowedCharacters = null;
|
||||
|
||||
/**
|
||||
* Array of the special characters that are allowed in any text drawing of Minecraft.
|
||||
* Array of the special characters that are allowed in any text drawing of
|
||||
* Minecraft.
|
||||
*/
|
||||
public static final char[] allowedCharactersArray = new char[] {'/', '\n', '\r', '\t', '\u0000', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':'};
|
||||
public static final char[] allowedCharactersArray = new char[] { '/', '\n', '\r', '\t', '\u0000', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':' };
|
||||
|
||||
/**
|
||||
* Load the font.txt resource file, that is on UTF-8 format. This file contains the characters that minecraft can
|
||||
* render Strings on screen.
|
||||
* Load the font.txt resource file, that is on UTF-8 format. This file contains
|
||||
* the characters that minecraft can render Strings on screen.
|
||||
*/
|
||||
static String getAllowedCharacters()
|
||||
{
|
||||
public static void getAllowedCharacters() {
|
||||
String var0 = "";
|
||||
|
||||
try
|
||||
{
|
||||
BufferedReader var1 = new BufferedReader(new InputStreamReader(ChatAllowedCharacters.class.getResourceAsStream("/font.txt"), "UTF-8"));
|
||||
try {
|
||||
BufferedReader var1 = new BufferedReader(new InputStreamReader(EaglerAdapter.loadResource("/font.txt"), "UTF-8"));
|
||||
String var2 = "";
|
||||
|
||||
while ((var2 = var1.readLine()) != null)
|
||||
{
|
||||
if (!var2.startsWith("#"))
|
||||
{
|
||||
while ((var2 = var1.readLine()) != null) {
|
||||
if (!var2.startsWith("#")) {
|
||||
var0 = var0 + var2;
|
||||
}
|
||||
}
|
||||
|
||||
var1.close();
|
||||
}
|
||||
catch (Exception var3)
|
||||
{
|
||||
} catch (Exception var3) {
|
||||
;
|
||||
}
|
||||
|
||||
return var0;
|
||||
allowedCharacters = var0;
|
||||
}
|
||||
|
||||
public static final boolean isAllowedCharacter(char par0)
|
||||
{
|
||||
public static final boolean isAllowedCharacter(char par0) {
|
||||
return par0 != 167 && (allowedCharacters.indexOf(par0) >= 0 || par0 > 32);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter string by only keeping those characters for which isAllowedCharacter() returns true.
|
||||
* Filter string by only keeping those characters for which isAllowedCharacter()
|
||||
* returns true.
|
||||
*/
|
||||
public static String filerAllowedCharacters(String par0Str)
|
||||
{
|
||||
public static String filerAllowedCharacters(String par0Str) {
|
||||
StringBuilder var1 = new StringBuilder();
|
||||
char[] var2 = par0Str.toCharArray();
|
||||
int var3 = var2.length;
|
||||
|
||||
for (int var4 = 0; var4 < var3; ++var4)
|
||||
{
|
||||
for (int var4 = 0; var4 < var3; ++var4) {
|
||||
char var5 = var2[var4];
|
||||
|
||||
if (isAllowedCharacter(var5))
|
||||
{
|
||||
if (isAllowedCharacter(var5)) {
|
||||
var1.append(var5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class FontRenderer {
|
||||
* If true, strings should be rendered with Unicode fonts instead of the
|
||||
* default.png font
|
||||
*/
|
||||
private boolean unicodeFlag;
|
||||
private boolean unicodeFlag = false;
|
||||
|
||||
/**
|
||||
* If true, the Unicode Bidirectional Algorithm should be run before rendering
|
||||
|
||||
@@ -124,7 +124,7 @@ public class GameSettings {
|
||||
public int particleSetting;
|
||||
|
||||
/** Game settings language */
|
||||
public String language;
|
||||
public String language = "en_US";
|
||||
|
||||
public boolean showSkinJacket = true;
|
||||
public boolean showSkinHat = true;
|
||||
|
||||
@@ -40,8 +40,8 @@ public class GuiAchievement extends Gui
|
||||
*/
|
||||
public void queueTakenAchievement(Achievement par1Achievement)
|
||||
{
|
||||
this.achievementGetLocalText = I18n.getString("achievement.get");
|
||||
this.achievementStatName = I18n.getString(par1Achievement.getName());
|
||||
this.achievementGetLocalText = StatCollector.translateToLocal("achievement.get");
|
||||
this.achievementStatName = StatCollector.translateToLocal(par1Achievement.getName());
|
||||
this.achievementTime = Minecraft.getSystemTime();
|
||||
this.theAchievement = par1Achievement;
|
||||
this.haveAchiement = false;
|
||||
@@ -52,7 +52,7 @@ public class GuiAchievement extends Gui
|
||||
*/
|
||||
public void queueAchievementInformation(Achievement par1Achievement)
|
||||
{
|
||||
this.achievementGetLocalText = I18n.getString(par1Achievement.getName());
|
||||
this.achievementGetLocalText = StatCollector.translateToLocal(par1Achievement.getName());
|
||||
this.achievementStatName = par1Achievement.getDescription();
|
||||
this.achievementTime = Minecraft.getSystemTime() - 2500L;
|
||||
this.theAchievement = par1Achievement;
|
||||
|
||||
@@ -4,9 +4,7 @@ import net.lax1dude.eaglercraft.EaglercraftRandom;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
import net.lax1dude.eaglercraft.glemu.RealOpenGLEnums;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
public class GuiAchievements extends GuiScreen
|
||||
{
|
||||
@@ -60,7 +58,7 @@ public class GuiAchievements extends GuiScreen
|
||||
public void initGui()
|
||||
{
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiSmallButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.getString("gui.done")));
|
||||
this.buttonList.add(new GuiSmallButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, StatCollector.translateToLocal("gui.done")));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +96,7 @@ public class GuiAchievements extends GuiScreen
|
||||
*/
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
{
|
||||
if (Mouse.isButtonDown(0))
|
||||
if (EaglerAdapter.mouseIsButtonDown(0))
|
||||
{
|
||||
int var4 = (this.width - this.achievementsPaneWidth) / 2;
|
||||
int var5 = (this.height - this.achievementsPaneHeight) / 2;
|
||||
@@ -224,7 +222,7 @@ public class GuiAchievements extends GuiScreen
|
||||
EaglerAdapter.glTranslatef(0.0F, 0.0F, -200.0F);
|
||||
EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D);
|
||||
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
|
||||
EaglerAdapter.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
EaglerAdapter.glEnable(RealOpenGLEnums.GL_RESCALE_NORMAL);
|
||||
EaglerAdapter.glEnable(EaglerAdapter.GL_COLOR_MATERIAL);
|
||||
int var10 = var4 + 288 >> 4;
|
||||
int var11 = var5 + 288 >> 4;
|
||||
@@ -332,7 +330,7 @@ public class GuiAchievements extends GuiScreen
|
||||
RenderItem var32 = new RenderItem();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
|
||||
EaglerAdapter.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
EaglerAdapter.glEnable(RealOpenGLEnums.GL_RESCALE_NORMAL);
|
||||
EaglerAdapter.glEnable(EaglerAdapter.GL_COLOR_MATERIAL);
|
||||
int var38;
|
||||
int var39;
|
||||
@@ -416,7 +414,7 @@ public class GuiAchievements extends GuiScreen
|
||||
|
||||
if (var30 != null)
|
||||
{
|
||||
String var34 = I18n.getString(var30.getName());
|
||||
String var34 = StatCollector.translateToLocal(var30.getName());
|
||||
String var35 = var30.getDescription();
|
||||
var37 = par1 + 12;
|
||||
var25 = par2 - 4;
|
||||
@@ -436,13 +434,13 @@ public class GuiAchievements extends GuiScreen
|
||||
|
||||
if (this.statFileWriter.hasAchievementUnlocked(var30))
|
||||
{
|
||||
this.fontRenderer.drawStringWithShadow(I18n.getString("achievement.taken"), var37, var25 + var39 + 4, -7302913);
|
||||
this.fontRenderer.drawStringWithShadow(StatCollector.translateToLocal("achievement.taken"), var37, var25 + var39 + 4, -7302913);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var38 = Math.max(this.fontRenderer.getStringWidth(var34), 120);
|
||||
String var41 = I18n.getStringParams("achievement.requires", new Object[] {I18n.getString(var30.parentAchievement.getName())});
|
||||
String var41 = StatCollector.translateToLocalFormatted("achievement.requires", new Object[] {StatCollector.translateToLocal(var30.parentAchievement.getName())});
|
||||
var28 = this.fontRenderer.splitStringWidth(var41, var38);
|
||||
this.drawGradientRect(var37 - 3, var25 - 3, var37 + var38 + 3, var25 + var28 + 12 + 3, -1073741824, -1073741824);
|
||||
this.fontRenderer.drawSplitString(var41, var37, var25 + 12, var38, -9416624);
|
||||
|
||||
@@ -171,8 +171,8 @@ public class GuiBeacon extends GuiContainer
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("tile.beacon.primary"), 62, 10, 14737632);
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("tile.beacon.secondary"), 169, 10, 14737632);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("tile.beacon.primary"), 62, 10, 14737632);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("tile.beacon.secondary"), 169, 10, 14737632);
|
||||
Iterator var3 = this.buttonList.iterator();
|
||||
|
||||
while (var3.hasNext())
|
||||
|
||||
@@ -13,6 +13,6 @@ class GuiBeaconButtonCancel extends GuiBeaconButton
|
||||
|
||||
public void func_82251_b(int par1, int par2)
|
||||
{
|
||||
this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.cancel"), par1, par2);
|
||||
this.beaconGui.drawCreativeTabHoveringText(StatCollector.translateToLocal("gui.cancel"), par1, par2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,6 @@ class GuiBeaconButtonConfirm extends GuiBeaconButton
|
||||
|
||||
public void func_82251_b(int par1, int par2)
|
||||
{
|
||||
this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.done"), par1, par2);
|
||||
this.beaconGui.drawCreativeTabHoveringText(StatCollector.translateToLocal("gui.done"), par1, par2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class GuiBeaconButtonPower extends GuiBeaconButton
|
||||
|
||||
public void func_82251_b(int par1, int par2)
|
||||
{
|
||||
String var3 = I18n.getString(Potion.potionTypes[this.field_82261_l].getName());
|
||||
String var3 = StatCollector.translateToLocal(Potion.potionTypes[this.field_82261_l].getName());
|
||||
|
||||
if (this.field_82262_m >= 3 && this.field_82261_l != Potion.regeneration.id)
|
||||
{
|
||||
|
||||
@@ -19,9 +19,9 @@ public class GuiBrewingStand extends GuiContainer
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
String var3 = this.brewingStand.isInvNameLocalized() ? this.brewingStand.getInvName() : I18n.getString(this.brewingStand.getInvName());
|
||||
String var3 = this.brewingStand.isInvNameLocalized() ? this.brewingStand.getInvName() : StatCollector.translateToLocal(this.brewingStand.getInvName());
|
||||
this.fontRenderer.drawString(var3, this.xSize / 2 - this.fontRenderer.getStringWidth(var3) / 2, 6, 4210752);
|
||||
this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,8 +31,8 @@ public class GuiChest extends GuiContainer
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
this.fontRenderer.drawString(this.lowerChestInventory.isInvNameLocalized() ? this.lowerChestInventory.getInvName() : I18n.getString(this.lowerChestInventory.getInvName()), 8, 6, 4210752);
|
||||
this.fontRenderer.drawString(this.upperChestInventory.isInvNameLocalized() ? this.upperChestInventory.getInvName() : I18n.getString(this.upperChestInventory.getInvName()), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRenderer.drawString(this.lowerChestInventory.isInvNameLocalized() ? this.lowerChestInventory.getInvName() : StatCollector.translateToLocal(this.lowerChestInventory.getInvName()), 8, 6, 4210752);
|
||||
this.fontRenderer.drawString(this.upperChestInventory.isInvNameLocalized() ? this.upperChestInventory.getInvName() : StatCollector.translateToLocal(this.upperChestInventory.getInvName()), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,8 +34,8 @@ public class GuiCommandBlock extends GuiScreen
|
||||
{
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("gui.done")));
|
||||
this.buttonList.add(this.cancelBtn = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, StatCollector.translateToLocal("gui.done")));
|
||||
this.buttonList.add(this.cancelBtn = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, StatCollector.translateToLocal("gui.cancel")));
|
||||
this.commandTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 150, 60, 300, 20);
|
||||
this.commandTextField.setMaxStringLength(32767);
|
||||
this.commandTextField.setFocused(true);
|
||||
@@ -122,11 +122,11 @@ public class GuiCommandBlock extends GuiScreen
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("advMode.setCommand"), this.width / 2, 20, 16777215);
|
||||
this.drawString(this.fontRenderer, I18n.getString("advMode.command"), this.width / 2 - 150, 47, 10526880);
|
||||
this.drawString(this.fontRenderer, I18n.getString("advMode.nearestPlayer"), this.width / 2 - 150, 97, 10526880);
|
||||
this.drawString(this.fontRenderer, I18n.getString("advMode.randomPlayer"), this.width / 2 - 150, 108, 10526880);
|
||||
this.drawString(this.fontRenderer, I18n.getString("advMode.allPlayers"), this.width / 2 - 150, 119, 10526880);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("advMode.setCommand"), this.width / 2, 20, 16777215);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("advMode.command"), this.width / 2 - 150, 47, 10526880);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("advMode.nearestPlayer"), this.width / 2 - 150, 97, 10526880);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("advMode.randomPlayer"), this.width / 2 - 150, 108, 10526880);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("advMode.allPlayers"), this.width / 2 - 150, 119, 10526880);
|
||||
this.commandTextField.drawTextBox();
|
||||
super.drawScreen(par1, par2, par3);
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ public class GuiConfirmOpenLink extends GuiYesNo
|
||||
|
||||
public GuiConfirmOpenLink(GuiScreen par1GuiScreen, String par2Str, int par3, boolean par4)
|
||||
{
|
||||
super(par1GuiScreen, I18n.getString(par4 ? "chat.link.confirmTrusted" : "chat.link.confirm"), par2Str, par3);
|
||||
this.buttonText1 = I18n.getString(par4 ? "chat.link.open" : "gui.yes");
|
||||
this.buttonText2 = I18n.getString(par4 ? "gui.cancel" : "gui.no");
|
||||
this.copyLinkButtonText = I18n.getString("chat.copy");
|
||||
this.openLinkWarning = I18n.getString("chat.link.warning");
|
||||
super(par1GuiScreen, StatCollector.translateToLocal(par4 ? "chat.link.confirmTrusted" : "chat.link.confirm"), par2Str, par3);
|
||||
this.buttonText1 = StatCollector.translateToLocal(par4 ? "chat.link.open" : "gui.yes");
|
||||
this.buttonText2 = StatCollector.translateToLocal(par4 ? "gui.cancel" : "gui.no");
|
||||
this.copyLinkButtonText = StatCollector.translateToLocal("chat.copy");
|
||||
this.openLinkWarning = StatCollector.translateToLocal("chat.link.warning");
|
||||
this.field_92028_p = par2Str;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class GuiConnecting extends GuiScreen
|
||||
public void initGui()
|
||||
{
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, StatCollector.translateToLocal("gui.cancel")));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,12 +85,12 @@ public class GuiConnecting extends GuiScreen
|
||||
|
||||
if (this.clientHandler == null)
|
||||
{
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("connect.connecting"), this.width / 2, this.height / 2 - 50, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("connect.connecting"), this.width / 2, this.height / 2 - 50, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, "", this.width / 2, this.height / 2 - 10, 16777215);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("connect.authorizing"), this.width / 2, this.height / 2 - 50, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("connect.authorizing"), this.width / 2, this.height / 2 - 50, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, this.clientHandler.field_72560_a, this.width / 2, this.height / 2 - 10, 16777215);
|
||||
}
|
||||
|
||||
|
||||
@@ -393,7 +393,7 @@ public class GuiContainerCreative extends InventoryEffectRenderer
|
||||
|
||||
if (var3.drawInForegroundOfTab())
|
||||
{
|
||||
this.fontRenderer.drawString(I18n.getString(var3.getTranslatedTabLabel()), 8, 6, 4210752);
|
||||
this.fontRenderer.drawString(StatCollector.translateToLocal(var3.getTranslatedTabLabel()), 8, 6, 4210752);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -645,7 +645,7 @@ public class GuiContainerCreative extends InventoryEffectRenderer
|
||||
|
||||
if (this.field_74235_v != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_74235_v.xDisplayPosition, this.field_74235_v.yDisplayPosition, 16, 16, par1, par2))
|
||||
{
|
||||
this.drawCreativeTabHoveringText(I18n.getString("inventory.binSlot"), par1, par2);
|
||||
this.drawCreativeTabHoveringText(StatCollector.translateToLocal("inventory.binSlot"), par1, par2);
|
||||
}
|
||||
|
||||
EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -684,7 +684,7 @@ public class GuiContainerCreative extends InventoryEffectRenderer
|
||||
|
||||
if (var5 != null)
|
||||
{
|
||||
var4.add(1, "" + EnumChatFormatting.BOLD + EnumChatFormatting.BLUE + I18n.getString(var5.getTranslatedTabLabel()));
|
||||
var4.add(1, "" + EnumChatFormatting.BOLD + EnumChatFormatting.BLUE + StatCollector.translateToLocal(var5.getTranslatedTabLabel()));
|
||||
}
|
||||
|
||||
for (int var12 = 0; var12 < var4.size(); ++var12)
|
||||
@@ -813,7 +813,7 @@ public class GuiContainerCreative extends InventoryEffectRenderer
|
||||
|
||||
if (this.isPointInRegion(var5 + 3, var7 + 3, 23, 27, par2, par3))
|
||||
{
|
||||
this.drawCreativeTabHoveringText(I18n.getString(par1CreativeTabs.getTranslatedTabLabel()), par2, par3);
|
||||
this.drawCreativeTabHoveringText(StatCollector.translateToLocal(par1CreativeTabs.getTranslatedTabLabel()), par2, par3);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -42,8 +42,8 @@ public class GuiControls extends GuiScreen
|
||||
this.buttonList.add(new GuiSmallButton(var2, var1 + var2 % 2 * 160, this.height / 6 + 24 * (var2 >> 1), 70, 20, this.options.getOptionDisplayString(var2)));
|
||||
}
|
||||
|
||||
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done")));
|
||||
this.screenTitle = I18n.getString("controls.title");
|
||||
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, StatCollector.translateToLocal("gui.done")));
|
||||
this.screenTitle = StatCollector.translateToLocal("controls.title");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,8 +17,8 @@ public class GuiCrafting extends GuiContainer
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
this.fontRenderer.drawString(I18n.getString("container.crafting"), 28, 6, 4210752);
|
||||
this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRenderer.drawString(StatCollector.translateToLocal("container.crafting"), 28, 6, 4210752);
|
||||
this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,16 +35,16 @@ public class GuiCreateFlatWorld extends GuiScreen
|
||||
public void initGui()
|
||||
{
|
||||
this.buttonList.clear();
|
||||
this.customizationTitle = I18n.getString("createWorld.customize.flat.title");
|
||||
this.layerMaterialLabel = I18n.getString("createWorld.customize.flat.tile");
|
||||
this.heightLabel = I18n.getString("createWorld.customize.flat.height");
|
||||
this.customizationTitle = StatCollector.translateToLocal("createWorld.customize.flat.title");
|
||||
this.layerMaterialLabel = StatCollector.translateToLocal("createWorld.customize.flat.tile");
|
||||
this.heightLabel = StatCollector.translateToLocal("createWorld.customize.flat.height");
|
||||
this.createFlatWorldListSlotGui = new GuiCreateFlatWorldListSlot(this);
|
||||
this.buttonList.add(this.buttonAddLayer = new GuiButton(2, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("createWorld.customize.flat.addLayer") + " (NYI)"));
|
||||
this.buttonList.add(this.buttonEditLayer = new GuiButton(3, this.width / 2 - 50, this.height - 52, 100, 20, I18n.getString("createWorld.customize.flat.editLayer") + " (NYI)"));
|
||||
this.buttonList.add(this.buttonRemoveLayer = new GuiButton(4, this.width / 2 - 155, this.height - 52, 150, 20, I18n.getString("createWorld.customize.flat.removeLayer")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("gui.done")));
|
||||
this.buttonList.add(new GuiButton(5, this.width / 2 + 5, this.height - 52, 150, 20, I18n.getString("createWorld.customize.presets")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(this.buttonAddLayer = new GuiButton(2, this.width / 2 - 154, this.height - 52, 100, 20, StatCollector.translateToLocal("createWorld.customize.flat.addLayer") + " (NYI)"));
|
||||
this.buttonList.add(this.buttonEditLayer = new GuiButton(3, this.width / 2 - 50, this.height - 52, 100, 20, StatCollector.translateToLocal("createWorld.customize.flat.editLayer") + " (NYI)"));
|
||||
this.buttonList.add(this.buttonRemoveLayer = new GuiButton(4, this.width / 2 - 155, this.height - 52, 150, 20, StatCollector.translateToLocal("createWorld.customize.flat.removeLayer")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, StatCollector.translateToLocal("gui.done")));
|
||||
this.buttonList.add(new GuiButton(5, this.width / 2 + 5, this.height - 52, 150, 20, StatCollector.translateToLocal("createWorld.customize.presets")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, StatCollector.translateToLocal("gui.cancel")));
|
||||
this.buttonAddLayer.drawButton = this.buttonEditLayer.drawButton = false;
|
||||
this.theFlatGeneratorInfo.func_82645_d();
|
||||
this.func_82270_g();
|
||||
|
||||
@@ -92,15 +92,15 @@ class GuiCreateFlatWorldListSlot extends GuiSlot
|
||||
|
||||
if (par1 == 0)
|
||||
{
|
||||
var9 = I18n.getStringParams("createWorld.customize.flat.layer.top", new Object[] {Integer.valueOf(var6.getLayerCount())});
|
||||
var9 = StatCollector.translateToLocalFormatted("createWorld.customize.flat.layer.top", new Object[] {Integer.valueOf(var6.getLayerCount())});
|
||||
}
|
||||
else if (par1 == GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size() - 1)
|
||||
{
|
||||
var9 = I18n.getStringParams("createWorld.customize.flat.layer.bottom", new Object[] {Integer.valueOf(var6.getLayerCount())});
|
||||
var9 = StatCollector.translateToLocalFormatted("createWorld.customize.flat.layer.bottom", new Object[] {Integer.valueOf(var6.getLayerCount())});
|
||||
}
|
||||
else
|
||||
{
|
||||
var9 = I18n.getStringParams("createWorld.customize.flat.layer", new Object[] {Integer.valueOf(var6.getLayerCount())});
|
||||
var9 = StatCollector.translateToLocalFormatted("createWorld.customize.flat.layer", new Object[] {Integer.valueOf(var6.getLayerCount())});
|
||||
}
|
||||
|
||||
this.createFlatWorldGui.fontRenderer.drawString(var9, par2 + 2 + 213 - this.createFlatWorldGui.fontRenderer.getStringWidth(var9), par3 + 3, 16777215);
|
||||
|
||||
@@ -74,7 +74,7 @@ public class GuiCreateWorld extends GuiScreen
|
||||
{
|
||||
this.parentGuiScreen = par1GuiScreen;
|
||||
this.seed = "";
|
||||
this.localizedNewWorldText = I18n.getString("selectWorld.newWorld");
|
||||
this.localizedNewWorldText = StatCollector.translateToLocal("selectWorld.newWorld");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,19 +93,19 @@ public class GuiCreateWorld extends GuiScreen
|
||||
{
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("selectWorld.create")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(this.buttonGameMode = new GuiButton(2, this.width / 2 - 75, 115, 150, 20, I18n.getString("selectWorld.gameMode")));
|
||||
this.buttonList.add(this.moreWorldOptions = new GuiButton(3, this.width / 2 - 75, 187, 150, 20, I18n.getString("selectWorld.moreWorldOptions")));
|
||||
this.buttonList.add(this.buttonGenerateStructures = new GuiButton(4, this.width / 2 - 155, 100, 150, 20, I18n.getString("selectWorld.mapFeatures")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, StatCollector.translateToLocal("selectWorld.create")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, StatCollector.translateToLocal("gui.cancel")));
|
||||
this.buttonList.add(this.buttonGameMode = new GuiButton(2, this.width / 2 - 75, 115, 150, 20, StatCollector.translateToLocal("selectWorld.gameMode")));
|
||||
this.buttonList.add(this.moreWorldOptions = new GuiButton(3, this.width / 2 - 75, 187, 150, 20, StatCollector.translateToLocal("selectWorld.moreWorldOptions")));
|
||||
this.buttonList.add(this.buttonGenerateStructures = new GuiButton(4, this.width / 2 - 155, 100, 150, 20, StatCollector.translateToLocal("selectWorld.mapFeatures")));
|
||||
this.buttonGenerateStructures.drawButton = false;
|
||||
this.buttonList.add(this.buttonBonusItems = new GuiButton(7, this.width / 2 + 5, 151, 150, 20, I18n.getString("selectWorld.bonusItems")));
|
||||
this.buttonList.add(this.buttonBonusItems = new GuiButton(7, this.width / 2 + 5, 151, 150, 20, StatCollector.translateToLocal("selectWorld.bonusItems")));
|
||||
this.buttonBonusItems.drawButton = false;
|
||||
this.buttonList.add(this.buttonWorldType = new GuiButton(5, this.width / 2 + 5, 100, 150, 20, I18n.getString("selectWorld.mapType")));
|
||||
this.buttonList.add(this.buttonWorldType = new GuiButton(5, this.width / 2 + 5, 100, 150, 20, StatCollector.translateToLocal("selectWorld.mapType")));
|
||||
this.buttonWorldType.drawButton = false;
|
||||
this.buttonList.add(this.buttonAllowCommands = new GuiButton(6, this.width / 2 - 155, 151, 150, 20, I18n.getString("selectWorld.allowCommands")));
|
||||
this.buttonList.add(this.buttonAllowCommands = new GuiButton(6, this.width / 2 - 155, 151, 150, 20, StatCollector.translateToLocal("selectWorld.allowCommands")));
|
||||
this.buttonAllowCommands.drawButton = false;
|
||||
this.buttonList.add(this.buttonCustomize = new GuiButton(8, this.width / 2 + 5, 120, 150, 20, I18n.getString("selectWorld.customizeType")));
|
||||
this.buttonList.add(this.buttonCustomize = new GuiButton(8, this.width / 2 + 5, 120, 150, 20, StatCollector.translateToLocal("selectWorld.customizeType")));
|
||||
this.buttonCustomize.drawButton = false;
|
||||
this.textboxWorldName = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 60, 200, 20);
|
||||
this.textboxWorldName.setFocused(true);
|
||||
@@ -158,41 +158,41 @@ public class GuiCreateWorld extends GuiScreen
|
||||
|
||||
private void updateButtonText()
|
||||
{
|
||||
this.buttonGameMode.displayString = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.gameMode);
|
||||
this.gameModeDescriptionLine1 = I18n.getString("selectWorld.gameMode." + this.gameMode + ".line1");
|
||||
this.gameModeDescriptionLine2 = I18n.getString("selectWorld.gameMode." + this.gameMode + ".line2");
|
||||
this.buttonGenerateStructures.displayString = I18n.getString("selectWorld.mapFeatures") + " ";
|
||||
this.buttonGameMode.displayString = StatCollector.translateToLocal("selectWorld.gameMode") + " " + StatCollector.translateToLocal("selectWorld.gameMode." + this.gameMode);
|
||||
this.gameModeDescriptionLine1 = StatCollector.translateToLocal("selectWorld.gameMode." + this.gameMode + ".line1");
|
||||
this.gameModeDescriptionLine2 = StatCollector.translateToLocal("selectWorld.gameMode." + this.gameMode + ".line2");
|
||||
this.buttonGenerateStructures.displayString = StatCollector.translateToLocal("selectWorld.mapFeatures") + " ";
|
||||
|
||||
if (this.generateStructures)
|
||||
{
|
||||
this.buttonGenerateStructures.displayString = this.buttonGenerateStructures.displayString + I18n.getString("options.on");
|
||||
this.buttonGenerateStructures.displayString = this.buttonGenerateStructures.displayString + StatCollector.translateToLocal("options.on");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.buttonGenerateStructures.displayString = this.buttonGenerateStructures.displayString + I18n.getString("options.off");
|
||||
this.buttonGenerateStructures.displayString = this.buttonGenerateStructures.displayString + StatCollector.translateToLocal("options.off");
|
||||
}
|
||||
|
||||
this.buttonBonusItems.displayString = I18n.getString("selectWorld.bonusItems") + " ";
|
||||
this.buttonBonusItems.displayString = StatCollector.translateToLocal("selectWorld.bonusItems") + " ";
|
||||
|
||||
if (this.bonusItems && !this.isHardcore)
|
||||
{
|
||||
this.buttonBonusItems.displayString = this.buttonBonusItems.displayString + I18n.getString("options.on");
|
||||
this.buttonBonusItems.displayString = this.buttonBonusItems.displayString + StatCollector.translateToLocal("options.on");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.buttonBonusItems.displayString = this.buttonBonusItems.displayString + I18n.getString("options.off");
|
||||
this.buttonBonusItems.displayString = this.buttonBonusItems.displayString + StatCollector.translateToLocal("options.off");
|
||||
}
|
||||
|
||||
this.buttonWorldType.displayString = I18n.getString("selectWorld.mapType") + " " + I18n.getString(WorldType.worldTypes[this.worldTypeId].getTranslateName());
|
||||
this.buttonAllowCommands.displayString = I18n.getString("selectWorld.allowCommands") + " ";
|
||||
this.buttonWorldType.displayString = StatCollector.translateToLocal("selectWorld.mapType") + " " + StatCollector.translateToLocal(WorldType.worldTypes[this.worldTypeId].getTranslateName());
|
||||
this.buttonAllowCommands.displayString = StatCollector.translateToLocal("selectWorld.allowCommands") + " ";
|
||||
|
||||
if (this.commandsAllowed && !this.isHardcore)
|
||||
{
|
||||
this.buttonAllowCommands.displayString = this.buttonAllowCommands.displayString + I18n.getString("options.on");
|
||||
this.buttonAllowCommands.displayString = this.buttonAllowCommands.displayString + StatCollector.translateToLocal("options.on");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.buttonAllowCommands.displayString = this.buttonAllowCommands.displayString + I18n.getString("options.off");
|
||||
this.buttonAllowCommands.displayString = this.buttonAllowCommands.displayString + StatCollector.translateToLocal("options.off");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,11 +399,11 @@ public class GuiCreateWorld extends GuiScreen
|
||||
|
||||
if (this.moreOptions)
|
||||
{
|
||||
this.moreWorldOptions.displayString = I18n.getString("gui.done");
|
||||
this.moreWorldOptions.displayString = StatCollector.translateToLocal("gui.done");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.moreWorldOptions.displayString = I18n.getString("selectWorld.moreWorldOptions");
|
||||
this.moreWorldOptions.displayString = StatCollector.translateToLocal("selectWorld.moreWorldOptions");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,20 +455,20 @@ public class GuiCreateWorld extends GuiScreen
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("selectWorld.create"), this.width / 2, 20, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("selectWorld.create"), this.width / 2, 20, 16777215);
|
||||
|
||||
if (this.moreOptions)
|
||||
{
|
||||
this.drawString(this.fontRenderer, I18n.getString("selectWorld.enterSeed"), this.width / 2 - 100, 47, 10526880);
|
||||
this.drawString(this.fontRenderer, I18n.getString("selectWorld.seedInfo"), this.width / 2 - 100, 85, 10526880);
|
||||
this.drawString(this.fontRenderer, I18n.getString("selectWorld.mapFeatures.info"), this.width / 2 - 150, 122, 10526880);
|
||||
this.drawString(this.fontRenderer, I18n.getString("selectWorld.allowCommands.info"), this.width / 2 - 150, 172, 10526880);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("selectWorld.enterSeed"), this.width / 2 - 100, 47, 10526880);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("selectWorld.seedInfo"), this.width / 2 - 100, 85, 10526880);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("selectWorld.mapFeatures.info"), this.width / 2 - 150, 122, 10526880);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("selectWorld.allowCommands.info"), this.width / 2 - 150, 172, 10526880);
|
||||
this.textboxSeed.drawTextBox();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drawString(this.fontRenderer, I18n.getString("selectWorld.enterName"), this.width / 2 - 100, 47, 10526880);
|
||||
this.drawString(this.fontRenderer, I18n.getString("selectWorld.resultFolder") + " " + this.folderName, this.width / 2 - 100, 85, 10526880);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("selectWorld.enterName"), this.width / 2 - 100, 47, 10526880);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("selectWorld.resultFolder") + " " + this.folderName, this.width / 2 - 100, 85, 10526880);
|
||||
this.textboxWorldName.drawTextBox();
|
||||
this.drawString(this.fontRenderer, this.gameModeDescriptionLine1, this.width / 2 - 100, 137, 10526880);
|
||||
this.drawString(this.fontRenderer, this.gameModeDescriptionLine2, this.width / 2 - 100, 149, 10526880);
|
||||
@@ -479,7 +479,7 @@ public class GuiCreateWorld extends GuiScreen
|
||||
|
||||
public void func_82286_a(WorldInfo par1WorldInfo)
|
||||
{
|
||||
this.localizedNewWorldText = I18n.getStringParams("selectWorld.newWorld.copyOf", new Object[] {par1WorldInfo.getWorldName()});
|
||||
this.localizedNewWorldText = StatCollector.translateToLocalFormatted("selectWorld.newWorld.copyOf", new Object[] {par1WorldInfo.getWorldName()});
|
||||
this.seed = par1WorldInfo.getSeed() + "";
|
||||
this.worldTypeId = par1WorldInfo.getTerrainType().getWorldTypeID();
|
||||
this.generatorOptionsToUse = par1WorldInfo.getGeneratorOptions();
|
||||
|
||||
@@ -3,55 +3,83 @@ package net.minecraft.src;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class GuiDisconnected extends GuiScreen
|
||||
{
|
||||
import net.lax1dude.eaglercraft.ConfigConstants;
|
||||
import net.lax1dude.eaglercraft.EaglerAdapter;
|
||||
|
||||
public class GuiDisconnected extends GuiScreen {
|
||||
/** The error message. */
|
||||
private String errorMessage;
|
||||
|
||||
/** The details about the error. */
|
||||
private String errorDetail;
|
||||
|
||||
private String errorDetail2;
|
||||
private String errorDetailTryAgain;
|
||||
private boolean kickForDoS;
|
||||
|
||||
private Object[] field_74247_c;
|
||||
private List field_74245_d;
|
||||
private final GuiScreen field_98095_n;
|
||||
|
||||
public GuiDisconnected(GuiScreen par1GuiScreen, String par2Str, String par3Str, Object ... par4ArrayOfObj)
|
||||
{
|
||||
public GuiDisconnected(GuiScreen par1GuiScreen, String par2Str, String par3Str, Object... par4ArrayOfObj) {
|
||||
StringTranslate var5 = StringTranslate.getInstance();
|
||||
this.field_98095_n = par1GuiScreen;
|
||||
this.errorMessage = I18n.getString(par2Str);
|
||||
this.errorDetail = par3Str;
|
||||
if(par2Str.startsWith("disconnect.ratelimit")) {
|
||||
this.errorMessage = var5.translateKey(par2Str + ".title");
|
||||
this.errorDetail = var5.translateKey(par2Str + ".description0");
|
||||
this.errorDetail2 = var5.translateKey(par2Str + ".description1");
|
||||
this.errorDetailTryAgain = var5.translateKey(par2Str + ".tryAgain");
|
||||
this.kickForDoS = true;
|
||||
}else {
|
||||
this.errorMessage = par2Str.equals("disconnect.requiresAuth") ? par2Str : var5.translateKey(par2Str);
|
||||
this.errorDetail = par3Str;
|
||||
this.errorDetail2 = null;
|
||||
this.errorDetailTryAgain = null;
|
||||
this.kickForDoS = false;
|
||||
}
|
||||
this.field_74247_c = par4ArrayOfObj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
|
||||
* Fired when a key is typed. This is the equivalent of
|
||||
* KeyListener.keyTyped(KeyEvent e).
|
||||
*/
|
||||
protected void keyTyped(char par1, int par2) {}
|
||||
protected void keyTyped(char par1, int par2) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the buttons (and other controls) to the screen in question.
|
||||
*/
|
||||
public void initGui()
|
||||
{
|
||||
public void initGui() {
|
||||
StringTranslate var1 = StringTranslate.getInstance();
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.toMenu")));
|
||||
|
||||
if (this.field_74247_c != null)
|
||||
{
|
||||
this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(I18n.getStringParams(this.errorDetail, this.field_74247_c), this.width - 50);
|
||||
if(!kickForDoS && !"disconnect.requiresAuth".equals(this.errorMessage)) {
|
||||
if (this.field_74247_c != null) {
|
||||
this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(var1.translateKeyFormat(this.errorDetail, this.field_74247_c), this.width - 50);
|
||||
} else {
|
||||
this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(var1.translateKey(this.errorDetail), this.width - 50);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(I18n.getString(this.errorDetail), this.width - 50);
|
||||
|
||||
int i = 0;
|
||||
if(kickForDoS) {
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 2 + this.height / 7, var1.translateKey("gui.toMenu")));
|
||||
}else if("disconnect.requiresAuth".equals(this.errorMessage)){
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, var1.translateKey("gui.toMenu")));
|
||||
}else {
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height - this.height / 5 - 40, var1.translateKey("gui.toMenu")));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
|
||||
* Fired when a control is clicked. This is the equivalent of
|
||||
* ActionListener.actionPerformed(ActionEvent e).
|
||||
*/
|
||||
protected void actionPerformed(GuiButton par1GuiButton)
|
||||
{
|
||||
if (par1GuiButton.id == 0)
|
||||
{
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if (par1GuiButton.id == 0) {
|
||||
this.mc.displayGuiScreen(this.field_98095_n);
|
||||
}
|
||||
}
|
||||
@@ -59,18 +87,46 @@ public class GuiDisconnected extends GuiScreen
|
||||
/**
|
||||
* Draws the screen and all the components in it.
|
||||
*/
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
{
|
||||
public void drawScreen(int par1, int par2, float par3) {
|
||||
this.drawDefaultBackground();
|
||||
this.drawCenteredString(this.fontRenderer, this.errorMessage, this.width / 2, this.height / 2 - 50, 11184810);
|
||||
int var4 = this.height / 2 - 30;
|
||||
|
||||
if (this.field_74245_d != null)
|
||||
{
|
||||
for (Iterator var5 = this.field_74245_d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT)
|
||||
{
|
||||
String var6 = (String)var5.next();
|
||||
this.drawCenteredString(this.fontRenderer, var6, this.width / 2, var4, 16777215);
|
||||
if(kickForDoS) {
|
||||
var4 -= 20;
|
||||
this.drawCenteredString(this.fontRenderer, this.errorMessage, this.width / 2, var4 - 20, 11184810);
|
||||
this.drawCenteredString(this.fontRenderer, this.errorDetail, this.width / 2, var4 + 10, 16777215);
|
||||
String s = this.errorDetail2;
|
||||
boolean b = s.startsWith("$");
|
||||
if(b) {
|
||||
s = s.substring(1);
|
||||
var4 -= 2;
|
||||
}
|
||||
this.drawCenteredString(this.fontRenderer, s, this.width / 2, var4 + 24, b ? 16777215 : 0xFF5555);
|
||||
this.drawCenteredString(this.fontRenderer, this.errorDetailTryAgain, this.width / 2, var4 + 50, 0x777777);
|
||||
}else if("disconnect.requiresAuth".equals(this.errorMessage)) {//22w12a
|
||||
EaglerAdapter.glPushMatrix();
|
||||
EaglerAdapter.glScalef(1.5f, 1.5f, 1.5f);
|
||||
this.drawCenteredString(this.fontRenderer, "Authentication Required", this.width / 3, this.height / 4 - 30, 0xDD5555);
|
||||
EaglerAdapter.glPopMatrix();
|
||||
this.drawCenteredString(this.fontRenderer, "This server requires a paid Minecraft account to join", this.width / 2, this.height / 2 - 55, 0xDDDD44);
|
||||
this.drawCenteredString(this.fontRenderer, "You are running Eaglercraft " + EnumChatFormatting.GRAY + ConfigConstants.version + EnumChatFormatting.RESET + " which does not", this.width / 2, this.height / 2 - 35, 0x44BB44);
|
||||
this.drawCenteredString(this.fontRenderer, "support Xbox Live sign-in, so this server is inaccessable", this.width / 2, this.height / 2 - 23, 0x44BB44);
|
||||
|
||||
EaglerAdapter.glPushMatrix();
|
||||
EaglerAdapter.glScalef(1.0f, 1.0f, 1.0f);
|
||||
this.drawCenteredString(this.fontRenderer, "Please contact the owner of this site to update, or", this.width / 2, this.height / 2 - 3, 0x666666);
|
||||
this.drawCenteredString(this.fontRenderer, "if you want to continue playing Eaglercraft without a", this.width / 2, this.height / 2 + 5, 0x666666);
|
||||
this.drawCenteredString(this.fontRenderer, "real Minecraft account then please choose to play on", this.width / 2, this.height / 2 + 14, 0x666666);
|
||||
this.drawCenteredString(this.fontRenderer, "an older server that does still you to play for free", this.width / 2, this.height / 2 + 23, 0x666666);
|
||||
EaglerAdapter.glPopMatrix();
|
||||
|
||||
}else {
|
||||
this.drawCenteredString(this.fontRenderer, this.errorMessage, this.width / 2, this.height / 2 - 50, 11184810);
|
||||
if (this.field_74245_d != null) {
|
||||
for (Iterator var5 = this.field_74245_d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) {
|
||||
String var6 = (String) var5.next();
|
||||
this.drawCenteredString(this.fontRenderer, var6, this.width / 2, var4, 16777215);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ public class GuiDispenser extends GuiContainer
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
String var3 = this.theDispenser.isInvNameLocalized() ? this.theDispenser.getInvName() : I18n.getString(this.theDispenser.getInvName());
|
||||
String var3 = this.theDispenser.isInvNameLocalized() ? this.theDispenser.getInvName() : StatCollector.translateToLocal(this.theDispenser.getInvName());
|
||||
this.fontRenderer.drawString(var3, this.xSize / 2 - this.fontRenderer.getStringWidth(var3) / 2, 6, 4210752);
|
||||
this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,7 +50,7 @@ public class GuiDownloadTerrain extends GuiScreen
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
{
|
||||
this.drawBackground(0);
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("multiplayer.downloadingTerrain"), this.width / 2, this.height / 2 - 50, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("multiplayer.downloadingTerrain"), this.width / 2, this.height / 2 - 50, 16777215);
|
||||
super.drawScreen(par1, par2, par3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ public class GuiEnchantment extends GuiContainer
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
this.fontRenderer.drawString(this.field_94079_C == null ? I18n.getString("container.enchant") : this.field_94079_C, 12, 5, 4210752);
|
||||
this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRenderer.drawString(this.field_94079_C == null ? StatCollector.translateToLocal("container.enchant") : this.field_94079_C, 12, 5, 4210752);
|
||||
this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@ public class GuiErrorScreen extends GuiScreen
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, 140, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, 140, StatCollector.translateToLocal("gui.cancel")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,15 +34,15 @@ public class GuiFlatPresets extends GuiScreen
|
||||
{
|
||||
this.buttonList.clear();
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
this.field_82300_d = I18n.getString("createWorld.customize.presets.title");
|
||||
this.field_82308_m = I18n.getString("createWorld.customize.presets.share");
|
||||
this.field_82306_n = I18n.getString("createWorld.customize.presets.list");
|
||||
this.field_82300_d = StatCollector.translateToLocal("createWorld.customize.presets.title");
|
||||
this.field_82308_m = StatCollector.translateToLocal("createWorld.customize.presets.share");
|
||||
this.field_82306_n = StatCollector.translateToLocal("createWorld.customize.presets.list");
|
||||
this.theTextField = new GuiTextField(this.fontRenderer, 50, 40, this.width - 100, 20);
|
||||
this.theFlatPresetsListSlot = new GuiFlatPresetsListSlot(this);
|
||||
this.theTextField.setMaxStringLength(1230);
|
||||
this.theTextField.setText(this.createFlatWorldGui.getFlatGeneratorInfo());
|
||||
this.buttonList.add(this.theButton = new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("createWorld.customize.presets.select")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(this.theButton = new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, StatCollector.translateToLocal("createWorld.customize.presets.select")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, StatCollector.translateToLocal("gui.cancel")));
|
||||
this.func_82296_g();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ public class GuiFurnace extends GuiContainer
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
String var3 = this.furnaceInventory.isInvNameLocalized() ? this.furnaceInventory.getInvName() : I18n.getString(this.furnaceInventory.getInvName());
|
||||
String var3 = this.furnaceInventory.isInvNameLocalized() ? this.furnaceInventory.getInvName() : StatCollector.translateToLocal(this.furnaceInventory.getInvName());
|
||||
this.fontRenderer.drawString(var3, this.xSize / 2 - this.fontRenderer.getStringWidth(var3) / 2, 6, 4210752);
|
||||
this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,17 +21,17 @@ public class GuiGameOver extends GuiScreen
|
||||
{
|
||||
if (this.mc.isIntegratedServerRunning())
|
||||
{
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.deleteWorld")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, StatCollector.translateToLocal("deathScreen.deleteWorld")));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.leaveServer")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, StatCollector.translateToLocal("deathScreen.leaveServer")));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 72, I18n.getString("deathScreen.respawn")));
|
||||
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.titleScreen")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 72, StatCollector.translateToLocal("deathScreen.respawn")));
|
||||
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 96, StatCollector.translateToLocal("deathScreen.titleScreen")));
|
||||
|
||||
if (this.mc.getSession() == null)
|
||||
{
|
||||
@@ -80,16 +80,16 @@ public class GuiGameOver extends GuiScreen
|
||||
EaglerAdapter.glPushMatrix();
|
||||
EaglerAdapter.glScalef(2.0F, 2.0F, 2.0F);
|
||||
boolean var4 = this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled();
|
||||
String var5 = var4 ? I18n.getString("deathScreen.title.hardcore") : I18n.getString("deathScreen.title");
|
||||
String var5 = var4 ? StatCollector.translateToLocal("deathScreen.title.hardcore") : StatCollector.translateToLocal("deathScreen.title");
|
||||
this.drawCenteredString(this.fontRenderer, var5, this.width / 2 / 2, 30, 16777215);
|
||||
EaglerAdapter.glPopMatrix();
|
||||
|
||||
if (var4)
|
||||
{
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("deathScreen.hardcoreInfo"), this.width / 2, 144, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("deathScreen.hardcoreInfo"), this.width / 2, 144, 16777215);
|
||||
}
|
||||
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("deathScreen.score") + ": " + EnumChatFormatting.YELLOW + this.mc.thePlayer.getScore(), this.width / 2, 100, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("deathScreen.score") + ": " + EnumChatFormatting.YELLOW + this.mc.thePlayer.getScore(), this.width / 2, 100, 16777215);
|
||||
super.drawScreen(par1, par2, par3);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ public class GuiHopper extends GuiContainer
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
this.fontRenderer.drawString(this.field_94080_s.isInvNameLocalized() ? this.field_94080_s.getInvName() : I18n.getString(this.field_94080_s.getInvName()), 8, 6, 4210752);
|
||||
this.fontRenderer.drawString(this.field_94081_r.isInvNameLocalized() ? this.field_94081_r.getInvName() : I18n.getString(this.field_94081_r.getInvName()), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRenderer.drawString(this.field_94080_s.isInvNameLocalized() ? this.field_94080_s.getInvName() : StatCollector.translateToLocal(this.field_94080_s.getInvName()), 8, 6, 4210752);
|
||||
this.fontRenderer.drawString(this.field_94081_r.isInvNameLocalized() ? this.field_94081_r.getInvName() : StatCollector.translateToLocal(this.field_94081_r.getInvName()), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -253,25 +253,6 @@ public class GuiIngame extends Gui
|
||||
this.mc.mcProfiler.endSection();
|
||||
}
|
||||
|
||||
if (this.mc.isDemo())
|
||||
{
|
||||
this.mc.mcProfiler.startSection("demo");
|
||||
var36 = "";
|
||||
|
||||
if (this.mc.theWorld.getTotalWorldTime() >= 120500L)
|
||||
{
|
||||
var36 = I18n.getString("demo.demoExpired");
|
||||
}
|
||||
else
|
||||
{
|
||||
var36 = I18n.getStringParams("demo.remainingTime", new Object[] {StringUtils.ticksToElapsedTime((int)(120500L - this.mc.theWorld.getTotalWorldTime()))});
|
||||
}
|
||||
|
||||
var13 = var8.getStringWidth(var36);
|
||||
var8.drawStringWithShadow(var36, var6 - var13 - 10, 5, 16777215);
|
||||
this.mc.mcProfiler.endSection();
|
||||
}
|
||||
|
||||
int var21;
|
||||
int var22;
|
||||
int var23;
|
||||
|
||||
@@ -17,19 +17,19 @@ public class GuiIngameMenu extends GuiScreen
|
||||
this.buttonList.clear();
|
||||
byte var1 = -16;
|
||||
boolean var2 = true;
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + var1, I18n.getString("menu.returnToMenu")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + var1, StatCollector.translateToLocal("menu.returnToMenu")));
|
||||
|
||||
if (!this.mc.isIntegratedServerRunning())
|
||||
{
|
||||
((GuiButton)this.buttonList.get(0)).displayString = I18n.getString("menu.disconnect");
|
||||
((GuiButton)this.buttonList.get(0)).displayString = StatCollector.translateToLocal("menu.disconnect");
|
||||
}
|
||||
|
||||
this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + var1, I18n.getString("menu.returnToGame")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.options")));
|
||||
this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + var1, StatCollector.translateToLocal("menu.returnToGame")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + var1, 98, 20, StatCollector.translateToLocal("menu.options")));
|
||||
GuiButton var3;
|
||||
this.buttonList.add(var3 = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.shareToLan")));
|
||||
this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.achievements")));
|
||||
this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.stats")));
|
||||
this.buttonList.add(var3 = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + var1, 98, 20, StatCollector.translateToLocal("menu.shareToLan")));
|
||||
this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + var1, 98, 20, StatCollector.translateToLocal("gui.achievements")));
|
||||
this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + var1, 98, 20, StatCollector.translateToLocal("gui.stats")));
|
||||
var3.enabled = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class GuiInventory extends InventoryEffectRenderer
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
this.fontRenderer.drawString(I18n.getString("container.crafting"), 86, 16, 4210752);
|
||||
this.fontRenderer.drawString(StatCollector.translateToLocal("container.crafting"), 86, 16, 4210752);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public class GuiLanguage extends GuiScreen
|
||||
{
|
||||
public class GuiLanguage extends GuiScreen {
|
||||
/** This GUI's parent GUI. */
|
||||
protected GuiScreen parentGui;
|
||||
|
||||
/**
|
||||
* Timer used to update texture packs, decreases every tick and is reset to 20
|
||||
* and updates texture packs upon reaching 0.
|
||||
*/
|
||||
private int updateTimer = -1;
|
||||
|
||||
/** This GUI's language list. */
|
||||
private GuiSlotLanguage languageList;
|
||||
|
||||
/** For saving the user's language selection to disk. */
|
||||
private final GameSettings theGameSettings;
|
||||
private final LanguageManager field_135014_d;
|
||||
|
||||
/** This GUI's 'Done' button. */
|
||||
private GuiSmallButton doneButton;
|
||||
|
||||
public GuiLanguage(GuiScreen par1GuiScreen, GameSettings par2GameSettings, LanguageManager par3LanguageManager)
|
||||
{
|
||||
public GuiLanguage(GuiScreen par1GuiScreen, GameSettings par2GameSettings) {
|
||||
this.parentGui = par1GuiScreen;
|
||||
this.theGameSettings = par2GameSettings;
|
||||
this.field_135014_d = par3LanguageManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the buttons (and other controls) to the screen in question.
|
||||
*/
|
||||
public void initGui()
|
||||
{
|
||||
this.buttonList.add(this.doneButton = new GuiSmallButton(6, this.width / 2 - 75, this.height - 38, I18n.getString("gui.done")));
|
||||
public void initGui() {
|
||||
StringTranslate var1 = StringTranslate.getInstance();
|
||||
this.buttonList.add(this.doneButton = new GuiSmallButton(6, this.width / 2 - 75, this.height - 38, var1.translateKey("gui.done")));
|
||||
this.languageList = new GuiSlotLanguage(this);
|
||||
this.languageList.registerScrollButtons(7, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
|
||||
* Fired when a control is clicked. This is the equivalent of
|
||||
* ActionListener.actionPerformed(ActionEvent e).
|
||||
*/
|
||||
protected void actionPerformed(GuiButton par1GuiButton)
|
||||
{
|
||||
if (par1GuiButton.enabled)
|
||||
{
|
||||
switch (par1GuiButton.id)
|
||||
{
|
||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||
if (par1GuiButton.enabled) {
|
||||
switch (par1GuiButton.id) {
|
||||
case 5:
|
||||
break;
|
||||
|
||||
@@ -57,32 +57,40 @@ public class GuiLanguage extends GuiScreen
|
||||
/**
|
||||
* Draws the screen and all the components in it.
|
||||
*/
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
{
|
||||
public void drawScreen(int par1, int par2, float par3) {
|
||||
this.languageList.drawScreen(par1, par2, par3);
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("options.language"), this.width / 2, 16, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, "(" + I18n.getString("options.languageWarning") + ")", this.width / 2, this.height - 56, 8421504);
|
||||
|
||||
if (this.updateTimer <= 0) {
|
||||
this.mc.texturePackList.updateAvaliableTexturePacks();
|
||||
this.updateTimer += 20;
|
||||
}
|
||||
|
||||
StringTranslate var4 = StringTranslate.getInstance();
|
||||
this.drawCenteredString(this.fontRenderer, var4.translateKey("options.language"), this.width / 2, 16, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, "(" + var4.translateKey("options.languageWarning") + ")", this.width / 2, this.height - 56, 8421504);
|
||||
super.drawScreen(par1, par2, par3);
|
||||
}
|
||||
|
||||
static LanguageManager func_135011_a(GuiLanguage par0GuiLanguage)
|
||||
{
|
||||
return par0GuiLanguage.field_135014_d;
|
||||
/**
|
||||
* Called from the main game loop to update the screen.
|
||||
*/
|
||||
public void updateScreen() {
|
||||
super.updateScreen();
|
||||
--this.updateTimer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the relevant instance of GameSettings. Synthetic method for use in GuiSlotLanguage
|
||||
* Gets the relevant instance of GameSettings. Synthetic method for use in
|
||||
* GuiSlotLanguage
|
||||
*/
|
||||
static GameSettings getGameSettings(GuiLanguage par0GuiLanguage)
|
||||
{
|
||||
static GameSettings getGameSettings(GuiLanguage par0GuiLanguage) {
|
||||
return par0GuiLanguage.theGameSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the private doneButton field.
|
||||
*/
|
||||
static GuiSmallButton getDoneButton(GuiLanguage par0GuiLanguage)
|
||||
{
|
||||
static GuiSmallButton getDoneButton(GuiLanguage par0GuiLanguage) {
|
||||
return par0GuiLanguage.doneButton;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class GuiMainMenu extends GuiScreen {
|
||||
this.splashText = "missingno";
|
||||
}
|
||||
}
|
||||
this.field_92025_p = "Eaglercraft 1.5.2 Service Pack #2";
|
||||
this.field_92025_p = "Eaglercraft 1.6.4";
|
||||
this.start = EaglerAdapter.steadyTimeMillis();
|
||||
this.start += this.start % 10000l;
|
||||
this.ackLines = new ArrayList();
|
||||
@@ -290,7 +290,7 @@ public class GuiMainMenu extends GuiScreen {
|
||||
|
||||
if (par1GuiButton.id == 5) {
|
||||
showingEndian = false;
|
||||
this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, null));
|
||||
this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings));
|
||||
}
|
||||
|
||||
if (par1GuiButton.id == 2) {
|
||||
@@ -504,7 +504,7 @@ public class GuiMainMenu extends GuiScreen {
|
||||
this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 155, 44);
|
||||
this.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44);
|
||||
|
||||
this.drawString(this.fontRenderer, "minecraft 1.5.2", 2, this.height - 20, 16777215);
|
||||
this.drawString(this.fontRenderer, "Minecraft 1.6.4", 2, this.height - 20, 16777215);
|
||||
this.drawString(this.fontRenderer, ConfigConstants.mainMenuString + " official", 2, this.height - 10, 16777215);
|
||||
|
||||
//String var10 = "Copyright " + Calendar.getInstance().get(Calendar.YEAR) + " Mojang AB.";
|
||||
|
||||
@@ -8,8 +8,8 @@ public class GuiMemoryErrorScreen extends GuiScreen
|
||||
public void initGui()
|
||||
{
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 4 + 120 + 12, I18n.getString("gui.toMenu")));
|
||||
this.buttonList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 4 + 120 + 12, I18n.getString("menu.quit")));
|
||||
this.buttonList.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 4 + 120 + 12, StatCollector.translateToLocal("gui.toMenu")));
|
||||
this.buttonList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 4 + 120 + 12, StatCollector.translateToLocal("menu.quit")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ public class GuiMerchant extends GuiContainer
|
||||
{
|
||||
super(new ContainerMerchant(par1InventoryPlayer, par2IMerchant, par3World));
|
||||
this.theIMerchant = par2IMerchant;
|
||||
this.field_94082_v = par4Str != null && par4Str.length() >= 1 ? par4Str : I18n.getString("entity.Villager.name");
|
||||
this.field_94082_v = par4Str != null && par4Str.length() >= 1 ? par4Str : StatCollector.translateToLocal("entity.Villager.name");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,7 +45,7 @@ public class GuiMerchant extends GuiContainer
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
this.fontRenderer.drawString(this.field_94082_v, this.xSize / 2 - this.fontRenderer.getStringWidth(this.field_94082_v) / 2, 6, 4210752);
|
||||
this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -140,13 +140,13 @@ public class GuiMultiplayer extends GuiScreen
|
||||
*/
|
||||
public void initGuiControls()
|
||||
{
|
||||
this.buttonList.add(this.field_96289_p = new GuiButton(7, this.width / 2 - 154, this.height - 28, 70, 20, I18n.getString("selectServer.edit")));
|
||||
this.buttonList.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 74, this.height - 28, 70, 20, I18n.getString("selectServer.delete")));
|
||||
this.buttonList.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("selectServer.select")));
|
||||
this.buttonList.add(new GuiButton(4, this.width / 2 - 50, this.height - 52, 100, 20, I18n.getString("selectServer.direct")));
|
||||
this.buttonList.add(new GuiButton(3, this.width / 2 + 4 + 50, this.height - 52, 100, 20, I18n.getString("selectServer.add")));
|
||||
this.buttonList.add(new GuiButton(8, this.width / 2 + 4, this.height - 28, 70, 20, I18n.getString("selectServer.refresh")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 + 4 + 76, this.height - 28, 75, 20, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(this.field_96289_p = new GuiButton(7, this.width / 2 - 154, this.height - 28, 70, 20, StatCollector.translateToLocal("selectServer.edit")));
|
||||
this.buttonList.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 74, this.height - 28, 70, 20, StatCollector.translateToLocal("selectServer.delete")));
|
||||
this.buttonList.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, StatCollector.translateToLocal("selectServer.select")));
|
||||
this.buttonList.add(new GuiButton(4, this.width / 2 - 50, this.height - 52, 100, 20, StatCollector.translateToLocal("selectServer.direct")));
|
||||
this.buttonList.add(new GuiButton(3, this.width / 2 + 4 + 50, this.height - 52, 100, 20, StatCollector.translateToLocal("selectServer.add")));
|
||||
this.buttonList.add(new GuiButton(8, this.width / 2 + 4, this.height - 28, 70, 20, StatCollector.translateToLocal("selectServer.refresh")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 + 4 + 76, this.height - 28, 75, 20, StatCollector.translateToLocal("gui.cancel")));
|
||||
boolean var1 = this.selectedServer >= 0 && this.selectedServer < this.serverSlotContainer.getSize();
|
||||
this.buttonSelect.enabled = var1;
|
||||
this.field_96289_p.enabled = var1;
|
||||
@@ -346,7 +346,7 @@ public class GuiMultiplayer extends GuiScreen
|
||||
this.lagTooltip = null;
|
||||
this.drawDefaultBackground();
|
||||
this.serverSlotContainer.drawScreen(par1, par2, par3);
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("multiplayer.title"), this.width / 2, 20, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("multiplayer.title"), this.width / 2, 20, 16777215);
|
||||
super.drawScreen(par1, par2, par3);
|
||||
|
||||
if (this.lagTooltip != null)
|
||||
|
||||
@@ -303,7 +303,7 @@ public class GuiNewChat extends Gui
|
||||
*/
|
||||
public void addTranslatedMessage(String par1Str, Object ... par2ArrayOfObj)
|
||||
{
|
||||
this.printChatMessage(I18n.getStringParams(par1Str, par2ArrayOfObj));
|
||||
this.printChatMessage(StatCollector.translateToLocalFormatted(par1Str, par2ArrayOfObj));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,7 @@ public class GuiOptions extends GuiScreen
|
||||
public void initGui()
|
||||
{
|
||||
int var1 = 0;
|
||||
this.screenTitle = I18n.getString("options.title");
|
||||
this.screenTitle = StatCollector.translateToLocal("options.title");
|
||||
EnumOptions[] var2 = relevantOptions;
|
||||
int var3 = var2.length;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class GuiOptions extends GuiScreen
|
||||
if (var5 == EnumOptions.DIFFICULTY && this.mc.theWorld != null && this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled())
|
||||
{
|
||||
var6.enabled = false;
|
||||
var6.displayString = I18n.getString("options.difficulty") + ": " + I18n.getString("options.difficulty.hardcore");
|
||||
var6.displayString = StatCollector.translateToLocal("options.difficulty") + ": " + StatCollector.translateToLocal("options.difficulty.hardcore");
|
||||
}
|
||||
|
||||
this.buttonList.add(var6);
|
||||
@@ -58,13 +58,13 @@ public class GuiOptions extends GuiScreen
|
||||
++var1;
|
||||
}
|
||||
|
||||
this.buttonList.add(new GuiButton(101, this.width / 2 - 152, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.video")));
|
||||
this.buttonList.add(new GuiButton(100, this.width / 2 + 2, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.controls")));
|
||||
this.buttonList.add(new GuiButton(102, this.width / 2 - 152, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.language")));
|
||||
this.buttonList.add(new GuiButton(103, this.width / 2 + 2, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.multiplayer.title")));
|
||||
this.buttonList.add(new GuiButton(105, this.width / 2 - 152, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.resourcepack")));
|
||||
this.buttonList.add(new GuiButton(104, this.width / 2 + 2, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.snooper.view")));
|
||||
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done")));
|
||||
this.buttonList.add(new GuiButton(101, this.width / 2 - 152, this.height / 6 + 96 - 6, 150, 20, StatCollector.translateToLocal("options.video")));
|
||||
this.buttonList.add(new GuiButton(100, this.width / 2 + 2, this.height / 6 + 96 - 6, 150, 20, StatCollector.translateToLocal("options.controls")));
|
||||
this.buttonList.add(new GuiButton(102, this.width / 2 - 152, this.height / 6 + 120 - 6, 150, 20, StatCollector.translateToLocal("options.language")));
|
||||
this.buttonList.add(new GuiButton(103, this.width / 2 + 2, this.height / 6 + 120 - 6, 150, 20, StatCollector.translateToLocal("options.multiplayer.title")));
|
||||
this.buttonList.add(new GuiButton(105, this.width / 2 - 152, this.height / 6 + 144 - 6, 150, 20, StatCollector.translateToLocal("options.resourcepack")));
|
||||
this.buttonList.add(new GuiButton(104, this.width / 2 + 2, this.height / 6 + 144 - 6, 150, 20, StatCollector.translateToLocal("options.snooper.view")));
|
||||
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, StatCollector.translateToLocal("gui.done")));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,7 +95,7 @@ public class GuiOptions extends GuiScreen
|
||||
if (par1GuiButton.id == 102)
|
||||
{
|
||||
this.mc.gameSettings.saveOptions();
|
||||
this.mc.displayGuiScreen(new GuiLanguage(this, this.options, this.mc.getLanguageManager()));
|
||||
this.mc.displayGuiScreen(new GuiLanguage(this, this.options));
|
||||
}
|
||||
|
||||
if (par1GuiButton.id == 103)
|
||||
|
||||
@@ -29,8 +29,8 @@ public class GuiRenameWorld extends GuiScreen
|
||||
{
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("selectWorld.renameButton")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, StatCollector.translateToLocal("selectWorld.renameButton")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, StatCollector.translateToLocal("gui.cancel")));
|
||||
ISaveFormat var1 = this.mc.getSaveLoader();
|
||||
WorldInfo var2 = var1.getWorldInfo(this.worldName);
|
||||
String var3 = var2.getWorldName();
|
||||
@@ -96,8 +96,8 @@ public class GuiRenameWorld extends GuiScreen
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("selectWorld.renameTitle"), this.width / 2, 20, 16777215);
|
||||
this.drawString(this.fontRenderer, I18n.getString("selectWorld.enterName"), this.width / 2 - 100, 47, 10526880);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("selectWorld.renameTitle"), this.width / 2, 20, 16777215);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("selectWorld.enterName"), this.width / 2 - 100, 47, 10526880);
|
||||
this.theGuiTextField.drawTextBox();
|
||||
super.drawScreen(par1, par2, par3);
|
||||
}
|
||||
|
||||
@@ -54,17 +54,17 @@ public class GuiRepair extends GuiContainer implements ICrafting
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING);
|
||||
this.fontRenderer.drawString(I18n.getString("container.repair"), 60, 6, 4210752);
|
||||
this.fontRenderer.drawString(StatCollector.translateToLocal("container.repair"), 60, 6, 4210752);
|
||||
|
||||
if (this.repairContainer.maximumCost > 0)
|
||||
{
|
||||
int var3 = 8453920;
|
||||
boolean var4 = true;
|
||||
String var5 = I18n.getStringParams("container.repair.cost", new Object[] {Integer.valueOf(this.repairContainer.maximumCost)});
|
||||
String var5 = StatCollector.translateToLocalFormatted("container.repair.cost", new Object[] {Integer.valueOf(this.repairContainer.maximumCost)});
|
||||
|
||||
if (this.repairContainer.maximumCost >= 40 && !this.mc.thePlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
var5 = I18n.getString("container.repair.expensive");
|
||||
var5 = StatCollector.translateToLocal("container.repair.expensive");
|
||||
var3 = 16736352;
|
||||
}
|
||||
else if (!this.repairContainer.getSlot(2).getHasStack())
|
||||
|
||||
@@ -34,9 +34,9 @@ public class GuiScreenAddServer extends GuiScreen
|
||||
{
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("addServer.add")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, 142, I18n.getString("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? I18n.getString("gui.yes") : I18n.getString("gui.no"))));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, StatCollector.translateToLocal("addServer.add")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, StatCollector.translateToLocal("gui.cancel")));
|
||||
this.buttonList.add(new GuiButton(2, this.width / 2 - 100, 142, StatCollector.translateToLocal("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? StatCollector.translateToLocal("gui.yes") : StatCollector.translateToLocal("gui.no"))));
|
||||
this.serverName = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 66, 200, 20);
|
||||
this.serverName.setFocused(true);
|
||||
this.serverName.setText(this.newServerData.serverName);
|
||||
@@ -74,7 +74,7 @@ public class GuiScreenAddServer extends GuiScreen
|
||||
else if (par1GuiButton.id == 2)
|
||||
{
|
||||
this.newServerData.setHideAddress(!this.newServerData.isHidingAddress());
|
||||
((GuiButton)this.buttonList.get(2)).displayString = I18n.getString("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? I18n.getString("gui.yes") : I18n.getString("gui.no"));
|
||||
((GuiButton)this.buttonList.get(2)).displayString = StatCollector.translateToLocal("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? StatCollector.translateToLocal("gui.yes") : StatCollector.translateToLocal("gui.no"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,9 +117,9 @@ public class GuiScreenAddServer extends GuiScreen
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("addServer.title"), this.width / 2, 17, 16777215);
|
||||
this.drawString(this.fontRenderer, I18n.getString("addServer.enterName"), this.width / 2 - 100, 53, 10526880);
|
||||
this.drawString(this.fontRenderer, I18n.getString("addServer.enterIp"), this.width / 2 - 100, 94, 10526880);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("addServer.title"), this.width / 2, 17, 16777215);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("addServer.enterName"), this.width / 2 - 100, 53, 10526880);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("addServer.enterIp"), this.width / 2 - 100, 94, 10526880);
|
||||
this.serverName.drawTextBox();
|
||||
this.serverAddress.drawTextBox();
|
||||
super.drawScreen(par1, par2, par3);
|
||||
|
||||
@@ -87,14 +87,14 @@ public class GuiScreenBook extends GuiScreen
|
||||
|
||||
if (this.bookIsUnsigned)
|
||||
{
|
||||
this.buttonList.add(this.buttonSign = new GuiButton(3, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.getString("book.signButton")));
|
||||
this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.getString("gui.done")));
|
||||
this.buttonList.add(this.buttonFinalize = new GuiButton(5, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.getString("book.finalizeButton")));
|
||||
this.buttonList.add(this.buttonCancel = new GuiButton(4, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(this.buttonSign = new GuiButton(3, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, StatCollector.translateToLocal("book.signButton")));
|
||||
this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, StatCollector.translateToLocal("gui.done")));
|
||||
this.buttonList.add(this.buttonFinalize = new GuiButton(5, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, StatCollector.translateToLocal("book.finalizeButton")));
|
||||
this.buttonList.add(this.buttonCancel = new GuiButton(4, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, StatCollector.translateToLocal("gui.cancel")));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 - 100, 4 + this.bookImageHeight, 200, 20, I18n.getString("gui.done")));
|
||||
this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 - 100, 4 + this.bookImageHeight, 200, 20, StatCollector.translateToLocal("gui.done")));
|
||||
}
|
||||
|
||||
int var1 = (this.width - this.bookImageWidth) / 2;
|
||||
@@ -400,20 +400,20 @@ public class GuiScreenBook extends GuiScreen
|
||||
}
|
||||
}
|
||||
|
||||
var7 = I18n.getString("book.editTitle");
|
||||
var7 = StatCollector.translateToLocal("book.editTitle");
|
||||
var8 = this.fontRenderer.getStringWidth(var7);
|
||||
this.fontRenderer.drawString(var7, var4 + 36 + (116 - var8) / 2, var5 + 16 + 16, 0);
|
||||
int var9 = this.fontRenderer.getStringWidth(var6);
|
||||
this.fontRenderer.drawString(var6, var4 + 36 + (116 - var9) / 2, var5 + 48, 0);
|
||||
String var10 = String.format(I18n.getString("book.byAuthor"), new Object[] {this.editingPlayer.getCommandSenderName()});
|
||||
String var10 = String.format(StatCollector.translateToLocal("book.byAuthor"), new Object[] {this.editingPlayer.getCommandSenderName()});
|
||||
int var11 = this.fontRenderer.getStringWidth(var10);
|
||||
this.fontRenderer.drawString(EnumChatFormatting.DARK_GRAY + var10, var4 + 36 + (116 - var11) / 2, var5 + 48 + 10, 0);
|
||||
String var12 = I18n.getString("book.finalizeWarning");
|
||||
String var12 = StatCollector.translateToLocal("book.finalizeWarning");
|
||||
this.fontRenderer.drawSplitString(var12, var4 + 36, var5 + 80, 116, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
var6 = String.format(I18n.getString("book.pageIndicator"), new Object[] {Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages)});
|
||||
var6 = String.format(StatCollector.translateToLocal("book.pageIndicator"), new Object[] {Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages)});
|
||||
var7 = "";
|
||||
|
||||
if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount())
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public class GuiScreenClientOutdated extends GuiScreen
|
||||
{
|
||||
private final GuiScreen previousScreen;
|
||||
|
||||
public GuiScreenClientOutdated(GuiScreen par1GuiScreen)
|
||||
{
|
||||
this.previousScreen = par1GuiScreen;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the buttons (and other controls) to the screen in question.
|
||||
*/
|
||||
public void initGui()
|
||||
{
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the screen and all the components in it.
|
||||
*/
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
String var4 = I18n.getString("mco.client.outdated.title");
|
||||
String var5 = I18n.getString("mco.client.outdated.msg");
|
||||
this.drawCenteredString(this.fontRenderer, var4, this.width / 2, this.height / 2 - 50, 16711680);
|
||||
this.drawCenteredString(this.fontRenderer, var5, this.width / 2, this.height / 2 - 30, 16777215);
|
||||
super.drawScreen(par1, par2, par3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
|
||||
*/
|
||||
protected void actionPerformed(GuiButton par1GuiButton)
|
||||
{
|
||||
if (par1GuiButton.id == 0)
|
||||
{
|
||||
this.mc.displayGuiScreen(this.previousScreen);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
|
||||
*/
|
||||
protected void keyTyped(char par1, int par2)
|
||||
{
|
||||
if (par2 == 28 || par2 == 156)
|
||||
{
|
||||
this.mc.displayGuiScreen(this.previousScreen);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,8 @@ public class GuiScreenHorseInventory extends GuiContainer
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2)
|
||||
{
|
||||
this.fontRenderer.drawString(this.field_110412_v.isInvNameLocalized() ? this.field_110412_v.getInvName() : I18n.getString(this.field_110412_v.getInvName()), 8, 6, 4210752);
|
||||
this.fontRenderer.drawString(this.field_110413_u.isInvNameLocalized() ? this.field_110413_u.getInvName() : I18n.getString(this.field_110413_u.getInvName()), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRenderer.drawString(this.field_110412_v.isInvNameLocalized() ? this.field_110412_v.getInvName() : StatCollector.translateToLocal(this.field_110412_v.getInvName()), 8, 6, 4210752);
|
||||
this.fontRenderer.drawString(this.field_110413_u.isInvNameLocalized() ? this.field_110413_u.getInvName() : StatCollector.translateToLocal(this.field_110413_u.getInvName()), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,8 +32,8 @@ public class GuiScreenServerList extends GuiScreen
|
||||
{
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("selectServer.select")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, StatCollector.translateToLocal("selectServer.select")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, StatCollector.translateToLocal("gui.cancel")));
|
||||
this.serverTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 116, 200, 20);
|
||||
this.serverTextField.setMaxStringLength(128);
|
||||
this.serverTextField.setFocused(true);
|
||||
@@ -100,8 +100,8 @@ public class GuiScreenServerList extends GuiScreen
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("selectServer.direct"), this.width / 2, 20, 16777215);
|
||||
this.drawString(this.fontRenderer, I18n.getString("addServer.enterIp"), this.width / 2 - 100, 100, 10526880);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("selectServer.direct"), this.width / 2, 20, 16777215);
|
||||
this.drawString(this.fontRenderer, StatCollector.translateToLocal("addServer.enterIp"), this.width / 2 - 100, 100, 10526880);
|
||||
this.serverTextField.drawTextBox();
|
||||
super.drawScreen(par1, par2, par3);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class GuiSelectWorld extends GuiScreen
|
||||
*/
|
||||
public void initGui()
|
||||
{
|
||||
this.screenTitle = I18n.getString("selectWorld.title");
|
||||
this.screenTitle = StatCollector.translateToLocal("selectWorld.title");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -73,11 +73,11 @@ public class GuiSelectWorld extends GuiScreen
|
||||
return;
|
||||
}
|
||||
|
||||
this.localizedWorldText = I18n.getString("selectWorld.world");
|
||||
this.localizedMustConvertText = I18n.getString("selectWorld.conversion");
|
||||
this.localizedGameModeText[EnumGameType.SURVIVAL.getID()] = I18n.getString("gameMode.survival");
|
||||
this.localizedGameModeText[EnumGameType.CREATIVE.getID()] = I18n.getString("gameMode.creative");
|
||||
this.localizedGameModeText[EnumGameType.ADVENTURE.getID()] = I18n.getString("gameMode.adventure");
|
||||
this.localizedWorldText = StatCollector.translateToLocal("selectWorld.world");
|
||||
this.localizedMustConvertText = StatCollector.translateToLocal("selectWorld.conversion");
|
||||
this.localizedGameModeText[EnumGameType.SURVIVAL.getID()] = StatCollector.translateToLocal("gameMode.survival");
|
||||
this.localizedGameModeText[EnumGameType.CREATIVE.getID()] = StatCollector.translateToLocal("gameMode.creative");
|
||||
this.localizedGameModeText[EnumGameType.ADVENTURE.getID()] = StatCollector.translateToLocal("gameMode.adventure");
|
||||
this.worldSlotContainer = new GuiWorldSlot(this);
|
||||
this.worldSlotContainer.registerScrollButtons(4, 5);
|
||||
this.initButtons();
|
||||
@@ -111,7 +111,7 @@ public class GuiSelectWorld extends GuiScreen
|
||||
|
||||
if (var2 == null || MathHelper.stringNullOrLengthZero(var2))
|
||||
{
|
||||
var2 = I18n.getString("selectWorld.world") + " " + (par1 + 1);
|
||||
var2 = StatCollector.translateToLocal("selectWorld.world") + " " + (par1 + 1);
|
||||
}
|
||||
|
||||
return var2;
|
||||
@@ -122,12 +122,12 @@ public class GuiSelectWorld extends GuiScreen
|
||||
*/
|
||||
public void initButtons()
|
||||
{
|
||||
this.buttonList.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 150, 20, I18n.getString("selectWorld.select")));
|
||||
this.buttonList.add(new GuiButton(3, this.width / 2 + 4, this.height - 52, 150, 20, I18n.getString("selectWorld.create")));
|
||||
this.buttonList.add(this.buttonRename = new GuiButton(6, this.width / 2 - 154, this.height - 28, 72, 20, I18n.getString("selectWorld.rename")));
|
||||
this.buttonList.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 76, this.height - 28, 72, 20, I18n.getString("selectWorld.delete")));
|
||||
this.buttonList.add(this.buttonRecreate = new GuiButton(7, this.width / 2 + 4, this.height - 28, 72, 20, I18n.getString("selectWorld.recreate")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 + 82, this.height - 28, 72, 20, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 150, 20, StatCollector.translateToLocal("selectWorld.select")));
|
||||
this.buttonList.add(new GuiButton(3, this.width / 2 + 4, this.height - 52, 150, 20, StatCollector.translateToLocal("selectWorld.create")));
|
||||
this.buttonList.add(this.buttonRename = new GuiButton(6, this.width / 2 - 154, this.height - 28, 72, 20, StatCollector.translateToLocal("selectWorld.rename")));
|
||||
this.buttonList.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 76, this.height - 28, 72, 20, StatCollector.translateToLocal("selectWorld.delete")));
|
||||
this.buttonList.add(this.buttonRecreate = new GuiButton(7, this.width / 2 + 4, this.height - 28, 72, 20, StatCollector.translateToLocal("selectWorld.recreate")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 + 82, this.height - 28, 72, 20, StatCollector.translateToLocal("gui.cancel")));
|
||||
this.buttonSelect.enabled = false;
|
||||
this.buttonDelete.enabled = false;
|
||||
this.buttonRename.enabled = false;
|
||||
@@ -257,10 +257,10 @@ public class GuiSelectWorld extends GuiScreen
|
||||
*/
|
||||
public static GuiYesNo getDeleteWorldScreen(GuiScreen par0GuiScreen, String par1Str, int par2)
|
||||
{
|
||||
String var3 = I18n.getString("selectWorld.deleteQuestion");
|
||||
String var4 = "\'" + par1Str + "\' " + I18n.getString("selectWorld.deleteWarning");
|
||||
String var5 = I18n.getString("selectWorld.deleteButton");
|
||||
String var6 = I18n.getString("gui.cancel");
|
||||
String var3 = StatCollector.translateToLocal("selectWorld.deleteQuestion");
|
||||
String var4 = "\'" + par1Str + "\' " + StatCollector.translateToLocal("selectWorld.deleteWarning");
|
||||
String var5 = StatCollector.translateToLocal("selectWorld.deleteButton");
|
||||
String var6 = StatCollector.translateToLocal("gui.cancel");
|
||||
GuiYesNo var7 = new GuiYesNo(par0GuiScreen, var3, var4, var5, var6, par2);
|
||||
return var7;
|
||||
}
|
||||
|
||||
@@ -28,25 +28,25 @@ public class GuiShareToLan extends GuiScreen
|
||||
public void initGui()
|
||||
{
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("lanServer.start")));
|
||||
this.buttonList.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel")));
|
||||
this.buttonList.add(this.buttonGameMode = new GuiButton(104, this.width / 2 - 155, 100, 150, 20, I18n.getString("selectWorld.gameMode")));
|
||||
this.buttonList.add(this.buttonAllowCommandsToggle = new GuiButton(103, this.width / 2 + 5, 100, 150, 20, I18n.getString("selectWorld.allowCommands")));
|
||||
this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 150, 20, StatCollector.translateToLocal("lanServer.start")));
|
||||
this.buttonList.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 150, 20, StatCollector.translateToLocal("gui.cancel")));
|
||||
this.buttonList.add(this.buttonGameMode = new GuiButton(104, this.width / 2 - 155, 100, 150, 20, StatCollector.translateToLocal("selectWorld.gameMode")));
|
||||
this.buttonList.add(this.buttonAllowCommandsToggle = new GuiButton(103, this.width / 2 + 5, 100, 150, 20, StatCollector.translateToLocal("selectWorld.allowCommands")));
|
||||
this.func_74088_g();
|
||||
}
|
||||
|
||||
private void func_74088_g()
|
||||
{
|
||||
this.buttonGameMode.displayString = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.gameMode);
|
||||
this.buttonAllowCommandsToggle.displayString = I18n.getString("selectWorld.allowCommands") + " ";
|
||||
this.buttonGameMode.displayString = StatCollector.translateToLocal("selectWorld.gameMode") + " " + StatCollector.translateToLocal("selectWorld.gameMode." + this.gameMode);
|
||||
this.buttonAllowCommandsToggle.displayString = StatCollector.translateToLocal("selectWorld.allowCommands") + " ";
|
||||
|
||||
if (this.allowCommands)
|
||||
{
|
||||
this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + I18n.getString("options.on");
|
||||
this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + StatCollector.translateToLocal("options.on");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + I18n.getString("options.off");
|
||||
this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + StatCollector.translateToLocal("options.off");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ public class GuiShareToLan extends GuiScreen
|
||||
public void drawScreen(int par1, int par2, float par3)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("lanServer.title"), this.width / 2, 50, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("lanServer.otherPlayers"), this.width / 2, 82, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("lanServer.title"), this.width / 2, 50, 16777215);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("lanServer.otherPlayers"), this.width / 2, 82, 16777215);
|
||||
super.drawScreen(par1, par2, par3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ public class GuiSleepMP extends GuiChat
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height - 40, I18n.getString("multiplayer.stopSleeping")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height - 40, StatCollector.translateToLocal("multiplayer.stopSleeping")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,83 +1,71 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import net.lax1dude.eaglercraft.adapter.Tessellator;
|
||||
|
||||
class GuiSlotLanguage extends GuiSlot
|
||||
{
|
||||
private final List field_77251_g;
|
||||
private final Map field_77253_h;
|
||||
class GuiSlotLanguage extends GuiSlot {
|
||||
private ArrayList field_77251_g;
|
||||
private TreeMap field_77253_h;
|
||||
|
||||
final GuiLanguage languageGui;
|
||||
|
||||
public GuiSlotLanguage(GuiLanguage par1GuiLanguage)
|
||||
{
|
||||
public GuiSlotLanguage(GuiLanguage par1GuiLanguage) {
|
||||
super(par1GuiLanguage.mc, par1GuiLanguage.width, par1GuiLanguage.height, 32, par1GuiLanguage.height - 65 + 4, 18);
|
||||
this.languageGui = par1GuiLanguage;
|
||||
this.field_77251_g = Lists.newArrayList();
|
||||
this.field_77253_h = Maps.newHashMap();
|
||||
Iterator var2 = GuiLanguage.func_135011_a(par1GuiLanguage).getLanguages().iterator();
|
||||
this.field_77253_h = StringTranslate.getInstance().getLanguageList();
|
||||
this.field_77251_g = new ArrayList();
|
||||
Iterator var2 = this.field_77253_h.keySet().iterator();
|
||||
|
||||
while (var2.hasNext())
|
||||
{
|
||||
Language var3 = (Language)var2.next();
|
||||
this.field_77253_h.put(var3.getLanguageCode(), var3);
|
||||
this.field_77251_g.add(var3.getLanguageCode());
|
||||
while (var2.hasNext()) {
|
||||
String var3 = (String) var2.next();
|
||||
this.field_77251_g.add(var3);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the size of the current slot list.
|
||||
*/
|
||||
protected int getSize()
|
||||
{
|
||||
protected int getSize() {
|
||||
return this.field_77251_g.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* the element in the slot that was clicked, boolean for wether it was double clicked or not
|
||||
* the element in the slot that was clicked, boolean for wether it was double
|
||||
* clicked or not
|
||||
*/
|
||||
protected void elementClicked(int par1, boolean par2)
|
||||
{
|
||||
Language var3 = (Language)this.field_77253_h.get(this.field_77251_g.get(par1));
|
||||
GuiLanguage.func_135011_a(this.languageGui).setCurrentLanguage(var3);
|
||||
GuiLanguage.getGameSettings(this.languageGui).language = var3.getLanguageCode();
|
||||
//this.languageGui.mc.refreshResources(); // FIX THIS SHIT
|
||||
this.languageGui.fontRenderer.setUnicodeFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLocaleUnicode());
|
||||
this.languageGui.fontRenderer.setBidiFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLanguageBidirectional());
|
||||
GuiLanguage.getDoneButton(this.languageGui).displayString = I18n.getString("gui.done");
|
||||
protected void elementClicked(int par1, boolean par2) {
|
||||
StringTranslate.getInstance().setLanguage((String) this.field_77251_g.get(par1), false);
|
||||
this.languageGui.mc.fontRenderer.setUnicodeFlag(StringTranslate.getInstance().isUnicode());
|
||||
GuiLanguage.getGameSettings(this.languageGui).language = (String) this.field_77251_g.get(par1);
|
||||
this.languageGui.fontRenderer.setBidiFlag(StringTranslate.isBidirectional(GuiLanguage.getGameSettings(this.languageGui).language));
|
||||
GuiLanguage.getDoneButton(this.languageGui).displayString = StringTranslate.getInstance().translateKey("gui.done");
|
||||
GuiLanguage.getGameSettings(this.languageGui).saveOptions();
|
||||
}
|
||||
|
||||
/**
|
||||
* returns true if the element passed in is currently selected
|
||||
*/
|
||||
protected boolean isSelected(int par1)
|
||||
{
|
||||
return ((String)this.field_77251_g.get(par1)).equals(GuiLanguage.func_135011_a(this.languageGui).getCurrentLanguage().getLanguageCode());
|
||||
protected boolean isSelected(int par1) {
|
||||
return ((String) this.field_77251_g.get(par1)).equals(StringTranslate.getInstance().getCurrentLanguage());
|
||||
}
|
||||
|
||||
/**
|
||||
* return the height of the content being scrolled
|
||||
*/
|
||||
protected int getContentHeight()
|
||||
{
|
||||
protected int getContentHeight() {
|
||||
return this.getSize() * 18;
|
||||
}
|
||||
|
||||
protected void drawBackground()
|
||||
{
|
||||
protected void drawBackground() {
|
||||
this.languageGui.drawDefaultBackground();
|
||||
}
|
||||
|
||||
protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator)
|
||||
{
|
||||
protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) {
|
||||
this.languageGui.fontRenderer.setBidiFlag(true);
|
||||
this.languageGui.drawCenteredString(this.languageGui.fontRenderer, ((Language)this.field_77253_h.get(this.field_77251_g.get(par1))).toString(), this.languageGui.width / 2, par3 + 1, 16777215);
|
||||
this.languageGui.fontRenderer.setBidiFlag(GuiLanguage.func_135011_a(this.languageGui).getCurrentLanguage().isBidirectional());
|
||||
this.languageGui.drawCenteredString(this.languageGui.fontRenderer, (String) this.field_77253_h.get(this.field_77251_g.get(par1)), this.languageGui.width / 2, par3 + 1, 16777215);
|
||||
this.languageGui.fontRenderer.setBidiFlag(StringTranslate.isBidirectional(GuiLanguage.getGameSettings(this.languageGui).language));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,12 +93,12 @@ class GuiSlotServer extends GuiSlot
|
||||
private void func_77248_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator)
|
||||
{
|
||||
LanServer var6 = (LanServer)GuiMultiplayer.getListOfLanServers(this.parentGui).get(par1 - GuiMultiplayer.getInternetServerList(this.parentGui).countServers());
|
||||
this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("lanServer.title"), par2 + 2, par3 + 1, 16777215);
|
||||
this.parentGui.drawString(this.parentGui.fontRenderer, StatCollector.translateToLocal("lanServer.title"), par2 + 2, par3 + 1, 16777215);
|
||||
this.parentGui.drawString(this.parentGui.fontRenderer, var6.getServerMotd(), par2 + 2, par3 + 12, 8421504);
|
||||
|
||||
if (this.parentGui.mc.gameSettings.hideServerAddress)
|
||||
{
|
||||
this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("selectServer.hiddenAddress"), par2 + 2, par3 + 12 + 11, 3158064);
|
||||
this.parentGui.drawString(this.parentGui.fontRenderer, StatCollector.translateToLocal("selectServer.hiddenAddress"), par2 + 2, par3 + 12 + 11, 3158064);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -108,7 +108,7 @@ class GuiSlotServer extends GuiSlot
|
||||
|
||||
private void func_77249_c(int par1, int par2, int par3, int par4, Tessellator par5Tessellator)
|
||||
{
|
||||
this.parentGui.drawCenteredString(this.parentGui.fontRenderer, I18n.getString("lanServer.scanning"), this.parentGui.width / 2, par3 + 1, 16777215);
|
||||
this.parentGui.drawCenteredString(this.parentGui.fontRenderer, StatCollector.translateToLocal("lanServer.scanning"), this.parentGui.width / 2, par3 + 1, 16777215);
|
||||
String var6;
|
||||
|
||||
switch (GuiMultiplayer.getTicksOpened(this.parentGui) / 3 % 4)
|
||||
|
||||
@@ -196,7 +196,7 @@ abstract class GuiSlotStats extends GuiSlot
|
||||
var9 = this.func_77258_c(2);
|
||||
}
|
||||
|
||||
var9 = ("" + I18n.getString(var9)).trim();
|
||||
var9 = ("" + StatCollector.translateToLocal(var9)).trim();
|
||||
|
||||
if (var9.length() > 0)
|
||||
{
|
||||
@@ -215,7 +215,7 @@ abstract class GuiSlotStats extends GuiSlot
|
||||
if (par1StatCrafting != null)
|
||||
{
|
||||
Item var4 = Item.itemsList[par1StatCrafting.getItemID()];
|
||||
String var5 = ("" + I18n.getString(var4.getUnlocalizedName() + ".name")).trim();
|
||||
String var5 = ("" + StatCollector.translateToLocal(var4.getUnlocalizedName() + ".name")).trim();
|
||||
|
||||
if (var5.length() > 0)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ class GuiSlotStatsGeneral extends GuiSlot
|
||||
protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator)
|
||||
{
|
||||
StatBase var6 = (StatBase)StatList.generalStats.get(par1);
|
||||
this.statsGui.drawString(GuiStats.getFontRenderer1(this.statsGui), I18n.getString(var6.getName()), par2 + 2, par3 + 1, par1 % 2 == 0 ? 16777215 : 9474192);
|
||||
this.statsGui.drawString(GuiStats.getFontRenderer1(this.statsGui), StatCollector.translateToLocal(var6.getName()), par2 + 2, par3 + 1, par1 % 2 == 0 ? 16777215 : 9474192);
|
||||
String var7 = var6.func_75968_a(GuiStats.getStatsFileWriter(this.statsGui).writeStat(var6));
|
||||
this.statsGui.drawString(GuiStats.getFontRenderer2(this.statsGui), var7, par2 + 2 + 213 - GuiStats.getFontRenderer3(this.statsGui).getStringWidth(var7), par3 + 1, par1 % 2 == 0 ? 16777215 : 9474192);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class GuiStats extends GuiScreen
|
||||
*/
|
||||
public void initGui()
|
||||
{
|
||||
this.statsTitle = I18n.getString("gui.stats");
|
||||
this.statsTitle = StatCollector.translateToLocal("gui.stats");
|
||||
this.slotGeneral = new GuiSlotStatsGeneral(this);
|
||||
this.slotGeneral.registerScrollButtons(1, 1);
|
||||
this.slotItem = new GuiSlotStatsItem(this);
|
||||
@@ -52,12 +52,12 @@ public class GuiStats extends GuiScreen
|
||||
*/
|
||||
public void addHeaderButtons()
|
||||
{
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 + 4, this.height - 28, 150, 20, I18n.getString("gui.done")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("stat.generalButton")));
|
||||
this.buttonList.add(new GuiButton(0, this.width / 2 + 4, this.height - 28, 150, 20, StatCollector.translateToLocal("gui.done")));
|
||||
this.buttonList.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, StatCollector.translateToLocal("stat.generalButton")));
|
||||
GuiButton var1;
|
||||
this.buttonList.add(var1 = new GuiButton(2, this.width / 2 - 46, this.height - 52, 100, 20, I18n.getString("stat.blocksButton")));
|
||||
this.buttonList.add(var1 = new GuiButton(2, this.width / 2 - 46, this.height - 52, 100, 20, StatCollector.translateToLocal("stat.blocksButton")));
|
||||
GuiButton var2;
|
||||
this.buttonList.add(var2 = new GuiButton(3, this.width / 2 + 62, this.height - 52, 100, 20, I18n.getString("stat.itemsButton")));
|
||||
this.buttonList.add(var2 = new GuiButton(3, this.width / 2 + 62, this.height - 52, 100, 20, StatCollector.translateToLocal("stat.itemsButton")));
|
||||
|
||||
if (this.slotBlock.getSize() == 0)
|
||||
{
|
||||
|
||||
@@ -29,9 +29,9 @@ public class GuiVideoSettings extends GuiScreen
|
||||
*/
|
||||
public void initGui()
|
||||
{
|
||||
this.screenTitle = I18n.getString("options.videoTitle");
|
||||
this.screenTitle = StatCollector.translateToLocal("options.videoTitle");
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done")));
|
||||
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, StatCollector.translateToLocal("gui.done")));
|
||||
this.is64bit = false;
|
||||
String[] var1 = new String[] {"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"};
|
||||
String[] var2 = var1;
|
||||
@@ -112,8 +112,8 @@ public class GuiVideoSettings extends GuiScreen
|
||||
|
||||
if (!this.is64bit && this.guiGameSettings.renderDistance == 0)
|
||||
{
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("options.farWarning1"), this.width / 2, this.height / 6 + 144 + 1, 11468800);
|
||||
this.drawCenteredString(this.fontRenderer, I18n.getString("options.farWarning2"), this.width / 2, this.height / 6 + 144 + 13, 11468800);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("options.farWarning1"), this.width / 2, this.height / 6 + 144 + 1, 11468800);
|
||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("options.farWarning2"), this.width / 2, this.height / 6 + 144 + 13, 11468800);
|
||||
}
|
||||
|
||||
super.drawScreen(par1, par2, par3);
|
||||
|
||||
@@ -85,12 +85,12 @@ class GuiWorldSlot extends GuiSlot
|
||||
|
||||
if (var6.isHardcoreModeEnabled())
|
||||
{
|
||||
var9 = EnumChatFormatting.DARK_RED + I18n.getString("gameMode.hardcore") + EnumChatFormatting.RESET;
|
||||
var9 = EnumChatFormatting.DARK_RED + StatCollector.translateToLocal("gameMode.hardcore") + EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
if (var6.getCheatsEnabled())
|
||||
{
|
||||
var9 = var9 + ", " + I18n.getString("selectWorld.cheats");
|
||||
var9 = var9 + ", " + StatCollector.translateToLocal("selectWorld.cheats");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ public class GuiYesNo extends GuiScreen
|
||||
this.message1 = par2Str;
|
||||
this.message2 = par3Str;
|
||||
this.worldNumber = par4;
|
||||
this.buttonText1 = I18n.getString("gui.yes");
|
||||
this.buttonText2 = I18n.getString("gui.no");
|
||||
this.buttonText1 = StatCollector.translateToLocal("gui.yes");
|
||||
this.buttonText2 = StatCollector.translateToLocal("gui.no");
|
||||
}
|
||||
|
||||
public GuiYesNo(GuiScreen par1GuiScreen, String par2Str, String par3Str, String par4Str, String par5Str, int par6)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
public class I18n
|
||||
{
|
||||
private static Locale i18nLocale;
|
||||
|
||||
static void setLocale(Locale par0Locale)
|
||||
{
|
||||
i18nLocale = par0Locale;
|
||||
}
|
||||
|
||||
public static String getString(String par0Str)
|
||||
{
|
||||
return i18nLocale.translateKey(par0Str);
|
||||
}
|
||||
|
||||
public static String getStringParams(String par0Str, Object ... par1ArrayOfObj)
|
||||
{
|
||||
return i18nLocale.formatMessage(par0Str, par1ArrayOfObj);
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public abstract class InventoryEffectRenderer extends GuiContainer
|
||||
this.drawTexturedModalRect(var1 + 6, var2 + 7, 0 + var9 % 8 * 18, 198 + var9 / 8 * 18, 18, 18);
|
||||
}
|
||||
|
||||
String var11 = I18n.getString(var8.getName());
|
||||
String var11 = StatCollector.translateToLocal(var8.getName());
|
||||
|
||||
if (var7.getAmplifier() == 1)
|
||||
{
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.SortedSet;
|
||||
|
||||
public class LanguageManager implements ResourceManagerReloadListener
|
||||
{
|
||||
private final MetadataSerializer field_135047_b;
|
||||
private String currentLanguage;
|
||||
protected static final Locale currentLocale = new Locale();
|
||||
private Map languageMap = Maps.newHashMap();
|
||||
|
||||
public LanguageManager(MetadataSerializer par1MetadataSerializer, String par2Str)
|
||||
{
|
||||
this.field_135047_b = par1MetadataSerializer;
|
||||
this.currentLanguage = par2Str;
|
||||
I18n.setLocale(currentLocale);
|
||||
}
|
||||
|
||||
public void parseLanguageMetadata(List par1List)
|
||||
{
|
||||
this.languageMap.clear();
|
||||
Iterator var2 = par1List.iterator();
|
||||
|
||||
while (var2.hasNext())
|
||||
{
|
||||
ResourcePack var3 = (ResourcePack)var2.next();
|
||||
|
||||
try
|
||||
{
|
||||
LanguageMetadataSection var4 = (LanguageMetadataSection)var3.getPackMetadata(this.field_135047_b, "language");
|
||||
|
||||
if (var4 != null)
|
||||
{
|
||||
Iterator var5 = var4.getLanguages().iterator();
|
||||
|
||||
while (var5.hasNext())
|
||||
{
|
||||
Language var6 = (Language)var5.next();
|
||||
|
||||
if (!this.languageMap.containsKey(var6.getLanguageCode()))
|
||||
{
|
||||
this.languageMap.put(var6.getLanguageCode(), var6);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (RuntimeException var7)
|
||||
{
|
||||
Minecraft.getMinecraft().getLogAgent().logWarningException("Unable to parse metadata section of resourcepack: " + var3.getPackName(), var7);
|
||||
}
|
||||
catch (IOException var8)
|
||||
{
|
||||
Minecraft.getMinecraft().getLogAgent().logWarningException("Unable to parse metadata section of resourcepack: " + var3.getPackName(), var8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onResourceManagerReload(ResourceManager par1ResourceManager)
|
||||
{
|
||||
ArrayList var2 = Lists.newArrayList(new String[] {"en_US"});
|
||||
|
||||
if (!"en_US".equals(this.currentLanguage))
|
||||
{
|
||||
var2.add(this.currentLanguage);
|
||||
}
|
||||
|
||||
currentLocale.loadLocaleDataFiles(par1ResourceManager, var2);
|
||||
//StringTranslate.func_135063_a(currentLocale.field_135032_a);
|
||||
}
|
||||
|
||||
public boolean isCurrentLocaleUnicode()
|
||||
{
|
||||
return currentLocale.isUnicode();
|
||||
}
|
||||
|
||||
public boolean isCurrentLanguageBidirectional()
|
||||
{
|
||||
return this.getCurrentLanguage().isBidirectional();
|
||||
}
|
||||
|
||||
public void setCurrentLanguage(Language par1Language)
|
||||
{
|
||||
this.currentLanguage = par1Language.getLanguageCode();
|
||||
}
|
||||
|
||||
public Language getCurrentLanguage()
|
||||
{
|
||||
return this.languageMap.containsKey(this.currentLanguage) ? (Language)this.languageMap.get(this.currentLanguage) : (Language)this.languageMap.get("en_US");
|
||||
}
|
||||
|
||||
public SortedSet getLanguages()
|
||||
{
|
||||
return Sets.newTreeSet(this.languageMap.values());
|
||||
}
|
||||
}
|
||||
@@ -1,152 +0,0 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Maps;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.IllegalFormatException;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.lax1dude.eaglercraft.TextureLocation;
|
||||
import org.apache.commons.io.Charsets;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
public class Locale
|
||||
{
|
||||
/** Splits on "=" */
|
||||
private static final Splitter splitter = Splitter.on('=').limit(2);
|
||||
private static final Pattern field_135031_c = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]");
|
||||
Map field_135032_a = Maps.newHashMap();
|
||||
private boolean field_135029_d;
|
||||
|
||||
/**
|
||||
* par2 is a list of languages. For each language $L and domain $D, attempts to load the resource $D:lang/$L.lang
|
||||
*/
|
||||
public synchronized void loadLocaleDataFiles(ResourceManager par1ResourceManager, List par2List)
|
||||
{
|
||||
this.field_135032_a.clear();
|
||||
Iterator var3 = par2List.iterator();
|
||||
|
||||
while (var3.hasNext())
|
||||
{
|
||||
String var4 = (String)var3.next();
|
||||
String var5 = String.format("lang/%s.lang", new Object[] {var4});
|
||||
Iterator var6 = par1ResourceManager.getResourceDomains().iterator();
|
||||
|
||||
while (var6.hasNext())
|
||||
{
|
||||
String var7 = (String)var6.next();
|
||||
|
||||
try
|
||||
{
|
||||
this.loadLocaleData(par1ResourceManager.getAllResources(new TextureLocation(var7 + var5)));
|
||||
}
|
||||
catch (IOException var9)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.checkUnicode();
|
||||
}
|
||||
|
||||
public boolean isUnicode()
|
||||
{
|
||||
return this.field_135029_d;
|
||||
}
|
||||
|
||||
private void checkUnicode()
|
||||
{
|
||||
this.field_135029_d = false;
|
||||
Iterator var1 = this.field_135032_a.values().iterator();
|
||||
|
||||
while (var1.hasNext())
|
||||
{
|
||||
String var2 = (String)var1.next();
|
||||
|
||||
for (int var3 = 0; var3 < var2.length(); ++var3)
|
||||
{
|
||||
if (var2.charAt(var3) >= 256)
|
||||
{
|
||||
this.field_135029_d = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* par1 is a list of Resources
|
||||
*/
|
||||
private void loadLocaleData(List par1List) throws IOException
|
||||
{
|
||||
Iterator var2 = par1List.iterator();
|
||||
|
||||
while (var2.hasNext())
|
||||
{
|
||||
Resource var3 = (Resource)var2.next();
|
||||
this.loadLocaleData(var3.getInputStream());
|
||||
}
|
||||
}
|
||||
|
||||
private void loadLocaleData(InputStream par1InputStream) throws IOException
|
||||
{
|
||||
Iterator var2 = IOUtils.readLines(par1InputStream, Charsets.UTF_8).iterator();
|
||||
|
||||
while (var2.hasNext())
|
||||
{
|
||||
String var3 = (String)var2.next();
|
||||
|
||||
if (!var3.isEmpty() && var3.charAt(0) != 35)
|
||||
{
|
||||
String[] var4 = (String[])Iterables.toArray(splitter.split(var3), String.class);
|
||||
|
||||
if (var4 != null && var4.length == 2)
|
||||
{
|
||||
String var5 = var4[0];
|
||||
String var6 = field_135031_c.matcher(var4[1]).replaceAll("%$1s");
|
||||
this.field_135032_a.put(var5, var6);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the translation, or the key itself if the key could not be translated.
|
||||
*/
|
||||
private String translateKeyPrivate(String par1Str)
|
||||
{
|
||||
String var2 = (String)this.field_135032_a.get(par1Str);
|
||||
return var2 == null ? par1Str : var2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the translation, or the key itself if the key could not be translated.
|
||||
*/
|
||||
public String translateKey(String par1Str)
|
||||
{
|
||||
return this.translateKeyPrivate(par1Str);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls String.format(translateKey(key), params)
|
||||
*/
|
||||
public String formatMessage(String par1Str, Object[] par2ArrayOfObj)
|
||||
{
|
||||
String var3 = this.translateKeyPrivate(par1Str);
|
||||
|
||||
try
|
||||
{
|
||||
return String.format(var3, par2ArrayOfObj);
|
||||
}
|
||||
catch (IllegalFormatException var5)
|
||||
{
|
||||
return "Format error: " + var3;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,8 +36,6 @@ public class Minecraft
|
||||
/** The RenderEngine instance used by Minecraft */
|
||||
public RenderEngine renderEngine;
|
||||
|
||||
private final ILogAgent mcLogAgent;
|
||||
|
||||
/**
|
||||
* Set to 'this' in Minecraft constructor; used by some settings get methods
|
||||
*/
|
||||
@@ -154,7 +152,6 @@ public class Minecraft
|
||||
private List defaultResourcePacks = Lists.newArrayList();
|
||||
private DefaultResourcePack mcDefaultResourcePack;
|
||||
private ResourcePackRepository mcResourcePackRepository;
|
||||
private LanguageManager mcLanguageManager;
|
||||
|
||||
/**
|
||||
* Set to true to keep the game loop running. Set to false by shutdown() to allow the game loop to exit cleanly.
|
||||
@@ -191,7 +188,6 @@ public class Minecraft
|
||||
|
||||
public Minecraft()
|
||||
{
|
||||
this.mcLogAgent = new LogAgent("Eagler-Client", " [CLIENT]", "client-log.txt");
|
||||
this.tempDisplayHeight = 480;
|
||||
this.fullscreen = false;
|
||||
Packet3Chat.maxChatLength = 32767;
|
||||
@@ -2147,7 +2143,7 @@ public class Minecraft
|
||||
|
||||
public ILogAgent getLogAgent()
|
||||
{
|
||||
return this.mcLogAgent;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Session getSession()
|
||||
@@ -2170,18 +2166,8 @@ public class Minecraft
|
||||
return this.mcResourcePackRepository;
|
||||
}
|
||||
|
||||
public LanguageManager getLanguageManager()
|
||||
{
|
||||
return this.mcLanguageManager;
|
||||
}
|
||||
|
||||
static String getLaunchedVersion(Minecraft par0Minecraft)
|
||||
{
|
||||
return "1.6.4";
|
||||
}
|
||||
|
||||
static LanguageManager func_142024_b(Minecraft par0Minecraft)
|
||||
{
|
||||
return par0Minecraft.mcLanguageManager;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -791,7 +791,7 @@ public class NetClientHandler extends NetHandler
|
||||
if (var4)
|
||||
{
|
||||
GameSettings var5 = this.mc.gameSettings;
|
||||
this.mc.ingameGUI.func_110326_a(I18n.getStringParams("mount.onboard", new Object[] {GameSettings.getKeyDisplayString(var5.keyBindSneak.keyCode)}), false);
|
||||
this.mc.ingameGUI.func_110326_a(StatCollector.translateToLocalFormatted("mount.onboard", new Object[] {GameSettings.getKeyDisplayString(var5.keyBindSneak.keyCode)}), false);
|
||||
}
|
||||
}
|
||||
else if (par1Packet39AttachEntity.attachState == 1 && var2 != null && var2 instanceof EntityLiving)
|
||||
|
||||
@@ -27,8 +27,8 @@ public class ScreenChatOptions extends GuiScreen
|
||||
public void initGui()
|
||||
{
|
||||
int var1 = 0;
|
||||
this.theChatOptions = I18n.getString("options.chat.title");
|
||||
this.field_82268_n = I18n.getString("options.multiplayer.title");
|
||||
this.theChatOptions = StatCollector.translateToLocal("options.chat.title");
|
||||
this.field_82268_n = StatCollector.translateToLocal("options.multiplayer.title");
|
||||
EnumOptions[] var2 = allScreenChatOptions;
|
||||
int var3 = var2.length;
|
||||
int var4;
|
||||
@@ -76,7 +76,7 @@ public class ScreenChatOptions extends GuiScreen
|
||||
++var1;
|
||||
}
|
||||
|
||||
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done")));
|
||||
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, StatCollector.translateToLocal("gui.done")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user