Assorted minor alt-click reskinning fixes, primarily context-based #83105
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About The Pull Request
This is a collection of tiny alt-click context fixes that I found during testing #82920, but I felt were not right to put in there.
Most of the following explanation is for posterity, like they're mostly one-liners, there's only so much explanation to do.
First off, the emotion mask would reset
current_skin
for infinite reskinning, while we have theINFINITE_RESKIN
flag:tgstation/code/modules/clothing/masks/costume.dm
Lines 16 to 19 in 0c562fd
We set this to
INFINITE_RESKIN
for sanity's sake.Then,
/obj/item/clothing/under/add_context(...)
would call its parent, but sometimes returnNONE
when its parent returnedCONTEXTUAL_SCREENTIP_SET
:tgstation/code/modules/clothing/under/_under.dm
Line 83 in 0c562fd
This is bad, because reskinning context is handled on the parent (
/obj/item
), and we have an item inheriting this which can be reskinned, the mech pilot's suit:tgstation/code/modules/clothing/under/costume.dm
Lines 224 to 240 in 0c562fd
So we make this return the parent return value rather than
NONE
:Next up,
/obj/item/clothing/accessory/add_context(...)
would never actually call the parent and thus neither the reskinning context. It also checks for whether you have an item in your active hand when context is added, even though the context it adds actually only applies when the accessory itself is in your active hand.tgstation/code/modules/clothing/under/accessories/_accessories.dm
Lines 205 to 210 in 0c562fd
So we instead make it call the parent first, check for whether the accessory itself is in our active hand, and return the parent value if not:
This resolves our issue.
We're almost there!
/obj/item/reagent_containers/spray/medical/add_context(...)
exists, but is entirely redundant due to this now being handled on the base item, and also misses some of the checks it has.tgstation/code/modules/reagents/reagent_containers/spray.dm
Lines 442 to 447 in 0c562fd
So we just remove it.
Finally, what is to me the funniest one:
tgstation/code/game/objects/items_reskin.dm
Lines 8 to 9 in 9145ecb
To add reskinning context, we check
item_flags
forINFINITE_RESKIN
, while it is actually onobj_flags
.So, instead, we were checking for the equivalent value in
item_flags
, beingIN_STORAGE
.tgstation/code/__DEFINES/obj_flags.dm
Line 15 in 9145ecb
tgstation/code/__DEFINES/obj_flags.dm
Line 34 in 9145ecb
And thus reskinning context for infinitely reskinnables would only show up if they were in storage.
For now, we just update this to use
obj_flags
instead.That's everything I found so far, which this should all fix.
Why It's Good For The Game
Having working item usage context tends to be a good thing.
Changelog
馃啈
fix: Emotion masks no longer use a janky workaround for infinite reskinning.
fix: Mech pilot suit shows reskinning usage context correctly.
fix: Accessories show "wear above/below suit" usage context appropriately.
fix: Accessories don't block reskinning usage context when they shouldn't.
fix: Showing reskinning usage context cares about the infinite reskinning flag, rather than whether it's in storage or not.
del: Removed redundant reskinning usage context code from medical sprays, now shows reskinning usage context like other reskinnables.
/:cl: