コード例 #1
0
        public override void ConfirmClicked(bool par1, int par2)
        {
            if (Deleting)
            {
                Deleting = false;

                if (par1)
                {
                    ISaveFormat isaveformat = Mc.GetSaveLoader();
                    isaveformat.FlushCache();
                    isaveformat.DeleteWorldDirectory(GetSaveFileName(par2));
                    LoadSaves();
                }

                Mc.DisplayGuiScreen(this);
            }
        }
コード例 #2
0
        /// <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)
            {
            default:
                break;

            case 1:
                if (Mc.TheWorld.GetWorldInfo().IsHardcoreModeEnabled())
                {
                    string s = Mc.TheWorld.GetSaveHandler().GetSaveDirectoryName();
                    Mc.ExitToMainMenu("Deleting world");
                    ISaveFormat isaveformat = Mc.GetSaveLoader();
                    isaveformat.FlushCache();
                    isaveformat.DeleteWorldDirectory(s);
                    Mc.DisplayGuiScreen(new GuiMainMenu());
                }
                else
                {
                    Mc.ThePlayer.RespawnPlayer();
                    Mc.DisplayGuiScreen(null);
                }

                break;

            case 2:
                if (Mc.IsMultiplayerWorld())
                {
                    Mc.TheWorld.SendQuittingDisconnectingPacket();
                }

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