private void DoAction(AdventureType adventureType) { _current?.Unselect(); _current = _consoleList[(int)adventureType]; _current?.Select(); var b = adventureType != AdventureType.Dungeon; var str = $"{adventureType} {(b ? $"[LOCKED]" : "")}"; _travelControl.Print(13, 1, str.PadRight(30), b ? Color.Red : Color.Orange); _currentAdventureType = adventureType; UpdateCost(); }
private MogwaiChooseButton CreateChoice(int index, int row, string name, string description, string pathIcon, AdventureType adventureType) { var choiceConsole = new Console(32, 7) { Position = new Point(13 + row * 45, 0 + index * 7) }; choiceConsole.Fill(Color.TransparentBlack, Color.Black, null); choiceConsole.Print(0, 0, name, Color.White); choiceConsole.Print(0, 1, $"[c:g b:darkred:black:black:{description.Length}]" + description, Color.DarkGray); Children.Add(choiceConsole); var controls = new ControlsConsole(10, 5) { Position = new Point(-12, 1) }; controls.Fill(Color.Transparent, Color.DarkGray, null); choiceConsole.Children.Add(controls); var button = new MogwaiChooseButton(10, 5) { Position = new Point(0, 0) }; button.Click += (btn, args) => { DoAction(adventureType); }; controls.Add(button); button.Unselect(); // Load the logo System.IO.Stream imageStream = TitleContainer.OpenStream(pathIcon); var image = Texture2D.FromStream(Global.GraphicsDevice, imageStream); imageStream.Dispose(); Font pictureFont = Global.LoadFont("Cheepicus12.font").GetFont(Font.FontSizes.Quarter); // Configure the logo SadConsole.Surfaces.Basic consoleImage = image.ToSurface(pictureFont, true); consoleImage.Position = new Point(85 + row * 75, 12 + 30 * index); //consoleImage.Tint = Color.DarkSlateBlue; controls.Children.Add(consoleImage); return(button); }