X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fnotify.qc;h=82690bee73a3d494a84a69762f7749f75806ce49;hp=3c4b9c10514236a10d5be3f633ebe3c48587a5bb;hb=e757068f0bf4ce3c5b29c9e52f251b39a4ef7470;hpb=f203a8239ab58e776da8df7bce46be73d2d655a4 diff --git a/qcsrc/client/hud/panel/notify.qc b/qcsrc/client/hud/panel/notify.qc index 3c4b9c105..82690bee7 100644 --- a/qcsrc/client/hud/panel/notify.qc +++ b/qcsrc/client/hud/panel/notify.qc @@ -1,4 +1,9 @@ -// Notification area (#4) +#include "notify.qh" + +#include +#include + +// Notifications (#4) void HUD_Notify_Push(string icon, string attacker, string victim) { @@ -46,8 +51,13 @@ void HUD_Notify() if (!autocvar_hud_panel_notify) return; - HUD_Panel_UpdateCvars(); - HUD_Panel_DrawBg(1); + HUD_Panel_LoadCvars(); + + if (autocvar_hud_panel_notify_dynamichud) + HUD_Scale_Enable(); + else + HUD_Scale_Disable(); + HUD_Panel_DrawBg(); if (!autocvar__hud_configure) if (notify_count == 0) @@ -75,7 +85,7 @@ void HUD_Notify() 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 * icon_aspect + eY) * entry_height; + vector icon_size = vec2(icon_aspect, 1) * 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); @@ -137,13 +147,13 @@ void HUD_Notify() icon_pos = pos + icon_left + eY * i * entry_height; drawpic_aspect_skin(icon_pos, icon, icon_size, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL); - victim = textShortenToWidth(victim, name_maxwidth, font_size, stringwidth_colors); + victim = textShortenToWidth(ColorTranslateRGB(victim), name_maxwidth, font_size, stringwidth_colors); victim_pos = pos + victim_left + name_top; drawcolorcodedstring(victim_pos, victim, font_size, panel_fg_alpha * alpha, DRAWFLAG_NORMAL); if (attacker != "") { - attacker = textShortenToWidth(attacker, name_maxwidth, font_size, stringwidth_colors); + attacker = textShortenToWidth(ColorTranslateRGB(attacker), name_maxwidth, font_size, stringwidth_colors); attacker_pos = pos + attacker_right - eX * stringwidth(attacker, true, font_size) + name_top; drawcolorcodedstring(attacker_pos, attacker, font_size, panel_fg_alpha * alpha, DRAWFLAG_NORMAL); }