From: terencehill Date: Mon, 10 Aug 2015 22:58:09 +0000 (+0200) Subject: seta hud_panel_itemstime_hidespawned "1" "if 1 hide an item from the panel when all... X-Git-Tag: xonotic-v0.8.1~12^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f9583b752f72c97a837017f41aae979509962e74;p=xonotic%2Fxonotic-data.pk3dir.git 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" --- diff --git a/_hud_common.cfg b/_hud_common.cfg index 3430d0927..d409ee1e6 100644 --- a/_hud_common.cfg +++ b/_hud_common.cfg @@ -42,7 +42,7 @@ seta hud_panel_physics_acceleration_movingaverage 1 "use an averaging method for seta hud_panel_phisics_update_interval 0.0666 "how often (in seconds) numeric values get updated on screen" 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 "0" "hide items once they respawn" +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" // 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 49d9719a9..7cd123bbf 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -277,7 +277,7 @@ 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 = 0; +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; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index db74f03ef..585fd6ec3 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -4671,7 +4671,7 @@ void DrawItemsTimeItem(vector myPos, vector mySize, float ar, float itemcode, fl vector color = '0 0 0'; float picalpha; - if(autocvar_hud_panel_itemstime_hidespawned) + if(autocvar_hud_panel_itemstime_hidespawned == 2) picalpha = 1; else if(item_available) { @@ -4762,12 +4762,15 @@ void HUD_ItemsTime(void) float i; float count = 0; - if (!autocvar_hud_panel_itemstime_hidespawned) + if(autocvar_hud_panel_itemstime_hidespawned == 1) for (i = 0; i < ITEMSTIME_MAXITEMS; ++i) - count += (ItemsTime_time[i] != -1); - else + count += (ItemsTime_time[i] > time || -ItemsTime_time[i] > time); + else if(autocvar_hud_panel_itemstime_hidespawned == 2) for (i = 0; i < ITEMSTIME_MAXITEMS; ++i) count += (ItemsTime_time[i] > time); + else + for (i = 0; i < ITEMSTIME_MAXITEMS; ++i) + count += (ItemsTime_time[i] != -1); if (count == 0) return; @@ -4841,7 +4844,7 @@ void HUD_ItemsTime(void) for (i = 0; i < ITEMSTIME_MAXITEMS; ++i) { if (ItemsTime_time[i] == -1) continue; - + float item_time = ItemsTime_time[i]; if(item_time < -1) { @@ -4864,8 +4867,12 @@ void HUD_ItemsTime(void) float f = (time - ItemsTime_availableTime[i]) * 2; f = (f > 1) ? 0 : bound(0, f, 1); - if(autocvar_hud_panel_itemstime_hidespawned) - if(item_available) + if(autocvar_hud_panel_itemstime_hidespawned == 1) + if(!(ItemsTime_time[i] > time || -ItemsTime_time[i] > time)) + continue; + + if(autocvar_hud_panel_itemstime_hidespawned == 2) + if(!(ItemsTime_time[i] > time)) continue; DrawItemsTimeItem(pos + eX * column * (itemstime_size.x + offset.x) + eY * row * (itemstime_size.y + offset.y), itemstime_size, ar, i, item_time, item_available, f);