From 35b274dcb9f6f93c437d846572bce191159e0f30 Mon Sep 17 00:00:00 2001 From: TimePath Date: Tue, 25 Aug 2015 10:48:18 +1000 Subject: [PATCH] Add a cvar to hide large armor and health --- _hud_common.cfg | 1 + qcsrc/client/autocvars.qh | 10 ------ qcsrc/common/mutators/mutator/itemstime.qc | 31 +++++++++++++++---- .../menu/xonotic/dialog_hudpanel_itemstime.qc | 2 ++ 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/_hud_common.cfg b/_hud_common.cfg index d409ee1e6..f17e7ac60 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -43,6 +43,7 @@ seta hud_panel_phisics_update_interval 0.0666 "how often (in seconds) numeric va seta hud_panel_itemstime_progressbar_maxtime "30" "when left time is at least this amount, the status bar is full" seta hud_panel_itemstime_hidespawned "1" "if 1 hide an item from the panel when all the occurrences of it are available again; if 2 hide it when at least one occurrence is available again" +seta hud_panel_itemstime_hidelarge "0" "if 1 hide large armor and health from the panel" // hud panel aliases alias hud_panel_radar_rotate "toggle hud_panel_radar_rotation 0 1 2 3 4" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index a9a442b30..9d6fd80c7 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -272,16 +272,6 @@ float autocvar_hud_panel_healtharmor_progressbar_gfx_damage; float autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth; float autocvar_hud_panel_healtharmor_progressbar_gfx_smooth; int autocvar_hud_panel_healtharmor_text; -int autocvar_hud_panel_itemstime = 2; -float autocvar_hud_panel_itemstime_dynamicsize = 1; -float autocvar_hud_panel_itemstime_ratio = 2; -int autocvar_hud_panel_itemstime_iconalign; -bool autocvar_hud_panel_itemstime_progressbar = 0; -float autocvar_hud_panel_itemstime_progressbar_maxtime = 30; -string autocvar_hud_panel_itemstime_progressbar_name = "progressbar"; -float autocvar_hud_panel_itemstime_progressbar_reduced; -bool autocvar_hud_panel_itemstime_hidespawned = 1; -int autocvar_hud_panel_itemstime_text = 1; bool autocvar_hud_panel_infomessages; bool autocvar_hud_panel_infomessages_flip; bool autocvar_hud_panel_modicons; diff --git a/qcsrc/common/mutators/mutator/itemstime.qc b/qcsrc/common/mutators/mutator/itemstime.qc index b90bd3c26..ca65c2c48 100644 --- a/qcsrc/common/mutators/mutator/itemstime.qc +++ b/qcsrc/common/mutators/mutator/itemstime.qc @@ -24,14 +24,33 @@ MUTATOR_HOOKFUNCTION(itemstime, CSQC_Parse_TempEntity) { } #endif +#ifdef CSQC +int autocvar_hud_panel_itemstime = 2; +float autocvar_hud_panel_itemstime_dynamicsize = 1; +float autocvar_hud_panel_itemstime_ratio = 2; +int autocvar_hud_panel_itemstime_iconalign; +bool autocvar_hud_panel_itemstime_progressbar = 0; +float autocvar_hud_panel_itemstime_progressbar_maxtime = 30; +string autocvar_hud_panel_itemstime_progressbar_name = "progressbar"; +float autocvar_hud_panel_itemstime_progressbar_reduced; +bool autocvar_hud_panel_itemstime_hidespawned = 1; +bool autocvar_hud_panel_itemstime_hidelarge = false; +int autocvar_hud_panel_itemstime_text = 1; +#define hud_panel_itemstime_hidelarge autocvar_hud_panel_itemstime_hidelarge +#endif + +#ifdef SVQC +#define hud_panel_itemstime_hidelarge false +#endif + bool Item_ItemsTime_Allow(GameItem it, WepSet _weapons) { - return (false - || it.instanceOfPowerup - || it == ITEM_ArmorMega || it == ITEM_ArmorLarge - || it == ITEM_HealthMega || it == ITEM_HealthLarge - || (_weapons & WEPSET_SUPERWEAPONS) - ); + return (false + || it.instanceOfPowerup + || it == ITEM_ArmorMega || (it == ITEM_ArmorLarge && !hud_panel_itemstime_hidelarge) + || it == ITEM_HealthMega || (it == ITEM_HealthLarge && !hud_panel_itemstime_hidelarge) + || (_weapons & WEPSET_SUPERWEAPONS) + ); } #ifdef SVQC diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_itemstime.qc b/qcsrc/menu/xonotic/dialog_hudpanel_itemstime.qc index be5eef529..1124044e3 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_itemstime.qc +++ b/qcsrc/menu/xonotic/dialog_hudpanel_itemstime.qc @@ -40,6 +40,8 @@ void XonoticHUDItemsTimeDialog_fill(entity me) me.TD(me, 1, 2.6, e = makeXonoticSlider(2, 8, 0.5, "hud_panel_itemstime_ratio")); me.TR(me); me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_itemstime_hidespawned", _("Hide spawned items"))); + me.TR(me); + me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_itemstime_hidelarge", _("Hide large armor and health"))); me.TR(me); me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_itemstime_dynamicsize", _("Dynamic size"))); } -- 2.39.2