Skip to content

feat: Add CustomKeycard wrapper n stuff - #632

Merged
louis1706 merged 44 commits into
ExMod-Team:devfrom
Someone-193:KeycardRework
Sep 10, 2025
Merged

feat: Add CustomKeycard wrapper n stuff#632
louis1706 merged 44 commits into
ExMod-Team:devfrom
Someone-193:KeycardRework

Conversation

@Someone-193

@Someone-193 Someone-193 commented Aug 20, 2025

Copy link
Copy Markdown
Collaborator

Description

Describe the changes
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 :trollface: ) but its pretty stable.

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentations

Submission checklist

  • I have checked the project can be compiled
  • I have tested my changes and it worked as expected

Patches (if there are any changes related to Harmony patches)

  • I have checked no IL patching errors in the console

Other

  • Still requires more testing

Someone-193 and others added 11 commits August 20, 2025 10:54
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)
@github-actions github-actions Bot added Transpiler base-game-bug Bug from the main game labels Aug 26, 2025
louis1706 and others added 15 commits August 28, 2025 10:11
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
louis1706 marked this pull request as ready for review September 10, 2025 08:59

@VALERA771 VALERA771 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove blank lines between get and set methods. Also did you test all of this?

Comment thread EXILED/Exiled.API/Features/Pickups/Keycards/CustomKeycardPickup.cs Outdated
Comment thread EXILED/Exiled.API/Features/Items/Keycards/CustomKeycardItem.cs
@louis1706
louis1706 merged commit a30b5f6 into ExMod-Team:dev Sep 10, 2025
6 checks passed
@Someone-193

Copy link
Copy Markdown
Collaborator Author

Remove blank lines between get and set methods. Also did you test all of this?

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

@Someone-193
Someone-193 deleted the KeycardRework branch December 20, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants