some fixes to exporter, custom aspect cvar for weaponicons
authorFruitieX <rasse@rasse-lappy.localdomain>
Sun, 11 Jul 2010 00:08:04 +0000 (03:08 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Sun, 11 Jul 2010 00:08:04 +0000 (03:08 +0300)
hud_wickedhud_default.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc

index 11789ba009f98c64d74eb1c1940615084d3739fe..7ac0c0a8e4cf0f40998f175968738f65f282391b 100644 (file)
@@ -25,16 +25,17 @@ seta _hud_panelorder "6 0 1 2 3 4 5 7 8 9 10 11 12 13 14" "contains order in whi
 seta hud_weaponicons 1 "enable/disable this panel"
 seta hud_weaponicons_pos "0.930000 0.090000" "position of this panel"
 seta hud_weaponicons_size "0.040000 0.490000" "size of this panel"
-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_ammo_color "0 1 0" "color of status bar"
-seta hud_weaponicons_ammo_alpha 1 "alpha of status bar"
 seta hud_weaponicons_bg "border_weaponicons" "if set to something else than \"\" = override default background"
 seta hud_weaponicons_bg_color "" "if set to something else than \"\" = override default panel background color"
 seta hud_weaponicons_bg_color_team "" "override panel color with team color in team based games"
 seta hud_weaponicons_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
 seta hud_weaponicons_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_weaponicons_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+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_ammo_color "0 1 0" "color of status bar"
+seta hud_weaponicons_ammo_alpha 1 "alpha of status bar"
 
 seta hud_inventory 1 "enable/disable this panel"
 seta hud_inventory_pos "0.190000 0.930000" "position of this panel"
index d53574d89546388df17dfcad676f36aa0e5b7136..5c0253ebf2ebd9cf162bc622bdebf51e197c02b4 100644 (file)
@@ -53,6 +53,7 @@ var string autocvar_hud_weaponicons_bg_color_team;
 var string autocvar_hud_weaponicons_bg_alpha;
 var string autocvar_hud_weaponicons_bg_border;
 var string autocvar_hud_weaponicons_bg_padding;
+var float autocvar_hud_weaponicons_aspect;
 var float autocvar_hud_weaponicons_accuracy;
 var float autocvar_hud_weaponicons_accuracy_yellow;
 var float autocvar_hud_weaponicons_ammo;
index e46a70ae4465ed65e2281a4872623158b81ec28f..cb55a4e1c38b68e48624780f8ad544e5dcd3ea04 100644 (file)
@@ -469,6 +469,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        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, "_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"));
                                        break;
                                case HUD_PANEL_INVENTORY:
                                        fputs(fh, strcat("seta hud_", panel_name, "_onlycurrent \"", cvar_string(strcat("hud_", panel_name, "_onlycurrent")), "\"", "\n"));
@@ -494,6 +495,9 @@ void HUD_Panel_ExportCfg(string cfgname)
                                case HUD_PANEL_VOTE:
                                        fputs(fh, strcat("seta hud_", panel_name, "_alreadyvoted_alpha \"", cvar_string(strcat("hud_", panel_name, "_alreadyvoted_alpha")), "\"", "\n"));
                                        break;
+                               case HUD_PANEL_PRESSEDKEYS:
+                                       fputs(fh, strcat("seta hud_", panel_name, "_aspect \"", cvar_string(strcat("hud_", panel_name, "_aspect")), "\"", "\n"));
+                                       break;
                        }
                        fputs(fh, "\n");
                }
@@ -1437,8 +1441,7 @@ void HUD_WeaponIcons(void)
 
        float rows, columns;
        rows = mySize_y/mySize_x;
-       rows = bound(1, floor((sqrt(4 * (2/1) * rows * WEP_COUNT + rows * rows) + rows + 0.5) / 2), WEP_COUNT);
-       //                               ^^^ weapon icon aspect goes here
+       rows = bound(1, floor((sqrt(4 * autocvar_hud_weaponicons_aspect * rows * WEP_COUNT + rows * rows) + rows + 0.5) / 2), WEP_COUNT);
 
        columns = ceil(WEP_COUNT/rows);
        float row, column;
@@ -1524,9 +1527,9 @@ void HUD_WeaponIcons(void)
 
                                        vector barsize;
                                        vector barpos;
-                                       if(wpnsize_x/wpnsize_y > 2)
+                                       if(wpnsize_x/wpnsize_y > autocvar_hud_weaponicons_aspect)
                                        {
-                                               barsize_x = 2 * wpnsize_y;
+                                               barsize_x = autocvar_hud_weaponicons_aspect * wpnsize_y;
                                                barsize_y = wpnsize_y;
 
                                                barpos_x = wpnpos_x + (wpnsize_x - barsize_x) / 2;
@@ -1534,7 +1537,7 @@ void HUD_WeaponIcons(void)
                                        }
                                        else
                                        {
-                                               barsize_y = 1/2 * wpnsize_x;
+                                               barsize_y = 1/autocvar_hud_weaponicons_aspect * wpnsize_x;
                                                barsize_x = wpnsize_x;
 
                                                barpos_y = wpnpos_y + (wpnsize_y - barsize_y) / 2;
@@ -1545,7 +1548,7 @@ void HUD_WeaponIcons(void)
                                                barpos_x,
                                                barpos_y,
                                                barsize_x * bound(0, a/fullammo, 1),
-                                               barsize_y); // use 2x more full ammo for uzi
+                                               barsize_y);
                                        drawpic_aspect_skin(wpnpos, "weapon_ammo", wpnsize, autocvar_hud_weaponicons_ammo_color, panel_fg_alpha * autocvar_hud_weaponicons_ammo_alpha, DRAWFLAG_NORMAL);
                                        drawresetcliparea();
                                }