public SelectionScreen(MogwaiController mogwaiController, int width, int height) : base(width, height) { borderSurface = new Basic(width + 2, height + 2, base.Font); borderSurface.DrawBox(new Rectangle(0, 0, borderSurface.Width, borderSurface.Height), new Cell(Color.DarkCyan, Color.Black), null, SurfaceBase.ConnectedLineThick); borderSurface.Position = new Point(-1, -1); Children.Add(borderSurface); controlsConsole = new ControlsConsole(110, 1); controlsConsole.Position = new Point(0, 24); controlsConsole.Fill(Color.DarkCyan, Color.Black, null); Children.Add(controlsConsole); infoConsole = new MogwaiConsole("Info", "", 24, 38); infoConsole.Position = new Point(113, -8); Children.Add(infoConsole); logConsole = new MogwaiConsole("Log", "", 110, 3); logConsole.Position = new Point(0, 27); Children.Add(logConsole); headerPosition = 1; trailerPosition = height - 2; CreateHeader(); CreateTrailer(); controller = mogwaiController; }
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 SelectionScreen(MogwaiController mogwaiController, int width, int height) : base(width, height) { _borderSurface = new Basic(width + 2, height + 2, Font); _borderSurface.DrawBox(new Rectangle(0, 0, _borderSurface.Width, _borderSurface.Height), new Cell(Color.DarkCyan, Color.Black), null, ConnectedLineThick); _borderSurface.Position = new Point(-1, -1); Children.Add(_borderSurface); _controlsConsole = new ControlsConsole(110, 1) { Position = new Point(0, 24) }; _controlsConsole.Fill(Color.DarkCyan, Color.Black, null); Children.Add(_controlsConsole); _infoConsole = new MogwaiConsole("Info", "", 24, 38) { Position = new Point(113, -8) }; Children.Add(_infoConsole); _debugConsole = new Console(24, 38) { Position = new Point(113, 22) }; _debugConsole.Fill(Color.Beige, Color.TransparentBlack, null); _debugConsole.Print(1, 1, $"Debug Console [{Coloring.Gold(" ")}]:"); _debugConsole.Print(1, 2, $"..armors: {Armors.Instance.AllBuilders().Count}"); _debugConsole.Print(1, 3, $"..weapns: {Weapons.Instance.AllBuilders().Count}"); _debugConsole.Print(1, 4, $"..mnstrs: {Monsters.Instance.AllBuilders().Count}"); Children.Add(_debugConsole); _logConsole = new MogwaiConsole("Log", "", 110, 3) { Position = new Point(0, 27) }; Children.Add(_logConsole); HeaderPosition = 1; TrailerPosition = height - 2; CreateHeader(); CreateTrailer(); _controller = mogwaiController; _transferFunds = 2; Init(); }
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); }
public CustomShop(Mogwai mogwai, int width, int height) : base("Home Town Shop", "", width, height) { _mogwai = mogwai; Fill(DefaultForeground, new Color(100, 0, 200, 150), null); _controlsConsole = new ControlsConsole(26, 20) { Position = new Point(1, 1) }; _controlsConsole.Fill(Color.Transparent, new Color(100, 0, 200, 150), null); Children.Add(_controlsConsole); _itemConsole = new MogwaiConsole("Item", "", 50, 20) { Position = new Point(30, 1) }; //_itemConsole.Fill(Color.Transparent, Color.DarkKhaki, null); Children.Add(_itemConsole); Init(); }
public PlayScreen(MogwaiController mogwaiController, int width, int height) : base(width, height) { _controller = mogwaiController; var mogwaiKeys = _controller.CurrentMogwaiKeys ?? _controller.TestMogwaiKeys(); _mogwai = mogwaiKeys.Mogwai; _playScreenButtons = new Dictionary <string, MogwaiButton>(); var playStatsConsole = new PlayStatsConsole(_mogwai, 44, 22) { Position = new Point(0, 0) }; Children.Add(playStatsConsole); _welcome = new CustomWelcome(91, 22) { Position = new Point(46, 0) }; _adventureChoose = new CustomAdventureChoose(mogwaiController, 91, 22) { Position = new Point(46, 0) }; _shop = new CustomShop(_mogwai, 91, 22) { Position = new Point(46, 0) }; _adventure = new CustomAdventure(mogwaiController, mogwaiKeys, 91, 22) { Position = new Point(46, 0) }; _adventureStats = new CustomAdventureStats(_mogwai, 91, 22) { Position = new Point(46, 0) }; //var logFont = Global.LoadFont("Bakus8.font").GetFont(Font.FontSizes.One); _log = new ScrollingConsole(85, 13, 100, null) { Position = new Point(0, 25) }; Children.Add(_log); var playInfoConsole = new PlayInfoConsole(mogwaiController, mogwaiKeys, 49, 14) { Position = new Point(88, 24) }; Children.Add(playInfoConsole); _command1 = new TestControls(86, 1) { Position = new Point(0, 23) }; _command1.Fill(Color.Transparent, Color.Black, null); Children.Add(_command1); _command2 = new ControlsConsole(8, 2) { Position = new Point(40, 2) }; _command2.Fill(Color.Transparent, Color.DarkGray, null); playInfoConsole.Children.Add(_command2); State = SadGuiState.Play; SetCustomWindowState(PlayScreenState.Welcome); Init(); }