From 4e3cf9e2e03d8cef6eb1ff2b972083b4c1b68d5b Mon Sep 17 00:00:00 2001 From: AdamTadeusz <44210793+AdamTadeusz@users.noreply.github.com> Date: Sat, 3 Aug 2024 19:06:49 +0100 Subject: [PATCH] Adds colon to name search, changes JINRAI and NSF colours to match original (#522) --- mp/src/game/client/hud_basechat.cpp | 11 +++++++ .../client/neo/ui/neo_hud_ghost_cap_point.cpp | 4 +-- mp/src/game/server/neo/neo_player.cpp | 2 +- mp/src/game/shared/neo/neo_gamerules.cpp | 32 +++++++++---------- mp/src/game/shared/neo/neo_player_shared.h | 4 +-- 5 files changed, 31 insertions(+), 22 deletions(-) diff --git a/mp/src/game/client/hud_basechat.cpp b/mp/src/game/client/hud_basechat.cpp index ccf04e3b7..3dce44e7f 100644 --- a/mp/src/game/client/hud_basechat.cpp +++ b/mp/src/game/client/hud_basechat.cpp @@ -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 } } diff --git a/mp/src/game/client/neo/ui/neo_hud_ghost_cap_point.cpp b/mp/src/game/client/neo/ui/neo_hud_ghost_cap_point.cpp index bc04aa1d7..af635fd36 100644 --- a/mp/src/game/client/neo/ui/neo_hud_ghost_cap_point.cpp +++ b/mp/src/game/client/neo/ui/neo_hud_ghost_cap_point.cpp @@ -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) diff --git a/mp/src/game/server/neo/neo_player.cpp b/mp/src/game/server/neo/neo_player.cpp index 60cdd5cd0..cff588f14 100644 --- a/mp/src/game/server/neo/neo_player.cpp +++ b/mp/src/game/server/neo/neo_player.cpp @@ -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; } } diff --git a/mp/src/game/shared/neo/neo_gamerules.cpp b/mp/src/game/shared/neo/neo_gamerules.cpp index f1113564a..f0a9de728 100644 --- a/mp/src/game/shared/neo/neo_gamerules.cpp +++ b/mp/src/game/shared/neo/neo_gamerules.cpp @@ -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; } } } @@ -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; } } } diff --git a/mp/src/game/shared/neo/neo_player_shared.h b/mp/src/game/shared/neo/neo_player_shared.h index 4a468611f..c7fcfd86d 100644 --- a/mp/src/game/shared/neo/neo_player_shared.h +++ b/mp/src/game/shared/neo/neo_player_shared.h @@ -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)