diff --git a/data/hud.png b/data/hud.png index 840f63243..288afce9d 100644 Binary files a/data/hud.png and b/data/hud.png differ diff --git a/datasrc/content.py b/datasrc/content.py index a9403f2bf..c6905f8c1 100644 --- a/datasrc/content.py +++ b/datasrc/content.py @@ -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)) diff --git a/datasrc/network.py b/datasrc/network.py index 033929e51..bd76de9cf 100644 --- a/datasrc/network.py +++ b/datasrc/network.py @@ -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", diff --git a/src/game/client/components/hud.cpp b/src/game/client/components/hud.cpp index d0b9e7b8e..3f5e8b828 100644 --- a/src/game/client/components/hud.cpp +++ b/src/game/client/components/hud.cpp @@ -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); diff --git a/src/game/client/components/hud.h b/src/game/client/components/hud.h index f292dd0b1..846b1f029 100644 --- a/src/game/client/components/hud.h +++ b/src/game/client/components/hud.h @@ -131,6 +131,7 @@ private: int m_DummyHammerOffset; int m_DummyCopyOffset; int m_PracticeModeOffset; + int m_LockModeOffset; }; #endif diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 8a9a59d30..4ecf093b6 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -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]); diff --git a/src/game/client/gameclient.h b/src/game/client/gameclient.h index 46109308e..69a2b374b 100644 --- a/src/game/client/gameclient.h +++ b/src/game/client/gameclient.h @@ -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; }; diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index 926b6e6a0..ade668fa0 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -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; }