add deep and live frozen display

This commit is contained in:
c0d3d3v 2022-03-25 10:09:13 +01:00
parent 63d4591fe5
commit 78a0a3d31e
No known key found for this signature in database
GPG key ID: 068AF680530DFF31
5 changed files with 26 additions and 5 deletions

View file

@ -450,6 +450,8 @@ container.sprites.Add(Sprite("hud_no_hammer_hit", set_hud, 6,2,2,2))
container.sprites.Add(Sprite("hud_no_shotgun_hit", set_hud, 8,2,2,2))
container.sprites.Add(Sprite("hud_no_grenade_hit", set_hud, 10,2,2,2))
container.sprites.Add(Sprite("hud_no_laser_hit", set_hud, 12,2,2,2))
container.sprites.Add(Sprite("hud_deep_frozen", set_hud, 0,4,2,2))
container.sprites.Add(Sprite("hud_live_frozen", set_hud, 2,4,2,2))
container.sprites.Add(Sprite("hud_teleport_grenade", set_hud, 4,4,2,2))
container.sprites.Add(Sprite("hud_teleport_gun", set_hud, 6,4,2,2))
container.sprites.Add(Sprite("hud_teleport_laser", set_hud, 8,4,2,2))

View file

@ -819,7 +819,9 @@ void CHud::PreparePlayerStateQuads()
m_NoGrenadeHitOffset = RenderTools()->QuadContainerAddSprite(m_HudQuadContainerIndex, 0.f, 0.f, 12.f, 12.f);
m_NoLaserHitOffset = RenderTools()->QuadContainerAddSprite(m_HudQuadContainerIndex, 0.f, 0.f, 12.f, 12.f);
// Quads for displaying dummy actions
// Quads for displaying dummy actions and freeze status
m_DeepFrozenOffset = RenderTools()->QuadContainerAddSprite(m_HudQuadContainerIndex, 0.f, 0.f, 12.f, 12.f);
m_LiveFrozenOffset = RenderTools()->QuadContainerAddSprite(m_HudQuadContainerIndex, 0.f, 0.f, 12.f, 12.f);
m_DummyHammerOffset = RenderTools()->QuadContainerAddSprite(m_HudQuadContainerIndex, 0.f, 0.f, 12.f, 12.f);
m_DummyCopyOffset = RenderTools()->QuadContainerAddSprite(m_HudQuadContainerIndex, 0.f, 0.f, 12.f, 12.f);
@ -1016,7 +1018,6 @@ void CHud::RenderPlayerState(const int ClientID)
HasCapabilities = true;
Graphics()->TextureSet(m_pClient->m_HudSkin.m_SpriteHudTeleportLaser);
Graphics()->RenderQuadContainerAsSprite(m_HudQuadContainerIndex, m_TeleportLaserOffset, x, y);
x += 12;
}
// render prohibited capabilities
@ -1073,15 +1074,26 @@ void CHud::RenderPlayerState(const int ClientID)
HasProhibitedCapabilities = true;
Graphics()->TextureSet(m_pClient->m_HudSkin.m_SpriteHudNoLaserHit);
Graphics()->RenderQuadContainerAsSprite(m_HudQuadContainerIndex, m_NoLaserHitOffset, x, y);
x += 12;
}
// render dummy actions
// render dummy actions and freeze state
x = 5;
if(HasProhibitedCapabilities)
{
y += 12;
}
if(pCharacter->m_DeepFrozen)
{
Graphics()->TextureSet(m_pClient->m_HudSkin.m_SpriteHudDeepFrozen);
Graphics()->RenderQuadContainerAsSprite(m_HudQuadContainerIndex, m_DeepFrozenOffset, x, y);
x += 12;
}
if(pCharacter->m_LiveFrozen)
{
Graphics()->TextureSet(m_pClient->m_HudSkin.m_SpriteHudLiveFrozen);
Graphics()->RenderQuadContainerAsSprite(m_HudQuadContainerIndex, m_LiveFrozenOffset, x, y);
x += 12;
}
if(g_Config.m_ClDummyHammer)
{
Graphics()->TextureSet(m_pClient->m_HudSkin.m_SpriteHudDummyHammer);
@ -1092,7 +1104,6 @@ void CHud::RenderPlayerState(const int ClientID)
{
Graphics()->TextureSet(m_pClient->m_HudSkin.m_SpriteHudDummyCopy);
Graphics()->RenderQuadContainerAsSprite(m_HudQuadContainerIndex, m_DummyCopyOffset, x, y);
x += 12;
}
}

View file

@ -121,6 +121,8 @@ private:
int m_NoShotgunHitOffset;
int m_NoGrenadeHitOffset;
int m_NoLaserHitOffset;
int m_DeepFrozenOffset;
int m_LiveFrozenOffset;
int m_DummyHammerOffset;
int m_DummyCopyOffset;
int m_NinjaBarFullLeftOffset;

View file

@ -3020,6 +3020,8 @@ void CGameClient::LoadHudSkin(const char *pPath, bool AsDir)
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudNoShotgunHit);
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudNoGrenadeHit);
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudNoLaserHit);
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudDeepFrozen);
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudLiveFrozen);
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudTeleportGrenade);
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudTeleportGun);
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudTeleportLaser);
@ -3071,6 +3073,8 @@ void CGameClient::LoadHudSkin(const char *pPath, bool AsDir)
m_HudSkin.m_SpriteHudNoShotgunHit = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_HUD_NO_SHOTGUN_HIT]);
m_HudSkin.m_SpriteHudNoGrenadeHit = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_HUD_NO_GRENADE_HIT]);
m_HudSkin.m_SpriteHudNoLaserHit = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_HUD_NO_LASER_HIT]);
m_HudSkin.m_SpriteHudDeepFrozen = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_HUD_DEEP_FROZEN]);
m_HudSkin.m_SpriteHudLiveFrozen = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_HUD_LIVE_FROZEN]);
m_HudSkin.m_SpriteHudTeleportGrenade = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_HUD_TELEPORT_GRENADE]);
m_HudSkin.m_SpriteHudTeleportGun = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_HUD_TELEPORT_GUN]);
m_HudSkin.m_SpriteHudTeleportLaser = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_HUD_TELEPORT_LASER]);

View file

@ -660,6 +660,8 @@ public:
IGraphics::CTextureHandle m_SpriteHudNoShotgunHit;
IGraphics::CTextureHandle m_SpriteHudNoGrenadeHit;
IGraphics::CTextureHandle m_SpriteHudNoLaserHit;
IGraphics::CTextureHandle m_SpriteHudDeepFrozen;
IGraphics::CTextureHandle m_SpriteHudLiveFrozen;
IGraphics::CTextureHandle m_SpriteHudTeleportGrenade;
IGraphics::CTextureHandle m_SpriteHudTeleportGun;
IGraphics::CTextureHandle m_SpriteHudTeleportLaser;