From 63b68b3a55a11b32b07e7b8bdbf3760722d5e7f9 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 27 Jun 2023 00:42:07 +1000 Subject: Nameplate and chat bubble improvements They should stack much better now. I also hooked up the true mouth position to the name-tag, but it's too shaky on chat bubbles. --- source/game/StarPlayer.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source/game/StarPlayer.cpp') diff --git a/source/game/StarPlayer.cpp b/source/game/StarPlayer.cpp index bb47704..3eb464b 100644 --- a/source/game/StarPlayer.cpp +++ b/source/game/StarPlayer.cpp @@ -580,9 +580,9 @@ Vec2F Player::velocity() const { return m_movementController->velocity(); } -Vec2F Player::mouthOffset() const { +Vec2F Player::mouthOffset(bool ignoreAdjustments) const { return Vec2F( - m_humanoid->mouthOffset(true)[0] * numericalDirection(facingDirection()), m_humanoid->mouthOffset(true)[1]); + m_humanoid->mouthOffset(ignoreAdjustments)[0] * numericalDirection(facingDirection()), m_humanoid->mouthOffset(ignoreAdjustments)[1]); } Vec2F Player::feetOffset() const { @@ -610,7 +610,11 @@ Vec2F Player::legsArmorOffset() const { } Vec2F Player::mouthPosition() const { - return position() + mouthOffset(); + return position() + mouthOffset(true); +} + +Vec2F Player::mouthPosition(bool ignoreAdjustments) const { + return position() + mouthOffset(ignoreAdjustments); } RectF Player::collisionArea() const { @@ -1933,6 +1937,10 @@ Vec3B Player::nametagColor() const { return jsonToVec3B(assets->json("/player.config:nametagColor")); } +Vec2F Player::nametagOrigin() const { + return mouthPosition(false); +} + void Player::setBodyDirectives(String const& directives) { m_identity.bodyDirectives = directives; m_identityUpdated = true; -- cgit v1.2.3