Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hidewearablesoftype does not hide hair when hidelimb is true #14700

Open
itchyOwl opened this issue Sep 23, 2024 Discussed in #14688 · 0 comments
Open

hidewearablesoftype does not hide hair when hidelimb is true #14700

itchyOwl opened this issue Sep 23, 2024 Discussed in #14688 · 0 comments
Labels
Bug Something isn't working Code Programming task Modding Modding-related feature request or issue, or a bug that only occurs with mods

Comments

@itchyOwl
Copy link
Collaborator

Discussed in #14688

Originally posted by 4-S-H September 23, 2024
Might be related to #11562;

Code of the wearable (the sprite is transparent):

<Wearable limbtype="Head" slots="Any,Headset" msg="ItemMsgPickUpSelect" displaycontainedstatus="true">
  <sprite name="mod_Head" texture="%ModDir%/images.png" limb="Head" hidelimb="true" inheritlimbdepth="true" ignorelimbscale="true" hidewearablesoftype="Moustache,Beard,Hair,FaceAttachment,Husk,Herpes" sourcerect="0,0,256,256" origin="0.5,0.5" />
</Wearable>

Appearance of the head without the wearable:
image
with the wearable and hidelimb=false:
image
with the wearable and hidelimb=true:
image

The code here might be responsible: when the if check on line 891 succeeds and the one on line 893 fails, the original hair sprite is drawn even though it should be hidden.

foreach (WearableSprite wearable in OtherWearables)
{
if (wearable.Type == WearableType.Husk) { continue; }
if (wearableTypesToHide.Contains(wearable.Type))
{
if (wearable.Type == WearableType.Hair)
{
if (HairWithHatSprite != null && !hideLimb)
{
DrawWearable(HairWithHatSprite, depthStep, spriteBatch, blankColor, alpha: color.A / 255f, spriteEffect);
depthStep += step;
continue;
}
}
else
{
continue;
}
}
DrawWearable(wearable, depthStep, spriteBatch, blankColor, alpha: color.A / 255f, spriteEffect);
//if there are multiple sprites on this limb, make the successive ones be drawn in front
depthStep += step;
}

@itchyOwl itchyOwl added Bug Something isn't working Code Programming task Modding Modding-related feature request or issue, or a bug that only occurs with mods labels Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Code Programming task Modding Modding-related feature request or issue, or a bug that only occurs with mods
Projects
None yet
Development

No branches or pull requests

1 participant