public NavigationWindow() { var width = Console.WindowWidth; var height = Console.WindowHeight; titleLabel = new GUI.Label(0, 0, width, 1, MenuColor.NavigationWindowTitleBG, MenuColor.NavigationWindowTitleFG, Text.NavigationWindowTitle) { HorizontalAlignment = Properties.HorizontalAlignment.Center }; windowsMenu = new GUI.ColumnView(2, 3, 40, 10, MenuColor.ContentBG, MenuColor.ContentFG, 1); windowList = windowsMenu.AddListBox(0, Text.NavigationWindowListHeader, false); windowList.SetItems(Program.windowNames); windowNumberTextBox = new GUI.TextBox(0, 4, 1, 10, MenuColor.ContentBG, MenuColor.ContentFG) { Content = new string[Program.windowNames.Length] }; for (int i = 0; i < Program.windowNames.Length; i++) { windowNumberTextBox.Content[i] = (i + 1).ToString(); } controlsLabel = new GUI.Label(0, height - 1, width - 1, 1, MenuColor.ControlsBG, MenuColor.ControlsFG, Text.DefaultControls); }
public LauncherWindow() : base(Text.LauncherWindowTitle, MenuColor.LauncherWindowTitleBG, MenuColor.LauncherWindowTitleFG) { LaunchableMapsList = Menu.AddListBox(0, Text.MapInstallerInstalledMapsHeader, true); LaunchableMapsList.SelectionChanged += MapSelectionChanged; DetailsTextBox = Menu.AddTextBox(1, null); StartupLevelList = new GUI.ListBox(DetailsTextBox.Left, DetailsTextBox.Top, DetailsTextBox.Width, DetailsTextBox.Height, MenuColor.ContentBG, MenuColor.ContentFG, true); }
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(); }
public SaveManagerWindow() : base(Text.SaveManagerWindowTitle, MenuColor.SaveMangerWindowTitleBG, MenuColor.SaveMangerWindowTitleFG) { CommandsList = Menu.AddListBox(0, null, true); CommandsList.SetItems(new string[] { Text.BackUpCurrentSave, Text.ViewBackups, Text.ToggleAutoBackups }); DetailsTextBox = Menu.AddTextBox(1, null); BackedUpSavesList = new GUI.ListBox(DetailsTextBox.Left, DetailsTextBox.Top, DetailsTextBox.Width, DetailsTextBox.Height, MenuColor.ContentBG, MenuColor.ContentFG, true); currentSavedMapName = string.Empty; backedUpSaves = new List <string>(); }
public BackupsWindow() : base(Text.BackupsWindowTitle, MenuColor.BackupsWindowTitleBG, MenuColor.BackupsWindowTitleFG) { CommandsList = Menu.AddListBox(0, null, true); CommandsList.SetItems(new string[] { Text.BackedUpLevels, Text.BackedUpScripts, }); DetailsTextBox = Menu.AddTextBox(1, null); BackedUpLevelsList = new GUI.ListBox( DetailsTextBox.Left, DetailsTextBox.Top, DetailsTextBox.Width, DetailsTextBox.Height, MenuColor.ContentBG, MenuColor.ContentFG, true); BackedUpScriptsList = new GUI.ListBox( DetailsTextBox.Left, DetailsTextBox.Top, DetailsTextBox.Width, DetailsTextBox.Height, MenuColor.ContentBG, MenuColor.ContentFG, true); }
public MapEditorWindow() : base(Text.MapEditorWindowTitle, MenuColor.MapEditorWindowBG, MenuColor.MapEditorWindowFG) { ignoreNextSelectionChangedEvent = false; mapCommands = new string[] { Text.MapEditorCommandEditMapInfo, Text.MapEditorCommandEditLevels, Text.Export, }; mapCommandsWithIssues = new string[] { Text.MapEditorCommandEditMapInfo, Text.MapEditorCommandEditLevels, Text.Export, Text.ShowIssues, }; levelCommands = new string[] { Text.Rename, Text.Delete, }; confirmDeleteCommands = new string[] { Text.Delete, }; exportCommands = new string[] { Text.Overwrite, Text.ExportWithTimestamp, }; mapList = Menu.AddListBox(0, null, true); mapList.SelectionChanged += MapListSelectionChanged; DetailsTextBox = Menu.AddTextBox(1, null); DetailsTextBox.Width--; NewMapNameInput = new GUI.TextInput(mapList.Left + 1, mapList.Top + 1, mapList.Width - 2, 1, MenuColor.TextInputBG, MenuColor.TextInputFG) { PreviewText = Text.MapName, DefaultOptions = new GUI.TextInput.PromptOptions(false, true, false, null) }; var infoOptionsNoEmpty = new GUI.TextInput.PromptOptions(false, true, true, null); var infoOptionsWithEmpty = new GUI.TextInput.PromptOptions(true, true, true, null); var nameInputOptions = new GUI.TextInput.PromptOptions(false, true, false, null); mapInfoNameInput = new GUI.TextInput( DetailsTextBox.Left + Text.MapInfoMapName.Length + 1, DetailsTextBox.Top, DetailsTextBox.Width - Text.MapInfoMapName.Length - 1, 1, MenuColor.TextInputBG, MenuColor.TextInputFG) { DefaultOptions = infoOptionsNoEmpty, }; mapInfoVersionInput = new GUI.TextInput( DetailsTextBox.Left + Text.MapInfoVersion.Length + 1, DetailsTextBox.Top + 1, DetailsTextBox.Width - Text.MapInfoVersion.Length - 1, 1, MenuColor.TextInputBG, MenuColor.TextInputFG) { DefaultOptions = infoOptionsWithEmpty, }; mapInfoAuthorInput = new GUI.TextInput( DetailsTextBox.Left + Text.MapInfoAuthor.Length + 1, DetailsTextBox.Top + 2, DetailsTextBox.Width - Text.MapInfoAuthor.Length - 1, 1, MenuColor.TextInputBG, MenuColor.TextInputFG) { DefaultOptions = infoOptionsWithEmpty, }; mapInfoStartupLevelInput = new GUI.TextInput( DetailsTextBox.Left + Text.MapInfoStartupLevel.Length + 1, DetailsTextBox.Top + 3, DetailsTextBox.Width - Text.MapInfoStartupLevel.Length - 1, 1, MenuColor.TextInputBG, MenuColor.TextInputFG) { DefaultOptions = infoOptionsWithEmpty, }; mapInfoShortDescriptionInput = new GUI.TextInput( DetailsTextBox.Left + Text.MapInfoShortDescription.Length + 1, DetailsTextBox.Top + 5, DetailsTextBox.Width - Text.MapInfoShortDescription.Length - 1, 1, MenuColor.TextInputBG, MenuColor.TextInputFG) { DefaultOptions = infoOptionsWithEmpty, }; mapInfoLongDescriptionInput = new GUI.TextInput( DetailsTextBox.Left, DetailsTextBox.Top + 7, DetailsTextBox.Width, DetailsTextBox.Height - 5, MenuColor.TextInputBG, MenuColor.TextInputFG) { DefaultOptions = infoOptionsWithEmpty, }; mapInfoList = new GUI.ListBox( DetailsTextBox.Left, DetailsTextBox.Top, DetailsTextBox.Width + 1, DetailsTextBox.Height, MenuColor.ContentBG, MenuColor.ContentBG, true); levelList = new GUI.ListBox( mapList.Left, mapList.Top, mapList.Width, mapList.Height, MenuColor.ContentBG, MenuColor.ContentFG, true); assignedLevelsList = new GUI.ListBox( DetailsTextBox.Left, DetailsTextBox.Top, DetailsTextBox.Width + 1, DetailsTextBox.Height, MenuColor.ContentBG, MenuColor.ContentBG, true); levelNameInput = new GUI.TextInput( levelList.Left + 1, levelList.Top, levelList.Width - 2, 1, MenuColor.TextInputBG, MenuColor.TextInputFG) { PreviewText = Text.LevelName, DefaultOptions = nameInputOptions, }; levelNameInput = new GUI.TextInput( levelList.Left + 1, levelList.Top, levelList.Width - 2, 1, MenuColor.TextInputBG, MenuColor.TextInputFG) { PreviewText = Text.LevelName, DefaultOptions = nameInputOptions, }; levelRenameInput = new GUI.TextInput( levelList.Left + 1, levelList.Top, levelList.Width - 2, 1, MenuColor.TextInputBG, MenuColor.TextInputFG) { PreviewText = Text.LevelName, DefaultOptions = infoOptionsNoEmpty, }; }