From: z411 Date: Sun, 4 Oct 2020 00:14:37 +0000 (-0300) Subject: New timer and scoreboard, defense medal X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f8a91e242aedbe45fb378caa133856f1fc316c78;p=xonotic%2Fxonotic-data.pk3dir.git New timer and scoreboard, defense medal --- diff --git a/qcsrc/client/hud/panel/score.qc b/qcsrc/client/hud/panel/score.qc index 553283e5b..60f886e15 100644 --- a/qcsrc/client/hud/panel/score.qc +++ b/qcsrc/client/hud/panel/score.qc @@ -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; diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 5e75693fb..7d7db3096 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -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))); diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index 4fa3886b6..293247f95 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -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(); } diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qh b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qh index 9cb5403a7..acc6dfb89 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qh +++ b/qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qh @@ -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;