seta hud_panel_itemstime_showspawned "0" "show icons of already spawned items"
seta hud_panel_itemstime_text "" "show text"
seta hud_panel_itemstime_ratio "" "ratio between space reserved for text and icon width of each item entry (min value is 2)"
+seta hud_panel_itemstime_size_dinamic "" "reduce panel size by removing spacing beetwen items"
seta hud_panel_itemstime_showspawned "0"
seta hud_panel_itemstime_text "1"
seta hud_panel_itemstime_ratio "2"
+seta hud_panel_itemstime_size_dinamic "1"
menu_sync
seta hud_panel_itemstime_showspawned "0"
seta hud_panel_itemstime_text "1"
seta hud_panel_itemstime_ratio "2"
+seta hud_panel_itemstime_size_dinamic "1"
menu_sync
seta hud_panel_itemstime_showspawned "0"
seta hud_panel_itemstime_text "1"
seta hud_panel_itemstime_ratio "2"
+seta hud_panel_itemstime_size_dinamic "1"
menu_sync
seta hud_panel_itemstime_showspawned "0"
seta hud_panel_itemstime_text "1"
seta hud_panel_itemstime_ratio "3.5"
+seta hud_panel_itemstime_size_dinamic "1"
menu_sync
seta hud_panel_itemstime_showspawned "0"
seta hud_panel_itemstime_text "1"
seta hud_panel_itemstime_ratio "2"
+seta hud_panel_itemstime_size_dinamic "1"
menu_sync
float autocvar_hud_panel_infomessages;
float autocvar_hud_panel_infomessages_flip;
float autocvar_hud_panel_itemstime;
+float autocvar_hud_panel_itemstime_size_dinamic;
float autocvar_hud_panel_itemstime_ratio;
float autocvar_hud_panel_itemstime_iconalign;
float autocvar_hud_panel_itemstime_progressbar;
pos = panel_pos;
mySize = panel_size;
- HUD_Panel_DrawBg(1);
if(panel_bg_padding)
{
pos += '1 1 0' * panel_bg_padding;
local noref vector offset; // fteqcc sucks
float newSize;
- if(itemstime_size_x/itemstime_size_y > ar)
+ if(autocvar_hud_panel_itemstime_size_dinamic)
{
- newSize = ar * itemstime_size_y;
- offset_x = itemstime_size_x - newSize;
- pos_x += offset_x/2;
- itemstime_size_x = newSize;
+ if(autocvar__hud_configure)
+ if(menu_enabled != 2)
+ HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
+
+ // reduce panel to avoid spacing items
+ if(itemstime_size_x / itemstime_size_y < ar)
+ {
+ newSize = rows * itemstime_size_x / ar;
+ pos_y += (mySize_y - newSize) / 2;
+ mySize_y = newSize;
+ itemstime_size_y = mySize_y / rows;
+ }
+ else
+ {
+ newSize = columns * itemstime_size_y * ar;
+ pos_x += (mySize_x - newSize) / 2;
+ mySize_x = newSize;
+ itemstime_size_x = mySize_x / columns;
+ }
+ panel_pos = pos - '1 1 0' * panel_bg_padding;
+ panel_size = mySize + '2 2 0' * panel_bg_padding;
}
else
{
- newSize = 1/ar * itemstime_size_x;
- offset_y = itemstime_size_y - newSize;
- pos_y += offset_y/2;
- itemstime_size_y = newSize;
+ if(itemstime_size_x/itemstime_size_y > ar)
+ {
+ newSize = ar * itemstime_size_y;
+ offset_x = itemstime_size_x - newSize;
+ pos_x += offset_x/2;
+ itemstime_size_x = newSize;
+ }
+ else
+ {
+ newSize = 1/ar * itemstime_size_x;
+ offset_y = itemstime_size_y - newSize;
+ pos_y += offset_y/2;
+ itemstime_size_y = newSize;
+ }
}
+ HUD_Panel_DrawBg(1);
+
for (i = 0; i < ITEMSTIME_MAXITEMS; ++i) {
if (ItemsTime_time[i] == -1)
continue;
HUD_Write_PanelCvar_q("_showspawned");
HUD_Write_PanelCvar_q("_text");
HUD_Write_PanelCvar_q("_ratio");
+ HUD_Write_PanelCvar_q("_size_dinamic");
break;
}
HUD_Write("\n");
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_showspawned", _("Show spawned items")));
+ me.TR(me);
+ me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_itemstime_size_dinamic", _("Dinamic size")));
}
#endif