mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-04-23 23:47:02 +00:00
Added skin box hide bit functionality
Added code to hide skin boxes when wearing a helmet if bit for said functionality is present.
This commit is contained in:
parent
fd2fd65908
commit
24c74aa225
|
|
@ -109,6 +109,7 @@ ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox)
|
||||||
pNewBox = new ModelPart(this, static_cast<int>(pBox->fU), static_cast<int>(pBox->fV));
|
pNewBox = new ModelPart(this, static_cast<int>(pBox->fU), static_cast<int>(pBox->fV));
|
||||||
pNewBox->visible=false;
|
pNewBox->visible=false;
|
||||||
if (pBox->fM > 0) pNewBox->bMirror = true; // check if this box has the mirror flag
|
if (pBox->fM > 0) pNewBox->bMirror = true; // check if this box has the mirror flag
|
||||||
|
if (pBox->fA > 0) pNewBox->hideWithHelmet = true; // check if this box has the "hide when helmet" is worn flag
|
||||||
pNewBox->addHumanoidBox(pBox->fX, pBox->fY, pBox->fZ, pBox->fW, pBox->fH, pBox->fD, scale);
|
pNewBox->addHumanoidBox(pBox->fX, pBox->fY, pBox->fZ, pBox->fW, pBox->fH, pBox->fD, scale);
|
||||||
// 4J-PB - don't compile here, since the lighting isn't set up. It'll be compiled on first use.
|
// 4J-PB - don't compile here, since the lighting isn't set up. It'll be compiled on first use.
|
||||||
//pNewBox->compile(1.0f/16.0f);
|
//pNewBox->compile(1.0f/16.0f);
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ void ModelPart::_init()
|
||||||
compiled=false;
|
compiled=false;
|
||||||
bMirror = false;
|
bMirror = false;
|
||||||
visible = true;
|
visible = true;
|
||||||
|
hideWithHelmet = false;
|
||||||
neverRender = false;
|
neverRender = false;
|
||||||
x=y=z = 0.0f;
|
x=y=z = 0.0f;
|
||||||
xRot=yRot=zRot = 0.0f;
|
xRot=yRot=zRot = 0.0f;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ public:
|
||||||
float xRot, yRot, zRot;
|
float xRot, yRot, zRot;
|
||||||
bool bMirror;
|
bool bMirror;
|
||||||
bool visible;
|
bool visible;
|
||||||
|
bool hideWithHelmet;
|
||||||
bool neverRender;
|
bool neverRender;
|
||||||
vector <Cube *> cubes;
|
vector <Cube *> cubes;
|
||||||
vector <ModelPart *> children;
|
vector <ModelPart *> children;
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,9 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
|
||||||
{
|
{
|
||||||
for(ModelPart *pModelPart : *pAdditionalModelParts)
|
for(ModelPart *pModelPart : *pAdditionalModelParts)
|
||||||
{
|
{
|
||||||
pModelPart->visible=true;
|
shared_ptr<ItemInstance> itemInstance = mob->inventory->getArmor(3);
|
||||||
|
if (itemInstance == nullptr || !pModelPart->hideWithHelmet)
|
||||||
|
pModelPart->visible=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue