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

Add WearableOverlay #12866

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Add WearableOverlay #12866

wants to merge 1 commit into from

Conversation

justinbrick
Copy link

feat: Add WearableOverlay property to Wearable to show an overlay when items are equipped

feat: Add WearableOverlay property to Wearable to show an overlay when items are equipped
@justinbrick
Copy link
Author

I forgot to add some context to this PR:
Currently, the only way to make an overlay appear when equipping items, is to apply a fake affliction with an overlay specified. With a WearableOverlay property, it can instead be directly specified through the Wearable component on an item, and will apply accordingly.
This looks like this:

<Wearable>
  <WearableOverlay texture="texture.png"/>
</Wearable>

Copy link
Collaborator

@Regalis11 Regalis11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are a couple of issues with the changes:

  • I believe there's a potential memory leak here: the sprite doesn't seem to ever be disposed. That should most likely be done in Wearable.RemoveComponentSpecific.
  • It also seems that the sprite is drawn when the item is selected, regardless if it's equipped or not.
  • If the item has multiple Wearable components (i.e. can be worn on multiple different limbs), only the first one is taken into account.

@Regalis11 Regalis11 added Feature request Request a new feature to be added Code Programming task Modding Modding-related feature request or issue, or a bug that only occurs with mods labels Jan 9, 2024
@justinbrick
Copy link
Author

Thanks for the feedback! I'll take a look this weekend when I've got a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Programming task Feature request Request a new feature to be added Modding Modding-related feature request or issue, or a bug that only occurs with mods
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants