]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add new cvar hud_panel_notify_icon_aspect, to choose the aspect ratio of the total...
authorSeverin Meyer <sev.ch@web.de>
Mon, 22 Sep 2014 08:47:59 +0000 (10:47 +0200)
committerSeverin Meyer <sev.ch@web.de>
Mon, 22 Sep 2014 08:47:59 +0000 (10:47 +0200)
_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.qh
qcsrc/client/hud_config.qc

index 5f21867d353600ab2aa32dbad1c137f6d3a8ccae..c9a0861556893d5aa382bfe98ec2e4626db42a9f 100644 (file)
@@ -128,6 +128,7 @@ seta hud_panel_notify_flip "" "order the list top to bottom instead of bottom to
 seta hud_panel_notify_fontsize "" "multiplier for the font size used for player names in the panel"
 seta hud_panel_notify_fadetime "" "fade out time"
 seta hud_panel_notify_time "" "time that a new entry stays until it fades out"
+seta hud_panel_notify_icon_aspect "" "aspect ratio of total drawing area per icon"
 
 seta hud_panel_timer "" "enable/disable this panel"
 seta hud_panel_timer_pos "" "position of this base of the panel"
index f2b4fa4bd8504dca76aae7b705b2d948614518c0..2736524c6485bfda302d67eb69869da4110d02b4 100644 (file)
@@ -126,6 +126,7 @@ seta hud_panel_notify_flip "0"
 seta hud_panel_notify_fontsize "0.8"
 seta hud_panel_notify_time "10"
 seta hud_panel_notify_fadetime "3"
+seta hud_panel_notify_icon_aspect "2"
 
 seta hud_panel_timer 1
 seta hud_panel_timer_pos "0.800000 0.040000"
index c401132ac3d2fe00f44ca3d1c3da806f85ea6a5b..fdb57a37ee521cb3cd75bd29e51e5909435f65e6 100644 (file)
@@ -126,6 +126,7 @@ seta hud_panel_notify_flip "1"
 seta hud_panel_notify_fontsize "0.8"
 seta hud_panel_notify_time "10"
 seta hud_panel_notify_fadetime "3"
+seta hud_panel_notify_icon_aspect "2"
 
 seta hud_panel_timer 1
 seta hud_panel_timer_pos "0.435000 0"
index 518492ed4a7998973481221c835453a6f4d71bab..e0345f822ee25da1e154aee0d54109ebb0f8b495 100644 (file)
@@ -126,6 +126,7 @@ seta hud_panel_notify_flip "1"
 seta hud_panel_notify_fontsize "0.8"
 seta hud_panel_notify_time "10"
 seta hud_panel_notify_fadetime "3"
+seta hud_panel_notify_icon_aspect "2"
 
 seta hud_panel_timer 1
 seta hud_panel_timer_pos "0.435000 0"
index 0a5f05955ef8d1a24b1fd5dbcbc95db0e8de84bf..6a94d2b3ee0dc01cbe185fde9bda4adbe6877585 100644 (file)
@@ -126,6 +126,7 @@ seta hud_panel_notify_flip "0"
 seta hud_panel_notify_fontsize "0.8"
 seta hud_panel_notify_time "10"
 seta hud_panel_notify_fadetime "3"
+seta hud_panel_notify_icon_aspect "2"
 
 seta hud_panel_timer 1
 seta hud_panel_timer_pos "0.870000 0"
index acf3ad921e84dd874a96f9b8bd6ca8d4253679ee..5d8ee1fb967f25fab964ecd29fb099a84894f86e 100644 (file)
@@ -126,6 +126,7 @@ seta hud_panel_notify_flip "0"
 seta hud_panel_notify_fontsize "1"
 seta hud_panel_notify_time "10"
 seta hud_panel_notify_fadetime "3"
+seta hud_panel_notify_icon_aspect "2"
 
 seta hud_panel_timer 1
 seta hud_panel_timer_pos "0.850000 0"
index 67a03259382feba3d5e14adf53087c834eac6491..678b5f49fea3dc21cd1a7b9205c642702861341a 100644 (file)
@@ -268,6 +268,7 @@ float autocvar_hud_panel_notify_fadetime;
 float autocvar_hud_panel_notify_flip;
 float autocvar_hud_panel_notify_fontsize;
 float autocvar_hud_panel_notify_time;
+float autocvar_hud_panel_notify_icon_aspect;
 float autocvar_hud_panel_physics;
 float autocvar_hud_panel_physics_acceleration_progressbar_mode;
 float autocvar_hud_panel_physics_acceleration_progressbar_scale;
index 0f43461ced005e0bbb170f163edc92a1d005ac71..9faf594451175f0bc2e97deb416ec6800d52488a 100644 (file)
@@ -1662,18 +1662,19 @@ void HUD_Notify(void)
                size -= '2 2 0' * panel_bg_padding;
        }
 
-       float entry_count = bound(1, floor(NOTIFY_MAX_ENTRIES * size_y / size_x), NOTIFY_MAX_ENTRIES);
-       float entry_height = size_y / entry_count;
-
        float fade_start = max(0, autocvar_hud_panel_notify_time);
        float fade_time = max(0, autocvar_hud_panel_notify_fadetime);
+       float icon_aspect = max(1, autocvar_hud_panel_notify_icon_aspect);
+
+       float entry_count = bound(1, floor(NOTIFY_MAX_ENTRIES * size_y / size_x), NOTIFY_MAX_ENTRIES);
+       float entry_height = size_y / entry_count;
 
        float panel_width_half = size_x * 0.5;
-       float icon_width_half = entry_height * NOTIFY_ICON_ASPECT / 2;
+       float icon_width_half = entry_height * icon_aspect / 2;
        float name_maxwidth = panel_width_half - icon_width_half - size_x * NOTIFY_ICON_MARGIN;
 
        vector font_size = '0.5 0.5 0' * entry_height * autocvar_hud_panel_notify_fontsize;
-       vector icon_size = (eX * NOTIFY_ICON_ASPECT + eY) * entry_height;
+       vector icon_size = (eX * icon_aspect + eY) * entry_height;
        vector icon_left = eX * (panel_width_half - icon_width_half);
        vector attacker_right = eX * name_maxwidth;
        vector victim_left = eX * (size_x - name_maxwidth);
index 26e9480ca9b8eaf646e8644e4b0917b01b368e29..dcaa81a87153d4a71efdd66514a3ef4fa42b3b0f 100644 (file)
@@ -338,7 +338,6 @@ HUD_Panel_GetBorder() \
 } ENDS_WITH_CURLY_BRACE
 
 #define NOTIFY_MAX_ENTRIES 10
-#define NOTIFY_ICON_ASPECT 1.78
 #define NOTIFY_ICON_MARGIN 0.02
 
 float notify_index;
index 98dbdefd1872ee2637a7d04ef383f4b244d48e70..8ecc326b1e788441547b2fd7ec2081ffbd7bbd60 100644 (file)
@@ -119,6 +119,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        HUD_Write_PanelCvar_q("_fontsize");
                                        HUD_Write_PanelCvar_q("_time");
                                        HUD_Write_PanelCvar_q("_fadetime");
+                                       HUD_Write_PanelCvar_q("_icon_aspect");
                                        break;
                                case HUD_PANEL_TIMER:
                                        HUD_Write_PanelCvar_q("_increment");