From 0fd6fa4f46e6e704eceac437d05daa326fa8cb14 Mon Sep 17 00:00:00 2001 From: TimePath Date: Wed, 2 Dec 2015 09:54:21 +1100 Subject: [PATCH] Shownames: fade when moving to spectate --- qcsrc/client/defs.qh | 2 +- qcsrc/client/hook.qc | 4 +-- qcsrc/client/hud/panel/infomessages.qc | 2 +- qcsrc/client/hud/panel/modicons.qc | 2 +- qcsrc/client/hud/panel/radar.qc | 2 +- qcsrc/client/hud/panel/score.qc | 4 +-- qcsrc/client/main.qc | 8 +++--- qcsrc/client/quickmenu.qc | 2 +- qcsrc/client/scoreboard.qc | 14 +++++------ qcsrc/client/shownames.qc | 8 +++--- qcsrc/client/view.qc | 4 +-- qcsrc/common/effects/qc/globalsound.qc | 2 ++ qcsrc/common/ent_cs.qh | 25 ++++++++++++------- qcsrc/common/minigames/cl_minigames.qc | 2 +- qcsrc/common/minigames/cl_minigames_hud.qc | 4 +-- qcsrc/common/minigames/minigame/bd.qc | 4 +-- qcsrc/common/minigames/minigame/c4.qc | 4 +-- qcsrc/common/minigames/minigame/nmm.qc | 4 +-- qcsrc/common/minigames/minigame/pong.qc | 2 +- qcsrc/common/minigames/minigame/pp.qc | 4 +-- qcsrc/common/minigames/minigame/ps.qc | 2 +- qcsrc/common/minigames/minigame/snake.qc | 4 +-- qcsrc/common/minigames/minigame/ttt.qc | 2 +- .../mutator/waypoints/waypointsprites.qc | 2 +- qcsrc/common/turrets/cl_turrets.qc | 2 +- qcsrc/common/weapons/weapon/shockwave.qc | 2 +- 26 files changed, 63 insertions(+), 54 deletions(-) diff --git a/qcsrc/client/defs.qh b/qcsrc/client/defs.qh index 98f25cc90..069598e3b 100644 --- a/qcsrc/client/defs.qh +++ b/qcsrc/client/defs.qh @@ -126,7 +126,7 @@ int serverflags; float uid2name_dialog; -.bool csqcmodel_isdead; // used by shownames and miscfunctions (float getplayerisdead(float) {}) to know when a player is dead +.bool csqcmodel_isdead; // used by shownames and miscfunctions (entcs_IsDead) to know when a player is dead #define player_currententnum (spectatee_status > 0 ? spectatee_status : player_localnum + 1) diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index e8bd44321..818e73782 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -92,7 +92,7 @@ void Draw_GrapplingHook(entity this) } } - t = GetPlayerColorForce(self.owner.sv_entnum); + t = entcs_GetTeamColor(self.owner.sv_entnum); switch(self.HookType) { @@ -106,7 +106,7 @@ void Draw_GrapplingHook(entity this) case NUM_TEAM_2: tex = "particles/hook_blue"; rgb = '0.3 0.3 1'; break; case NUM_TEAM_3: tex = "particles/hook_yellow"; rgb = '1 1 0.3'; break; case NUM_TEAM_4: tex = "particles/hook_pink"; rgb = '1 0.3 1'; break; - default: tex = "particles/hook_white"; rgb = getcsqcplayercolor(self.sv_entnum - 1); break; + default: tex = "particles/hook_white"; rgb = entcs_GetColor(self.sv_entnum - 1); break; } break; case NET_ENT_CLIENT_ARC_BEAM: // todo diff --git a/qcsrc/client/hud/panel/infomessages.qc b/qcsrc/client/hud/panel/infomessages.qc index 2bcad6426..33f797f3d 100644 --- a/qcsrc/client/hud/panel/infomessages.qc +++ b/qcsrc/client/hud/panel/infomessages.qc @@ -62,7 +62,7 @@ void HUD_InfoMessages() if(spectatee_status == -1) s = _("^1Observing"); else - s = sprintf(_("^1Spectating: ^7%s"), GetPlayerName(current_player)); + s = sprintf(_("^1Spectating: ^7%s"), entcs_GetName(current_player)); drawInfoMessage(s); if(spectatee_status == -1) diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc index 1a64b9b74..8fab80ed6 100644 --- a/qcsrc/client/hud/panel/modicons.qc +++ b/qcsrc/client/hud/panel/modicons.qc @@ -598,7 +598,7 @@ void HUD_Mod_Race(vector pos, vector mySize) drawcolorcodedstring_aspect(namepos, s, '1 0.2 0' * squareSize, panel_fg_alpha * a, DRAWFLAG_NORMAL); drawstring_aspect(rankpos, rankname, '1 0.15 0' * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL); } else if(race_status == 2) { - if(race_status_name == GetPlayerName(player_localnum) || !race_myrank || race_myrank < rank) + if(race_status_name == entcs_GetName(player_localnum) || !race_myrank || race_myrank < rank) drawpic_aspect_skin(medalPos + '0.1 0 0' * squareSize, "race_newrankgreen", '1 1 0' * 0.8 * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL); else drawpic_aspect_skin(medalPos + '0.1 0 0' * squareSize, "race_newrankyellow", '1 1 0' * 0.8 * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL); diff --git a/qcsrc/client/hud/panel/radar.qc b/qcsrc/client/hud/panel/radar.qc index 1982686c9..55efbad5d 100644 --- a/qcsrc/client/hud/panel/radar.qc +++ b/qcsrc/client/hud/panel/radar.qc @@ -361,7 +361,7 @@ void HUD_Radar() { if (!tm.m_entcs_private) continue; if (entcs_is_self(tm)) continue; - color2 = GetPlayerColor(tm.sv_entnum); + color2 = entcs_GetTeam(tm.sv_entnum); //if(color == NUM_SPECTATOR || color == color2) draw_teamradar_player(tm.origin, tm.angles, Team_ColorRGB(color2)); } diff --git a/qcsrc/client/hud/panel/score.qc b/qcsrc/client/hud/panel/score.qc index dd3000c4c..d120c1cd1 100644 --- a/qcsrc/client/hud/panel/score.qc +++ b/qcsrc/client/hud/panel/score.qc @@ -46,7 +46,7 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me) { rgb = '1 1 0'; drawfill(pos, eX * mySize.x + eY * fontsize.y, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); - s = GetPlayerName(player_localnum); + s = entcs_GetName(player_localnum); score = 7; } else @@ -114,7 +114,7 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me) } if (team_count) score_color = Team_ColorRGB(pl.team) * 0.8; - s = textShortenToWidth(GetPlayerName(pl.sv_entnum), name_size, fontsize, stringwidth_colors); + s = textShortenToWidth(entcs_GetName(pl.sv_entnum), name_size, fontsize, stringwidth_colors); 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/main.qc b/qcsrc/client/main.qc index 510293e76..f2df818aa 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -244,7 +244,7 @@ void Playerchecker_Think() for(i = 0; i < maxclients; ++i) { e = playerslots[i]; - if(GetPlayerName(i) == "") + if(entcs_GetName(i) == "") { if(e.sort_prev) { @@ -270,7 +270,7 @@ void Playerchecker_Think() e.ping_packetloss = 0; e.ping_movementloss = 0; //e.gotscores = 0; // we might already have the scores... - SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with HUD_UpdatePlayerTeams + SetTeam(e, entcs_GetTeam(i)); // will not hurt; later updates come with HUD_UpdatePlayerTeams RegisterPlayer(e); HUD_UpdatePlayerPos(e); } @@ -672,7 +672,7 @@ NET_HANDLE(ENT_CLIENT_SPAWNEVENT, bool is_new) if(is_new) { - float teamnum = GetPlayerColor(entnum - 1); + float teamnum = entcs_GetTeam(entnum - 1); if(autocvar_cl_spawn_event_particles) { @@ -1074,7 +1074,7 @@ NET_HANDLE(TE_CSQC_RACE, bool isNew) strunzone(grecordholder[pos-1]); grecordholder[pos-1] = strzone(ReadString()); grecordtime[pos-1] = ReadInt24_t(); - if(grecordholder[pos-1] == GetPlayerName(player_localnum)) + if(grecordholder[pos-1] == entcs_GetName(player_localnum)) race_myrank = pos; break; case RACE_NET_SERVER_STATUS: diff --git a/qcsrc/client/quickmenu.qc b/qcsrc/client/quickmenu.qc index e0e758c2f..90f6c171c 100644 --- a/qcsrc/client/quickmenu.qc +++ b/qcsrc/client/quickmenu.qc @@ -758,7 +758,7 @@ void HUD_Quickmenu_PlayerListEntries(string cmd, float teamplayers, float withou continue; if(without_me && pl.sv_entnum == player_localnum) continue; - QUICKMENU_ENTRY(GetPlayerName(pl.sv_entnum), sprintf(cmd, GetPlayerName(pl.sv_entnum))) + QUICKMENU_ENTRY(entcs_GetName(pl.sv_entnum), sprintf(cmd, entcs_GetName(pl.sv_entnum))) } return; diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index 655e72904..1f864a540 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -109,7 +109,7 @@ void HUD_UpdatePlayerTeams() for(pl = players.sort_next; pl; pl = pl.sort_next) { num += 1; - Team = GetPlayerColor(pl.sv_entnum); + Team = entcs_GetTeam(pl.sv_entnum); if(SetTeam(pl, Team)) { tmp = pl.sort_prev; @@ -146,8 +146,8 @@ int HUD_CompareScore(float vl, float vr, int f) float HUD_ComparePlayerScores(entity left, entity right) { float vl, vr, r; - vl = GetPlayerColor(left.sv_entnum); - vr = GetPlayerColor(right.sv_entnum); + vl = entcs_GetTeam(left.sv_entnum); + vr = entcs_GetTeam(right.sv_entnum); if(!left.gotscores) vl = NUM_SPECTATOR; @@ -571,7 +571,7 @@ string HUD_GetField(entity pl, int field) hud_field_icon2_rgb = colormapPaletteColor(f % 16, 1); } } - return GetPlayerName(pl.sv_entnum); + return entcs_GetName(pl.sv_entnum); case SP_FRAGS: f = pl.(scores[SP_KILLS]); @@ -710,7 +710,7 @@ void HUD_PrintScoreboardItem(vector pos, vector item_size, entity pl, float is_s string str; int field; float is_spec; - is_spec = (GetPlayerColor(pl.sv_entnum) == NUM_SPECTATOR); + is_spec = (entcs_GetTeam(pl.sv_entnum) == NUM_SPECTATOR); if((rgb == '1 1 1') && (!is_spec)) { rgb.x = autocvar_scoreboard_color_bg_r + 0.5; @@ -1201,7 +1201,7 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl, vector rgb, vector bg_ return pos; float is_spec; - is_spec = (GetPlayerColor(pl.sv_entnum) == NUM_SPECTATOR); + is_spec = (entcs_GetTeam(pl.sv_entnum) == NUM_SPECTATOR); vector hl_rgb; hl_rgb.x = autocvar_scoreboard_color_bg_r + 0.5; hl_rgb.y = autocvar_scoreboard_color_bg_g + 0.5; @@ -1230,7 +1230,7 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl, vector rgb, vector bg_ continue; n = grecordholder[i]; p = count_ordinal(i+1); - if(grecordholder[i] == GetPlayerName(player_localnum)) + if(grecordholder[i] == entcs_GetName(player_localnum)) drawfill(pos, '1 0 0' * sbwidth + '0 1.25 0' * hud_fontsize.y, hl_rgb, scoreboard_highlight_alpha_self, DRAWFLAG_NORMAL); else if(!(i % 2) && scoreboard_highlight) drawfill(pos, '1 0 0' * sbwidth + '0 1.25 0' * hud_fontsize.y, hl_rgb, scoreboard_highlight_alpha, DRAWFLAG_NORMAL); diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index b70714558..16a693dd3 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -99,7 +99,7 @@ void Draw_ShowNames(entity this) // multiply by player alpha if (!this.sameteam || (this.sv_entnum == player_localentnum)) { - float f = getplayeralpha(this.sv_entnum - 1); + float f = entcs_GetAlpha(this.sv_entnum - 1); if (f == 0) f = 1; if (f < 0) f = 0; // FIXME: alpha is negative when dead, breaking death fade @@ -150,9 +150,9 @@ void Draw_ShowNames(entity this) DRAWFLAG_NORMAL); } } - string s = GetPlayerName(this.sv_entnum - 1); + string s = entcs_GetName(this.sv_entnum - 1); if ((autocvar_hud_shownames_decolorize == 1 && teamplay) - || autocvar_hud_shownames_decolorize == 2) s = playername(s, GetPlayerColor(this.sv_entnum - 1)); + || autocvar_hud_shownames_decolorize == 2) s = playername(s, entcs_GetTeam(this.sv_entnum - 1)); drawfontscale = '1 1 0' * resize; s = textShortenToWidth(s, namewidth, '1 1 0' * autocvar_hud_shownames_fontsize, stringwidth_colors); float width = stringwidth(s, true, '1 1 0' * autocvar_hud_shownames_fontsize); @@ -186,7 +186,7 @@ void Draw_ShowNames_All() it.armorvalue = 0; it.sameteam = false; } - bool dead = getplayerisdead(i); + bool dead = entcs_IsDead(i) || entcs_IsSpectating(i); if (!it.csqcmodel_isdead && entcs.has_origin) setorigin(it, entcs.origin); it.csqcmodel_isdead = dead; Draw_ShowNames(it); diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index f483fd50a..f2792d0bb 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -610,7 +610,7 @@ float EnemyHitCheck() return SHOTTYPE_HITWORLD; if(n > maxclients) return SHOTTYPE_HITWORLD; - t = GetPlayerColor(n - 1); + t = entcs_GetTeam(n - 1); if(teamplay) if(t == myteam) return SHOTTYPE_HITTEAM; @@ -1420,7 +1420,7 @@ void CSQC_UpdateView(float w, float h) current_player = player_localentnum - 1; else // then player_localentnum is the vehicle I'm driving current_player = player_localnum; - myteam = GetPlayerColor(current_player); + myteam = entcs_GetTeam(current_player); if(myteam != prev_myteam) { diff --git a/qcsrc/common/effects/qc/globalsound.qc b/qcsrc/common/effects/qc/globalsound.qc index d920bd139..674ca8461 100644 --- a/qcsrc/common/effects/qc/globalsound.qc +++ b/qcsrc/common/effects/qc/globalsound.qc @@ -85,6 +85,8 @@ } else { + LOG_WARNINGF("Missing entcs data for player %d\n", who); + // Can this happen? entity e = new(globalsound); e.origin = o; sound8(e, o, chan, sample, vol, atten, 0, 0); diff --git a/qcsrc/common/ent_cs.qh b/qcsrc/common/ent_cs.qh index 7f773527b..73d4d871e 100644 --- a/qcsrc/common/ent_cs.qh +++ b/qcsrc/common/ent_cs.qh @@ -54,11 +54,20 @@ REGISTER_NET_LINKED(ENT_CLIENT_ENTCS) #define entcs_receiver_2(i, v) AL_sete(_entcs, i, v) #define entcs_is_self(e) ((e).sv_entnum == player_localentnum - 1) + /** + * @param i zero indexed player + */ + bool entcs_IsSpectating(int i) + { + bool unconnected = !playerslots[i].gotscores; + return unconnected || stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR; + } + /** * @param i zero indexed player * @returns 0 if not teamplay */ - int GetPlayerColorForce(int i) + int entcs_GetTeamColor(int i) { return (!teamplay) ? 0 : stof(getplayerkeyvalue(i, "colors")) & 15; } @@ -67,17 +76,15 @@ REGISTER_NET_LINKED(ENT_CLIENT_ENTCS) * @param i zero indexed player * @returns 0 if not teamplay | NUM_TEAM_##N | NUM_SPECTATOR */ - int GetPlayerColor(int i) + int entcs_GetTeam(int i) { - bool unconnected = !playerslots[i].gotscores; - bool spec = unconnected || stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR; - return (spec) ? NUM_SPECTATOR : GetPlayerColorForce(i); + return entcs_IsSpectating(i) ? NUM_SPECTATOR : entcs_GetTeamColor(i); } /** * @param i zero indexed player */ - string GetPlayerName(int i) + string entcs_GetName(int i) { return ColorTranslateRGB(getplayerkeyvalue(i, "name")); } @@ -92,7 +99,7 @@ REGISTER_NET_LINKED(ENT_CLIENT_ENTCS) /** * @param i zero indexed player */ - float getplayeralpha(int i) + float entcs_GetAlpha(int i) { entity e = CSQCModel_server2csqc(i); return e ? e.alpha : 1; @@ -101,7 +108,7 @@ REGISTER_NET_LINKED(ENT_CLIENT_ENTCS) /** * @param i zero indexed player */ - vector getcsqcplayercolor(int i) + vector entcs_GetColor(int i) { entity e = CSQCModel_server2csqc(i); return (!e || e.colormap <= 0) @@ -115,7 +122,7 @@ REGISTER_NET_LINKED(ENT_CLIENT_ENTCS) /** * @param i zero indexed player */ - bool getplayerisdead(int i) + bool entcs_IsDead(int i) { entity e = CSQCModel_server2csqc(i); return e ? e.csqcmodel_isdead : false; diff --git a/qcsrc/common/minigames/cl_minigames.qc b/qcsrc/common/minigames/cl_minigames.qc index 3ea50caad..a9f4a4f4c 100644 --- a/qcsrc/common/minigames/cl_minigames.qc +++ b/qcsrc/common/minigames/cl_minigames.qc @@ -212,7 +212,7 @@ NET_HANDLE(ENT_CLIENT_MINIGAME, bool isnew) minigame_read_owner(); float ent = ReadLong(); self.minigame_playerslot = ent; - LOG_DEBUG("Player: ",GetPlayerName(ent-1),"\n"); + LOG_DEBUG("Player: ",entcs_GetName(ent-1),"\n"); activate = (ent == player_localnum+1 && self.owner && self.owner != active_minigame); diff --git a/qcsrc/common/minigames/cl_minigames_hud.qc b/qcsrc/common/minigames/cl_minigames_hud.qc index 822aff3fa..e93c95ca6 100644 --- a/qcsrc/common/minigames/cl_minigames_hud.qc +++ b/qcsrc/common/minigames/cl_minigames_hud.qc @@ -283,11 +283,11 @@ void HUD_MinigameMenu_ClickInvite() entity prev = self; for(int i = 0; i < maxclients; ++i) { - if ( player_localnum != i && playerslots[i] && GetPlayerName(i) != "" && + if ( player_localnum != i && playerslots[i] && entcs_GetName(i) != "" && !findfloat(world,minigame_playerslot,i+1) && playerslots[i].ping ) { e = HUD_MinigameMenu_SpawnSubEntry( - strzone(GetPlayerName(i)), HUD_MinigameMenu_ClickInvite_Entry, + strzone(entcs_GetName(i)), HUD_MinigameMenu_ClickInvite_Entry, self ); e.flags |= 1; e.netname = strzone(ftos(i+1)); diff --git a/qcsrc/common/minigames/minigame/bd.qc b/qcsrc/common/minigames/minigame/bd.qc index a311005b7..ed84b6469 100644 --- a/qcsrc/common/minigames/minigame/bd.qc +++ b/qcsrc/common/minigames/minigame/bd.qc @@ -854,7 +854,7 @@ void bd_hud_status(vector pos, vector mySize) { mypos = pos; minigame_drawcolorcodedstring_trunc(mySize_x,mypos, - GetPlayerName(e.minigame_playerslot-1), + entcs_GetName(e.minigame_playerslot-1), player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); mypos_y += player_fontsize_y; @@ -1143,4 +1143,4 @@ int bd_client_event(entity minigame, string event, ...) return false; } -#endif \ No newline at end of file +#endif diff --git a/qcsrc/common/minigames/minigame/c4.qc b/qcsrc/common/minigames/minigame/c4.qc index a7ba05068..9b9d57085 100644 --- a/qcsrc/common/minigames/minigame/c4.qc +++ b/qcsrc/common/minigames/minigame/c4.qc @@ -302,7 +302,7 @@ void c4_hud_board(vector pos, vector mySize) FOREACH_MINIGAME_ENTITY(e) if ( e.classname == "minigame_player" && e.team == (active_minigame.minigame_flags & C4_TURN_TEAM) ) - playername = GetPlayerName(e.minigame_playerslot-1); + playername = entcs_GetName(e.minigame_playerslot-1); vector win_pos = pos+eY*(mySize_y-winfs_y)/2; vector win_sz; @@ -352,7 +352,7 @@ void c4_hud_status(vector pos, vector mySize) if ( e.team == 2 ) mypos_y += player_fontsize_y + ts_y; minigame_drawcolorcodedstring_trunc(mySize_x,mypos, - GetPlayerName(e.minigame_playerslot-1), + entcs_GetName(e.minigame_playerslot-1), player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); mypos_y += player_fontsize_y; diff --git a/qcsrc/common/minigames/minigame/nmm.qc b/qcsrc/common/minigames/minigame/nmm.qc index 93c88f657..e4e0dc638 100644 --- a/qcsrc/common/minigames/minigame/nmm.qc +++ b/qcsrc/common/minigames/minigame/nmm.qc @@ -477,7 +477,7 @@ void nmm_hud_board(vector pos, vector mySize) FOREACH_MINIGAME_ENTITY(e) if ( e.classname == "minigame_player" && e.team == (active_minigame.minigame_flags & NMM_TURN_TEAM) ) - playername = GetPlayerName(e.minigame_playerslot-1); + playername = entcs_GetName(e.minigame_playerslot-1); vector win_pos = pos+eY*(mySize_y-winfs_y)/2; vector win_sz; @@ -531,7 +531,7 @@ void nmm_hud_status(vector pos, vector mySize) if ( e.team == 2 ) mypos_y += player_fontsize_y + ts_y; minigame_drawcolorcodedstring_trunc(mySize_x,mypos, - GetPlayerName(e.minigame_playerslot-1), + entcs_GetName(e.minigame_playerslot-1), player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); } else if ( e.classname == "minigame_board_piece" ) diff --git a/qcsrc/common/minigames/minigame/pong.qc b/qcsrc/common/minigames/minigame/pong.qc index 540f7ecf2..359003fff 100644 --- a/qcsrc/common/minigames/minigame/pong.qc +++ b/qcsrc/common/minigames/minigame/pong.qc @@ -566,7 +566,7 @@ void pong_hud_status(vector pos, vector mySize) drawfill(mypos, ts, pong_team_to_color(e.team), 0.25, DRAWFLAG_ADDITIVE); minigame_drawcolorcodedstring_trunc(mySize_x,mypos, - (e.minigame_playerslot ? GetPlayerName(e.minigame_playerslot-1) : _("AI")), + (e.minigame_playerslot ? entcs_GetName(e.minigame_playerslot-1) : _("AI")), player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); drawstring(mypos+eY*player_fontsize_y,ftos(e.pong_score),'48 48 0', diff --git a/qcsrc/common/minigames/minigame/pp.qc b/qcsrc/common/minigames/minigame/pp.qc index 3ef2124dc..a66a83967 100644 --- a/qcsrc/common/minigames/minigame/pp.qc +++ b/qcsrc/common/minigames/minigame/pp.qc @@ -354,7 +354,7 @@ void pp_hud_board(vector pos, vector mySize) FOREACH_MINIGAME_ENTITY(e) if ( e.classname == "minigame_player" && e.team == (active_minigame.minigame_flags & PP_TURN_TEAM) ) - playername = GetPlayerName(e.minigame_playerslot-1); + playername = entcs_GetName(e.minigame_playerslot-1); vector win_pos = pos+eY*(mySize_y-winfs_y)/2; vector win_sz; @@ -412,7 +412,7 @@ void pp_hud_status(vector pos, vector mySize) if ( e.team == 2 ) mypos_y += player_fontsize_y + ts_y; minigame_drawcolorcodedstring_trunc(mySize_x,mypos, - GetPlayerName(e.minigame_playerslot-1), + entcs_GetName(e.minigame_playerslot-1), player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); mypos_y += player_fontsize_y; diff --git a/qcsrc/common/minigames/minigame/ps.qc b/qcsrc/common/minigames/minigame/ps.qc index 54be75cd4..4eb0009b9 100644 --- a/qcsrc/common/minigames/minigame/ps.qc +++ b/qcsrc/common/minigames/minigame/ps.qc @@ -464,7 +464,7 @@ void ps_hud_status(vector pos, vector mySize) { mypos = pos; minigame_drawcolorcodedstring_trunc(mySize_x,mypos, - GetPlayerName(e.minigame_playerslot-1), + entcs_GetName(e.minigame_playerslot-1), player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); mypos_y += player_fontsize_y; diff --git a/qcsrc/common/minigames/minigame/snake.qc b/qcsrc/common/minigames/minigame/snake.qc index cbb13420f..371df34d3 100644 --- a/qcsrc/common/minigames/minigame/snake.qc +++ b/qcsrc/common/minigames/minigame/snake.qc @@ -703,7 +703,7 @@ void snake_hud_status(vector pos, vector mySize) if ( e.team > 1 ) mypos_y += player_fontsize_y + (ts_y * (e.team - 1)); minigame_drawcolorcodedstring_trunc(mySize_x,mypos, - GetPlayerName(e.minigame_playerslot-1), + entcs_GetName(e.minigame_playerslot-1), player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); vector tile_color = snake_teamcolor(e.team); @@ -850,4 +850,4 @@ int snake_client_event(entity minigame, string event, ...) return false; } -#endif \ No newline at end of file +#endif diff --git a/qcsrc/common/minigames/minigame/ttt.qc b/qcsrc/common/minigames/minigame/ttt.qc index c3c76376c..cd9565abd 100644 --- a/qcsrc/common/minigames/minigame/ttt.qc +++ b/qcsrc/common/minigames/minigame/ttt.qc @@ -295,7 +295,7 @@ void ttt_hud_status(vector pos, vector mySize) if ( e.team == 2 ) mypos_y += player_fontsize_y + ts_y; minigame_drawcolorcodedstring_trunc(mySize_x,mypos, - (e.minigame_playerslot ? GetPlayerName(e.minigame_playerslot-1) : _("AI")), + (e.minigame_playerslot ? entcs_GetName(e.minigame_playerslot-1) : _("AI")), player_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL); mypos_y += player_fontsize_y; diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index a66a92993..fd21947d6 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -469,7 +469,7 @@ void Draw_WaypointSprite(entity this) InterpolateOrigin_Do(self); - float t = GetPlayerColor(player_localnum) + 1; + float t = entcs_GetTeam(player_localnum) + 1; string spriteimage = ""; diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index e05f519f4..dbf1e9e33 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -65,7 +65,7 @@ void turret_draw2d(entity this) return; float dist = vlen(self.origin - view_origin); - float t = (GetPlayerColor(player_localnum) + 1); + float t = (entcs_GetTeam(player_localnum) + 1); vector o; string txt; diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index dd1b1b1b9..43a207e96 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -744,7 +744,7 @@ void Draw_Shockwave(entity this) if(a < ALPHA_MIN_VISIBLE) { remove(self); } // WEAPONTODO: save this only once when creating the entity - vector sw_color = getcsqcplayercolor(self.sv_entnum - 1); // GetTeamRGB(GetPlayerColor(self.sv_entnum)); + vector sw_color = entcs_GetColor(self.sv_entnum - 1); // GetTeamRGB(entcs_GetTeam(self.sv_entnum)); // WEAPONTODO: trace to find what we actually hit vector endpos = (self.sw_shotorg + (self.sw_shotdir * self.sw_distance)); -- 2.39.2