From dbf3b84ab7f899fbc8dc288a9122c8a9b9133ed2 Mon Sep 17 00:00:00 2001 From: pierow Date: Tue, 22 Aug 2023 23:47:27 -0400 Subject: [PATCH] add hud_nameinfo; welder text on client --- main/source/cl_dll/hud.cpp | 1 + main/source/dlls/player.cpp | 6 ------ main/source/mod/AvHHud.cpp | 17 ++++++++++++++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/main/source/cl_dll/hud.cpp b/main/source/cl_dll/hud.cpp index 1663e38f..ddc7744b 100644 --- a/main/source/cl_dll/hud.cpp +++ b/main/source/cl_dll/hud.cpp @@ -226,6 +226,7 @@ void CHud :: Init( void ) CVAR_CREATE("hud_minimapnamesRed", "255", FCVAR_ARCHIVE); CVAR_CREATE("hud_minimapnamesGreen", "255", FCVAR_ARCHIVE); CVAR_CREATE("hud_minimapnamesBlue", "255", FCVAR_ARCHIVE); + CVAR_CREATE("hud_nameinfo", "1", FCVAR_ARCHIVE); m_pSpriteList = NULL; diff --git a/main/source/dlls/player.cpp b/main/source/dlls/player.cpp index d4570435..3435042d 100644 --- a/main/source/dlls/player.cpp +++ b/main/source/dlls/player.cpp @@ -2079,16 +2079,10 @@ void CBasePlayer::UpdateStatusBar() if ( g_pGameRules->PlayerRelationship( this, pEntity ) == GR_TEAMMATE ) { int theLevel = 1; - bool hasWelder = 0; AvHPlayer* thePlayer = dynamic_cast(pEntity); if(thePlayer) { theLevel = thePlayer->GetExperienceLevel(); - //TODO:change out for icon in statusbar rendering code or localize. - hasWelder = thePlayer->GetHasItem("weapon_welder"); - if (hasWelder) { - strcat(sbuf1, " [Welder]"); - } } //newSBarState[ SBAR_ID_TARGETHEALTH ] = 100 * (pEntity->pev->health / pEntity->pev->max_health); diff --git a/main/source/mod/AvHHud.cpp b/main/source/mod/AvHHud.cpp index 8e6483f8..b1b25148 100644 --- a/main/source/mod/AvHHud.cpp +++ b/main/source/mod/AvHHud.cpp @@ -5435,9 +5435,24 @@ bool AvHHud::GetEntityInfoString(int inEntityID, string& outEntityInfoString, bo // Do this client side so the extra chars don't need to be transmitted. Welder handled server side in UpdateStatusBar. if (theEntity->curstate.team == theTeam) { + if (g_PlayerExtraInfo[theEntity->index].extra & WEAPON_WELDER) + { + if (CVAR_GET_FLOAT("hud_nameinfo") == 1) + outEntityInfoString += " [Welder]"; + else if (CVAR_GET_FLOAT("hud_nameinfo") == 2.0f) + outEntityInfoString += " [Weld]"; + else if (CVAR_GET_FLOAT("hud_nameinfo") == 3.0f) + outEntityInfoString += " [W]"; + } if (GetHasUpgrade(theEntity->curstate.iuser4, MASK_PARASITED)) { - outEntityInfoString += " [Parasited]"; + if (CVAR_GET_FLOAT("hud_nameinfo") == 1) + outEntityInfoString += " [Parasited]"; + else if (CVAR_GET_FLOAT("hud_nameinfo") == 2.0f) + outEntityInfoString += " [Para]"; + else if (CVAR_GET_FLOAT("hud_nameinfo") == 3.0f) + outEntityInfoString += " [P]"; + } }