mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Merge pull request #7926 from dobrykafe/pr-hud-teamlock
Add team-lock indicator to HUD
This commit is contained in:
commit
5ddf6aefa1
BIN
data/hud.png
BIN
data/hud.png
Binary file not shown.
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 77 KiB |
|
@ -448,6 +448,7 @@ container.sprites.Add(Sprite("hud_teleport_laser", set_hud, 8,4,2,2))
|
|||
container.sprites.Add(Sprite("hud_practice_mode", set_hud, 4,6,2,2))
|
||||
container.sprites.Add(Sprite("hud_dummy_hammer", set_hud, 6,6,2,2))
|
||||
container.sprites.Add(Sprite("hud_dummy_copy", set_hud, 8,6,2,2))
|
||||
container.sprites.Add(Sprite("hud_lock_mode", set_hud, 10,6,2,2))
|
||||
|
||||
container.sprites.Add(Sprite("part_snowflake", set_extras, 0,0,2,2))
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ CharacterFlags = ["SOLO", "JETPACK", "COLLISION_DISABLED", "ENDLESS_HOOK", "ENDL
|
|||
"HAMMER_HIT_DISABLED", "SHOTGUN_HIT_DISABLED", "GRENADE_HIT_DISABLED", "LASER_HIT_DISABLED", "HOOK_HIT_DISABLED",
|
||||
"TELEGUN_GUN", "TELEGUN_GRENADE", "TELEGUN_LASER",
|
||||
"WEAPON_HAMMER", "WEAPON_GUN", "WEAPON_SHOTGUN", "WEAPON_GRENADE", "WEAPON_LASER", "WEAPON_NINJA",
|
||||
"MOVEMENTS_DISABLED", "IN_FREEZE", "PRACTICE_MODE"]
|
||||
"MOVEMENTS_DISABLED", "IN_FREEZE", "PRACTICE_MODE", "LOCK_MODE"]
|
||||
GameInfoFlags = [
|
||||
"TIMESCORE", "GAMETYPE_RACE", "GAMETYPE_FASTCAP", "GAMETYPE_FNG",
|
||||
"GAMETYPE_DDRACE", "GAMETYPE_DDNET", "GAMETYPE_BLOCK_WORLDS",
|
||||
|
|
|
@ -744,8 +744,9 @@ void CHud::PreparePlayerStateQuads()
|
|||
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);
|
||||
|
||||
// Quad for displaying practice mode
|
||||
// Quads for displaying team modes
|
||||
m_PracticeModeOffset = RenderTools()->QuadContainerAddSprite(m_HudQuadContainerIndex, 0.f, 0.f, 12.f, 12.f);
|
||||
m_LockModeOffset = RenderTools()->QuadContainerAddSprite(m_HudQuadContainerIndex, 0.f, 0.f, 12.f, 12.f);
|
||||
}
|
||||
|
||||
void CHud::RenderPlayerState(const int ClientID)
|
||||
|
@ -984,6 +985,12 @@ void CHud::RenderPlayerState(const int ClientID)
|
|||
{
|
||||
y += 12;
|
||||
}
|
||||
if(m_pClient->m_Snap.m_aCharacters[ClientID].m_HasExtendedDisplayInfo && m_pClient->m_Snap.m_aCharacters[ClientID].m_ExtendedData.m_Flags & CHARACTERFLAG_LOCK_MODE)
|
||||
{
|
||||
Graphics()->TextureSet(m_pClient->m_HudSkin.m_SpriteHudLockMode);
|
||||
Graphics()->RenderQuadContainerAsSprite(m_HudQuadContainerIndex, m_LockModeOffset, x, y);
|
||||
x += 12;
|
||||
}
|
||||
if(m_pClient->m_Snap.m_aCharacters[ClientID].m_HasExtendedDisplayInfo && m_pClient->m_Snap.m_aCharacters[ClientID].m_ExtendedData.m_Flags & CHARACTERFLAG_PRACTICE_MODE)
|
||||
{
|
||||
Graphics()->TextureSet(m_pClient->m_HudSkin.m_SpriteHudPracticeMode);
|
||||
|
|
|
@ -131,6 +131,7 @@ private:
|
|||
int m_DummyHammerOffset;
|
||||
int m_DummyCopyOffset;
|
||||
int m_PracticeModeOffset;
|
||||
int m_LockModeOffset;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -3266,6 +3266,7 @@ void CGameClient::LoadHudSkin(const char *pPath, bool AsDir)
|
|||
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudTeleportGun);
|
||||
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudTeleportLaser);
|
||||
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudPracticeMode);
|
||||
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudLockMode);
|
||||
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudDummyHammer);
|
||||
Graphics()->UnloadTexture(&m_HudSkin.m_SpriteHudDummyCopy);
|
||||
m_HudSkinLoaded = false;
|
||||
|
@ -3324,6 +3325,7 @@ void CGameClient::LoadHudSkin(const char *pPath, bool AsDir)
|
|||
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]);
|
||||
m_HudSkin.m_SpriteHudPracticeMode = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_HUD_PRACTICE_MODE]);
|
||||
m_HudSkin.m_SpriteHudLockMode = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_HUD_LOCK_MODE]);
|
||||
m_HudSkin.m_SpriteHudDummyHammer = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_HUD_DUMMY_HAMMER]);
|
||||
m_HudSkin.m_SpriteHudDummyCopy = Graphics()->LoadSpriteTexture(ImgInfo, &g_pData->m_aSprites[SPRITE_HUD_DUMMY_COPY]);
|
||||
|
||||
|
|
|
@ -706,6 +706,7 @@ public:
|
|||
IGraphics::CTextureHandle m_SpriteHudTeleportGun;
|
||||
IGraphics::CTextureHandle m_SpriteHudTeleportLaser;
|
||||
IGraphics::CTextureHandle m_SpriteHudPracticeMode;
|
||||
IGraphics::CTextureHandle m_SpriteHudLockMode;
|
||||
IGraphics::CTextureHandle m_SpriteHudDummyHammer;
|
||||
IGraphics::CTextureHandle m_SpriteHudDummyCopy;
|
||||
};
|
||||
|
|
|
@ -1269,6 +1269,10 @@ void CCharacter::Snap(int SnappingClient)
|
|||
{
|
||||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_PRACTICE_MODE;
|
||||
}
|
||||
if(Teams()->TeamLocked(Team()))
|
||||
{
|
||||
pDDNetCharacter->m_Flags |= CHARACTERFLAG_LOCK_MODE;
|
||||
}
|
||||
pDDNetCharacter->m_TargetX = m_Core.m_Input.m_TargetX;
|
||||
pDDNetCharacter->m_TargetY = m_Core.m_Input.m_TargetY;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue