mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 14:08:19 +00:00
CHud::RenderPlayerState: Split ninja state rendering
This commit is contained in:
parent
a2ad543877
commit
ba7be6982d
|
@ -952,12 +952,14 @@ void CHud::RenderPlayerState(const int ClientID)
|
|||
Graphics()->RenderQuadContainerAsSprite(m_HudQuadContainerIndex, m_aWeaponOffset[WEAPON_NINJA], x, y);
|
||||
Graphics()->QuadsSetRotation(0);
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
x += 12;
|
||||
}
|
||||
if(pCharacter->m_aWeapons[WEAPON_NINJA].m_Got)
|
||||
{
|
||||
const int Max = g_pData->m_Weapons.m_Ninja.m_Duration * Client()->GameTickSpeed() / 1000;
|
||||
float NinjaProgress = clamp(pCharacter->m_Ninja.m_ActivationTick + g_pData->m_Weapons.m_Ninja.m_Duration * Client()->GameTickSpeed() / 1000 - Client()->GameTick(g_Config.m_ClDummy), 0, Max) / (float)Max;
|
||||
if(NinjaProgress > 0.0f && m_pClient->m_Snap.m_aCharacters[ClientID].m_HasExtendedDisplayInfo)
|
||||
{
|
||||
x += 12;
|
||||
RenderNinjaBarPos(x, y - 12, 6.f, 24.f, NinjaProgress);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue