Skip to content

Commit

Permalink
Client: Don't show own nickname in first person
Browse files Browse the repository at this point in the history
  • Loading branch information
SirLynix committed Oct 25, 2024
1 parent 837bccf commit 1bb49a0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ClientLib/ClientSessionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,10 @@ namespace tsom

entt::handle& visualEntity = visualEntityComp.visualEntity;

Nz::UInt32 playerRenderMask = (entityData.controllingPlayerId == m_ownPlayerIndex) ? tsom::Constants::RenderMaskLocalPlayer : tsom::Constants::RenderMaskOtherPlayer;

auto& gfx = visualEntity.emplace<Nz::GraphicsComponent>();
gfx.AttachRenderable(m_playerModel->model, (entityData.controllingPlayerId == m_ownPlayerIndex) ? tsom::Constants::RenderMaskLocalPlayer : tsom::Constants::RenderMaskOtherPlayer);
gfx.AttachRenderable(m_playerModel->model, playerRenderMask);

// Skeleton & animations
std::shared_ptr<Nz::Skeleton> skeleton = std::make_shared<Nz::Skeleton>(m_playerAnimAssets->referenceSkeleton);
Expand All @@ -743,7 +745,7 @@ namespace tsom
textNode.SetParent(visualEntity);
textNode.SetPosition({ -textSprite->GetAABB().width * 0.5f, 1.5f, 0.f });

frontTextEntity.emplace<Nz::GraphicsComponent>(textSprite);
frontTextEntity.emplace<Nz::GraphicsComponent>(textSprite, playerRenderMask);
}
visualEntity.get_or_emplace<EntityOwnerComponent>().Register(frontTextEntity);

Expand All @@ -754,7 +756,7 @@ namespace tsom
textNode.SetPosition({ textSprite->GetAABB().width * 0.5f, 1.5f, 0.f });
textNode.SetRotation(Nz::EulerAnglesf(0.f, Nz::TurnAnglef(0.5f), 0.f));

backTextEntity.emplace<Nz::GraphicsComponent>(textSprite);
backTextEntity.emplace<Nz::GraphicsComponent>(textSprite, playerRenderMask);
}
visualEntity.get_or_emplace<EntityOwnerComponent>().Register(backTextEntity);

Expand Down

0 comments on commit 1bb49a0

Please sign in to comment.