mirror of
https://github.com/ENSL/NS.git
synced 2025-01-22 01:01:17 +00:00
add hud_nameinfo; welder text on client
This commit is contained in:
parent
60c4e0901c
commit
dbf3b84ab7
3 changed files with 17 additions and 7 deletions
|
@ -226,6 +226,7 @@ void CHud :: Init( void )
|
||||||
CVAR_CREATE("hud_minimapnamesRed", "255", FCVAR_ARCHIVE);
|
CVAR_CREATE("hud_minimapnamesRed", "255", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE("hud_minimapnamesGreen", "255", FCVAR_ARCHIVE);
|
CVAR_CREATE("hud_minimapnamesGreen", "255", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE("hud_minimapnamesBlue", "255", FCVAR_ARCHIVE);
|
CVAR_CREATE("hud_minimapnamesBlue", "255", FCVAR_ARCHIVE);
|
||||||
|
CVAR_CREATE("hud_nameinfo", "1", FCVAR_ARCHIVE);
|
||||||
|
|
||||||
m_pSpriteList = NULL;
|
m_pSpriteList = NULL;
|
||||||
|
|
||||||
|
|
|
@ -2079,16 +2079,10 @@ void CBasePlayer::UpdateStatusBar()
|
||||||
if ( g_pGameRules->PlayerRelationship( this, pEntity ) == GR_TEAMMATE )
|
if ( g_pGameRules->PlayerRelationship( this, pEntity ) == GR_TEAMMATE )
|
||||||
{
|
{
|
||||||
int theLevel = 1;
|
int theLevel = 1;
|
||||||
bool hasWelder = 0;
|
|
||||||
AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(pEntity);
|
AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(pEntity);
|
||||||
if(thePlayer)
|
if(thePlayer)
|
||||||
{
|
{
|
||||||
theLevel = thePlayer->GetExperienceLevel();
|
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);
|
//newSBarState[ SBAR_ID_TARGETHEALTH ] = 100 * (pEntity->pev->health / pEntity->pev->max_health);
|
||||||
|
|
|
@ -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.
|
// 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 (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))
|
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]";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue