Example #1
0
        public override void Selected(GUI.Selection selection)
        {
            bool promptQuit = false;

            GUI.ListBox listBox = selection.RowIndex switch
            {
                0 => BackedUpLevelsList,
                1 => BackedUpScriptsList,
                _ => throw new NotImplementedException(),
            };
            CommandsList.HighlightCurrentItem();
            listBox.Clear();
            listBox.Draw();
            listBox.NavigateToDefault();
            while (!promptQuit)
            {
                var subSelection = BackedUpLevelsList.PromptSelection();
                if (subSelection.Command == Properties.Command.Cancel)
                {
                    promptQuit = true;
                }
            }

            CommandsList.SelectCurrentItem();
            DetailsTextBox.Clear();
            WriteSummary();
        }
Example #2
0
        public override void Selected(GUI.Selection selection)
        {
            if (selection.List.IsEmpty)
            {
                return;
            }
            LogTextBox.ClearContent();

            switch (selection.RowIndex)
            {
            case 0:                     // Backup current map
                LogTextBox.WriteLine(Text.BackingUpCurrentSave);
                BackupCurrentSave();
                RefreshInfo();
                WriteSummary();
                LogTextBox.WriteLine(string.Format(Text.BackedUpMap, currentSavedMapName));
                break;

            case 1:                     // View backups...
                CommandsList.HighlightCurrentItem();
                ShowBackups();
                CommandsList.SelectCurrentItem();
                break;

            case 2:
                if (Program.manageSaves)
                {
                    Program.manageSaves = false;
                    LogTextBox.WriteLine(Text.DisabledManageSaves);
                }
                else
                {
                    Program.manageSaves = true;
                    LogTextBox.WriteLine(Text.EnabledManageSaves);
                }
                Program.SaveSettings();
                WriteSummary();
                break;
            }
        }