diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 00:42:07 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 00:42:07 +1000 |
commit | 63b68b3a55a11b32b07e7b8bdbf3760722d5e7f9 (patch) | |
tree | a6e9f0b6005d20fe69a00e1a585502c7b73461cd /source/game/StarPlayer.cpp | |
parent | 94c84ad01333850b88091f2c188e4f6173fd25e7 (diff) |
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.
Diffstat (limited to 'source/game/StarPlayer.cpp')
-rw-r--r-- | source/game/StarPlayer.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
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; |