/// <summary>
        /// Adds the buttons (and other controls) to the screen in question.
        /// </summary>
        public override void InitGui()
        {
            ControlList.Clear();

            if (Mc.TheWorld.GetWorldInfo().IsHardcoreModeEnabled())
            {
                ControlList.Add(new GuiButton(1, Width / 2 - 100, Height / 4 + 96, StatCollector.TranslateToLocal("deathScreen.deleteWorld")));
            }
            else
            {
                ControlList.Add(new GuiButton(1, Width / 2 - 100, Height / 4 + 72, StatCollector.TranslateToLocal("deathScreen.respawn")));
                ControlList.Add(new GuiButton(2, Width / 2 - 100, Height / 4 + 96, StatCollector.TranslateToLocal("deathScreen.titleScreen")));

                if (Mc.Session == null)
                {
                    ControlList[1].Enabled = false;
                }
            }

            for (IEnumerator <GuiButton> iterator = ControlList.GetEnumerator(); iterator.MoveNext();)
            {
                GuiButton guibutton = iterator.Current;
                guibutton.Enabled = false;
            }
        }
        /// <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 == 0)
            {
                Mc.DisplayGuiScreen(ParentGui);
            }
            else if (par1GuiButton.Id == 1)
            {
                SelectedSlot = SlotGeneral;
            }
            else if (par1GuiButton.Id == 3)
            {
                SelectedSlot = SlotItem;
            }
            else if (par1GuiButton.Id == 2)
            {
                SelectedSlot = SlotBlock;
            }
            else
            {
                SelectedSlot.ActionPerformed(par1GuiButton);
            }
        }
        /// <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;
            }

            int i = GuiGameSettings.GuiScale;

            if (par1GuiButton.Id < 100 && (par1GuiButton is GuiSmallButton))
            {
                GuiGameSettings.SetOptionValue(((GuiSmallButton)par1GuiButton).ReturnOptions(), 1);
                par1GuiButton.DisplayString = GuiGameSettings.GetKeyBinding(Options.GetOptions(par1GuiButton.Id));
            }

            if (par1GuiButton.Id == 200)
            {
                Mc.GameSettings.SaveOptions();
                Mc.DisplayGuiScreen(ParentGuiScreen);
            }

            if (GuiGameSettings.GuiScale != i)
            {
                ScaledResolution scaledresolution = new ScaledResolution(Mc.GameSettings, Mc.DisplayWidth, Mc.DisplayHeight);
                int j = scaledresolution.GetScaledWidth();
                int k = scaledresolution.GetScaledHeight();
                SetWorldAndResolution(Mc, j, k);
            }
        }
        /// <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.Id == 0)
            {
                Mc.DisplayGuiScreen(new GuiOptions(this, Mc.GameSettings));
            }

            if (par1GuiButton.Id == 5)
            {
                Mc.DisplayGuiScreen(new GuiLanguage(this, Mc.GameSettings));
            }

            if (par1GuiButton.Id == 1)
            {
                Mc.DisplayGuiScreen(new GuiSelectWorld(this));
            }

            if (par1GuiButton.Id == 2)
            {
                Mc.DisplayGuiScreen(new GuiMultiplayer(this));
            }

            if (par1GuiButton.Id == 3)
            {
                Mc.DisplayGuiScreen(new GuiTexturePacks(this));
            }

            if (par1GuiButton.Id == 4)
            {
                Mc.Shutdown();
            }
        }
 /// <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.Id == 0)
     {
         Mc.DisplayGuiScreen(new GuiMainMenu());
     }
 }
 /// <summary>
 /// Draws the screen and all the components in it.
 /// </summary>
 public virtual void DrawScreen(int mouseX, int mouseY, float par3)
 {
     for (int i = 0; i < ControlList.Count; i++)
     {
         GuiButton guibutton = ControlList[i];
         guibutton.DrawButton(Mc, mouseX, mouseY);
     }
 }
 /// <summary>
 /// Called when the mouse is moved or a mouse button is released.  Signature: (mouseX, mouseY, which) which==-1 is
 /// mouseMove, which==0 or which==1 is mouseUp
 /// </summary>
 protected virtual void MouseMovedOrUp(int par1, int par2, int par3)
 {
     if (SelectedButton != null && par3 == 0)
     {
         SelectedButton.MouseReleased(par1, par2);
         SelectedButton = null;
     }
 }
        /// <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);
            }
        }
Example #9
0
        ///<summary>
        /// Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
        ///</summary>
        protected new void ActionPerformed(GuiButton par1GuiButton)
        {
            if (par1GuiButton.Id == 1)
            {
                Mc.DisplayGuiScreen(null);
                Mc.SetIngameFocus();
            }

            base.ActionPerformed(par1GuiButton);
        }
 /// <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.Id == 1)
     {
         WakeEntity();
     }
     else
     {
         base.ActionPerformed(par1GuiButton);
     }
 }
Example #11
0
        /// <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.Id == 0)
            {
                Mc.DisplayGuiScreen(new GuiAchievements(Mc.StatFileWriter));
            }

            if (par1GuiButton.Id == 1)
            {
                Mc.DisplayGuiScreen(new GuiStats(this, Mc.StatFileWriter));
            }
        }
Example #12
0
        /// <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 == 0)
            {
                EntitySign.OnInventoryChanged();
                Mc.DisplayGuiScreen(null);
            }
        }
        /// <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;
        }
Example #14
0
        /// <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.Id == 0)
            {
                Cancelled = true;

                if (ClientHandler != null)
                {
                    ClientHandler.Disconnect();
                }

                Mc.DisplayGuiScreen(new GuiMainMenu());
            }
        }
        /// <summary>
        /// Called from the main game loop to update the screen.
        /// </summary>
        public override void UpdateScreen()
        {
            base.UpdateScreen();
            CooldownTimer++;

            if (CooldownTimer == 20)
            {
                for (IEnumerator <GuiButton> iterator = ControlList.GetEnumerator(); iterator.MoveNext();)
                {
                    GuiButton guibutton = iterator.Current;
                    guibutton.Enabled = true;
                }
            }
        }
        /// <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>
        /// 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;
        }
Example #18
0
        /// <summary>
        /// Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
        /// </summary>
        protected override void ActionPerformed(GuiButton par1GuiButton)
        {
            for (int i = 0; i < Options.KeyBindings.Length; i++)
            {
                ControlList[i].DisplayString = Options.GetOptionDisplayString(i);
            }

            if (par1GuiButton.Id == 200)
            {
                Mc.DisplayGuiScreen(ParentScreen);
            }
            else
            {
                ButtonId = par1GuiButton.Id;
                par1GuiButton.DisplayString = (new StringBuilder()).Append("> ").Append(Options.GetOptionDisplayString(par1GuiButton.Id)).Append(" <").ToString();
            }
        }
        /// <summary>
        /// Called when the mouse is clicked.
        /// </summary>
        protected virtual void MouseClicked(int mouseX, int mouseY, int par3)
        {
            if (par3 == 0)
            {
                for (int i = 0; i < ControlList.Count; i++)
                {
                    GuiButton guibutton = ControlList[i];

                    if (guibutton.MousePressed(Mc, mouseX, mouseY))
                    {
                        SelectedButton = guibutton;
                        Mc.SndManager.PlaySoundFX("random.click", 1.0F, 1.0F);
                        ActionPerformed(guibutton);
                    }
                }
            }
        }
Example #20
0
        /// <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)
            {
                GuiScreen.ConfirmClicked(false, 0);
            }
            else if (par1GuiButton.Id == 0)
            {
                ServerListStorage.Host = ServerTextField.GetText();
                GuiScreen.ConfirmClicked(true, 0);
            }
        }
Example #21
0
        /// <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)
            {
                ISaveFormat isaveformat = Mc.GetSaveLoader();
                isaveformat.RenameWorld(WorldName, TheGuiTextField.GetText().Trim());
                Mc.DisplayGuiScreen(ParentGuiScreen);
            }
        }
        /// <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)
            {
                ParentGui.ConfirmClicked(false, 0);
            }
            else if (par1GuiButton.Id == 0)
            {
                ServerNBTStorage.Name = ServerName.GetText();
                ServerNBTStorage.Host = ServerAddress.GetText();
                ParentGui.ConfirmClicked(true, 0);
            }
        }
        /// <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);
            }
        }
Example #24
0
        public virtual void ActionPerformed(GuiButton par1GuiButton)
        {
            if (!par1GuiButton.Enabled)
            {
                return;
            }

            if (par1GuiButton.Id == ScrollUpButtonID)
            {
                AmountScrolled -= (SlotHeight * 2) / 3;
                InitialClickY   = -2F;
                BindAmountScrolled();
            }
            else if (par1GuiButton.Id == ScrollDownButtonID)
            {
                AmountScrolled += (SlotHeight * 2) / 3;
                InitialClickY   = -2F;
                BindAmountScrolled();
            }
        }
Example #25
0
        /// <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 == 5)
            {            /*
                          *     bool flag = false;
                          *
                          *     try
                          *     {
                          *             Type class1 = Type.GetType("java.awt.Desktop");
                          *             object obj = class1.GetMethod("getDesktop", new Type[0]).Invoke(null, new object[0]);
                          *             class1.GetMethod("browse", new Type[] { typeof(URI) }).Invoke(obj, new object[] { (new File(Minecraft.GetMinecraftDir(), "texturepacks")).toURI() });
                          *     }
                          *     catch (Exception throwable)
                          *     {
                          *             Console.WriteLine(throwable.ToString());
                          *             Console.Write(throwable.StackTrace);
                          *             flag = true;
                          *     }
                          *
                          *     if (flag)
                          *     {
                          *             Console.WriteLine("Opening via Sys class!");
                          *             Sys.openURL((new StringBuilder()).Append("file://").Append(FileLocation).ToString());
                          *     }*/
            }
            else if (par1GuiButton.Id == 6)
            {
                //Mc.RenderEngineOld.RefreshTextures();
                Mc.DisplayGuiScreen(GuiScreen);
            }
            else
            {
                GuiTexturePackSlot.ActionPerformed(par1GuiButton);
            }
        }
        /// <summary>
        /// Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
        /// </summary>
        protected override void ActionPerformed(GuiButton par1GuiButton)
        {
            switch (par1GuiButton.Id)
            {
            case 2:
            case 3:
            default:
                break;

            case 0:
                Mc.DisplayGuiScreen(new GuiOptions(this, Mc.GameSettings));
                break;

            case 1:
                Mc.StatFileWriter.ReadStat(StatList.LeaveGameStat, 1);

                if (Mc.IsMultiplayerWorld())
                {
                    Mc.TheWorld.SendQuittingDisconnectingPacket();
                }

                Mc.ChangeWorld1(null);
                Mc.DisplayGuiScreen(new GuiMainMenu());
                break;

            case 4:
                Mc.DisplayGuiScreen(null);
                Mc.SetIngameFocus();
                break;

            case 5:
                Mc.DisplayGuiScreen(new GuiAchievements(Mc.StatFileWriter));
                break;

            case 6:
                Mc.DisplayGuiScreen(new GuiStats(this, Mc.StatFileWriter));
                break;
            }
        }
Example #27
0
        /// <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();
        }
Example #28
0
        /// <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;
            }

            switch (par1GuiButton.Id)
            {
            case 6:
                Field_44006_d.SaveOptions();
                Mc.DisplayGuiScreen(ParentGui);
                break;

            default:
                LanguageList.ActionPerformed(par1GuiButton);
                break;

            case 5:
                break;
            }
        }
        /// <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;
            }
        }
Example #30
0
        /// <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 < 100 && (par1GuiButton is GuiSmallButton))
            {
                Settings.SetOptionValue(((GuiSmallButton)par1GuiButton).ReturnOptions(), 1);
                par1GuiButton.DisplayString = Settings.GetKeyBinding(Options.GetOptions(par1GuiButton.Id));
            }

            if (par1GuiButton.Id == 101)
            {
                Mc.GameSettings.SaveOptions();
                Mc.DisplayGuiScreen(new GuiVideoSettings(this, Settings));
            }

            if (par1GuiButton.Id == 100)
            {
                Mc.GameSettings.SaveOptions();
                Mc.DisplayGuiScreen(new GuiControls(this, Settings));
            }

            if (par1GuiButton.Id == 102)
            {
                Mc.GameSettings.SaveOptions();
                Mc.DisplayGuiScreen(new GuiLanguage(this, Settings));
            }

            if (par1GuiButton.Id == 200)
            {
                Mc.GameSettings.SaveOptions();
                Mc.DisplayGuiScreen(ParentScreen);
            }
        }