From: terencehill <piuntn@gmail.com>
Date: Tue, 26 May 2015 10:41:11 +0000 (+0200)
Subject: Small cleanup
X-Git-Tag: xonotic-v0.8.1~12^2~22
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7ddcc225bcbe38adaf2dc7c49d448b0dd1728016;p=xonotic%2Fxonotic-data.pk3dir.git

Small cleanup
---

diff --git a/hud_luma.cfg b/hud_luma.cfg
index 3c3d0ee4b..70260c34c 100644
--- a/hud_luma.cfg
+++ b/hud_luma.cfg
@@ -24,7 +24,7 @@ seta hud_progressbar_speed_color "0.77 0.67 0"
 seta hud_progressbar_acceleration_color "0.2 0.65 0.93"
 seta hud_progressbar_acceleration_neg_color "0.86 0.35 0"
 
-seta _hud_panelorder "15 12 9 5 10 6 14 0 7 4 11 2 1 3 8 13 16 "
+seta _hud_panelorder "15 12 9 5 10 6 14 0 7 4 11 2 1 3 8 13 16 17 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.005000"
diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc
index 22f36dded..3ff3acdcc 100644
--- a/qcsrc/client/hud.qc
+++ b/qcsrc/client/hud.qc
@@ -4691,9 +4691,7 @@ void HUD_ItemsTime(void)
 
 	float rows, columns;
 	float ar = max(2, autocvar_hud_panel_itemstime_ratio) + 1;
-	rows = mySize_y/mySize_x;
-	rows = bound(1, floor((sqrt(4 * ar * rows * count + rows * rows) + rows + 0.5) / 2), count);
-
+	rows = HUD_GetRowCount(count, mySize, ar);
 	columns = ceil(count/rows);
 
 	vector itemstime_size;
diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh
index 0718e8147..54cf6f906 100644
--- a/qcsrc/client/hud.qh
+++ b/qcsrc/client/hud.qh
@@ -155,8 +155,9 @@ int prev_p_health, prev_p_armor;
 	HUD_PANEL(INFOMESSAGES , HUD_InfoMessages , infomessages) 														\
 	HUD_PANEL(PHYSICS      , HUD_Physics      , physics) 															\
 	HUD_PANEL(CENTERPRINT  , HUD_CenterPrint  , centerprint) 														\
-	HUD_PANEL(BUFFS        , HUD_Buffs        , buffs)																\
-	HUD_PANEL(ITEMSTIME    , HUD_ItemsTime    , itemstime)
+	HUD_PANEL(BUFFS        , HUD_Buffs        , buffs) \
+	HUD_PANEL(ITEMSTIME    , HUD_ItemsTime    , itemstime) \
+	// always add new panels to the end of list
 
 #define HUD_PANEL(NAME, draw_func, name)																			\
 	int HUD_PANEL_##NAME;																							\