allow custom colors (by cvars) on the complain bubbles
authorFruitieX <rasse@rasse-lappy.localdomain>
Tue, 13 Jul 2010 11:27:18 +0000 (14:27 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Tue, 13 Jul 2010 11:27:18 +0000 (14:27 +0300)
hud_wickedhud_default.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc

index 7ac0c0a8e4cf0f40998f175968738f65f282391b..3c14d3637fb8c78e41394a004e4b8a65158e5110 100644 (file)
@@ -34,6 +34,9 @@ seta hud_weaponicons_bg_padding "" "if set to something else than \"\" = overrid
 seta hud_weaponicons_aspect 2 "use this aspect on the items"
 seta hud_weaponicons_complainbubble 1 "complain bubble (out of ammo, weapon not available etc)"
 seta hud_weaponicons_complainbubble_padding -10 "padding for the complainbubble"
+seta hud_weaponicons_complainbubble_color_outofammo "0.8 0 0" "color of the complainbubble when showing out of ammo message"
+seta hud_weaponicons_complainbubble_color_donthave "0.8 0.5 0" "color of the complainbubble when showing don't have weapon message"
+seta hud_weaponicons_complainbubble_color_unavailable "0 0.3 0.8" "color of the complainbubble when showing weapon unavailable message"
 seta hud_weaponicons_ammo_color "0 1 0" "color of status bar"
 seta hud_weaponicons_ammo_alpha 1 "alpha of status bar"
 
index ba29fb81193c58366378d18879cca567c9d9185f..640a8e23cf135437a1bebd0bd2324f950234f952 100644 (file)
@@ -70,6 +70,9 @@ var float autocvar_hud_weaponicons_complainbubble;
 var float autocvar_hud_weaponicons_complainbubble_padding;
 var float autocvar_hud_weaponicons_complainbubble_time;
 var float autocvar_hud_weaponicons_complainbubble_fadetime;
+var vector autocvar_hud_weaponicons_complainbubble_color_outofammo;
+var vector autocvar_hud_weaponicons_complainbubble_color_donthave;
+var vector autocvar_hud_weaponicons_complainbubble_color_unavailable;
 
 var float autocvar_hud_inventory;
 var vector autocvar_hud_inventory_pos;
index 0f962ca36a76a1673ce597a95f8b8a309268c24c..27484c52d7fdfab0a63deb656d56641361fb946f 100644 (file)
@@ -467,6 +467,9 @@ void HUD_Panel_ExportCfg(string cfgname)
                                case HUD_PANEL_WEAPONICONS:
                                        fputs(fh, strcat("seta hud_", panel_name, "_complainbubble \"", cvar_string(strcat("hud_", panel_name, "_complainbubble")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_", panel_name, "_complainbubble_padding \"", cvar_string(strcat("hud_", panel_name, "_complainbubble_padding")), "\"", "\n"));
+                                       fputs(fh, strcat("seta hud_", panel_name, "_complainbubble_color_outofammo \"", cvar_string(strcat("hud_", panel_name, "_complainbubble_color_outofammo")), "\"", "\n"));
+                                       fputs(fh, strcat("seta hud_", panel_name, "_complainbubble_color_donthave \"", cvar_string(strcat("hud_", panel_name, "_complainbubble_color_donthave")), "\"", "\n"));
+                                       fputs(fh, strcat("seta hud_", panel_name, "_complainbubble_color_unavailable \"", cvar_string(strcat("hud_", panel_name, "_complainbubble_color_unavailable")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_", panel_name, "_ammo_color \"", cvar_string(strcat("hud_", panel_name, "_ammo_color")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_", panel_name, "_ammo_alpha \"", cvar_string(strcat("hud_", panel_name, "_ammo_alpha")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_", panel_name, "_aspect \"", cvar_string(strcat("hud_", panel_name, "_ammo_alpha")), "\"", "\n"));
@@ -1582,15 +1585,15 @@ void HUD_WeaponIcons(void)
                        string s;
                        if(complain_weapon_type == 0) {
                                s = "Out of ammo";
-                               color = '0.8 0 0';
+                               color = autocvar_hud_weaponicons_complainbubble_color_outofammo;
                        }
                        else if(complain_weapon_type == 1) {
                                s = "Don't have";
-                               color = '0.8 0.5 0';
+                               color = autocvar_hud_weaponicons_complainbubble_color_donthave;
                        }
                        else {
                                s = "Unavailable";
-                               color = '0 0.3 0.8';
+                               color = autocvar_hud_weaponicons_complainbubble_color_unavailable;
                        }
                        drawpic_aspect_skin(wpnpos + '1 1 0' * autocvar_hud_weaponicons_complainbubble_padding, "weapon_complainbubble", wpnsize - '2 2 0' * autocvar_hud_weaponicons_complainbubble_padding, color, a * panel_fg_alpha, DRAWFLAG_NORMAL);
                        drawstring_aspect(wpnpos + '1 1 0' * autocvar_hud_weaponicons_complainbubble_padding, s, wpnsize - '2 2 0' * autocvar_hud_weaponicons_complainbubble_padding, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);