]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Shownames: fade when moving to spectate
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 1 Dec 2015 22:54:21 +0000 (09:54 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 1 Dec 2015 22:54:21 +0000 (09:54 +1100)
26 files changed:
qcsrc/client/defs.qh
qcsrc/client/hook.qc
qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/hud/panel/radar.qc
qcsrc/client/hud/panel/score.qc
qcsrc/client/main.qc
qcsrc/client/quickmenu.qc
qcsrc/client/scoreboard.qc
qcsrc/client/shownames.qc
qcsrc/client/view.qc
qcsrc/common/effects/qc/globalsound.qc
qcsrc/common/ent_cs.qh
qcsrc/common/minigames/cl_minigames.qc
qcsrc/common/minigames/cl_minigames_hud.qc
qcsrc/common/minigames/minigame/bd.qc
qcsrc/common/minigames/minigame/c4.qc
qcsrc/common/minigames/minigame/nmm.qc
qcsrc/common/minigames/minigame/pong.qc
qcsrc/common/minigames/minigame/pp.qc
qcsrc/common/minigames/minigame/ps.qc
qcsrc/common/minigames/minigame/snake.qc
qcsrc/common/minigames/minigame/ttt.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/weapons/weapon/shockwave.qc

index 98f25cc9037772d9d3a158407109af1fb63e7fe1..069598e3b4613c457f86d0479fdba2a4077edb4c 100644 (file)
@@ -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)
 
index e8bd4432162f947c541b737d80c732cec61e2f37..818e73782eb84bb35e700c911a3bdac8eb30103a 100644 (file)
@@ -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
index 2bcad642609d7b86dfc4b7dd0c1170566057c57a..33f797f3d3201b0a337596a774f709c1c8244ce9 100644 (file)
@@ -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)
index 1a64b9b74bb53afbb9b11cc05128dd03ce617b6a..8fab80ed6170b0dc93e19877d994f64be9be6f56 100644 (file)
@@ -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);
index 1982686c9df3c54d90564942ed356858d599e239..55efbad5dd4ac31620079a8ef0cca6619c4dbd64 100644 (file)
@@ -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));
        }
index dd3000c4cb6ffe1f51b09761b23e710c9f3394b5..d120c1cd181d75cc400a4cf8f57a201fa3607c11 100644 (file)
@@ -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;
index 510293e76602eac4cccaad26a202b9f834d69e18..f2df818aa62e2123ce86509934beac37b578788b 100644 (file)
@@ -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:
index e0e758c2fb192e3061b91fce2459ec83f2f847b6..90f6c171c88c621a3b7b72ad3631f62bec7c87e7 100644 (file)
@@ -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;
index 655e7290412262c8611472f43f75d71f2fcfad03..1f864a540db584f6d31babdce8ebf2ee2597d093 100644 (file)
@@ -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);
index b70714558326bbee3d145cd87e758c7fa7195d4a..16a693dd3e7d58cd73ccf56494c970408a799d6d 100644 (file)
@@ -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);
index f483fd50a59574cdad5d3b4366022d61ab4afbd0..f2792d0bb1f542e22f2e705f441332f69aba4f38 100644 (file)
@@ -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)
        {
index d920bd139eab195a99d7013db532e17d1a0bc98e..674ca846177a900f0ff165f85105f4ae5c475548 100644 (file)
@@ -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);
index 7f773527b073f34b85907ee481e4442bd38f28fd..73d4d871e2ade5efa430f7538a9827c055ba4282 100644 (file)
@@ -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;
index 3ea50caad3d0554bb5f1b7b4e389b29bf6052d6b..a9f4a4f4cfab763ce23a22572b74b964bacb4a26 100644 (file)
@@ -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);
 
index 822aff3fad4439a129a97ea3413f239d52dcf417..e93c95ca6077bed5935373c47bf0e1426f4c3315 100644 (file)
@@ -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));
index a311005b7fd5ebb377cba2f9c08533d4d60be6ec..ed84b6469c33c56b79eda5592d92c51206fe0228 100644 (file)
@@ -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
index a7ba05068ac85e929d607a43e7d0028c4385edac..9b9d570855b490d8ac01d737cfb2114329656fe7 100644 (file)
@@ -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;
index 93c88f6570486a6f85290a508d186ab20c2c8532..e4e0dc6380d9aec56a1b05601a8f5d733fe1b9c5 100644 (file)
@@ -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" )
index 540f7ecf2f1d506b30a28e98f045c3783f9c4e0e..359003fffc8e676a051d972ead0bc304e3cad08f 100644 (file)
@@ -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',
index 3ef2124dcac1b72aa7a27a84e6a21bcea136c115..a66a839677d9ceed95f9e62bdeaea3d72ddf5c34 100644 (file)
@@ -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;
index 54be75cd46f51ba2c62756d99ec8716cb6764fd0..4eb0009b9db2ae5383906e7772270a85cc1258bf 100644 (file)
@@ -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;
index cbb13420fb1573ad76e31e2b7eb6a1057e0fa51c..371df34d38d7c26a6c159160dfe403ce5fef6a81 100644 (file)
@@ -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
index c3c76376c169cd8b19ab22c715b50c3f47401582..cd9565abd54ce2bf401b9459f33afa4ad4a25dd3 100644 (file)
@@ -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;
index a66a92993355ca8f3873a100837a06366fa1b71b..fd21947d6fdeffa2cfba866fc75bcde6930ba928 100644 (file)
@@ -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 = "";
 
index e05f519f4fb24d6decf4f8964e4a03d1e5dc22b1..dbf1e9e33b7fde472184323cb1cf54bc339d5fe9 100644 (file)
@@ -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;
index dd1b1b1b9ca0cc93bda906d93bad71aa6486ff95..43a207e9686d0eff9c6da2f577c0b196305dd6d7 100644 (file)
@@ -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));