/// <summary> /// Adds the buttons (and other controls) to the screen in question. /// </summary> public override void InitGui() { StringTranslate stringtranslate = StringTranslate.GetInstance(); ControlList.Add(DoneButton = new GuiSmallButton(6, Width / 2 - 75, Height - 38, stringtranslate.TranslateKey("gui.done"))); LanguageList = new GuiSlotLanguage(this); LanguageList.RegisterScrollButtons(ControlList, 7, 8); }
/// <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"))); }