]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
New timer and scoreboard, defense medal
authorz411 <z411@omaera.org>
Sun, 4 Oct 2020 00:14:37 +0000 (21:14 -0300)
committerz411 <z411@omaera.org>
Sun, 4 Oct 2020 00:14:37 +0000 (21:14 -0300)
qcsrc/client/hud/panel/score.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/timer.qc
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qh

index 553283e5bc4ab3bc2e15de5fde1eca5f9f94914f..60f886e15efe76cff62d0ba7721a67726eb317ad 100644 (file)
@@ -131,7 +131,21 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me)
                }
                if (team_count)
                        score_color = Team_ColorRGB(pl.team) * 0.8;
+               
+               entity entcs = entcs_receiver(pl.sv_entnum);
                s = textShortenToWidth(entcs_GetName(pl.sv_entnum), name_size, fontsize, stringwidth_colors);
+               
+               if(entcs.m_entcs_private) {
+                       // z411 draw health/armor barÂș
+                       vector bar_sz = vec2(mySize.x * 0.5, fontsize.y);
+                       HUD_Panel_DrawProgressBar(pos, bar_sz, "nametag_statusbar",
+                               entcs.healthvalue / autocvar_hud_panel_healtharmor_maxhealth, false, 1, '1 0 0', panel_fg_alpha * 0.5,
+                               DRAWFLAG_NORMAL);
+                       HUD_Panel_DrawProgressBar(pos + eX * bar_sz.x, bar_sz, "nametag_statusbar",
+                               GetResource(entcs, RES_ARMOR) / autocvar_hud_panel_healtharmor_maxarmor, false, 0, '0 1 0', panel_fg_alpha * 0.5,
+                               DRAWFLAG_NORMAL);
+               }
+               
                drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, true, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
                drawstring(pos + eX * (name_size + spacing_size), ftos(pl.(scores(ps_primary))), fontsize, score_color, panel_fg_alpha, DRAWFLAG_NORMAL);
                pos.y += fontsize.y;
index 5e75693fb92882e43ad436ae31fba7d749e5860d..7d7db3096402892acafe87f6e16b4a7bb0bb85a7 100644 (file)
@@ -1451,7 +1451,7 @@ vector Scoreboard_MedalStats_Draw(vector pos)
        pos = Scoreboard_DrawMedal(pos, "gfx/medal/impressive",         height, pl.(scores(SP_MEDAL_IMPRESSIVE)));
        pos = Scoreboard_DrawMedal(pos, "gfx/medal/yoda",                       height, pl.(scores(SP_MEDAL_YODA)));
        
-       pos.x += hud_fontsize.x * 2;
+       pos.x += hud_fontsize.x;
        
        pos = Scoreboard_DrawMedal(pos, "gfx/medal/assist",             height, pl.(scores(SP_MEDAL_ASSIST)));
        pos = Scoreboard_DrawMedal(pos, "gfx/medal/defense",            height, pl.(scores(SP_MEDAL_DEFENSE)));
index 4fa3886b60ce2302f8e4170ffec18452952e6412..293247f951191325e9e63446c2904bce70aa942e 100644 (file)
@@ -38,6 +38,7 @@ void HUD_Timer()
        }
 
        string timer;
+       string timer_sub = "";
        float timelimit, timeleft, minutesLeft, overtimes;
 
        timelimit = STAT(TIMELIMIT);
@@ -69,29 +70,43 @@ void HUD_Timer()
 
        if (intermission_time) {
                timer = seconds_tostring(max(0, floor(intermission_time - STAT(GAMESTARTTIME))));
-       } else if (warmup_stage) {
-               timer = _("WARMUP");
-       } else if (autocvar_hud_panel_timer_increment) {
-               if (time < STAT(GAMESTARTTIME))
-                       timer = seconds_tostring(0); //while restart is still active, show 00:00
+               timer_sub = "Intermission";
+       //} else if (autocvar_hud_panel_timer_increment || (!warmup_stage && timelimit == 0) || (warmup_stage && warmup_timeleft <= 0)) {
+       } else if (autocvar_hud_panel_timer_increment || timelimit == 0) {
+               if((warmup_stage && warmup_timeleft <= 0) || time < STAT(GAMESTARTTIME))
+                       timer = seconds_tostring(0);
                else
                        timer = seconds_tostring(floor(time - STAT(GAMESTARTTIME)));
        } else {
-               if (time < STAT(GAMESTARTTIME))
-                       timer = seconds_tostring(floor(timelimit * 60));
-               else if (overtimes > 0)
-                       timer = seconds_tostring(floor(time - STAT(OVERTIMESTARTTIME)));
-               else
-                       timer = seconds_tostring(timeleft);
+               if(warmup_stage) {
+                       if(warmup_timeleft <= 0)
+                               timer = seconds_tostring(floor(timelimit * 60));
+                       else
+                               timer = seconds_tostring(warmup_timeleft);
+               } else {
+                       if (time < STAT(GAMESTARTTIME))
+                               timer = seconds_tostring(floor(timelimit * 60));
+                       else if (overtimes > 0)
+                               timer = seconds_tostring(floor(time - STAT(OVERTIMESTARTTIME)));
+                       else
+                               timer = seconds_tostring(timeleft);
+               }
        }
        
-       if(overtimes == 1) {
-               timer = sprintf("%s (OT)", timer);
-       } else if (overtimes > 1) {
-               timer = sprintf("%s (OT #%d)", timer, overtimes);
-       }
+       if(warmup_stage)
+               timer_sub = "Warmup";
+       else if(overtimes == 1)
+               timer_sub = "Overtime";
+       else if (overtimes > 1)
+               timer_sub = sprintf("Overtime #%d", overtimes);
        
        drawstring_aspect(pos, timer, mySize, timer_color, panel_fg_alpha, DRAWFLAG_NORMAL);
+       
+       if(timer_sub != "") {
+               pos.y += mySize.y;
+               mySize.y = mySize.y / 2;
+               drawstring_aspect(pos, timer_sub, mySize, '1 0 0', panel_fg_alpha, DRAWFLAG_NORMAL);
+       }
 
        draw_endBoldFont();
 }
index 9cb5403a7ac45913e8edffdd7dbdf1dc38e1ee32..acc6dfb89a43d76015f70eeeb9652a926ee0ba5b 100644 (file)
@@ -47,8 +47,7 @@ REGISTER_MUTATOR(ca, false)
 
                allowed_to_spawn = true;
                round_handler_Spawn(CA_CheckTeams, CA_CheckWinner, CA_RoundStart);
-               if(!warmup_stage)
-                       round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
+               round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
                EliminatedPlayers_Init(ca_isEliminated);
        }
        return 0;