feat: Add CustomKeycard wrapper n stuff - #632
Merged
Merged
Conversation
WHY MUST I SUFFERRRRRR
Moved custom keycard instantiation logic from CustomKeycard.cs to Item.cs, simplifying the process and removing redundant internal methods. Keycard creation now uses direct type checks and switch expressions for improved clarity and maintainability.
WE LOVEE NWWW I LOVE NON-INSTANCED GFX YIPEEEEEEEEE (things might be still borked btw)
basically all done I think 😭 cant wait for NW to change custom keycards to sync vars next update and make all my work obsolete
Introduced new ChaosKeycard and SingleUseKeycard types for keycard items, updating Item.cs logic to instantiate these specific classes. Updated Keycard.cs to support owner parameter and improved type handling. Added reference to Snake.dll for ChaosKeycard functionality. Clarified documentation in CustomKeycardItem.cs.
… property Implemented ReadPickupInfoBefore in SingleUseKeycard to populate properties from its pickup. Added a SnakeEngine property to ChaosKeycardPickup for accessing the underlying engine instance.
Just slightly more optomized
louis1706
marked this pull request as ready for review
September 10, 2025 08:59
louis1706
approved these changes
Sep 10, 2025
VALERA771
requested changes
Sep 10, 2025
VALERA771
left a comment
There was a problem hiding this comment.
Remove blank lines between get and set methods. Also did you test all of this?
Collaborator
Author
bruh that's stylecop making us do this. I have tested this extensively with my own plugins (one literally changes every keycard to a custom keycard, which then Exiled wraps) on a like ~10+ pop server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Describe the changes
) but its pretty stable.
Adds dedicated wrappers for all custom keycard types with modifiable properties as well as chaos keycards and single use keycards. There's a lot of "terrible" code in this (most cuz NW moment
What is the current behavior? (You can also link to an open issue here)
The only keycard wrapper that exists is KeycardItem and KeycardPickup (which are kinda mid)
What is the new behavior? (if this is a feature change)
see described changes
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No, old keycard is the same, PR tries to add wrappers for the new keycard that can have jank getters and setters (that we add) for most properties and all new wrappers inherit from KeycardItem / KeycardPickup so all casts n such still work
Other information:
Waiting on tests / discussions
Types of changes
Submission checklist
Patches (if there are any changes related to Harmony patches)
Other