Пример #1
0
 private void DrawEntityHealthbar(Color color, Color outline, Rect bg, float hpWidth, float esWidth, RenderingContext rc)
 {
     if (outline.ToArgb() != 0)
     {
         Rect rect = new Rect(bg.X - 2, bg.Y - 2, bg.W + 4, bg.H + 4);
         rc.AddBox(rect, outline);
     }
     if (Settings.GetBool("Healthbars.ShowIncrements"))
     {
         rc.AddTexture("healthbar_increment.png", bg, color);
     }
     else
     {
         rc.AddTexture("healthbar.png", bg, color);
     }
     if ((int)hpWidth < bg.W)
     {
         Rect rect2 = new Rect(bg.X + (int)hpWidth, bg.Y, bg.W - (int)hpWidth, bg.H);
         rc.AddTexture("healthbar_bg.png", rect2, color);
     }
     if (Settings.GetBool("Healthbars.ShowES"))
     {
         bg.W = (int)esWidth;
         rc.AddTexture("esbar.png", bg, Color.White);
     }
 }
Пример #2
0
        private void DrawEntityHealthbar(Color color, Color outline, Rect bg, float hpWidth, float esWidth, RenderingContext rc)
        {
            if (outline.ToArgb() != 0)
            {
                Rect rect = new Rect(bg.X - 2, bg.Y - 2, bg.W + 4, bg.H + 4);
                rc.AddBox(rect, outline);
            }
            rc.AddTexture(Settings.GetBool("Healthbars.ShowIncrements") ? "healthbar_increment.png" : "healthbar.png", bg, color);

            if ((int)hpWidth < bg.W)
            {
                Rect rect2 = new Rect(bg.X + (int)hpWidth, bg.Y, bg.W - (int)hpWidth, bg.H);
                rc.AddTexture("healthbar_bg.png", rect2, color);
            }
            if (Settings.GetBool("Healthbars.ShowES"))
            {
                bg.W = (int)esWidth;
                rc.AddTexture("esbar.png", bg, Color.White);
            }
        }
Пример #3
0
 public override void Render(RenderingContext rc)
 {
     if (!this.isVisible)
     {
         return;
     }
     Color color = this.isEnabled ? Color.Gray : Color.Crimson;
     rc.AddTextWithHeight(new Vec2(base.Bounds.X + base.Bounds.W / 2, base.Bounds.Y + base.Bounds.H / 2), this.text, Color.White, 12, DrawTextFormat.VerticalCenter | DrawTextFormat.Center);
     rc.AddBox(base.Bounds, Color.Black);
     rc.AddBox(new Rect(base.Bounds.X + 1, base.Bounds.Y + 1, base.Bounds.W - 2, base.Bounds.H - 2), color);
     if (this.children.Count > 0)
     {
         int num = (int)((float)(base.Bounds.W - 2) * 0.05f);
         int num2 = (base.Bounds.H - 2) / 2;
         rc.AddTexture("menu_submenu.png", new Rect(base.Bounds.X + base.Bounds.W - 1 - num, base.Bounds.Y + 1 + num2 - num2 / 2, num, num2));
     }
     foreach (MenuItem current in this.children)
     {
         current.Render(rc);
     }
 }
Пример #4
0
        public override void Render(RenderingContext rc)
        {
            if (!this.isVisible)
            {
                return;
            }
            Color color = this.isEnabled ? Color.Gray : Color.Crimson;

            rc.AddTextWithHeight(new Vec2(base.Bounds.X + base.Bounds.W / 2, base.Bounds.Y + base.Bounds.H / 2), this.text, Color.White, 12, DrawTextFormat.VerticalCenter | DrawTextFormat.Center);
            rc.AddBox(base.Bounds, Color.Black);
            rc.AddBox(new Rect(base.Bounds.X + 1, base.Bounds.Y + 1, base.Bounds.W - 2, base.Bounds.H - 2), color);
            if (this.children.Count > 0)
            {
                int num  = (int)((float)(base.Bounds.W - 2) * 0.05f);
                int num2 = (base.Bounds.H - 2) / 2;
                rc.AddTexture("menu_submenu.png", new Rect(base.Bounds.X + base.Bounds.W - 1 - num, base.Bounds.Y + 1 + num2 - num2 / 2, num, num2));
            }
            foreach (MenuItem current in this.children)
            {
                current.Render(rc);
            }
        }
Пример #5
0
        public void RenderAt(RenderingContext rc, Vec2 point)
        {
            Rect rect = new Rect(point.X - this.Size / 2, point.Y - this.Size / 2, this.Size, this.Size);

            rc.AddTexture(this.Texture, rect, this.color);
        }