MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / setHandFrameOverrides

Method setHandFrameOverrides

source/game/StarHumanoid.cpp:649–662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

647}
648
649void Humanoid::setHandFrameOverrides(ToolHand hand, StringView back, StringView front) {
650 auto& handInfo = const_cast<HandDrawingInfo&>(getHand(hand));
651 // some users stick directives in these?? better make sure they don't break with custom clothing
652 size_t backEnd = back.utf8().find('?');
653 size_t frontEnd = front.utf8().find('?');
654 Directives backDirectives = backEnd == NPos ? Directives() : Directives( back.utf8().substr( backEnd));
655 Directives frontDirectives = frontEnd == NPos ? Directives() : Directives(front.utf8().substr(frontEnd));
656 if ( backEnd != NPos) back = back.utf8().substr(0, backEnd);
657 if (frontEnd != NPos) front = front.utf8().substr(0, frontEnd);
658 handInfo. backFrame = ! back.empty() ? std::move( back) : "rotation";
659 handInfo.frontFrame = !front.empty() ? std::move(front) : "rotation";
660 handInfo. backDirectives = ! backDirectives.empty() ? std::move( backDirectives) : Directives();
661 handInfo.frontDirectives = !frontDirectives.empty() ? std::move(frontDirectives) : Directives();
662}
663
664void Humanoid::setHandDrawables(ToolHand hand, List<Drawable> drawables) {
665 const_cast<HandDrawingInfo&>(getHand(hand)).itemDrawables = std::move(drawables);

Callers 1

Calls 4

DirectivesClass · 0.85
findMethod · 0.45
substrMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected