From a73fbc14c8aff7f43b68101cb35b1b1434dea65b Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 9 Feb 2015 11:49:02 +0100 Subject: [PATCH] Upscale icons with the previous code (AR "fix") rather then with hud_panel_weapons_onlyowned_icon_maxscale (feature removed) --- _hud_descriptions.cfg | 1 - hud_luma.cfg | 1 - hud_luminos.cfg | 1 - hud_luminos_minimal.cfg | 1 - hud_luminos_minimal_xhair.cfg | 1 - hud_luminos_old.cfg | 1 - hud_nexuiz.cfg | 1 - qcsrc/client/autocvars.qh | 1 - qcsrc/client/hud.qc | 26 +++++++++----------------- qcsrc/client/hud_config.qc | 1 - 10 files changed, 9 insertions(+), 26 deletions(-) diff --git a/_hud_descriptions.cfg b/_hud_descriptions.cfg index 06ffb8ccb..a47884ef0 100644 --- a/_hud_descriptions.cfg +++ b/_hud_descriptions.cfg @@ -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" diff --git a/hud_luma.cfg b/hud_luma.cfg index 26f82aac4..4f801509e 100644 --- a/hud_luma.cfg +++ b/hud_luma.cfg @@ -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" diff --git a/hud_luminos.cfg b/hud_luminos.cfg index 77c224e06..34db2beb6 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -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" diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg index 93424cadc..39a6fd2ed 100644 --- a/hud_luminos_minimal.cfg +++ b/hud_luminos_minimal.cfg @@ -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" diff --git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg index 3947487af..4b6b7e4a7 100644 --- a/hud_luminos_minimal_xhair.cfg +++ b/hud_luminos_minimal_xhair.cfg @@ -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" diff --git a/hud_luminos_old.cfg b/hud_luminos_old.cfg index 203e1bce5..20650899e 100644 --- a/hud_luminos_old.cfg +++ b/hud_luminos_old.cfg @@ -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" diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg index 3ecebc5bf..2d86881f5 100644 --- a/hud_nexuiz.cfg +++ b/hud_nexuiz.cfg @@ -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" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index ac254df87..e35bf82dd 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -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; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 108801180..c799ad550 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -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 diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc index fb3a42638..898f3eb56 100644 --- a/qcsrc/client/hud_config.qc +++ b/qcsrc/client/hud_config.qc @@ -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"); -- 2.39.2