示例#1
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);
        }
示例#2
0
        public override List <SaveFormatComparator> GetSaveList()
        {
            List <SaveFormatComparator> arraylist = new List <SaveFormatComparator>();

            string[] afile  = Directory.GetDirectories(SavesDirectory);
            string[] afile1 = afile;
            int      i      = afile1.Length;

            for (int j = 0; j < i; j++)
            {
                DirectoryInfo file = new DirectoryInfo(afile1[j]);

                string    s         = file.Name;
                WorldInfo worldinfo = GetWorldInfo(s);

                Console.WriteLine("the current loading world " + s);

                if (worldinfo == null)
                {
                    continue;
                }

                bool   flag = worldinfo.GetSaveVersion() != Func_48431_c();
                string s1   = worldinfo.GetWorldName();

                if (s1 == null || MathHelper2.StringNullOrLengthZero(s1))
                {
                    s1 = s;
                }

                long l = 0L;
                arraylist.Add(new SaveFormatComparator(s, s1, worldinfo.GetLastTimePlayed(), l, worldinfo.GetGameType(), flag, worldinfo.IsHardcoreModeEnabled()));
            }

            return(arraylist);
        }