public NotEnoughStoreSpace(ColorScheme colorScheme, byte[] background, int palette = 6) { AddControl(new Border(20, 32, 256, 160, colorScheme, background, palette)); AddControl(new Label(75, Label.Center, "NOT ENOUGH STORE SPACE!", Font.Large, colorScheme)); AddControl(new Label(90, Label.Center, "Build a new store facility or transfer existing", Font.Normal, colorScheme)); AddControl(new Label(100, Label.Center, "stores to other bases.", Font.Normal, colorScheme)); AddControl(new Button(154, 100, 120, 18, "OK", colorScheme, Font.Normal, EndModal)); }
public NotEnoughLivingSpace(ColorScheme colorScheme, byte[] background) { AddControl(new Border(20, 32, 256, 160, colorScheme, background, 6)); AddControl(new Label(75, Label.Center, "NOT ENOUGH LIVING SPACE!", Font.Large, colorScheme)); AddControl(new Label(90, Label.Center, "Build new living quarters or transfer personnel to", Font.Normal, colorScheme)); AddControl(new Label(100, Label.Center, "other bases.", Font.Normal, colorScheme)); AddControl(new Button(154, 100, 120, 18, "OK", colorScheme, Font.Normal, EndModal)); }
public WrappedLabel(int topRow, int leftColumn, int width, string text, Font font, ColorScheme scheme) { var nextTopRow = topRow; foreach (var lineOfText in WrapText(text, width, font)) { AddControl(new Label(nextTopRow, leftColumn, lineOfText, font, scheme)); nextTopRow += font.Height; } Bottom = nextTopRow; }
public DynamicLabel( int topRow, int leftColumn, Func<string> textAction, Font font, ColorScheme scheme) : base(topRow, leftColumn, textAction(), font, scheme) { this.textAction = textAction; }
public NoFreeHangars(ColorScheme colorScheme, byte[] background, string purpose) { AddControl(new Border(20, 32, 256, 160, colorScheme, background, 6)); AddControl(new Label(58, Label.Center, "NO FREE HANGARS FOR", Font.Large, colorScheme)); AddControl(new Label(74, Label.Center, $"{purpose}!", Font.Large, colorScheme)); AddControl(new Label(90, Label.Center, "Each craft assigned to a base, transferred to a", Font.Normal, colorScheme)); AddControl(new Label(100, Label.Center, "base, purchased or constructed uses one hangar.", Font.Normal, colorScheme)); AddControl(new Label(110, Label.Center, "Build a new hangar or transfer a craft to another", Font.Normal, colorScheme)); AddControl(new Label(120, Label.Center, "base.", Font.Normal, colorScheme)); AddControl(new Button(154, 100, 120, 18, "OK", colorScheme, Font.Normal, EndModal)); }
public ExtendedEdit( int topRow, int leftColumn, int width, string text, Font font, ColorScheme scheme, Action<string> action) : base(topRow, leftColumn, width, text, font, scheme, action) { }
public ExtendedLabel( int topRow, int leftColumn, int width, string text, Font font, ColorScheme scheme) : base(topRow, leftColumn, text, font, scheme) { this.width = width; fillScheme = scheme; }
public Toggle( int topRow, int leftColumn, int width, int height, string text, ColorScheme scheme, Font font, Action action) : base(topRow, leftColumn, width, height, text, scheme, font, action) { }
public UpDown( int topRow, int leftColumn, ColorScheme scheme, Action upAction, Action downAction) { this.topRow = topRow; this.leftColumn = leftColumn; this.scheme = scheme; this.upAction = upAction; this.downAction = downAction; }
public void DrawString( GraphicsBuffer buffer, int topRow, int leftColumn, string value, ColorScheme scheme) { var column = leftColumn; foreach (var character in value.Select(GetCharacter)) { character.Render(buffer, topRow, column, scheme); column += character.Width - 1; } }
public void Render(GraphicsBuffer buffer, int topRow, int leftColumn, ColorScheme scheme) { foreach (var rowIndex in Enumerable.Range(0, height)) { foreach (var columnIndex in Enumerable.Range(0, Width)) { var colorIndex = data[rowIndex * Width + columnIndex]; if (colorIndex != 0) buffer.SetPixel( topRow + rowIndex, leftColumn + columnIndex, scheme.GetColor(colorIndex)); } } }
public Border( int topRow, int leftColumn, int width, int height, ColorScheme scheme, byte[] background, int paletteIndex) { this.topRow = topRow; this.leftColumn = leftColumn; this.width = width; this.height = height; this.scheme = scheme; this.background = background; this.paletteIndex = paletteIndex; }
public LabeledValue( int topRow, int leftColumn, string labelText, string valueText, Font font, ColorScheme labelScheme, ColorScheme valueScheme) { this.topRow = topRow; this.leftColumn = leftColumn; this.labelText = labelText; this.valueText = valueText; this.font = font; this.labelScheme = labelScheme; this.valueScheme = valueScheme; }
public Edit( int topRow, int leftColumn, int width, string text, Font font, ColorScheme scheme, Action<string> action) { TopRow = topRow; LeftColumn = leftColumn; Width = width; Text = text; Font = font; Scheme = scheme; this.action = action; }
public Button( int topRow, int leftColumn, int width, int height, string text, ColorScheme scheme, Font font, Action action) { this.topRow = topRow; this.leftColumn = leftColumn; this.width = width; this.height = height; this.text = text; this.scheme = scheme; this.font = font; Action = action; Visible = true; }
public NotEnoughMoney(ColorScheme colorScheme, byte[] background) { AddControl(new Border(20, 32, 256, 160, colorScheme, background, 6)); AddControl(new Label(82, Label.Center, "NOT ENOUGH MONEY!", Font.Large, colorScheme)); AddControl(new Button(154, 100, 120, 18, "OK", colorScheme, Font.Normal, EndModal)); }