Skip to content

Commit

Permalink
Adds colon to name search, changes JINRAI and NSF colours to match or…
Browse files Browse the repository at this point in the history
…iginal (#522)
  • Loading branch information
AdamTadeusz authored Aug 3, 2024
1 parent d585c2e commit 4e3cf9e
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 22 deletions.
11 changes: 11 additions & 0 deletions mp/src/game/client/hud_basechat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,15 +1872,26 @@ void CBaseHudChat::ChatPrintf( int iPlayerIndex, int iFilter, const char *fmt, .

if ( pName )
{
#ifdef NEO
wchar_t wideName[MAX_PLAYER_NAME_LENGTH+1];
char pNameWithColon[MAX_PLAYER_NAME_LENGTH+1];
V_snprintf(pNameWithColon, MAX_PLAYER_NAME_LENGTH+1, "%s:", pName);
g_pVGuiLocalize->ConvertANSIToUnicode(pNameWithColon, wideName, sizeof( wideName ) );
#else
wchar_t wideName[MAX_PLAYER_NAME_LENGTH];
g_pVGuiLocalize->ConvertANSIToUnicode( pName, wideName, sizeof( wideName ) );
#endif

const wchar_t *nameInString = wcsstr( wbuf, wideName );

if ( nameInString )
{
iNameStart = (nameInString - wbuf);
#ifdef NEO
iNameLength = wcslen( wideName ) - 1;
#else
iNameLength = wcslen( wideName );
#endif
}
}

Expand Down
4 changes: 1 addition & 3 deletions mp/src/game/client/neo/ui/neo_hud_ghost_cap_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ void CNEOHud_GhostCapPoint::DrawNeoHudElement()
auto *player = C_NEO_Player::GetLocalNEOPlayer();
const int playerTeam = player->GetTeamNumber();

static const Color COLORCAP_JINRAI(76, 255, 0, 255);
static const Color COLORCAP_NSF(0, 76, 255, 255);
Color targetColor = (m_iCapTeam == TEAM_JINRAI) ? COLORCAP_JINRAI : COLORCAP_NSF;
Color targetColor = (m_iCapTeam == TEAM_JINRAI) ? COLOR_JINRAI : COLOR_NSF;

const bool playerIsPlaying = (playerTeam == TEAM_JINRAI || playerTeam == TEAM_NSF);
if (playerIsPlaying)
Expand Down
2 changes: 1 addition & 1 deletion mp/src/game/server/neo/neo_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ void CNEO_Player::SetNeoPlayerName(const char *newNeoName)
// NEO NOTE (nullsystem): Generally it's never NULL but just incase
if (newNeoName)
{
V_memcpy(m_szNeoName.GetForModify(), newNeoName, sizeof(m_szNeoName));
V_memcpy(m_szNeoName.GetForModify(), newNeoName, sizeof(m_szNeoName)-1);
m_szNeoNameHasSet = true;
}
}
Expand Down
32 changes: 16 additions & 16 deletions mp/src/game/shared/neo/neo_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1824,20 +1824,20 @@ const char* CNEORules::GetChatFormat(bool bTeamOnly, CBasePlayer* pPlayer)
{
switch (pPlayer->GetTeamNumber())
{
case TEAM_JINRAI: return FMT_TEAM_JINRAI " (team) " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_NSF: return FMT_TEAM_NSF " (team) " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_SPECTATOR: return FMT_TEAM_SPECTATOR " (team) " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
default: return FMT_TEAM_UNASSIGNED " (team) " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_JINRAI: return FMT_TEAM_JINRAI " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_NSF: return FMT_TEAM_NSF " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_SPECTATOR: return FMT_TEAM_SPECTATOR " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
default: return FMT_TEAM_UNASSIGNED " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
}
}
else
{
switch (pPlayer->GetTeamNumber())
{
case TEAM_JINRAI: return FMT_TEAM_JINRAI " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_NSF: return FMT_TEAM_NSF " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_SPECTATOR: return FMT_TEAM_SPECTATOR " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
default: return FMT_TEAM_UNASSIGNED " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_JINRAI: return FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_NSF: return FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_SPECTATOR: return FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
default: return FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
}
}
}
Expand All @@ -1847,20 +1847,20 @@ const char* CNEORules::GetChatFormat(bool bTeamOnly, CBasePlayer* pPlayer)
{
switch (pPlayer->GetTeamNumber())
{
case TEAM_JINRAI: return FMT_DEAD " " FMT_TEAM_JINRAI " (team) " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_NSF: return FMT_DEAD " " FMT_TEAM_NSF " (team) " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_SPECTATOR: return FMT_TEAM_SPECTATOR " (team) " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
default: return FMT_TEAM_UNASSIGNED " (team) " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_JINRAI: return FMT_DEAD FMT_TEAM_JINRAI " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_NSF: return FMT_DEAD FMT_TEAM_NSF " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_SPECTATOR: return FMT_TEAM_SPECTATOR " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
default: return FMT_TEAM_UNASSIGNED " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
}
}
else
{
switch (pPlayer->GetTeamNumber())
{
case TEAM_JINRAI: return FMT_DEAD " " FMT_TEAM_JINRAI " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_NSF: return FMT_DEAD " " FMT_TEAM_NSF " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_SPECTATOR: return FMT_TEAM_SPECTATOR " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
default: return FMT_TEAM_UNASSIGNED " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_JINRAI: return FMT_DEAD " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_NSF: return FMT_DEAD " " FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
case TEAM_SPECTATOR: return FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
default: return FMT_PLAYERNAME ": " FMT_CHATMESSAGE;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions mp/src/game/shared/neo/neo_player_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ enum NeoStar {
#define COLOR_NSF COLOR_NEO_BLUE
#define COLOR_SPEC COLOR_NEO_ORANGE

#define COLOR_NEO_BLUE Color(181, 216, 248, 255)
#define COLOR_NEO_GREEN Color(192, 244, 196, 255)
#define COLOR_NEO_BLUE Color(154, 205, 255, 255)
#define COLOR_NEO_GREEN Color(154, 255, 154, 255)
#define COLOR_NEO_ORANGE Color(243, 190, 52, 255)
#define COLOR_NEO_WHITE Color(218, 217, 213, 255)

Expand Down

0 comments on commit 4e3cf9e

Please sign in to comment.