]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Upscale icons with the previous code (AR "fix") rather then with hud_panel_weapons_on...
authorterencehill <piuntn@gmail.com>
Mon, 9 Feb 2015 10:49:02 +0000 (11:49 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 9 Feb 2015 11:08:54 +0000 (12:08 +0100)
_hud_descriptions.cfg
hud_luma.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc

index 06ffb8ccb9b7b88ab79b563d898027a6c1437b66..a47884ef05f586d66da20ad330a33b864eb3d017 100644 (file)
@@ -62,7 +62,6 @@ seta hud_panel_weapons_label_scale "" "scale of the weapon text label"
 seta hud_panel_weapons_accuracy "" "show accuracy color as the weapon icon background; colors can be configured with accuracy_color* cvars"
 seta hud_panel_weapons_ammo "" "show ammo as a status bar"
 seta hud_panel_weapons_onlyowned "" "show only owned weapons"
-seta hud_panel_weapons_onlyowned_icon_maxscale "" "scale icons up by this factor when there's enough available space; 0 means use maximum available scale"
 
 seta hud_panel_ammo "" "enable/disable this panel"
 seta hud_panel_ammo_pos "" "position of this panel"
index 26f82aac45679141ca8fee44c14442676bbb408b..4f801509eb8681932a3ca0e9cdd98cd9fb9daf60 100644 (file)
@@ -60,7 +60,6 @@ seta hud_panel_weapons_timeout_fadefgmin "0.4"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "1"
-seta hud_panel_weapons_onlyowned_icon_maxscale "1.5"
 
 seta hud_panel_ammo 1
 seta hud_panel_ammo_pos "0.330000 0.865000"
index 77c224e06b068283b2b08d85affb6abb060c9fba..34db2beb663e7cdf118e8cdb3814575a18529ef1 100644 (file)
@@ -60,7 +60,6 @@ seta hud_panel_weapons_timeout_fadefgmin "0.4"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "1"
-seta hud_panel_weapons_onlyowned_icon_maxscale "1.5"
 
 seta hud_panel_ammo 1
 seta hud_panel_ammo_pos "0.330000 0.960000"
index 93424cadc00e9d7a00f2cadb4dd223c0b4143a6b..39a6fd2eddbcb8547c9be24ca5cc983ad6ac0c7c 100644 (file)
@@ -60,7 +60,6 @@ seta hud_panel_weapons_timeout_fadefgmin "0"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "1"
-seta hud_panel_weapons_onlyowned_icon_maxscale "1.5"
 
 seta hud_panel_ammo 1
 seta hud_panel_ammo_pos "0.650000 0.890000"
index 3947487afecdeb2059fb104eb0de109e18dca616..4b6b7e4a74288362ce8761363045f4d2e8767042 100644 (file)
@@ -60,7 +60,6 @@ seta hud_panel_weapons_timeout_fadefgmin "0"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "1"
-seta hud_panel_weapons_onlyowned_icon_maxscale "1.5"
 
 seta hud_panel_ammo 1
 seta hud_panel_ammo_pos "0.450000 0.630000"
index 203e1bce56b0e3438004c4dddbd08c4bd2c288e3..20650899e77de25e7e1e33d485fbeb5beb2e243f 100644 (file)
@@ -60,7 +60,6 @@ seta hud_panel_weapons_timeout_fadefgmin "0"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "1"
-seta hud_panel_weapons_onlyowned_icon_maxscale "1.5"
 
 seta hud_panel_ammo 1
 seta hud_panel_ammo_pos "0.190000 0.920000"
index 3ecebc5bf8bbc17bcb43cba82492b12f8399619d..2d86881f5fa81c7827cf133718987757fd0da4df 100644 (file)
@@ -60,7 +60,6 @@ seta hud_panel_weapons_timeout_fadefgmin "0"
 seta hud_panel_weapons_timeout_speed_in "0.25"
 seta hud_panel_weapons_timeout_speed_out "0.75"
 seta hud_panel_weapons_onlyowned "0"
-seta hud_panel_weapons_onlyowned_icon_maxscale "1.5"
 
 seta hud_panel_ammo 1
 seta hud_panel_ammo_pos "0.160000 0.910000"
index ac254df87da4aec303cfc4dbb91b275408f3a849..e35bf82dd2759122afc2cf11d46707ef5fc1177b 100644 (file)
@@ -352,7 +352,6 @@ float autocvar_hud_panel_weapons_complainbubble_time;
 int autocvar_hud_panel_weapons_label;
 float autocvar_hud_panel_weapons_label_scale = 0.5;
 bool autocvar_hud_panel_weapons_onlyowned;
-float autocvar_hud_panel_weapons_onlyowned_icon_maxscale = 1.5;
 float autocvar_hud_panel_weapons_timeout;
 int autocvar_hud_panel_weapons_timeout_effect;
 float autocvar_hud_panel_weapons_timeout_fadebgmin;
index 1088011808d0c6479f632725848403b82ed3d2bd..c799ad550d2f8acce515a2b1b54f8b791eb3efbb 100644 (file)
@@ -566,25 +566,17 @@ void HUD_Weapons(void)
                        rows = ceil(weapon_count / columns);
                }
 
-               // reduce cell size to match the desired aspect ratio
-               // NOTE: it doesn't reduce weapon icon size itself at all
-               // (assuming aspect ratio of the real weapon image == aspect)
-               if(weapon_size.x / weapon_size.y > aspect)
-                       weapon_size.x = aspect * weapon_size.y;
+               // NOTE: although weapons should aways look the same even if onlyowned is enabled,
+               // we enlarge them a bit when possible to better match the desired aspect ratio
+               if(padded_panel_size.y > padded_panel_size.x)
+               {
+                       weapon_size.y = min(padded_panel_size.y / rows, weapon_size.x / aspect);
+                       weapon_size.x = min(padded_panel_size.x / columns, aspect * weapon_size.y);
+               }
                else
-                       weapon_size.y = weapon_size.x / aspect;
-
-               float maxscale = autocvar_hud_panel_weapons_onlyowned_icon_maxscale;
-               if(maxscale == 0)
-                       maxscale = 99;
-               if(maxscale > 1)
                {
-                       weapon_size.x = min(padded_panel_size.x / columns, weapon_size.x * maxscale);
-                       weapon_size.y = min(padded_panel_size.y / rows, weapon_size.y * maxscale);
-                       if(weapon_size.x / weapon_size.y > aspect)
-                               weapon_size.x = aspect * weapon_size.y;
-                       else
-                               weapon_size.y = weapon_size.x / aspect;
+                       weapon_size.x = min(padded_panel_size.x / columns, aspect * weapon_size.y);
+                       weapon_size.y = min(padded_panel_size.y / rows, weapon_size.x / aspect);
                }
 
                // reduce size of the panel
index fb3a42638f0b1d70118814ad0c22bcf1020809e8..898f3eb56f00f9cf6bb1195ba6d31e7a41035e74 100644 (file)
@@ -98,7 +98,6 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        HUD_Write_PanelCvar_q("_timeout_speed_in");
                                        HUD_Write_PanelCvar_q("_timeout_speed_out");
                                        HUD_Write_PanelCvar_q("_onlyowned");
-                                       HUD_Write_PanelCvar_q("onlyowned_icon_maxscale");
                                        break;
                                case HUD_PANEL_AMMO:
                                        HUD_Write_PanelCvar_q("_onlycurrent");