Add unused support for using the actual humanoid for armor preview
This commit is contained in:
parent
59ab7dabe6
commit
4c006afc94
@ -24,5 +24,5 @@
|
|||||||
"buttonHoverOffSound" : [ "/sfx/interface/button/hover_off.wav" ],
|
"buttonHoverOffSound" : [ "/sfx/interface/button/hover_off.wav" ],
|
||||||
|
|
||||||
"debugSpatialClearTime" : 0.0,
|
"debugSpatialClearTime" : 0.0,
|
||||||
"debugOffset" : [32, 100]
|
"debugOffset" : [64, 100]
|
||||||
}
|
}
|
@ -798,6 +798,8 @@ void MainInterface::renderInWorldElements() {
|
|||||||
if (m_disableHud)
|
if (m_disableHud)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
m_guiContext->setDefaultFont();
|
||||||
|
m_guiContext->setFontProcessingDirectives("");
|
||||||
m_guiContext->setFontColor(Vec4B::filled(255));
|
m_guiContext->setFontColor(Vec4B::filled(255));
|
||||||
m_questIndicatorPainter->render();
|
m_questIndicatorPainter->render();
|
||||||
m_nameplatePainter->render();
|
m_nameplatePainter->render();
|
||||||
@ -808,6 +810,8 @@ void MainInterface::render() {
|
|||||||
if (m_disableHud)
|
if (m_disableHud)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
m_guiContext->setDefaultFont();
|
||||||
|
m_guiContext->setFontProcessingDirectives("");
|
||||||
m_guiContext->setFontColor(Vec4B::filled(255));
|
m_guiContext->setFontColor(Vec4B::filled(255));
|
||||||
renderBreath();
|
renderBreath();
|
||||||
renderMessages();
|
renderMessages();
|
||||||
|
@ -896,7 +896,7 @@ List<Drawable> Humanoid::renderSkull() const {
|
|||||||
Root::singleton().speciesDatabase()->species(m_identity.species)->skull(), 1.0f, true, Vec2F())};
|
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();
|
auto assets = Root::singleton().assets();
|
||||||
Humanoid humanoid(assets->json("/humanoid.config"));
|
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.m_backArmFrameset = assets->json("/humanoid/any/dummy.config:backArm").toString();
|
||||||
humanoid.setFacingDirection(DirectionNames.getLeft(assets->json("/humanoid/any/dummy.config:direction").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) {
|
if (head) {
|
||||||
humanoid.setHeadArmorFrameset(head->frameset(gender));
|
setHeadArmorFrameset(head->frameset(gender));
|
||||||
humanoid.setHeadArmorDirectives(head->directives());
|
setHeadArmorDirectives(head->directives());
|
||||||
humanoid.setHelmetMaskDirectives(head->maskDirectives());
|
setHelmetMaskDirectives(head->maskDirectives());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chest) {
|
if (chest) {
|
||||||
humanoid.setBackSleeveFrameset(chest->backSleeveFrameset(gender));
|
setBackSleeveFrameset(chest->backSleeveFrameset(gender));
|
||||||
humanoid.setFrontSleeveFrameset(chest->frontSleeveFrameset(gender));
|
setFrontSleeveFrameset(chest->frontSleeveFrameset(gender));
|
||||||
humanoid.setChestArmorFrameset(chest->bodyFrameset(gender));
|
setChestArmorFrameset(chest->bodyFrameset(gender));
|
||||||
humanoid.setChestArmorDirectives(chest->directives());
|
setChestArmorDirectives(chest->directives());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (legs) {
|
if (legs) {
|
||||||
humanoid.setLegsArmorFrameset(legs->frameset(gender));
|
setLegsArmorFrameset(legs->frameset(gender));
|
||||||
humanoid.setLegsArmorDirectives(legs->directives());
|
setLegsArmorDirectives(legs->directives());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (back) {
|
if (back) {
|
||||||
humanoid.setBackArmorFrameset(back->frameset(gender));
|
setBackArmorFrameset(back->frameset(gender));
|
||||||
humanoid.setBackArmorDirectives(back->directives());
|
setBackArmorDirectives(back->directives());
|
||||||
}
|
}
|
||||||
|
|
||||||
auto drawables = humanoid.render();
|
auto drawables = render();
|
||||||
Drawable::scaleAll(drawables, TilePixels);
|
Drawable::scaleAll(drawables, TilePixels);
|
||||||
|
|
||||||
return drawables;
|
return drawables;
|
||||||
|
@ -98,6 +98,7 @@ public:
|
|||||||
|
|
||||||
Humanoid(Json const& config);
|
Humanoid(Json const& config);
|
||||||
Humanoid(HumanoidIdentity const& identity);
|
Humanoid(HumanoidIdentity const& identity);
|
||||||
|
Humanoid(Humanoid const&) = default;
|
||||||
|
|
||||||
struct HumanoidTiming {
|
struct HumanoidTiming {
|
||||||
explicit HumanoidTiming(Json config = Json());
|
explicit HumanoidTiming(Json config = Json());
|
||||||
@ -199,9 +200,10 @@ public:
|
|||||||
|
|
||||||
List<Drawable> renderSkull() const;
|
List<Drawable> renderSkull() const;
|
||||||
|
|
||||||
|
static Humanoid makeDummy(Gender gender);
|
||||||
// Renders to centered drawables (centered on the normal image center for the
|
// Renders to centered drawables (centered on the normal image center for the
|
||||||
// player graphics), (in pixels, not world space)
|
// 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);
|
LegsArmor const* legs = nullptr, BackArmor const* back = nullptr);
|
||||||
|
|
||||||
Vec2F primaryHandPosition(Vec2F const& offset) const;
|
Vec2F primaryHandPosition(Vec2F const& offset) const;
|
||||||
|
@ -2013,6 +2013,10 @@ void Player::setPersonality(Personality const& personality) {
|
|||||||
m_humanoid->setIdentity(m_identity);
|
m_humanoid->setIdentity(m_identity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HumanoidPtr Player::humanoid() {
|
||||||
|
return m_humanoid;
|
||||||
|
}
|
||||||
|
|
||||||
List<String> Player::pullQueuedMessages() {
|
List<String> Player::pullQueuedMessages() {
|
||||||
return take(m_queuedMessages);
|
return take(m_queuedMessages);
|
||||||
}
|
}
|
||||||
|
@ -300,6 +300,8 @@ public:
|
|||||||
void setGender(Gender const& gender);
|
void setGender(Gender const& gender);
|
||||||
void setPersonality(Personality const& personality);
|
void setPersonality(Personality const& personality);
|
||||||
|
|
||||||
|
HumanoidPtr humanoid();
|
||||||
|
|
||||||
void setAdmin(bool isAdmin);
|
void setAdmin(bool isAdmin);
|
||||||
bool isAdmin() const override;
|
bool isAdmin() const override;
|
||||||
|
|
||||||
|
@ -113,7 +113,9 @@ Directives const& HeadArmor::maskDirectives() const {
|
|||||||
|
|
||||||
List<Drawable> HeadArmor::preview(PlayerPtr const& viewer) const {
|
List<Drawable> HeadArmor::preview(PlayerPtr const& viewer) const {
|
||||||
Gender gender = viewer ? viewer->gender() : Gender::Male;
|
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)
|
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 {
|
List<Drawable> ChestArmor::preview(PlayerPtr const& viewer) const {
|
||||||
Gender gender = viewer ? viewer->gender() : Gender::Male;
|
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)
|
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 {
|
List<Drawable> LegsArmor::preview(PlayerPtr const& viewer) const {
|
||||||
Gender gender = viewer ? viewer->gender() : Gender::Male;
|
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)
|
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 {
|
List<Drawable> BackArmor::preview(PlayerPtr const& viewer) const {
|
||||||
Gender gender = viewer ? viewer->gender() : Gender::Male;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user