Exemple #1
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>
        /// 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 GuiSmallButton(0, Width / 2 - 155, Height / 4 + 120 + 12, stringtranslate.TranslateKey("gui.toMenu")));
            ControlList.Add(new GuiSmallButton(1, (Width / 2 - 155) + 160, Height / 4 + 120 + 12, stringtranslate.TranslateKey("menu.quit")));
        }
Exemple #3
0
 /// <summary>
 /// the element in the slot that was clicked, bool for wether it was double clicked or not
 /// </summary>
 protected override void ElementClicked(int par1, bool par2)
 {
     StringTranslate.GetInstance().SetLanguage((string)Field_44013_b[par1]);
     Field_44015_a.Mc.FontRendererOld.SetUnicodeFlag(StringTranslate.GetInstance().IsUnicode());
     GuiLanguage.Func_44005_a(Field_44015_a).Language = (string)Field_44013_b[par1];
     //Field_44015_a.FontRenderer.SetBidiFlag(StringTranslate.IsBidrectional(GuiLanguage.Func_44005_a(Field_44015_a).Language));
     GuiLanguage.Func_46028_b(Field_44015_a).DisplayString = StringTranslate.GetInstance().TranslateKey("gui.done");
 }
Exemple #4
0
        /// <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>
        /// 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);*/
        }
Exemple #7
0
        /// <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);
        }
Exemple #8
0
        /// <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);
        }
Exemple #9
0
        /*
         * 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]));
        }
Exemple #10
0
        /// <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>
        /// 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);
        }
Exemple #12
0
        public GuiSlotLanguage(GuiLanguage par1GuiLanguage) : base(par1GuiLanguage.Mc, par1GuiLanguage.Width, par1GuiLanguage.Height, 32, (par1GuiLanguage.Height - 65) + 4, 18)
        {
            Field_44015_a = par1GuiLanguage;
            Field_44014_c = StringTranslate.GetInstance().GetLanguageList();
            Field_44013_b = new List <string>();
            string s;

            for (IEnumerator <string> iterator = Field_44014_c.Keys.GetEnumerator(); iterator.MoveNext(); Field_44013_b.Add(s))
            {
                s = iterator.Current;
            }
        }
Exemple #13
0
        /// <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>
        /// 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();

            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();
        }
Exemple #16
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 - 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>
        /// 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);
            }
        }
        protected override void Func_27257_b(int par1, int par2)
        {
            if (par2 < Top || par2 > Bottom)
            {
                return;
            }
            int i = Func_27256_c(par1, par2);
            int j = Field_27269_g.Width / 2 - 92 - 16;

            if (i >= 0)
            {
                if (par1 < j + 40 || par1 > j + 40 + 20)
                {
                    return;
                }
                StatCrafting statcrafting = Func_27264_b(i);
                Func_27267_a(statcrafting, par1, par2);
            }
            else
            {
                string s = "";
                if (par1 >= (j + 115) - 18 && par1 <= j + 115)
                {
                    s = Func_27263_a(0);
                }
                else if (par1 >= (j + 165) - 18 && par1 <= j + 165)
                {
                    s = Func_27263_a(1);
                }
                else if (par1 >= (j + 215) - 18 && par1 <= j + 215)
                {
                    s = Func_27263_a(2);
                }
                else
                {
                    return;
                }
                s = (new StringBuilder()).Append("").Append(StringTranslate.GetInstance().TranslateKey(s)).ToString().Trim();
                if (s.Length > 0)
                {
                    int k  = par1 + 12;
                    int l  = par2 - 12;
                    int i1 = GuiStats.GetFontRenderer(Field_27269_g).GetStringWidth(s);
                    GuiStats.DrawGradientRect(Field_27269_g, k - 3, l - 3, k + i1 + 3, l + 8 + 3, 0xc000000, 0xc000000);
                    GuiStats.GetFontRenderer(Field_27269_g).DrawStringWithShadow(s, k, l, -1);
                }
            }
        }
        /// <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;
            }
        }
Exemple #21
0
        /// <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);
        }
Exemple #22
0
        /// <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);
        }
Exemple #23
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 - 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>
        /// 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;
        }
        protected void Func_27267_a(StatCrafting par1StatCrafting, int par2, int par3)
        {
            if (par1StatCrafting == null)
            {
                return;
            }
            Item   item = Item.ItemsList[par1StatCrafting.GetItemID()];
            string s    = new StringBuilder().Append("").Append(StringTranslate.GetInstance().TranslateNamedKey(item.GetItemName())).ToString().Trim();

            if (s.Length > 0)
            {
                int i = par2 + 12;
                int j = par3 - 12;
                int k = GuiStats.GetFontRenderer(Field_27269_g).GetStringWidth(s);
                GuiStats.DrawGradientRect(Field_27269_g, i - 3, j - 3, i + k + 3, j + 8 + 3, 0xc000000, 0xc000000);
                GuiStats.GetFontRenderer(Field_27269_g).DrawStringWithShadow(s, i, j, -1);
            }
        }
Exemple #27
0
        /// <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);
            }
        }
Exemple #29
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();
        }
Exemple #30
0
        private void Func_35363_g()
        {
            StringTranslate stringtranslate;

            stringtranslate = StringTranslate.GetInstance();
            GameModeButton.DisplayString           = (new StringBuilder()).Append(stringtranslate.TranslateKey("selectWorld.gameMode")).Append(" ").Append(stringtranslate.TranslateKey((new StringBuilder()).Append("selectWorld.gameMode.").Append(GameMode).ToString())).ToString();
            GameModeDescriptionLine1               = stringtranslate.TranslateKey((new StringBuilder()).Append("selectWorld.gameMode.").Append(GameMode).Append(".line1").ToString());
            GameModeDescriptionLine2               = stringtranslate.TranslateKey((new StringBuilder()).Append("selectWorld.gameMode.").Append(GameMode).Append(".line2").ToString());
            GenerateStructuresButton.DisplayString = (new StringBuilder()).Append(stringtranslate.TranslateKey("selectWorld.mapFeatures")).Append(" ").ToString();

            if (!(!Field_35365_g))
            {
                GenerateStructuresButton.DisplayString += stringtranslate.TranslateKey("options.on");
            }
            else
            {
                GenerateStructuresButton.DisplayString += stringtranslate.TranslateKey("options.off");
            }

            WorldTypeButton.DisplayString = (new StringBuilder()).Append(stringtranslate.TranslateKey("selectWorld.mapType")).Append(" ").Append(stringtranslate.TranslateKey(WorldType.WorldTypes[Field_46030_z].GetTranslateName())).ToString();
            return;
        }