]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Reflect HUD background brightness if bigger than 0.25 (so the color remains visible...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 4 Sep 2010 22:46:24 +0000 (01:46 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 4 Sep 2010 22:46:24 +0000 (01:46 +0300)
data/qcsrc/client/sbar.qc

index 974a2ddca1a089110c0aa441e826a65cbc9d52eb..cabd0a807e9482405e6b482d0ac42a7624da0560 100644 (file)
@@ -2906,14 +2906,23 @@ void Sbar_Draw (void)
 \r
                                drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach", '256 256 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
                        }\r
+                       vector stomach_status_color;\r
                        if(getstati(STAT_STOMACH_EATEN))\r
                        {\r
-                               drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Stomachstatus_Colortrans('1 0 0'), sbar_alpha_bg, DRAWFLAG_NORMAL);\r
+                               stomach_status_color_x = bound(0.25, vlen(color), 1); // reflect HUD background brightness, but only up to a certain limit (so the color is still visible with black HUD)\r
+                               stomach_status_color_y = 0;\r
+                               stomach_status_color_z = 0;\r
+\r
+                               drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', stomach_status_color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
                                drawstring(bottomleft - '-80 168 0', "predator:", '8 8 0', '0 0 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        }\r
                        else\r
                        {\r
-                               drawpic(bottomleft- '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', Stomachstatus_Colortrans('0 1 0'), sbar_alpha_bg, DRAWFLAG_NORMAL);\r
+                               stomach_status_color_x = 0;\r
+                               stomach_status_color_y = bound(0.25, vlen(color), 1); // reflect HUD background brightness, but only up to a certain limit (so the color is still visible with black HUD)\r
+                               stomach_status_color_z = 0;\r
+\r
+                               drawpic(bottomleft - '0 256 0', "gfx/hud/bg_stomach_status", '256 256 0', stomach_status_color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
                                drawstring(bottomleft - '-80 168 0', "self:", '8 8 0', '0 0 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                        }\r
                }\r