CustomInteractions: update for SPT 4.1.2 - #1
Open
svanovsky wants to merge 1 commit into
Open
Conversation
SPT 4.1 deobfuscated the client assembly, so the obfuscated names this mod reached for no longer exist. - ContextInteractionsClass<EItemInfoButton> -> ContextInteractions<EItemInfoButton>, implementing the three abstract members the base class now requires. - Replace the reflection lookup of the dynamic-interactions dictionary with direct field access. In 4.1 the underscore-prefixed backing fields are public, so GetField(name, NonPublic | Instance) silently returns null rather than throwing - the mod appeared to load and then did nothing. - Retarget the patches at ItemUiContext.GetItemContextInteractions and InteractionButtonsContainer.CreateDynamicContextButton. Tested in-game on SPT 4.1.2 / EFT 0.16.9.5.40743: custom interactions appear on the item context menu and invoke correctly. Build files are intentionally not included - the csproj here still points at the upstream relative paths. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Updates CustomInteractions for SPT 4.1.2 (EFT 0.16.9.5.40743). Nothing else in the repo is touched.
Disclosure: this was written largely with AI assistance (Claude). I've tested it in-game rather than
just compiling it — details below — but I'm not going to claim I derived every line myself.
What changed
SPT 4.1 deobfuscated the client assembly, so the obfuscated names the mod reached for no longer exist.
ContextInteractionsClass<EItemInfoButton>→ContextInteractions<EItemInfoButton>, implementingthe three abstract members the base class now requires.
This one is worth a look: in 4.1 the underscore-prefixed backing fields are public, so
GetField(name, NonPublic | Instance)returnsnullrather than throwing. The mod loaded fine andthen silently did nothing.
ItemUiContext.GetItemContextInteractionsandInteractionButtonsContainer.CreateDynamicContextButton.Testing
Tested in-game on SPT 4.1.2 / EFT 0.16.9.5.40743. Custom interactions appear on the item context menu
and invoke correctly. Also exercised indirectly via Transmog, which depends on this mod.
Not included
The
.csprojis unchanged. I did convert it locally to SDK-style with absolute reference paths,because my machine has no .NET Framework 4.7.2 dev pack — but that's my environment, not a 4.1
requirement, and it doesn't belong in a compatibility PR. Happy to send it separately if it'd be
useful to you.