From 6cb8d7d5e0961e49e4b6725b5ce31b161687bea0 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 24 Jun 2011 19:29:14 +0200 Subject: [PATCH] Centerprint something when configuring the hud --- qcsrc/client/hud.qc | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 26d306f9a..f81b72fe1 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -4403,15 +4403,49 @@ void centerprint(string strMessage) // CenterPrint (#16) // +float hud_configure_cp_generation_time; +void reset_centerprint_messages(void) +{ + float i; + for (i=0; i hud_configure_cp_generation_time) + { + float r; + r = random(); + if (r > 0.9) + centerprint_generic(floor(r*1000), strcat(sprintf("Countdown message at time %d", time), " %d seconds left"), 1, 10); + else if (r > 0.7) + centerprint_generic(0, sprintf("Multiline message at time %d that\nlasts longer than normal", time), 25, 0); + else + centerprint(sprintf("Message at time %d", time)); + hud_configure_cp_generation_time = time + 1 + random()*4; + } + } + HUD_Panel_UpdateCvars(centerprint); // this panel doesn't fade when showing the scoreboard -- 2.39.2