From: terencehill Date: Tue, 24 May 2011 18:19:00 +0000 (+0200) Subject: hud_panel_centerprint_flip to invert messages order X-Git-Tag: xonotic-v0.5.0~218 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=e35e92661224a69661a33f58e0233aaa614a0af2;p=xonotic%2Fxonotic-data.pk3dir.git hud_panel_centerprint_flip to invert messages order --- diff --git a/hud_luminos.cfg b/hud_luminos.cfg index e1ab76507..a03e9f50f 100644 --- a/hud_luminos.cfg +++ b/hud_luminos.cfg @@ -241,6 +241,7 @@ seta hud_panel_centerprint_bg_alpha "" seta hud_panel_centerprint_bg_border "" seta hud_panel_centerprint_bg_padding "" seta hud_panel_centerprint_align "0.5" +seta hud_panel_centerprint_flip "0" seta hud_panel_centerprint_fontscale "1" seta hud_panel_centerprint_time "2" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index fc7fd4e9e..84bade0c8 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -207,6 +207,7 @@ float autocvar_hud_panel_healtharmor_progressbar_gfx_smooth; float autocvar_hud_panel_centerprint; float autocvar_hud_panel_centerprint_align; +float autocvar_hud_panel_centerprint_flip; float autocvar_hud_panel_centerprint_fontscale; float autocvar_hud_panel_centerprint_time; float autocvar_hud_panel_healtharmor_text; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 3299648da..44ce25192 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -4409,11 +4409,13 @@ void HUD_CenterPrint (void) entries = bound(1, floor(panel_size_y/height), CENTERPRINT_MAX_ENTRIES); float i, j, k, n; - float a, sz, fade, align; + float a, sz, fade, align, next_msg_pos_y; vector pos; string ts; pos = panel_pos; + if (autocvar_hud_panel_centerprint_flip) + pos_y += panel_size_y - fontsize_y; fade = min(autocvar_hud_panel_centerprint_time/8, 0.25); align = bound(0, autocvar_hud_panel_centerprint_align, 1); for (i=0, j=cpm_index; i panel_pos_y + panel_size_y - fontsize_y) + if (pos_y > panel_pos_y + panel_size_y - fontsize_y) // check if the next line can be shown { drawfontscale = '1 1 0'; return; } } } - if (a < 1) - pos_y -= 1.5 * fontsize_y * (1 - a*a); + if (autocvar_hud_panel_centerprint_flip) + { + pos_y = next_msg_pos_y; + if (a < 1) + pos_y += 1.5 * fontsize_y * (1 - a*a); + } + else + { + if (a < 1) + pos_y -= 1.5 * fontsize_y * (1 - a*a); + } drawfontscale = '1 1 0'; } } diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc index 80a28a48a..a897bdd33 100644 --- a/qcsrc/client/hud_config.qc +++ b/qcsrc/client/hud_config.qc @@ -123,6 +123,7 @@ void HUD_Panel_ExportCfg(string cfgname) break; case HUD_PANEL_CENTERPRINT: HUD_Write_PanelCvar_q("_align"); + HUD_Write_PanelCvar_q("_flip"); HUD_Write_PanelCvar_q("_fontscale"); HUD_Write_PanelCvar_q("_time"); break;