public override void Draw(CompactGraphics g, Input.inpuT input)
 {
     if (isIteractable)
     {
         inputAction(input);
     }
     else
     {
         action();
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Updates and adds all the current widgets to the frame, passing user input.
 /// </summary>
 /// <param name="input">The current user input value</param>
 public virtual void StepFrame(Input.inpuT input)
 {
     foreach (Widget widget in onPage)
     {
         if (widget.Selected)
         {
             widget.Draw(g, input);
         }
         else
         {
             widget.Draw(g);
         }
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Update the text entry with a key input then draw to the screen buffer.
 /// </summary>
 /// <param name="g"></param>
 /// <param name="keyInfo"></param>
 public override void Draw(CompactGraphics g, Input.inpuT keyInfo)
 {
     if (keyInfo.key != ConsoleKey.Backspace)
     {
         text += keyInfo.KeyChar;
     }
     else if (keyInfo.key == ConsoleKey.Backspace)
     {
         if (text.Length > 0)
         {
             text = text.Remove(text.Length - 1);
         }
     }
     Draw(g);
 }
Ejemplo n.º 4
0
        public override void Draw(CompactGraphics g, Input.inpuT mouse)
        {
            if (Bounds.Overlaps(mouse.MouseX, mouse.MouseY))
            {
                switch (mouse.buttonState)
                {
                case 0:
                    tempback = hover_color;
                    if (mouseDown == 1)
                    {
                        OnClick(mouse);
                    }
                    mouseDown = 0;
                    break;

                case 1 when mouseDown == 0 || mouseDown == 1:
                    tempback  = ClickColor;
                    mouseDown = 1;
                    break;

                default:
                    tempback  = backColor;
                    mouseDown = 0;
                    break;
                }
            }
            else
            {
                tempback = backColor;
            }
            for (int i = 0; i < lines.Count; i++)
            {
                if (Bounds.y1 + i < Bounds.y2)
                {
                    g.Draw(lines[i], tempfor, Bounds.x1, Bounds.y1 + i);
                    g.DrawBGRectangle(tempback, Bounds.x1, Bounds.x2 - 1, Bounds.y1 + i, Bounds.y1 + i);
                }
            }
        }
Ejemplo n.º 5
0
 public void Step(Input.inpuT userInput)
 {
 }