]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Entry aspect ratio is now customizable in the itemstime panel for a nicer layout...
authorterencehill <piuntn@gmail.com>
Fri, 23 Dec 2011 23:22:14 +0000 (00:22 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 24 Dec 2011 17:46:13 +0000 (18:46 +0100)
_hud_descriptions.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc

index 2f2ea597eeb994da7ec3ae8f6558f70d751da1eb..b48639a4d22ddf3402330e3f3a32306300adca20 100644 (file)
@@ -303,4 +303,5 @@ seta hud_panel_itemstime_progressbar_name "" "name of progressbar to use behind
 seta hud_panel_itemstime_progressbar_xoffset "" "percentage of item width to offset progressbar with"
 seta hud_panel_itemstime_showspawned "0" "show icons of already spawned items"
 seta hud_panel_itemstime_text "" "show text/icons"
+seta hud_panel_itemstime_ratio "2" "ratio between space reserved for text and icon width of each item entry (min value is 2)"
 
index 723d77efa792bbf12a08cee48fd5609bf8150e16..c800015570b65587d8e7992b95bdeb4703af1542 100644 (file)
@@ -297,5 +297,6 @@ seta hud_panel_itemstime_progressbar_name "progressbar"
 seta hud_panel_itemstime_progressbar_reduced "0"
 seta hud_panel_itemstime_showspawned "0"
 seta hud_panel_itemstime_text "1"
+seta hud_panel_itemstime_ratio "2"
 
 menu_sync
index 802231d7bdb5ad2a59cfa3405cdee1ee1be155c4..c0c5ea8718d3c4c57c74cc404307dc1f22e439dc 100644 (file)
@@ -297,5 +297,6 @@ seta hud_panel_itemstime_progressbar_name "progressbar"
 seta hud_panel_itemstime_progressbar_reduced "0"
 seta hud_panel_itemstime_showspawned "0"
 seta hud_panel_itemstime_text "1"
+seta hud_panel_itemstime_ratio "2"
 
 menu_sync
index df62eb38d44ba0b69288c9915598068c88d6a555..17bc72cd99d9af821208e556033d7f9553774ad1 100644 (file)
@@ -297,5 +297,6 @@ seta hud_panel_itemstime_progressbar_name "progressbar"
 seta hud_panel_itemstime_progressbar_reduced "0"
 seta hud_panel_itemstime_showspawned "0"
 seta hud_panel_itemstime_text "1"
+seta hud_panel_itemstime_ratio "2"
 
 menu_sync
index 07e0147a60674d2ff134c3a66d9bab87646afe2f..4fc14af0594db695e4295a128407e18bf07cbb39 100644 (file)
@@ -283,19 +283,20 @@ seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
 seta hud_panel_centerprint_fade_minfontsize "0"
 
 seta hud_panel_itemstime 1
-seta hud_panel_itemstime_pos "0.020000 0.500000"
-seta hud_panel_itemstime_size "0.150000 0.120000"
-seta hud_panel_itemstime_bg ""
+seta hud_panel_itemstime_pos "0.020000 0.490000"
+seta hud_panel_itemstime_size "0.150000 0.140000"
+seta hud_panel_itemstime_bg "0"
 seta hud_panel_itemstime_bg_color ""
 seta hud_panel_itemstime_bg_color_team ""
 seta hud_panel_itemstime_bg_alpha ""
 seta hud_panel_itemstime_bg_border ""
 seta hud_panel_itemstime_bg_padding ""
 seta hud_panel_itemstime_iconalign "0"
-seta hud_panel_itemstime_progressbar "0"
+seta hud_panel_itemstime_progressbar "1"
 seta hud_panel_itemstime_progressbar_name "progressbar"
-seta hud_panel_itemstime_progressbar_reduced "0"
+seta hud_panel_itemstime_progressbar_reduced "1"
 seta hud_panel_itemstime_showspawned "0"
 seta hud_panel_itemstime_text "1"
+seta hud_panel_itemstime_ratio "3.5"
 
 menu_sync
index 5fbfb9d4edb5d29d5e7a2a16ecc126d39d530013..3617db57e60d7dda733f666b6234b05589068f18 100644 (file)
@@ -297,5 +297,6 @@ seta hud_panel_itemstime_progressbar_name "progressbar"
 seta hud_panel_itemstime_progressbar_reduced "0"
 seta hud_panel_itemstime_showspawned "0"
 seta hud_panel_itemstime_text "1"
+seta hud_panel_itemstime_ratio "2"
 
 menu_sync
index e9b088a9d1eb07e398b7d0dcd6a5c231dbbfbb82..319a9d66438699d3857271635a9a715c3ee1b1cf 100644 (file)
@@ -243,6 +243,7 @@ float autocvar_hud_panel_healtharmor_text;
 float autocvar_hud_panel_infomessages;
 float autocvar_hud_panel_infomessages_flip;
 float autocvar_hud_panel_itemstime;
+float autocvar_hud_panel_itemstime_ratio;
 float autocvar_hud_panel_itemstime_iconalign;
 float autocvar_hud_panel_itemstime_progressbar;
 float autocvar_hud_panel_itemstime_progressbar_maxtime;
index 76daff588d97eebb88fc54ecd16c8724304e902d..7b45966cd22e0834eb5acf74695f20b459e54ecc 100644 (file)
@@ -4800,7 +4800,7 @@ string GetItemsTimePicture(float i)
        }
 }
 
-void DrawItemsTimeItem(vector myPos, vector mySize, float itemcode)
+void DrawItemsTimeItem(vector myPos, vector mySize, float ar, float itemcode)
 {
        float t;
        vector color;
@@ -4828,7 +4828,7 @@ void DrawItemsTimeItem(vector myPos, vector mySize, float itemcode)
        if(autocvar_hud_panel_itemstime_iconalign)
        {
                numpos = myPos;
-               picpos = myPos + eX * 2 * mySize_y;
+               picpos = myPos + eX * (ar - 1) * mySize_y;
        }
        else
        {
@@ -4842,7 +4842,7 @@ void DrawItemsTimeItem(vector myPos, vector mySize, float itemcode)
                if(autocvar_hud_panel_itemstime_progressbar_reduced)
                {
                        p_pos = numpos;
-                       p_size = eX * (2/3) * mySize_x + eY * mySize_y;
+                       p_size = eX * ((ar - 1)/ar) * mySize_x + eY * mySize_y;
                }
                else
                {
@@ -4853,7 +4853,7 @@ void DrawItemsTimeItem(vector myPos, vector mySize, float itemcode)
        }
 
        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);
+               drawstring_aspect(numpos, ftos(t), eX * ((ar - 1)/ar) * 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);
 }
 
@@ -4915,9 +4915,9 @@ void HUD_ItemsTime(void)
        }
 
        float rows, columns, row, column;
-       const float ASPECT_RATIO = 3;
+       float ar = max(2, autocvar_hud_panel_itemstime_ratio) + 1;
        rows = mySize_y/mySize_x;
-       rows = bound(1, floor((sqrt(4 * ASPECT_RATIO * rows * count + rows * rows) + rows + 0.5) / 2), count);
+       rows = bound(1, floor((sqrt(4 * ar * rows * count + rows * rows) + rows + 0.5) / 2), count);
 
        columns = ceil(count/rows);
 
@@ -4926,16 +4926,16 @@ void HUD_ItemsTime(void)
 
        local noref vector offset; // fteqcc sucks
        float newSize;
-       if(itemstime_size_x/itemstime_size_y > ASPECT_RATIO)
+       if(itemstime_size_x/itemstime_size_y > ar)
        {
-               newSize = ASPECT_RATIO * itemstime_size_y;
+               newSize = ar * itemstime_size_y;
                offset_x = itemstime_size_x - newSize;
                pos_x += offset_x/2;
                itemstime_size_x = newSize;
        }
        else
        {
-               newSize = 1/ASPECT_RATIO * itemstime_size_x;
+               newSize = 1/ar * itemstime_size_x;
                offset_y = itemstime_size_y - newSize;
                pos_y += offset_y/2;
                itemstime_size_y = newSize;
@@ -4947,7 +4947,7 @@ void HUD_ItemsTime(void)
                if (!autocvar_hud_panel_itemstime_showspawned)
                        if (ItemsTime_time[i] <= time)
                                continue;
-               DrawItemsTimeItem(pos + eX * column * (itemstime_size_x + offset_x) + eY * row * (itemstime_size_y + offset_y), itemstime_size, i);
+               DrawItemsTimeItem(pos + eX * column * (itemstime_size_x + offset_x) + eY * row * (itemstime_size_y + offset_y), itemstime_size, ar, i);
                ++row;
                if(row >= rows)
                {
index c9c78d481c3d85f286ec7f70d1dee7abe18b5e15..61cddaa1c2c44ea35e158c58d0490fe91687cc30 100644 (file)
@@ -184,6 +184,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        HUD_Write_PanelCvar_q("_progressbar_xoffset");
                                        HUD_Write_PanelCvar_q("_showspawned");
                                        HUD_Write_PanelCvar_q("_text");
+                                       HUD_Write_PanelCvar_q("_ratio");
                                        break;
                        }
                        HUD_Write("\n");