]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
horizontal layout for health/armor panel
authorFruitieX <rasse@rasse-lappy.localdomain>
Sun, 2 May 2010 07:20:19 +0000 (10:20 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Sun, 2 May 2010 11:40:19 +0000 (14:40 +0300)
qcsrc/client/hud.qc

index 31d7e9ccda4b806354f21d5d10998709fedc4c5f..241df8fb9f44500f2173bed602c167d46f643b7c 100644 (file)
@@ -1412,6 +1412,38 @@ void HUD_HealthArmor(void)
                                HUD_DrawXNum_Colored(pos + eY * 0.55 * mySize_y, x, numbers, 0.5 * mySize_y, hud_alpha_fg);
                        }
 
+                       // health
+                       x = health;
+                       if (x < 10)
+                               numbers = 1;
+                       else if (x < 100)
+                               numbers = 2;
+                       else
+                               numbers = 3;
+
+                       drawpic(pos + eX * mySize_x - eX * 1.22 * mySize_y, "gfx/hud/sb_health", '0.7 0.7 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+                       HUD_DrawXNum_Colored(pos + eX * mySize_x - eX * numbers * 0.5 * mySize_y + eY * 0.55 * mySize_y, x, numbers, 0.5 * mySize_y, hud_alpha_fg);
+               }
+               else
+               {
+                       // armor
+                       x = armor;
+                       if (x < 10)
+                               numbers = 1;
+                       else if (x < 100)
+                               numbers = 2;
+                       else
+                               numbers = 3;
+
+                       if (x > 0)
+                       {
+                               if (x > 45)
+                                       drawpic(pos + eX * 0.4 * mySize_y, "gfx/hud/sb_armor", '0.7 0.7 0' * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
+                               else
+                                       drawpic(pos + eX * 0.4 * mySize_y, "gfx/hud/sb_armor", '0.7 0.7 0' * mySize_y, '1 1 1', (x+10)/55 * hud_alpha_fg, DRAWFLAG_NORMAL);
+                               HUD_DrawXNum_Colored(pos + eY * 0.55 * mySize_y, x, numbers, 0.5 * mySize_y, hud_alpha_fg);
+                       }
+
                        // health
                        x = health;
                        if (x < 10)