]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Timer, improved chat tags
authorz411 <z411@omaera.org>
Thu, 27 Aug 2020 03:31:07 +0000 (23:31 -0400)
committerz411 <z411@omaera.org>
Thu, 27 Aug 2020 03:31:07 +0000 (23:31 -0400)
qcsrc/client/hud/panel/timer.qc
qcsrc/common/notifications/all.inc
qcsrc/server/command/cmd.qc
qcsrc/server/miscfunctions.qc

index 83fef5b9883a0b30de4d25fb5c8373230af2c4ff..4a38d91d7c9b9a334c3e65208459536abc908049 100644 (file)
@@ -38,9 +38,10 @@ void HUD_Timer()
        }
 
        string timer;
-       float timelimit, timeleft, minutesLeft;
+       float timelimit, timeleft, minutesLeft, overtimes;
 
        timelimit = STAT(TIMELIMIT);
+       overtimes = STAT(OVERTIMESADDED);
 
        timeleft = max(0, timelimit * 60 + STAT(GAMESTARTTIME) - time);
        timeleft = ceil(timeleft);
@@ -68,25 +69,26 @@ void HUD_Timer()
 
        if (intermission_time) {
                timer = seconds_tostring(max(0, floor(intermission_time - STAT(GAMESTARTTIME))));
-       } else if (warmup_stage && warmup_timeleft >= 60) {
+       } else if (warmup_stage) {
                timer = _("WARMUP");
-       } else if (autocvar_hud_panel_timer_increment || (!warmup_stage && timelimit == 0) || (warmup_stage && warmup_timeleft <= 0)) {
+       } else if (autocvar_hud_panel_timer_increment) {
                if (time < STAT(GAMESTARTTIME))
                        timer = seconds_tostring(0); //while restart is still active, show 00:00
                else
                        timer = seconds_tostring(floor(time - STAT(GAMESTARTTIME)));
        } else {
-               if(warmup_stage)
-                       timer = seconds_tostring(warmup_timeleft);
+               if (time < STAT(GAMESTARTTIME))
+                       timer = seconds_tostring(floor(timelimit * 60));
                else
                        timer = seconds_tostring(timeleft);
        }
        
-       if(STAT(OVERTIMESADDED) >= 1)
-       {
-               timer = sprintf("%s (OT #%d)", timer, floor(STAT(OVERTIMESADDED)));
+       if(overtimes == 1) {
+               timer = sprintf("%s (OT)", timer);
+       } else if (overtimes > 1) {
+               timer = sprintf("%s (OT #%d)", timer, overtimes);
        }
-
+       
        drawstring_aspect(pos, timer, mySize, timer_color, panel_fg_alpha, DRAWFLAG_NORMAL);
 
        draw_endBoldFont();
index 3da7b88c787d2fe642db6f6c4342793afde6092e..ffad793a53143af9a2f57b031cbdd1f80f1d2282 100644 (file)
@@ -429,6 +429,7 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input !=
     MSG_INFO_NOTIF(POWERUP_STRENGTH,                        N_CONSOLE,  1, 0, "s1", "s1",       "strength",     _("^BG%s^K1 picked up Strength"), "")
 
     MSG_INFO_NOTIF(QUIT_DISCONNECT,                         N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 disconnected"), "")
+       MSG_INFO_NOTIF(QUIT_KICK,                               N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was kicked"), "")
     MSG_INFO_NOTIF(QUIT_KICK_IDLING,                        N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was kicked for idling"), "")
     MSG_INFO_NOTIF(QUIT_KICK_SPECTATING,                    N_CONSOLE,  0, 0, "", "",           "",             _("^F2You were kicked from the server because you are a spectator and spectators aren't allowed at the moment."), "")
     MSG_INFO_NOTIF(QUIT_KICK_TEAMKILL,                      N_CHATCON,  1, 0, "s1", "",         "",             _("^BG%s^F3 was kicked for excessive teamkilling"), "")
@@ -787,7 +788,7 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input !=
 
     MSG_CENTER_NOTIF(TIMEOUT_BEGINNING,                 N_ENABLE,    0, 1, "",               CPID_TIMEOUT,           "1 f1", _("^F4Timeout begins in ^COUNT"), "")
     MSG_CENTER_NOTIF(TIMEOUT_ENDING,                    N_ENABLE,    0, 1, "",               CPID_TIMEIN,            "1 f1", _("^F4Timeout ends in ^COUNT"), "")
-       MSG_CENTER_NOTIF(TIMEOUT_ONGOING,                   N_ENABLE,    0, 0, "",               CPID_TIMEIN,            "1 f1", _("^F4Match paused."), "")
+       MSG_CENTER_NOTIF(TIMEOUT_ONGOING,                   N_ENABLE,    0, 0, "",               CPID_TIMEIN,            "1 f1", _("^F4Match paused"), "")
 
     MSG_CENTER_NOTIF(JOIN_PREVENT_MINIGAME,             N_ENABLE,    0, 0, "",               CPID_Null,              "0 0",  _("^K1Cannot join given minigame session!"), "" )
 
index fe92d36673552852495602cd46b6d798450b752f..e60154eee5aed49f70a5c93a08bbd1443af682fd 100644 (file)
@@ -394,13 +394,13 @@ void ClientCommand_ready(entity caller, int request)  // todo: anti-spam for tog
                                                {
                                                        caller.ready = false;
                                                        if(IS_PLAYER(caller) || caller.caplayer == 1)
-                                                               bprint(playername(caller, false), "^2 is ^1NOT^2 ready\n");
+                                                               bprint("\{1}", playername(caller, false), "^2 is ^1NOT^2 ready\n");
                                                }
                                                else
                                                {
                                                        caller.ready = true;
                                                        if(IS_PLAYER(caller) || caller.caplayer == 1)
-                                                               bprint(playername(caller, false), "^2 is ready\n");
+                                                               bprint("\{1}", playername(caller, false), "^2 is ready\n");
                                                }
 
                                                // cannot reset the game while a timeout is active!
index e8b4ab681c5bb91a64e7ef650dd89c2dfd3018cd..3104b06d4b80a8964e518c7ad7d335293862d248 100644 (file)
@@ -414,14 +414,30 @@ void GetCvars(entity this, entity store, int f)
 // decolorizes and team colors the player name when needed
 string playername(entity p, bool team_colorize)
 {
-    string t;
-    if (team_colorize && teamplay && !intermission_running && IS_PLAYER(p))
-    {
-        t = Team_ColorCode(p.team);
-        return strcat(t, strdecolorize(p.netname));
-    }
-    else
-        return p.netname;
+    //string t;
+    //if (team_colorize && teamplay && !intermission_running && IS_PLAYER(p))
+    //{
+    //    t = Team_ColorCode(p.team);
+    //    return strcat(t, strdecolorize(p.netname));
+    //}
+    //else
+    //    return p.netname;
+       
+       string t;
+       
+       if (team_colorize && teamplay && p.team != -1)
+               t = strcat(Team_ColorCode(p.team), strdecolorize(p.netname));
+       else
+               t = p.netname;
+       
+       if (IS_DEAD(p) || p.frags == FRAGS_PLAYER_OUT_OF_GAME)
+               return strcat("(DEAD) ", t);
+       else if (IS_OBSERVER(p))
+               return strcat("(s) ", t);
+       else
+               return t;
+               
+       //return sprintf("%s (%d) %s", p.classname, p.team, t);
 }
 
 float want_weapon(entity weaponinfo, float allguns)