Beispiel #1
0
        public override ConCol PopColor()
        {
            var color = base.PopColor();

            System.Console.ForegroundColor = ColorStack.Peek().ConsoleColor;
            return(color);
        }
Beispiel #2
0
 /// <summary>
 /// Renamable obstacle in the home.
 /// </summary>
 /// <param name="parent">Containing panel</param>
 public Obstacle(Panel parent) : base(parent)
 {
     color = new ColorStack(BaseColor, SelectionColor, Color.Red);
     // Add name label
     name = new Label {
         Dock      = DockStyle.Fill,
         TextAlign = ContentAlignment.MiddleLeft
     };
     SetName("New obstacle");
     Controls.Add(name);
     // Marker label
     marker = new Label {
         AutoSize  = false,
         Dock      = DockStyle.Left,
         Size      = new Size(Room.PixelsPerMeter, Room.PixelsPerMeter),
         Text      = "×",
         TextAlign = ContentAlignment.MiddleCenter
     };
     marker.Font = new Font(marker.Font.FontFamily, 16);
     Controls.Add(marker);
     // Set mouse behaviour (on both labels, because they're on top)
     SetDraggable(name);
     SetDraggable(marker);
     // Design
     Repaint();
     Size = new Size(125, 25);
     BringToFront(); // Obstacles are always above rooms
 }
Beispiel #3
0
 /// <summary>
 /// Clears all of the renderer's layout parameter stacks.
 /// </summary>
 public void ClearLayoutStacks()
 {
     StyleStack.Clear();
     FontStack.Clear();
     ColorStack.Clear();
     GlyphShaderStack.Clear();
     LinkStack.Clear();
 }
Beispiel #4
0
 /// <summary>
 /// A room in the home.
 /// </summary>
 /// <param name="parent">Containing panel</param>
 public Room(Panel parent) : base(parent)
 {
     color = new ColorStack(BaseColor, SelectionColor, ActivationColor);
     // Add name label
     name = new Label {
         Dock      = DockStyle.Fill,
         TextAlign = ContentAlignment.MiddleCenter
     };
     SetName("New room");
     Controls.Add(name);
     // Set mouse behaviour (on the filling label, because that's on top)
     SetDraggable(name);
     // Design
     BorderStyle = BorderStyle.FixedSingle;
     Size        = new Size(5 * PixelsPerMeter, 5 * PixelsPerMeter);
     SendToBack(); // Rooms are always behind every other object
 }
Beispiel #5
0
            public void PopStyleScope()
            {
                var scope = StyleStack.Count;

                while (FontStack.Count > 0 && FontStack.Peek().Scope == scope)
                {
                    FontStack.Pop();
                }

                while (ColorStack.Count > 0 && ColorStack.Peek().Scope == scope)
                {
                    ColorStack.Pop();
                }

                while (GlyphShaderStack.Count > 0 && GlyphShaderStack.Peek().Scope == scope)
                {
                    GlyphShaderStack.Pop();
                }
            }
Beispiel #6
0
 /// <summary>
 /// A sensor in a room.
 /// </summary>
 /// <param name="parent">Containing element</param>
 public Sensor(SerializablePanel parent) : base(parent)
 {
     color = new ColorStack(BaseColor, SelectionColor, ActivationColor);
     // Marker label
     marker = new Label {
         AutoSize  = false,
         ForeColor = Color.Gray,
         Dock      = DockStyle.Fill,
         Size      = new Size(SensorSize, SensorSize),
         Text      = "O",
         TextAlign = ContentAlignment.MiddleCenter
     };
     marker.Font = new Font(marker.Font.FontFamily, SensorSize / 2);
     Controls.Add(marker);
     // Set mouse behaviour (on the filling label, because that's on top)
     SetDraggable(marker);
     // Design
     Repaint();
     Size = new Size(25, 25);
     BringToFront(); // Sensors are always above every other object
     sensors.Add(this);
 }
Beispiel #7
0
 void Start()
 {
     colorStack = gameObject.GetComponent<ColorStack>();
 }
Beispiel #8
0
 public BaseDrawer()
 {
     _colorStack      = new ColorStack();
     _textureDatabase = TextureDatabaseProvider.GetDatabase(this);
     _contentCache    = new GUIContentCache();
 }
Beispiel #9
0
 public BaseDrawer()
 {
     _colorStack = new ColorStack ();
     _textureDatabase = TextureDatabaseProvider.GetDatabase (this);
     _contentCache = new GUIContentCache ();
 }
Beispiel #10
0
 public ConsoleWriter()
 {
     System.Console.ResetColor();
     ColorStack.Push(new ConCol(System.Console.ForegroundColor));
 }