From: Severin Meyer Date: Sun, 18 Jan 2015 23:35:36 +0000 (+0100) Subject: Add hud_panel_ammo_noncurrent_scale cvar X-Git-Tag: xonotic-v0.8.1~156^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e2ccf19ca691f6e31b2b76769d27c8e598103566;p=xonotic%2Fxonotic-data.pk3dir.git Add hud_panel_ammo_noncurrent_scale cvar --- diff --git a/_hud_descriptions.cfg b/_hud_descriptions.cfg index ae1908fa3..7d8b0ccf9 100644 --- a/_hud_descriptions.cfg +++ b/_hud_descriptions.cfg @@ -67,6 +67,7 @@ seta hud_panel_ammo_pos "" "position of this panel" seta hud_panel_ammo_size "" "size of this panel" seta hud_panel_ammo_onlycurrent "" "1 = show only current ammo type" seta hud_panel_ammo_noncurrent_alpha "" "alpha of noncurrent ammo types" +seta hud_panel_ammo_noncurrent_scale "" "scale of noncurrent ammo types, relative to the current ammo type" seta hud_panel_ammo_iconalign "" "0 = align icons to the left, 1 = align icons to the right" seta hud_panel_ammo_bg "" "if set to something else than \"\" = override default background" seta hud_panel_ammo_bg_color "" "if set to something else than \"\" = override default panel background color" diff --git a/hud_luminos.cfg b/hud_luminos.cfg index bad9709c1..a37447783 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -71,6 +71,7 @@ seta hud_panel_ammo_bg_border "" seta hud_panel_ammo_bg_padding "" seta hud_panel_ammo_onlycurrent "0" seta hud_panel_ammo_noncurrent_alpha "0.7" +seta hud_panel_ammo_noncurrent_scale "1" seta hud_panel_ammo_iconalign "0" seta hud_panel_ammo_progressbar "0" seta hud_panel_ammo_progressbar_name "progressbar" diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg index 6008152d2..3128aff4f 100644 --- a/hud_luminos_minimal.cfg +++ b/hud_luminos_minimal.cfg @@ -71,6 +71,7 @@ seta hud_panel_ammo_bg_border "" seta hud_panel_ammo_bg_padding "" seta hud_panel_ammo_onlycurrent "0" seta hud_panel_ammo_noncurrent_alpha "0.7" +seta hud_panel_ammo_noncurrent_scale "1" seta hud_panel_ammo_iconalign "0" seta hud_panel_ammo_progressbar "0" seta hud_panel_ammo_progressbar_name "progressbar" diff --git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg index de18c4556..0f424c6f0 100644 --- a/hud_luminos_minimal_xhair.cfg +++ b/hud_luminos_minimal_xhair.cfg @@ -71,6 +71,7 @@ seta hud_panel_ammo_bg_border "" seta hud_panel_ammo_bg_padding "" seta hud_panel_ammo_onlycurrent "1" seta hud_panel_ammo_noncurrent_alpha "0.7" +seta hud_panel_ammo_noncurrent_scale "1" seta hud_panel_ammo_iconalign "0" seta hud_panel_ammo_progressbar "1" seta hud_panel_ammo_progressbar_name "progressbar_ammo" diff --git a/hud_luminos_old.cfg b/hud_luminos_old.cfg index c6202d7ec..3ee6b9277 100644 --- a/hud_luminos_old.cfg +++ b/hud_luminos_old.cfg @@ -71,6 +71,7 @@ seta hud_panel_ammo_bg_border "" seta hud_panel_ammo_bg_padding "" seta hud_panel_ammo_onlycurrent "0" seta hud_panel_ammo_noncurrent_alpha "0.7" +seta hud_panel_ammo_noncurrent_scale "1" seta hud_panel_ammo_iconalign "0" seta hud_panel_ammo_progressbar "0" seta hud_panel_ammo_progressbar_name "progressbar" diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg index a5c6cfc3e..c4aebab73 100644 --- a/hud_nexuiz.cfg +++ b/hud_nexuiz.cfg @@ -71,6 +71,7 @@ seta hud_panel_ammo_bg_border "" seta hud_panel_ammo_bg_padding "" seta hud_panel_ammo_onlycurrent "0" seta hud_panel_ammo_noncurrent_alpha "0.7" +seta hud_panel_ammo_noncurrent_scale "1" seta hud_panel_ammo_iconalign "0" seta hud_panel_ammo_progressbar "0" seta hud_panel_ammo_progressbar_name "progressbar" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index e6655bf21..8215b9faf 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -222,6 +222,7 @@ float autocvar_hud_panel_ammo_iconalign; float autocvar_hud_panel_ammo_maxammo; float autocvar_hud_panel_ammo_onlycurrent; float autocvar_hud_panel_ammo_noncurrent_alpha = 0.7; +float autocvar_hud_panel_ammo_noncurrent_scale = 1; float autocvar_hud_panel_ammo_progressbar; string autocvar_hud_panel_ammo_progressbar_name; float autocvar_hud_panel_ammo_progressbar_xoffset; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 37d105a5e..c15f1c47e 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -895,6 +895,13 @@ void DrawAmmoItem(vector myPos, vector mySize, .float ammoType, float isCurrent, else ammo = getstati(GetAmmoStat(ammoType)); + if(!isCurrent) + { + float scale = bound(0, autocvar_hud_panel_ammo_noncurrent_scale, 1); + myPos = myPos + (mySize - mySize * scale) * 0.5; + mySize = mySize * scale; + } + vector iconPos, textPos; if(autocvar_hud_panel_ammo_iconalign) { diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc index 1d230a1b4..78f16f88d 100644 --- a/qcsrc/client/hud_config.qc +++ b/qcsrc/client/hud_config.qc @@ -89,6 +89,7 @@ void HUD_Panel_ExportCfg(string cfgname) case HUD_PANEL_AMMO: HUD_Write_PanelCvar_q("_onlycurrent"); HUD_Write_PanelCvar_q("_noncurrent_alpha"); + HUD_Write_PanelCvar_q("_noncurrent_scale"); HUD_Write_PanelCvar_q("_iconalign"); HUD_Write_PanelCvar_q("_progressbar"); HUD_Write_PanelCvar_q("_progressbar_name"); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_ammo.c b/qcsrc/menu/xonotic/dialog_hudpanel_ammo.c index 5544ffdef..15095b2ba 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_ammo.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_ammo.c @@ -26,8 +26,12 @@ void XonoticHUDAmmoDialog_fill(entity me) me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_ammo_onlycurrent", _("Show only current ammo type"))); me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha noncurrent:"))); + me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Noncurrent alpha:"))); me.TD(me, 1, 2.6, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_ammo_noncurrent_alpha")); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Noncurrent scale:"))); + me.TD(me, 1, 2.6, e = makeXonoticSlider(0, 1, 0.1, "hud_panel_ammo_noncurrent_scale")); me.TR(me); me.TDempty(me, 0.2); me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Align icon:")));