]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/infomessages.qc
Display game start countdown in the infomessages panel when playing too
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / infomessages.qc
index 33f797f3d3201b0a337596a774f709c1c8244ce9..4e32fa6628baf9ca31f557c0b8ca48b24f7def9e 100644 (file)
@@ -1,11 +1,11 @@
 // Info messages panel (#14)
 
-#define drawInfoMessage(s) do {                                                                                                                                                                                \
+#define drawInfoMessage(s) MACRO_BEGIN {                                                                                                                                                       \
        if(autocvar_hud_panel_infomessages_flip)                                                                                                                                                \
                o.x = pos.x + mySize.x - stringwidth(s, true, fontsize);                                                                                                        \
        drawcolorcodedstring(o, s, fontsize, a, DRAWFLAG_NORMAL);                                                                                                               \
        o.y += fontsize.y;                                                                                                                                                                                              \
-} while(0)
+} MACRO_END
 void HUD_InfoMessages()
 {
        if(!autocvar__hud_configure)
@@ -94,17 +94,16 @@ void HUD_InfoMessages()
                        else
                                s = sprintf(_("^1Press ^3%s^1 to join"), getcommandkey("jump", "+jump"));
                        drawInfoMessage(s);
+               }
 
-                       //show restart countdown:
-                       if (time < STAT(GAMESTARTTIME)) {
-                               float countdown;
-                               //we need to ceil, otherwise the countdown would be off by .5 when using round()
-                               countdown = ceil(STAT(GAMESTARTTIME) - time);
-                               s = sprintf(_("^1Game starts in ^3%d^1 seconds"), countdown);
-                               drawcolorcodedstring(o, s, fontsize, a, DRAWFLAG_NORMAL);
-                               o.y += fontsize.y;
-                       }
+               if (time < STAT(GAMESTARTTIME))
+               {
+                       //we need to ceil, otherwise the countdown would be off by .5 when using round()
+                       float countdown = ceil(STAT(GAMESTARTTIME) - time);
+                       s = sprintf(_("^1Game starts in ^3%d^1 seconds"), countdown);
+                       drawInfoMessage(s);
                }
+
                if(warmup_stage && !intermission)
                {
                        s = _("^2Currently in ^1warmup^2 stage!");