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));
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
        public DynamicLabel(
			int topRow,
			int leftColumn,
			Func<string> textAction,
			Font font,
			ColorScheme scheme)
            : base(topRow, leftColumn, textAction(), font, scheme)
        {
            this.textAction = textAction;
        }
Esempio n. 5
0
 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));
 }
Esempio n. 6
0
        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)
        {
        }
Esempio n. 7
0
        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;
        }
Esempio n. 8
0
        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)
        {
        }
Esempio n. 9
0
        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;
        }
Esempio n. 10
0
        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;
            }
        }
Esempio n. 11
0
 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));
         }
     }
 }
Esempio n. 12
0
        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;
        }
Esempio n. 13
0
        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;
        }
Esempio n. 14
0
        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;
        }
Esempio n. 15
0
        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;
        }
Esempio n. 16
0
 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));
 }