Exemple #1
0
        public override void Draw(Renderer renderer)
        {
            base.Draw(renderer);
            String s = "";

            if (Avalable == -1)
            {
                s = "oo";
            }
            else
            {
                s = Avalable.ToString();
            }
            var a = ComponentSelector.ComponentsLeftFont.MeasureString(s);

            if (component.drawCount)
            {
                Main.renderer.DrawString(ComponentSelector.ComponentsLeftFont, s,
                                         new Rectangle((int)Position.X, (int)(Position.Y + SIZE_X - a.Y), (int)SIZE_X - 2, (int)a.Y),
                                         Color.White, Renderer.TextAlignment.Right);
            }

            renderer.Draw(fav, new Rectangle((int)position.X + SIZE_X - 13, (int)position.Y + 1, 12, 12),
                          component.IsFavourite ? Color.White : Color.Gray);
        }
Exemple #2
0
 public override void onMouseMove(InputEngine.MouseMoveArgs e)
 {
     if (IsIn(e.curState.X, e.curState.Y))
     {
         String s = "";
         if (Avalable == -1)
         {
             s = "oo";
         }
         else
         {
             s = Avalable.ToString();
         }
         Shortcuts.SetInGameStatus(Text + " (" + s + " avalable)",
                                   "<Click> to select, <Middle click> for handbook");
     }
     base.onMouseMove(e);
 }
Exemple #3
0
        public override void DrawAt(int x, int y, Renderer renderer)
        {
            Vector2 t = position;

            position = new Vector2(x, y);

            if (Texture == null)
            {
                return;
            }
            if (!isVisible)
            {
                return;
            }
            renderer.Draw(ComponentSelector.ComponentBackground, new Rectangle((int)position.X, (int)position.Y, SIZE_X, SIZE_Y),
                          Color.White);
            renderer.Draw(Texture, new Rectangle((int)position.X + 4, (int)position.Y + 4, SIZE_X - 8, SIZE_Y - 8), Color);
            String s = "";

            if (Avalable == -1)
            {
                s = "oo";
            }
            else
            {
                s = Avalable.ToString();
            }
            var a = ComponentSelector.ComponentsLeftFont.MeasureString(s);

            if (component.drawCount)
            {
                Main.renderer.DrawString(ComponentSelector.ComponentsLeftFont, s,
                                         new Rectangle((int)Position.X, (int)(Position.Y + SIZE_X - a.Y), (int)SIZE_X - 1, (int)a.Y),
                                         Color.White, Renderer.TextAlignment.Right);
            }

            position = t;
        }