Skip to content

Commit a58b1a3

Browse files
committed
moved nameplate and renamed the config variables
1 parent 40a6c31 commit a58b1a3

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/engine/shared/config_variables.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,8 @@ MACRO_CONFIG_INT(SvConnlimitTime, sv_connlimit_time, 20, 0, 1000, CFGFLAG_SERVER
708708
MACRO_CONFIG_STR(SvConnLoggingServer, sv_conn_logging_server, 128, "", CFGFLAG_SERVER, "Unix socket server for IP address logging (Unix only)")
709709
#endif
710710

711-
MACRO_CONFIG_INT(ClShowAntipingGhost, cl_show_antiping_ghost, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show predicted shadow tee (0 = off, 1 = on, -1 = don't even show in debug mode)")
711+
MACRO_CONFIG_INT(ClAntipingGhost, cl_antiping_ghost, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show predicted shadow tee (0 = off, 1 = on, -1 = don't even show in debug mode)")
712+
MACRO_CONFIG_INT(ClAntipingGhostAlpha, cl_antiping_ghost_alpha, 75, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Alpha % of antiping ghost")
712713
MACRO_CONFIG_INT(ClUnpredictedShadow, cl_unpredicted_shadow, 0, -1, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show unpredicted shadow tee (0 = off, 1 = on, -1 = don't even show in debug mode)")
713714
MACRO_CONFIG_INT(ClPredictFreeze, cl_predict_freeze, 1, 0, 2, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Predict freeze tiles (0 = off, 1 = on, 2 = partial (allow a small amount of movement in freeze)")
714715
MACRO_CONFIG_INT(ClShowNinja, cl_show_ninja, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show ninja skin")

src/game/client/components/nameplates.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,15 @@ void CNamePlates::OnRender()
882882
// Only render name plates for active characters
883883
if(GameClient()->m_Snap.m_aCharacters[i].m_Active)
884884
{
885-
const vec2 RenderPos = GameClient()->m_aClients[i].m_RenderPos;
885+
vec2 RenderPos = GameClient()->m_aClients[i].m_RenderPos;
886+
887+
bool Local = GameClient()->m_Snap.m_LocalClientId == i;
888+
889+
if (!Local && g_Config.m_ClAntipingGhost)
890+
RenderPos = mix(
891+
vec2(GameClient()->m_Snap.m_aCharacters[i].m_Prev.m_X, GameClient()->m_Snap.m_aCharacters[i].m_Prev.m_Y),
892+
vec2(GameClient()->m_Snap.m_aCharacters[i].m_Cur.m_X, GameClient()->m_Snap.m_aCharacters[i].m_Cur.m_Y),
893+
Client()->IntraGameTick(g_Config.m_ClDummy));
886894
RenderNamePlateGame(RenderPos, pInfo, 1.0f);
887895
}
888896
}

src/game/client/components/players.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ void CPlayers::RenderPlayer(
561561

562562
vec2 Pred_Position = Position;
563563

564-
if (!Local && g_Config.m_ClShowAntipingGhost)
564+
if (!Local && g_Config.m_ClAntipingGhost)
565565
Position = mix(
566566
vec2(GameClient()->m_Snap.m_aCharacters[ClientId].m_Prev.m_X, GameClient()->m_Snap.m_aCharacters[ClientId].m_Prev.m_Y),
567567
vec2(GameClient()->m_Snap.m_aCharacters[ClientId].m_Cur.m_X, GameClient()->m_Snap.m_aCharacters[ClientId].m_Cur.m_Y),
@@ -812,9 +812,9 @@ void CPlayers::RenderPlayer(
812812
RenderTools()->RenderTee(&State, &RenderInfo, Player.m_Emote, Direction, ShadowPosition, 0.5f); // render ghost
813813
}
814814

815-
if(!Local && g_Config.m_ClShowAntipingGhost)
815+
if(!Local && g_Config.m_ClAntipingGhost)
816816
{
817-
RenderTools()->RenderTee(&State, &RenderInfo, Player.m_Emote, Direction, Pred_Position, 0.5f); // render ghost
817+
RenderTools()->RenderTee(&State, &RenderInfo, Player.m_Emote, Direction, Pred_Position, g_Config.m_ClAntipingGhostAlpha*0.01); // render ghost
818818
RenderTools()->RenderTee(&State, &RenderInfo, Player.m_Emote, Direction, Position, Alpha);
819819
}
820820
else

0 commit comments

Comments
 (0)