public void Init() { _consoleList.Add(CreateChoice(0, 0, "Hollow Mountain", "Hollow Mountain is the largest peak on Rivenrake Island, which lies at " + "the northwestern edge of the Varisian Gulf", "icon2s.png", AdventureType.TestRoom)); _consoleList.Add(CreateChoice(1, 0, "The Manstone Caverns", "The underground complex, a network of caverns accessible only via " + "the Darklands or through well-defended chambers connected to hideouts " + "above.", "icon1s.png", AdventureType.Chamber)); _consoleList.Add(CreateChoice(2, 0, "Gallowspire", "Located in the Hungry Mountains in southwestern Ustalav, the tower of Gallowspire " + "stands as a crumbling testament to the power of the immortal lich Tar-Baphon.", "icon3s.png", AdventureType.Dungeon)); _consoleList.Add(CreateChoice(0, 1, "The Pyramid of Kamaria", "Kamaria, which dominates the southern skyline of the Osirian " + "city of An. Dedicated to the only ruler of the ancient kingdom.", "icon4s.png", AdventureType.Battle)); _consoleList.Add(CreateChoice(1, 1, "The King Karamoss", "A thousand years ago, the city of Absalom faced one of its most exotic foes. " + "The mysterious wizard Karamoss.", "icon5s.png", AdventureType.Quest)); _travelControl = new ControlsConsole(43, 7) { Position = new Point(47, 14) }; _travelControl.Fill(Color.Transparent, new Color(05, 05, 05, 255), null); Children.Add(_travelControl); _travelControl.Print(1, 1, "Adventure: ", Color.Gainsboro); _travelControl.Print(1, 2, "Difficulty:", Color.Gainsboro); _travelControl.Print(1, 4, "Cost:", Color.Gainsboro); var button = new MogwaiButton(10, 1) { Position = new Point(33, 6), Text = "TRAVEL" }; button.Click += (btn, args) => { DoAdventure(); }; _travelControl.Add(button); var bDec = new MogwaiButton(3, 1) { Position = new Point(34, 2), Text = "-" }; bDec.Click += (btn, args) => { DoDifficulty(false); }; _travelControl.Add(bDec); var bInc = new MogwaiButton(3, 1) { Position = new Point(38, 2), Text = "+" }; bInc.Click += (btn, args) => { DoDifficulty(true); }; _travelControl.Add(bInc); DoDifficulty(false); DoAction(_currentAdventureType); }
public static void PrintCentre(this ControlsConsole console, int x, int y, string text, Cell cell = null) { int half_text_width = text.Count() / 2; if (cell == null) { console.Print(x - half_text_width, y, text, new Cell(Color.White, Color.Black)); } else { console.Print(x - half_text_width, y, text, cell); } }
private void UpdateCost() { _currentCost = new AdventureAction(_currentAdventureType, _currentDifficultyType, _mogwai.CurrentLevel).Cost(); _travelControl.Print(13, 4, _currentCost.ToString("0.00000000"), Color.Gainsboro); _travelControl.Print(24, 4, "MOG", Color.Gold); }
public void RedrawPanels() { int activeRow = 0; ToolsConsole.Clear(); ToolsConsole.RemoveAll(); _hotSpots.Clear(); char open = (char)31; char closed = (char)16; List <CustomPanel> allPanels = new List <CustomPanel>() { PanelFiles }; // Custom panels from the selected editor if (MainScreen.Instance.ActiveEditor != null) { if (MainScreen.Instance.ActiveEditor.Panels != null && MainScreen.Instance.ActiveEditor.Panels.Length != 0) { allPanels.AddRange(MainScreen.Instance.ActiveEditor.Panels); } } // Custom panels from the selected tool //if (SelectedTool.ControlPanels != null && SelectedTool.ControlPanels.Length != 0) // allPanels.AddRange(SelectedTool.ControlPanels); // Display all panels needed if (allPanels.Count != 0) { foreach (var pane in allPanels) { if (pane.IsVisible) { pane.Loaded(); _hotSpots.Add(new Tuple <CustomPanel, int>(pane, activeRow)); if (pane.IsCollapsed == false) { ToolsConsole.Print(1, activeRow++, open + " " + pane.Title); ToolsConsole.Print(0, activeRow++, new string((char)196, ToolsConsole.TextSurface.Width)); foreach (var control in pane.Controls) { if (control != null) { if (control.IsVisible) { ToolsConsole.Add(control); control.Position = new Point(1, activeRow); activeRow += pane.Redraw(control) + control.Height; } } else { activeRow++; } } activeRow += 1; } else { ToolsConsole.Print(1, activeRow++, closed + " " + pane.Title); } } } } int scrollAbility = activeRow + 1 - Settings.Config.WindowHeight; if (scrollAbility <= 0) { ToolsPaneScroller.IsEnabled = false; ToolsPaneScroller.Maximum = 0; } else { ToolsPaneScroller.Maximum = scrollAbility; ToolsPaneScroller.IsEnabled = true; } }