diff options
-rw-r--r-- | assets/opensb/interface.config.patch | 2 | ||||
-rw-r--r-- | source/frontend/StarMainInterface.cpp | 4 | ||||
-rw-r--r-- | source/game/StarHumanoid.cpp | 30 | ||||
-rw-r--r-- | source/game/StarHumanoid.hpp | 4 | ||||
-rw-r--r-- | source/game/StarPlayer.cpp | 4 | ||||
-rw-r--r-- | source/game/StarPlayer.hpp | 2 | ||||
-rw-r--r-- | source/game/items/StarArmors.cpp | 16 |
7 files changed, 43 insertions, 19 deletions
diff --git a/assets/opensb/interface.config.patch b/assets/opensb/interface.config.patch index 8031217..020fdba 100644 --- a/assets/opensb/interface.config.patch +++ b/assets/opensb/interface.config.patch @@ -24,5 +24,5 @@ "buttonHoverOffSound" : [ "/sfx/interface/button/hover_off.wav" ], "debugSpatialClearTime" : 0.0, - "debugOffset" : [32, 100] + "debugOffset" : [64, 100] }
\ No newline at end of file diff --git a/source/frontend/StarMainInterface.cpp b/source/frontend/StarMainInterface.cpp index eb13a35..2664d2c 100644 --- a/source/frontend/StarMainInterface.cpp +++ b/source/frontend/StarMainInterface.cpp @@ -798,6 +798,8 @@ void MainInterface::renderInWorldElements() { if (m_disableHud) return; + m_guiContext->setDefaultFont(); + m_guiContext->setFontProcessingDirectives(""); m_guiContext->setFontColor(Vec4B::filled(255)); m_questIndicatorPainter->render(); m_nameplatePainter->render(); @@ -808,6 +810,8 @@ void MainInterface::render() { if (m_disableHud) return; + m_guiContext->setDefaultFont(); + m_guiContext->setFontProcessingDirectives(""); m_guiContext->setFontColor(Vec4B::filled(255)); renderBreath(); renderMessages(); diff --git a/source/game/StarHumanoid.cpp b/source/game/StarHumanoid.cpp index 68ccecb..84c64bf 100644 --- a/source/game/StarHumanoid.cpp +++ b/source/game/StarHumanoid.cpp @@ -896,7 +896,7 @@ List<Drawable> Humanoid::renderSkull() const { Root::singleton().speciesDatabase()->species(m_identity.species)->skull(), 1.0f, true, Vec2F())}; } -List<Drawable> Humanoid::renderDummy(Gender gender, HeadArmor const* head, ChestArmor const* chest, LegsArmor const* legs, BackArmor const* back) { +Humanoid Humanoid::makeDummy(Gender gender) { auto assets = Root::singleton().assets(); Humanoid humanoid(assets->json("/humanoid.config")); @@ -906,30 +906,34 @@ List<Drawable> Humanoid::renderDummy(Gender gender, HeadArmor const* head, Chest humanoid.m_backArmFrameset = assets->json("/humanoid/any/dummy.config:backArm").toString(); humanoid.setFacingDirection(DirectionNames.getLeft(assets->json("/humanoid/any/dummy.config:direction").toString())); + return humanoid; +} + +List<Drawable> Humanoid::renderDummy(Gender gender, HeadArmor const* head, ChestArmor const* chest, LegsArmor const* legs, BackArmor const* back) { if (head) { - humanoid.setHeadArmorFrameset(head->frameset(gender)); - humanoid.setHeadArmorDirectives(head->directives()); - humanoid.setHelmetMaskDirectives(head->maskDirectives()); + setHeadArmorFrameset(head->frameset(gender)); + setHeadArmorDirectives(head->directives()); + setHelmetMaskDirectives(head->maskDirectives()); } if (chest) { - humanoid.setBackSleeveFrameset(chest->backSleeveFrameset(gender)); - humanoid.setFrontSleeveFrameset(chest->frontSleeveFrameset(gender)); - humanoid.setChestArmorFrameset(chest->bodyFrameset(gender)); - humanoid.setChestArmorDirectives(chest->directives()); + setBackSleeveFrameset(chest->backSleeveFrameset(gender)); + setFrontSleeveFrameset(chest->frontSleeveFrameset(gender)); + setChestArmorFrameset(chest->bodyFrameset(gender)); + setChestArmorDirectives(chest->directives()); } if (legs) { - humanoid.setLegsArmorFrameset(legs->frameset(gender)); - humanoid.setLegsArmorDirectives(legs->directives()); + setLegsArmorFrameset(legs->frameset(gender)); + setLegsArmorDirectives(legs->directives()); } if (back) { - humanoid.setBackArmorFrameset(back->frameset(gender)); - humanoid.setBackArmorDirectives(back->directives()); + setBackArmorFrameset(back->frameset(gender)); + setBackArmorDirectives(back->directives()); } - auto drawables = humanoid.render(); + auto drawables = render(); Drawable::scaleAll(drawables, TilePixels); return drawables; diff --git a/source/game/StarHumanoid.hpp b/source/game/StarHumanoid.hpp index 9850d4a..0b4ef70 100644 --- a/source/game/StarHumanoid.hpp +++ b/source/game/StarHumanoid.hpp @@ -98,6 +98,7 @@ public: Humanoid(Json const& config); Humanoid(HumanoidIdentity const& identity); + Humanoid(Humanoid const&) = default; struct HumanoidTiming { explicit HumanoidTiming(Json config = Json()); @@ -199,9 +200,10 @@ public: List<Drawable> renderSkull() const; + static Humanoid makeDummy(Gender gender); // Renders to centered drawables (centered on the normal image center for the // player graphics), (in pixels, not world space) - static List<Drawable> renderDummy(Gender gender, HeadArmor const* head = nullptr, ChestArmor const* chest = nullptr, + List<Drawable> renderDummy(Gender gender, HeadArmor const* head = nullptr, ChestArmor const* chest = nullptr, LegsArmor const* legs = nullptr, BackArmor const* back = nullptr); Vec2F primaryHandPosition(Vec2F const& offset) const; diff --git a/source/game/StarPlayer.cpp b/source/game/StarPlayer.cpp index 1363af5..ccfea66 100644 --- a/source/game/StarPlayer.cpp +++ b/source/game/StarPlayer.cpp @@ -2013,6 +2013,10 @@ void Player::setPersonality(Personality const& personality) { m_humanoid->setIdentity(m_identity); } +HumanoidPtr Player::humanoid() { + return m_humanoid; +} + List<String> Player::pullQueuedMessages() { return take(m_queuedMessages); } diff --git a/source/game/StarPlayer.hpp b/source/game/StarPlayer.hpp index b4fe623..1129b06 100644 --- a/source/game/StarPlayer.hpp +++ b/source/game/StarPlayer.hpp @@ -300,6 +300,8 @@ public: void setGender(Gender const& gender); void setPersonality(Personality const& personality); + HumanoidPtr humanoid(); + void setAdmin(bool isAdmin); bool isAdmin() const override; diff --git a/source/game/items/StarArmors.cpp b/source/game/items/StarArmors.cpp index 71f95a2..354113d 100644 --- a/source/game/items/StarArmors.cpp +++ b/source/game/items/StarArmors.cpp @@ -113,7 +113,9 @@ Directives const& HeadArmor::maskDirectives() const { List<Drawable> HeadArmor::preview(PlayerPtr const& viewer) const { Gender gender = viewer ? viewer->gender() : Gender::Male; - return Humanoid::renderDummy(gender, this); + Humanoid humanoid = Humanoid::makeDummy(gender); + //Humanoid humanoid = viewer ? *viewer->humanoid() : Humanoid::makeDummy(gender); + return humanoid.renderDummy(gender, this); } ChestArmor::ChestArmor(Json const& config, String const& directory, Json const& data) @@ -156,7 +158,9 @@ String const& ChestArmor::backSleeveFrameset(Gender gender) const { List<Drawable> ChestArmor::preview(PlayerPtr const& viewer) const { Gender gender = viewer ? viewer->gender() : Gender::Male; - return Humanoid::renderDummy(gender, nullptr, this); + Humanoid humanoid = Humanoid::makeDummy(gender); + //Humanoid humanoid = viewer ? *viewer->humanoid() : Humanoid::makeDummy(gender); + return humanoid.renderDummy(gender, nullptr, this); } LegsArmor::LegsArmor(Json const& config, String const& directory, Json const& data) @@ -178,7 +182,9 @@ String const& LegsArmor::frameset(Gender gender) const { List<Drawable> LegsArmor::preview(PlayerPtr const& viewer) const { Gender gender = viewer ? viewer->gender() : Gender::Male; - return Humanoid::renderDummy(gender, nullptr, nullptr, this); + Humanoid humanoid = Humanoid::makeDummy(gender); + //Humanoid humanoid = viewer ? *viewer->humanoid() : Humanoid::makeDummy(gender); + return humanoid.renderDummy(gender, nullptr, nullptr, this); } BackArmor::BackArmor(Json const& config, String const& directory, Json const& data) @@ -200,7 +206,9 @@ String const& BackArmor::frameset(Gender gender) const { List<Drawable> BackArmor::preview(PlayerPtr const& viewer) const { Gender gender = viewer ? viewer->gender() : Gender::Male; - return Humanoid::renderDummy(gender, nullptr, nullptr, nullptr, this); + Humanoid humanoid = Humanoid::makeDummy(gender); + //Humanoid humanoid = viewer ? *viewer->humanoid() : Humanoid::makeDummy(gender); + return humanoid.renderDummy(gender, nullptr, nullptr, nullptr, this); } } |