From: terencehill Date: Tue, 20 Dec 2011 00:05:07 +0000 (+0100) Subject: hud_panel_itemstime_progressbar_reduced to avoid drawing the progressbar under the... X-Git-Tag: xonotic-v0.8.1~12^2~60 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8c821be331c35a6f84cc9f898fb87d68bbc31a6d;p=xonotic%2Fxonotic-data.pk3dir.git hud_panel_itemstime_progressbar_reduced to avoid drawing the progressbar under the icon (simpler and better than the old _xoffset cvar that always offsets the bar regardless of the icon position). --- diff --git a/hud_luminos.cfg b/hud_luminos.cfg index 628b5334c..723d77efa 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -294,7 +294,7 @@ seta hud_panel_itemstime_bg_padding "" seta hud_panel_itemstime_iconalign "0" seta hud_panel_itemstime_progressbar "0" seta hud_panel_itemstime_progressbar_name "progressbar" -seta hud_panel_itemstime_progressbar_xoffset "0" +seta hud_panel_itemstime_progressbar_reduced "0" seta hud_panel_itemstime_showspawned "0" seta hud_panel_itemstime_text "1" diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg index a40f86d39..802231d7b 100644 --- a/hud_luminos_minimal.cfg +++ b/hud_luminos_minimal.cfg @@ -294,7 +294,7 @@ seta hud_panel_itemstime_bg_padding "" seta hud_panel_itemstime_iconalign "0" seta hud_panel_itemstime_progressbar "0" seta hud_panel_itemstime_progressbar_name "progressbar" -seta hud_panel_itemstime_progressbar_xoffset "0" +seta hud_panel_itemstime_progressbar_reduced "0" seta hud_panel_itemstime_showspawned "0" seta hud_panel_itemstime_text "1" diff --git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg index 5e93e80f4..df62eb38d 100644 --- a/hud_luminos_minimal_xhair.cfg +++ b/hud_luminos_minimal_xhair.cfg @@ -294,7 +294,7 @@ seta hud_panel_itemstime_bg_padding "" seta hud_panel_itemstime_iconalign "0" seta hud_panel_itemstime_progressbar "0" seta hud_panel_itemstime_progressbar_name "progressbar" -seta hud_panel_itemstime_progressbar_xoffset "0" +seta hud_panel_itemstime_progressbar_reduced "0" seta hud_panel_itemstime_showspawned "0" seta hud_panel_itemstime_text "1" diff --git a/hud_luminos_old.cfg b/hud_luminos_old.cfg index 2241e187d..07e0147a6 100644 --- a/hud_luminos_old.cfg +++ b/hud_luminos_old.cfg @@ -294,7 +294,7 @@ seta hud_panel_itemstime_bg_padding "" seta hud_panel_itemstime_iconalign "0" seta hud_panel_itemstime_progressbar "0" seta hud_panel_itemstime_progressbar_name "progressbar" -seta hud_panel_itemstime_progressbar_xoffset "0" +seta hud_panel_itemstime_progressbar_reduced "0" seta hud_panel_itemstime_showspawned "0" seta hud_panel_itemstime_text "1" diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg index 1a5f9eabe..5fbfb9d4e 100644 --- a/hud_nexuiz.cfg +++ b/hud_nexuiz.cfg @@ -294,7 +294,7 @@ seta hud_panel_itemstime_bg_padding "" seta hud_panel_itemstime_iconalign "0" seta hud_panel_itemstime_progressbar "0" seta hud_panel_itemstime_progressbar_name "progressbar" -seta hud_panel_itemstime_progressbar_xoffset "0" +seta hud_panel_itemstime_progressbar_reduced "0" seta hud_panel_itemstime_showspawned "0" seta hud_panel_itemstime_text "1" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 342aafdd3..e9b088a9d 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -247,7 +247,7 @@ float autocvar_hud_panel_itemstime_iconalign; float autocvar_hud_panel_itemstime_progressbar; float autocvar_hud_panel_itemstime_progressbar_maxtime; string autocvar_hud_panel_itemstime_progressbar_name; -float autocvar_hud_panel_itemstime_progressbar_xoffset; +float autocvar_hud_panel_itemstime_progressbar_reduced; float autocvar_hud_panel_itemstime_showspawned; float autocvar_hud_panel_itemstime_text; float autocvar_hud_panel_modicons; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index c7fb2fc23..76daff588 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -4836,11 +4836,24 @@ void DrawItemsTimeItem(vector myPos, vector mySize, float itemcode) picpos = myPos; } - if(t > 0 && autocvar_hud_panel_itemstime_progressbar) - HUD_Panel_DrawProgressBar(myPos + eX * autocvar_hud_panel_itemstime_progressbar_xoffset * mySize_x, mySize - eX * autocvar_hud_panel_itemstime_progressbar_xoffset * mySize_x, autocvar_hud_panel_itemstime_progressbar_name, t/autocvar_hud_panel_itemstime_progressbar_maxtime, 0, 0, color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); + if(t > 0 && autocvar_hud_panel_itemstime_progressbar) + { + vector p_pos, p_size; + if(autocvar_hud_panel_itemstime_progressbar_reduced) + { + p_pos = numpos; + p_size = eX * (2/3) * mySize_x + eY * mySize_y; + } + else + { + p_pos = myPos; + p_size = mySize; + } + HUD_Panel_DrawProgressBar(p_pos, p_size, autocvar_hud_panel_itemstime_progressbar_name, t/autocvar_hud_panel_itemstime_progressbar_maxtime, 0, 0, color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); + } - if(t > 0 && autocvar_hud_panel_itemstime_text) - drawstring_aspect(numpos, ftos(t), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL); + if(t > 0 && autocvar_hud_panel_itemstime_text) + drawstring_aspect(numpos, ftos(t), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL); drawpic_aspect_skin(picpos, GetItemsTimePicture(itemcode), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * picalpha, DRAWFLAG_NORMAL); }