From 49763343810a66c4067e4b235a0862be923cc9d6 Mon Sep 17 00:00:00 2001 From: div0 Date: Fri, 6 Feb 2009 15:16:50 +0000 Subject: [PATCH] make centerprint messages fade out git-svn-id: svn://svn.icculus.org/nexuiz/trunk@5787 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/client/sbar.qc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index cd909c623..fb7eddc5a 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -1241,7 +1241,6 @@ void Sbar_Score(float margin) if(race_checkpointtime) { - a = bound(0, 2 - (time - race_checkpointtime), 1); s = ""; forcetime = ""; @@ -1649,8 +1648,16 @@ void Sbar_DrawCenterPrint (void) float i; vector pos; string ts; + float a; + + //if(time > centerprint_expire) + // return; + + //a = bound(0, 1 - 2 * (time - centerprint_expire), 1); + a = bound(0, 1 - 4 * (time - centerprint_expire), 1); + //sz = 1.2 / (a + 0.2); - if(time > centerprint_expire) + if(a <= 0) return; pos = centerprint_start; @@ -1661,7 +1668,8 @@ void Sbar_DrawCenterPrint (void) if (ts != "") { dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0) - drawcolorcodedstring(pos, ts, centerprint_fontsize, 1, DRAWFLAG_NORMAL); + drawcolorcodedstring(pos, ts, centerprint_fontsize, a, DRAWFLAG_NORMAL); + // - '0 0.5 0' * (sz - 1) * centerprint_fontsize_x - '0.5 0 0' * (sz - 1) * centerprint_width[i] * centerprint_fontsize_y, centerprint_fontsize * sz pos_y = pos_y + centerprint_fontsize_y; } else -- 2.39.2