public ScrollingConsole(int width, int height, int bufferHeight, Font font = null) { UseKeyboard = false; UseMouse = true; _controlsHost = new ControlsConsole(1, height); var 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); _mainConsole = new Console(width - 1, bufferHeight) { ViewPort = new Rectangle(0, 0, width - 1, height), Cursor = { IsVisible = false }, Font = font == null ? Font:font }; _scrollBar = ScrollBar.Create(Orientation.Vertical, height); _scrollBar.IsEnabled = false; _scrollBar.ValueChanged += ScrollBar_ValueChanged; _controlsHost.Add(_scrollBar); _controlsHost.Position = new Point(1 + _mainConsole.Width, Position.Y); Children.Add(_mainConsole); Children.Add(_controlsHost); _scrollingCounter = 0; }
public ScrollableConsole(string title, int width, int height, int bufferHeight) : base(width - 1, bufferHeight, new Rectangle(0, 0, width - 1, height)) { controlsContainer = new ControlsConsole(1, height); ViewPort = new Rectangle(0, 0, width, height); scrollBar = SadConsole.Controls.ScrollBar.Create(Orientation.Vertical, height); scrollBar.IsEnabled = false; scrollBar.ValueChanged += ScrollBar_ValueChanged; controlsContainer.Add(scrollBar); controlsContainer.Position = new Point(Position.X + width - 1, Position.Y); controlsContainer.IsVisible = true; 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); borderSurface.Print(2, 0, title, Color.DarkCyan, Color.Black); Children.Add(borderSurface); Cursor.IsVisible = false; IsVisible = true; scrollingCounter = 0; }
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 TestControls(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.TransparentBlack)); BorderSurface.Position = new Point(-1, -1); Children.Add(BorderSurface); }
public WalletConsole(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); controller = mogwaiController; }
public MogwaiConsole(string title, string footer, int width, int height) : base(width, height) { Cursor.Position = new Point(0, 0); 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); borderSurface.Print(2, 0, title, Color.DarkCyan, Color.Black); borderSurface.Print(width - footer.Length - 2, height + 1, footer, Color.DarkCyan, Color.Black); Children.Add(borderSurface); }
public PlayStatsConsole(Mogwai mogwai, int width, int height) : base(width, height) { _mogwai = mogwai; _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); Init(); }
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(); }
public LogoConsole(int width, int height) : base(width, height) { var footer = "Mogwaicoin Team 2018"; Cursor.Position = new Point(0, 0); 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); borderSurface.Print(width - footer.Length - 2, height + 1, footer, Color.DarkCyan, Color.Black); Children.Add(borderSurface); for (int i = 0; i < Ascii.Logo.Length; i++) { string str = Ascii.Logo[i]; Print(4, i, $"[c:g b:0,0,0:Black:DarkCyan:DarkGoldenRod:DarkRed:Black:0,0,0:{str.Length}][c:g f:LimeGreen:Orange:{str.Length}]" + str, Color.Cyan, Color.Black); } }