/// <summary> /// Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). /// </summary> protected override void ActionPerformed(GuiButton par1GuiButton) { if (!par1GuiButton.Enabled) { return; } if (par1GuiButton.Id == 2) { string s = ServerList[SelectedServer].Name; if (s != null) { DeleteClicked = true; StringTranslate stringtranslate = StringTranslate.GetInstance(); string s1 = stringtranslate.TranslateKey("selectServer.deleteQuestion"); string s2 = new StringBuilder().Append("'").Append(s).Append("' ").Append(stringtranslate.TranslateKey("selectServer.deleteWarning")).ToString(); string s3 = stringtranslate.TranslateKey("selectServer.deleteButton"); string s4 = stringtranslate.TranslateKey("gui.cancel"); GuiYesNo guiyesno = new GuiYesNo(this, s1, s2, s3, s4, SelectedServer); Mc.DisplayGuiScreen(guiyesno); } } else if (par1GuiButton.Id == 1) { JoinServer(SelectedServer); } else if (par1GuiButton.Id == 4) { DirectClicked = true; Mc.DisplayGuiScreen(new GuiScreenServerList(this, TempServer = new ServerNBTStorage(StatCollector.TranslateToLocal("selectServer.defaultName"), ""))); } else if (par1GuiButton.Id == 3) { AddClicked = true; Mc.DisplayGuiScreen(new GuiScreenAddServer(this, TempServer = new ServerNBTStorage(StatCollector.TranslateToLocal("selectServer.defaultName"), ""))); } else if (par1GuiButton.Id == 7) { EditClicked = true; ServerNBTStorage servernbtstorage = (ServerNBTStorage)ServerList[SelectedServer]; Mc.DisplayGuiScreen(new GuiScreenAddServer(this, TempServer = new ServerNBTStorage(servernbtstorage.Name, servernbtstorage.Host))); } else if (par1GuiButton.Id == 0) { Mc.DisplayGuiScreen(ParentScreen); } else if (par1GuiButton.Id == 8) { Mc.DisplayGuiScreen(new GuiMultiplayer(ParentScreen)); } else { ServerSlotContainer.ActionPerformed(par1GuiButton); } }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); ScreenTitle = stringtranslate.TranslateKey("options.videoTitle"); int i = 0; object[] aobj = VideoOptions; int j = aobj.Length; for (int k = 0; k < j; k++) { Options enumoptions = (Options)aobj[k]; if (!enumoptions.Float) { ControlList.Add(new GuiSmallButton(enumoptions.Ordinal(), (Width / 2 - 155) + (i % 2) * 160, Height / 6 + 24 * (i >> 1), enumoptions, GuiGameSettings.GetKeyBinding(enumoptions))); } else { ControlList.Add(new GuiSlider(enumoptions.Ordinal(), (Width / 2 - 155) + (i % 2) * 160, Height / 6 + 24 * (i >> 1), enumoptions, GuiGameSettings.GetKeyBinding(enumoptions), GuiGameSettings.GetOptionFloatValue(enumoptions))); } i++; } ControlList.Add(new GuiButton(200, Width / 2 - 100, Height / 6 + 168, stringtranslate.TranslateKey("gui.done"))); Is64bit = false; Is64bit = Environment.Is64BitProcess; /* * aobj = (new string[] { "sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch" }); * string[] @as = ((string [])(aobj)); * int l = @as.Length; * int i1 = 0; * * do * { * if (i1 >= l) * { * break; * } * * string s = @as[i1]; * string s1 = System.getProperty(s); * * if (s1 != null && s1.IndexOf("64") >= 0) * { * Is64bit = true; * break; * } * * i1++; * } * while (true);*/ }
/// <summary> /// Draws the screen and all the components in it. /// </summary> public override void DrawScreen(int par1, int par2, float par3) { StringTranslate stringtranslate = StringTranslate.GetInstance(); DrawDefaultBackground(); DrawCenteredString(FontRenderer, stringtranslate.TranslateKey("selectWorld.renameTitle"), Width / 2, (Height / 4 - 60) + 20, 0xffffff); DrawString(FontRenderer, stringtranslate.TranslateKey("selectWorld.enterName"), Width / 2 - 100, 47, 0xa0a0a0); TheGuiTextField.DrawTextBox(); base.DrawScreen(par1, par2, par3); }
/// <summary> /// Draws the screen and all the components in it. /// </summary> public override void DrawScreen(int par1, int par2, float par3) { StringTranslate stringtranslate = StringTranslate.GetInstance(); DrawDefaultBackground(); DrawCenteredString(FontRenderer, stringtranslate.TranslateKey("selectServer.direct"), Width / 2, (Height / 4 - 60) + 20, 0xffffff); DrawString(FontRenderer, stringtranslate.TranslateKey("addServer.enterIp"), Width / 2 - 100, 100, 0xa0a0a0); ServerTextField.DrawTextBox(); base.DrawScreen(par1, par2, par3); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); ControlList.Add(new GuiSmallButton(5, Width / 2 - 154, Height - 48, stringtranslate.TranslateKey("texturePack.openFolder"))); ControlList.Add(new GuiSmallButton(6, Width / 2 + 4, Height - 48, stringtranslate.TranslateKey("gui.done"))); Mc.TexturePackList.UpdateAvaliableTexturePacks(); FileLocation = (System.IO.Path.Combine(Minecraft.GetMinecraftDir(), "Texturepacks")); GuiTexturePackSlot = new GuiTexturePackSlot(this); GuiTexturePackSlot.RegisterScrollButtons(ControlList, 7, 8); }
/// <summary> /// intilize the buttons for this GUI /// </summary> public virtual void InitButtons() { StringTranslate stringtranslate = StringTranslate.GetInstance(); ControlList.Add(ButtonSelect = new GuiButton(1, Width / 2 - 154, Height - 52, 150, 20, stringtranslate.TranslateKey("selectWorld.select"))); ControlList.Add(ButtonDelete = new GuiButton(6, Width / 2 - 154, Height - 28, 70, 20, stringtranslate.TranslateKey("selectWorld.rename"))); ControlList.Add(ButtonRename = new GuiButton(2, Width / 2 - 74, Height - 28, 70, 20, stringtranslate.TranslateKey("selectWorld.delete"))); ControlList.Add(new GuiButton(3, Width / 2 + 4, Height - 52, 150, 20, stringtranslate.TranslateKey("selectWorld.create"))); ControlList.Add(new GuiButton(0, Width / 2 + 4, Height - 28, 150, 20, stringtranslate.TranslateKey("gui.cancel"))); ButtonSelect.Enabled = false; ButtonRename.Enabled = false; ButtonDelete.Enabled = false; }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); int i = Func_20080_j(); for (int j = 0; j < Options.KeyBindings.Length; j++) { ControlList.Add(new GuiSmallButton(j, i + (j % 2) * 160, Height / 6 + 24 * (j >> 1), 70, 20, Options.GetOptionDisplayString(j))); } ControlList.Add(new GuiButton(200, Width / 2 - 100, Height / 6 + 168, stringtranslate.TranslateKey("gui.done"))); ScreenTitle = stringtranslate.TranslateKey("controls.title"); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); ScreenTitle = stringtranslate.TranslateKey("selectWorld.title"); LocalizedWorldText = stringtranslate.TranslateKey("selectWorld.world"); LocalizedMustConvertText = stringtranslate.TranslateKey("selectWorld.conversion"); LocalizedGameModeText[0] = stringtranslate.TranslateKey("gameMode.survival"); LocalizedGameModeText[1] = stringtranslate.TranslateKey("gameMode.creative"); LoadSaves(); WorldSlotContainer = new GuiWorldSlot(this); WorldSlotContainer.RegisterScrollButtons(ControlList, 4, 5); InitButtons(); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); //Keyboard.EnableRepeatEvents(true); ControlList.Clear(); ControlList.Add(new GuiButton(0, Width / 2 - 100, Height / 4 + 96 + 12, stringtranslate.TranslateKey("selectServer.select"))); ControlList.Add(new GuiButton(1, Width / 2 - 100, Height / 4 + 120 + 12, stringtranslate.TranslateKey("gui.cancel"))); ServerTextField = new GuiTextField(FontRenderer, Width / 2 - 100, 116, 200, 20); ServerTextField.SetMaxStringLength(128); ServerTextField.setFocused(true); ServerTextField.SetText(Field_52009_d); ControlList[0].Enabled = ServerTextField.GetText().Length > 0 && StringHelperClass.StringSplit(ServerTextField.GetText(), ":", true).Length > 0; }
public GuiDisconnected(string par1Str, string par2Str, object[] par3ArrayOfObj) { StringTranslate stringtranslate = StringTranslate.GetInstance(); ErrorMessage = stringtranslate.TranslateKey(par1Str); if (par3ArrayOfObj != null) { ErrorDetail = stringtranslate.TranslateKeyFormat(par2Str, par3ArrayOfObj); } else { ErrorDetail = stringtranslate.TranslateKey(par2Str); } }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { ViewportTexture = Mc.RenderEngine.AllocateTexture(Mc.RenderEngine.GenerateNewTexture(256, 256)); DateTime calendar = new DateTime(); calendar = DateTime.Now; if (calendar.Month + 1 == 11 && calendar.Day == 9) { SplashText = "Happy birthday, ez!"; } else if (calendar.Month + 1 == 6 && calendar.Day == 1) { SplashText = "Happy birthday, Notch!"; } else if (calendar.Month + 1 == 12 && calendar.Day == 24) { SplashText = "Merry X-mas!"; } else if (calendar.Month + 1 == 1 && calendar.Day == 1) { SplashText = "Happy new year!"; } StringTranslate stringtranslate = StringTranslate.GetInstance(); int i = Height / 4 + 48; ControlList.Add(new GuiButton(1, Width / 2 - 100, i, stringtranslate.TranslateKey("menu.singleplayer"))); ControlList.Add(MultiplayerButton = new GuiButton(2, Width / 2 - 100, i + 24, stringtranslate.TranslateKey("menu.multiplayer"))); ControlList.Add(new GuiButton(3, Width / 2 - 100, i + 48, stringtranslate.TranslateKey("menu.mods"))); if (Mc.HideQuitButton) { ControlList.Add(new GuiButton(0, Width / 2 - 100, i + 72, stringtranslate.TranslateKey("menu.options"))); } else { ControlList.Add(new GuiButton(0, Width / 2 - 100, i + 72 + 12, 98, 20, stringtranslate.TranslateKey("menu.options"))); ControlList.Add(new GuiButton(4, Width / 2 + 2, i + 72 + 12, 98, 20, stringtranslate.TranslateKey("menu.quit"))); } ControlList.Add(new GuiButtonLanguage(5, Width / 2 - 124, i + 72 + 12)); if (Mc.Session == null) { MultiplayerButton.Enabled = false; } }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); ControlList.Clear(); ControlList.Add(new GuiButton(0, Width / 2 - 100, Height / 4 + 120 + 12, stringtranslate.TranslateKey("gui.toMenu"))); }
/// <summary> /// Draws the screen and all the components in it. /// </summary> public override void DrawScreen(int par1, int par2, float par3) { GuiTexturePackSlot.DrawScreen(par1, par2, par3); if (RefreshTimer <= 0) { Mc.TexturePackList.UpdateAvaliableTexturePacks(); RefreshTimer += 20; } StringTranslate stringtranslate = StringTranslate.GetInstance(); DrawCenteredString(FontRenderer, stringtranslate.TranslateKey("texturePack.title"), Width / 2, 16, 0xffffff); DrawCenteredString(FontRenderer, stringtranslate.TranslateKey("texturePack.folderInfo"), Width / 2 - 77, Height - 26, 0x808080); base.DrawScreen(par1, par2, par3); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { base.InitGui(); StringTranslate stringtranslate = StringTranslate.GetInstance(); ControlList.Add(new GuiButton(1, Width / 2 - 100, Height - 40, stringtranslate.TranslateKey("multiplayer.stopSleeping"))); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); //Keyboard.EnableRepeatEvents(true); ControlList.Clear(); ControlList.Add(new GuiButton(0, Width / 2 - 100, Height / 4 + 96 + 12, stringtranslate.TranslateKey("selectWorld.renameButton"))); ControlList.Add(new GuiButton(1, Width / 2 - 100, Height / 4 + 120 + 12, stringtranslate.TranslateKey("gui.cancel"))); ISaveFormat isaveformat = Mc.GetSaveLoader(); WorldInfo worldinfo = isaveformat.GetWorldInfo(WorldName); string s = worldinfo.GetWorldName(); TheGuiTextField = new GuiTextField(FontRenderer, Width / 2 - 100, 60, 200, 20); TheGuiTextField.setFocused(true); TheGuiTextField.SetText(s); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); //Keyboard.EnableRepeatEvents(true); ControlList.Clear(); ControlList.Add(new GuiButton(0, Width / 2 - 100, Height / 4 + 96 + 12, stringtranslate.TranslateKey("addServer.add"))); ControlList.Add(new GuiButton(1, Width / 2 - 100, Height / 4 + 120 + 12, stringtranslate.TranslateKey("gui.cancel"))); ServerName = new GuiTextField(FontRenderer, Width / 2 - 100, 76, 200, 20); ServerName.setFocused(true); ServerName.SetText(ServerNBTStorage.Name); ServerAddress = new GuiTextField(FontRenderer, Width / 2 - 100, 116, 200, 20); ServerAddress.SetMaxStringLength(128); ServerAddress.SetText(ServerNBTStorage.Host); ControlList[0].Enabled = ServerAddress.GetText().Length > 0 && StringHelperClass.StringSplit(ServerAddress.GetText(), ":", true).Length > 0 && ServerName.GetText().Length > 0; }
///<summary> /// Adds the string to chat message after translate it with the language file. ///</summary> public void AddChatMessageTranslate(String par1Str) { StringTranslate stringtranslate = StringTranslate.GetInstance(); string s = stringtranslate.TranslateKey(par1Str); AddChatMessage(s); }
/// <summary> /// Populate the GuiScreen controlList /// </summary> public virtual void InitGuiControls() { StringTranslate stringtranslate = StringTranslate.GetInstance(); ControlList.Add(ButtonEdit = new GuiButton(7, Width / 2 - 154, Height - 28, 70, 20, stringtranslate.TranslateKey("selectServer.edit"))); ControlList.Add(ButtonDelete = new GuiButton(2, Width / 2 - 74, Height - 28, 70, 20, stringtranslate.TranslateKey("selectServer.delete"))); ControlList.Add(ButtonSelect = new GuiButton(1, Width / 2 - 154, Height - 52, 100, 20, stringtranslate.TranslateKey("selectServer.select"))); ControlList.Add(new GuiButton(4, Width / 2 - 50, Height - 52, 100, 20, stringtranslate.TranslateKey("selectServer.direct"))); ControlList.Add(new GuiButton(3, Width / 2 + 4 + 50, Height - 52, 100, 20, stringtranslate.TranslateKey("selectServer.add"))); ControlList.Add(new GuiButton(8, Width / 2 + 4, Height - 28, 70, 20, stringtranslate.TranslateKey("selectServer.refresh"))); ControlList.Add(new GuiButton(0, Width / 2 + 4 + 76, Height - 28, 75, 20, stringtranslate.TranslateKey("gui.cancel"))); bool flag = SelectedServer >= 0 && SelectedServer < ServerSlotContainer.GetSize(); ButtonSelect.Enabled = flag; ButtonEdit.Enabled = flag; ButtonDelete.Enabled = flag; }
/// <summary> /// Draws the screen and all the components in it. /// </summary> public override void DrawScreen(int par1, int par2, float par3) { DrawDefaultBackground(); StringTranslate stringtranslate = StringTranslate.GetInstance(); if (ClientHandler == null) { DrawCenteredString(FontRenderer, stringtranslate.TranslateKey("connect.connecting"), Width / 2, Height / 2 - 50, 0xffffff); DrawCenteredString(FontRenderer, "", Width / 2, Height / 2 - 10, 0xffffff); } else { DrawCenteredString(FontRenderer, stringtranslate.TranslateKey("connect.authorizing"), Width / 2, Height / 2 - 50, 0xffffff); DrawCenteredString(FontRenderer, ClientHandler.Field_1209_a, Width / 2, Height / 2 - 10, 0xffffff); } base.DrawScreen(par1, par2, par3); }
/// <summary> /// Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). /// </summary> protected override void ActionPerformed(GuiButton par1GuiButton) { if (!par1GuiButton.Enabled) { return; } if (par1GuiButton.Id == 2) { string s = GetSaveName(SelectedWorld); if (s != null) { Deleting = true; StringTranslate stringtranslate = StringTranslate.GetInstance(); string s1 = stringtranslate.TranslateKey("selectWorld.deleteQuestion"); string s2 = (new StringBuilder()).Append("'").Append(s).Append("' ").Append(stringtranslate.TranslateKey("selectWorld.deleteWarning")).ToString(); string s3 = stringtranslate.TranslateKey("selectWorld.deleteButton"); string s4 = stringtranslate.TranslateKey("gui.cancel"); GuiYesNo guiyesno = new GuiYesNo(this, s1, s2, s3, s4, SelectedWorld); Mc.DisplayGuiScreen(guiyesno); } } else if (par1GuiButton.Id == 1) { SelectWorld(SelectedWorld); } else if (par1GuiButton.Id == 3) { Mc.DisplayGuiScreen(new GuiCreateWorld(this)); } else if (par1GuiButton.Id == 6) { Mc.DisplayGuiScreen(new GuiRenameWorld(this, GetSaveFileName(SelectedWorld))); } else if (par1GuiButton.Id == 0) { Mc.DisplayGuiScreen(ParentScreen); } else { WorldSlotContainer.ActionPerformed(par1GuiButton); } }
/* * public virtual bool GetOptionOrdinalValue(Options par1Options) * { * switch (par1Options) * { * case 1: * return InvertMouse; * * case 2: * return ViewBobbing; * * case 3: * return Anaglyph; * * case 4: * return AdvancedOpengl; * * case 5: * return AmbientOcclusion; * * case 6: * return Clouds; * } * * return false; * } */ private static string Func_48571_a(string[] par0ArrayOfStr, int par1) { if (par1 < 0 || par1 >= par0ArrayOfStr.Length) { par1 = 0; } StringTranslate stringtranslate = StringTranslate.GetInstance(); return(stringtranslate.TranslateKey(par0ArrayOfStr[par1])); }
/// <summary> /// returns the name of the saved game /// </summary> protected virtual string GetSaveName(int par1) { string s = SaveList[par1].GetDisplayName(); if (s == null || MathHelper2.StringNullOrLengthZero(s)) { StringTranslate stringtranslate = StringTranslate.GetInstance(); s = (new StringBuilder()).Append(stringtranslate.TranslateKey("selectWorld.world")).Append(" ").Append(par1 + 1).ToString(); } return(s); }
/// <summary> /// Draws the screen and all the components in it. /// </summary> public override void DrawScreen(int par1, int par2, float par3) { StringTranslate stringtranslate = StringTranslate.GetInstance(); DrawDefaultBackground(); DrawCenteredString(FontRenderer, stringtranslate.TranslateKey("selectWorld.create"), Width / 2, 20, 0xffffff); if (!MoreOptions) { DrawString(FontRenderer, stringtranslate.TranslateKey("selectWorld.enterName"), Width / 2 - 100, 47, 0xa0a0a0); DrawString(FontRenderer, (new StringBuilder()).Append(stringtranslate.TranslateKey("selectWorld.resultFolder")).Append(" ").Append(FolderName).ToString(), Width / 2 - 100, 85, 0xa0a0a0); TextboxWorldName.DrawTextBox(); DrawString(FontRenderer, GameModeDescriptionLine1, Width / 2 - 100, 122, 0xa0a0a0); DrawString(FontRenderer, GameModeDescriptionLine2, Width / 2 - 100, 134, 0xa0a0a0); } else { DrawString(FontRenderer, stringtranslate.TranslateKey("selectWorld.enterSeed"), Width / 2 - 100, 47, 0xa0a0a0); DrawString(FontRenderer, stringtranslate.TranslateKey("selectWorld.seedInfo"), Width / 2 - 100, 85, 0xa0a0a0); DrawString(FontRenderer, stringtranslate.TranslateKey("selectWorld.mapFeatures.info"), Width / 2 - 150, 122, 0xa0a0a0); TextboxSeed.DrawTextBox(); } base.DrawScreen(par1, par2, par3); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); //Keyboard.enableRepeatEvents(true); ControlList.Clear(); ControlList.Add(new GuiButton(0, Width / 2 - 155, Height - 28, 150, 20, stringtranslate.TranslateKey("selectWorld.create"))); ControlList.Add(new GuiButton(1, Width / 2 + 5, Height - 28, 150, 20, stringtranslate.TranslateKey("gui.cancel"))); ControlList.Add(GameModeButton = new GuiButton(2, Width / 2 - 75, 100, 150, 20, stringtranslate.TranslateKey("selectWorld.gameMode"))); ControlList.Add(MoreWorldOptions = new GuiButton(3, Width / 2 - 75, 172, 150, 20, stringtranslate.TranslateKey("selectWorld.moreWorldOptions"))); ControlList.Add(GenerateStructuresButton = new GuiButton(4, Width / 2 - 155, 100, 150, 20, stringtranslate.TranslateKey("selectWorld.mapFeatures"))); GenerateStructuresButton.ShowButton = false; ControlList.Add(WorldTypeButton = new GuiButton(5, Width / 2 + 5, 100, 150, 20, stringtranslate.TranslateKey("selectWorld.mapType"))); WorldTypeButton.ShowButton = false; TextboxWorldName = new GuiTextField(FontRenderer, Width / 2 - 100, 60, 200, 20); TextboxWorldName.setFocused(true); TextboxWorldName.SetText(LocalizedNewWorldText); TextboxSeed = new GuiTextField(FontRenderer, Width / 2 - 100, 60, 200, 20); TextboxSeed.SetText(Seed); MakeUseableName(); Func_35363_g(); }
/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); ScreenTitle = stringtranslate.TranslateKey("options.title"); int i = 0; Options[] aenumoptions = RelevantOptions; int j = aenumoptions.Length; for (int k = 0; k < j; k++) { Options enumoptions = aenumoptions[k]; if (!enumoptions.Float) { GuiSmallButton guismallbutton = new GuiSmallButton(enumoptions.Ordinal(), (Width / 2 - 155) + (i % 2) * 160, Height / 6 + 24 * (i >> 1), enumoptions, Settings.GetKeyBinding(enumoptions)); if (enumoptions == Options.DIFFICULTY && Mc.TheWorld != null && Mc.TheWorld.GetWorldInfo().IsHardcoreModeEnabled()) { guismallbutton.Enabled = false; guismallbutton.DisplayString = (new StringBuilder()).Append(StatCollector.TranslateToLocal("options.difficulty")).Append(": ").Append(StatCollector.TranslateToLocal("options.difficulty.hardcore")).ToString(); } ControlList.Add(guismallbutton); } else { ControlList.Add(new GuiSlider(enumoptions.Ordinal(), (Width / 2 - 155) + (i % 2) * 160, Height / 6 + 24 * (i >> 1), enumoptions, Settings.GetKeyBinding(enumoptions), Settings.GetOptionFloatValue(enumoptions))); } i++; } ControlList.Add(new GuiButton(101, Width / 2 - 100, (Height / 6 + 96) - 6, stringtranslate.TranslateKey("options.video"))); ControlList.Add(new GuiButton(100, Width / 2 - 100, (Height / 6 + 120) - 6, stringtranslate.TranslateKey("options.controls"))); ControlList.Add(new GuiButton(102, Width / 2 - 100, (Height / 6 + 144) - 6, stringtranslate.TranslateKey("options.language"))); ControlList.Add(new GuiButton(200, Width / 2 - 100, Height / 6 + 168, stringtranslate.TranslateKey("gui.done"))); }
/// <summary> /// Creates the buttons that appear at the top of the Stats GUI. /// </summary> public virtual void AddHeaderButtons() { StringTranslate stringtranslate = StringTranslate.GetInstance(); ControlList.Add(new GuiButton(0, Width / 2 + 4, Height - 28, 150, 20, stringtranslate.TranslateKey("gui.done"))); ControlList.Add(new GuiButton(1, Width / 2 - 154, Height - 52, 100, 20, stringtranslate.TranslateKey("stat.generalButton"))); GuiButton guibutton; ControlList.Add(guibutton = new GuiButton(2, Width / 2 - 46, Height - 52, 100, 20, stringtranslate.TranslateKey("stat.blocksButton"))); GuiButton guibutton1; ControlList.Add(guibutton1 = new GuiButton(3, Width / 2 + 62, Height - 52, 100, 20, stringtranslate.TranslateKey("stat.itemsButton"))); if (SlotBlock.GetSize() == 0) { guibutton.Enabled = false; } if (SlotItem.GetSize() == 0) { guibutton1.Enabled = false; } }
/// <summary> /// Draws the screen and all the components in it. /// </summary> public override void DrawScreen(int par1, int par2, float par3) { LagTooltip = null; StringTranslate stringtranslate = StringTranslate.GetInstance(); DrawDefaultBackground(); ServerSlotContainer.DrawScreen(par1, par2, par3); DrawCenteredString(FontRenderer, stringtranslate.TranslateKey("multiplayer.title"), Width / 2, 20, 0xffffff); base.DrawScreen(par1, par2, par3); if (LagTooltip != null) { Func_35325_a(LagTooltip, par1, par2); } }
/// <summary> /// Draws the screen and all the components in it. /// </summary> public override void DrawScreen(int par1, int par2, float par3) { LanguageList.DrawScreen(par1, par2, par3); if (UpdateTimer <= 0) { Mc.TexturePackList.UpdateAvaliableTexturePacks(); UpdateTimer += 20; } StringTranslate stringtranslate = StringTranslate.GetInstance(); DrawCenteredString(FontRenderer, stringtranslate.TranslateKey("options.language"), Width / 2, 16, 0xffffff); DrawCenteredString(FontRenderer, (new StringBuilder()).Append("(").Append(stringtranslate.TranslateKey("options.languageWarning")).Append(")").ToString(), Width / 2, Height - 56, 0x808080); base.DrawScreen(par1, par2, par3); }
/// <summary> /// Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). /// </summary> protected override void ActionPerformed(GuiButton par1GuiButton) { if (!par1GuiButton.Enabled) { return; } if (par1GuiButton.Id == 1) { Mc.DisplayGuiScreen(ParentGuiScreen); } else if (par1GuiButton.Id == 0) { Mc.DisplayGuiScreen(null); if (CreateClicked) { return; } CreateClicked = true; long l = (new Random()).Next(); string s = TextboxSeed.GetText(); if (!string.IsNullOrEmpty(s)) { try { long l1 = Convert.ToInt64(s); if (l1 != 0L) { l = l1; } } catch (FormatException numberformatexception) { Utilities.LogException(numberformatexception); l = s.GetHashCode(); } } int i = 0; if (GameMode.Equals("creative")) { i = 1; Mc.PlayerController = new PlayerControllerCreative(Mc); } else { Mc.PlayerController = new PlayerControllerSP(Mc); } Mc.StartWorld(FolderName, TextboxWorldName.GetText(), new WorldSettings(l, i, Field_35365_g, Field_40232_h, WorldType.WorldTypes[Field_46030_z])); Mc.DisplayGuiScreen(null); } else if (par1GuiButton.Id == 3) { MoreOptions = !MoreOptions; GameModeButton.ShowButton = !MoreOptions; GenerateStructuresButton.ShowButton = MoreOptions; WorldTypeButton.ShowButton = MoreOptions; if (MoreOptions) { StringTranslate stringtranslate = StringTranslate.GetInstance(); MoreWorldOptions.DisplayString = stringtranslate.TranslateKey("gui.done"); } else { StringTranslate stringtranslate1 = StringTranslate.GetInstance(); MoreWorldOptions.DisplayString = stringtranslate1.TranslateKey("selectWorld.moreWorldOptions"); } } else if (par1GuiButton.Id == 2) { if (GameMode.Equals("survival")) { Field_40232_h = false; GameMode = "hardcore"; Field_40232_h = true; Func_35363_g(); } else if (GameMode.Equals("hardcore")) { Field_40232_h = false; GameMode = "creative"; Func_35363_g(); Field_40232_h = false; } else { GameMode = "survival"; Func_35363_g(); Field_40232_h = false; } Func_35363_g(); } else if (par1GuiButton.Id == 4) { Field_35365_g = !Field_35365_g; Func_35363_g(); } else if (par1GuiButton.Id == 5) { Field_46030_z++; if (Field_46030_z >= WorldType.WorldTypes.Length) { Field_46030_z = 0; } do { if (WorldType.WorldTypes[Field_46030_z] != null && WorldType.WorldTypes[Field_46030_z].GetCanBeCreated()) { break; } Field_46030_z++; if (Field_46030_z >= WorldType.WorldTypes.Length) { Field_46030_z = 0; } }while (true); Func_35363_g(); } }
/// <summary> /// Gets a key binding. /// </summary> public virtual string GetKeyBinding(Options par1Options) { StringTranslate stringtranslate = StringTranslate.GetInstance(); string s = (new StringBuilder()).Append(stringtranslate.TranslateKey(par1Options.String)).Append(": ").ToString(); if (par1Options.Float) { float f = GetOptionFloatValue(par1Options); if (par1Options == Options.SENSITIVITY) { if (f == 0.0F) { return((new StringBuilder()).Append(s).Append(stringtranslate.TranslateKey("options.sensitivity.min")).ToString()); } if (f == 1.0F) { return((new StringBuilder()).Append(s).Append(stringtranslate.TranslateKey("options.sensitivity.max")).ToString()); } else { return((new StringBuilder()).Append(s).Append((int)(f * 200F)).Append("%").ToString()); } } if (par1Options == Options.FOV) { if (f == 0.0F) { return((new StringBuilder()).Append(s).Append(stringtranslate.TranslateKey("options.fov.min")).ToString()); } if (f == 1.0F) { return((new StringBuilder()).Append(s).Append(stringtranslate.TranslateKey("options.fov.max")).ToString()); } else { return((new StringBuilder()).Append(s).Append((int)(70F + f * 40F)).ToString()); } } if (par1Options == Options.GAMMA) { if (f == 0.0F) { return((new StringBuilder()).Append(s).Append(stringtranslate.TranslateKey("options.gamma.min")).ToString()); } if (f == 1.0F) { return((new StringBuilder()).Append(s).Append(stringtranslate.TranslateKey("options.gamma.max")).ToString()); } else { return((new StringBuilder()).Append(s).Append("+").Append((int)(f * 100F)).Append("%").ToString()); } } if (f == 0.0F) { return((new StringBuilder()).Append(s).Append(stringtranslate.TranslateKey("options.off")).ToString()); } else { return((new StringBuilder()).Append(s).Append((int)(f * 100F)).Append("%").ToString()); } } if (par1Options.Bool) { //bool flag = GetOptionOrdinalValue(par1Options); //if (flag) { return((new StringBuilder()).Append(s).Append(stringtranslate.TranslateKey("options.on")).ToString()); }/* * else * { * return (new StringBuilder()).Append(s).Append(stringtranslate.TranslateKey("options.off")).ToString(); * }*/ } if (par1Options == Options.RENDER_DISTANCE) { return((new StringBuilder()).Append(s).Append(Func_48571_a(RENDER_DISTANCES, RenderDistance)).ToString()); } if (par1Options == Options.DIFFICULTY) { return((new StringBuilder()).Append(s).Append(Func_48571_a(DIFFICULTIES, Difficulty)).ToString()); } if (par1Options == Options.GUI_SCALE) { return((new StringBuilder()).Append(s).Append(Func_48571_a(GUISCALES, GuiScale)).ToString()); } if (par1Options == Options.PARTICLES) { return((new StringBuilder()).Append(s).Append(Func_48571_a(PARTICLES, ParticleSetting)).ToString()); } if (par1Options == Options.FRAMERATE_LIMIT) { return((new StringBuilder()).Append(s).Append(Func_48571_a(LIMIT_FRAMERATES, LimitFramerate)).ToString()); } if (par1Options == Options.GRAPHICS) { if (FancyGraphics) { return((new StringBuilder()).Append(s).Append(stringtranslate.TranslateKey("options.graphics.fancy")).ToString()); } else { return((new StringBuilder()).Append(s).Append(stringtranslate.TranslateKey("options.graphics.fast")).ToString()); } } else { return(s); } }