Skip to content

Expose managed NPC awareness events - #266

Merged
ifBars merged 9 commits into
stablefrom
diffuin/244-2c9fc64e
Aug 14, 2026
Merged

Expose managed NPC awareness events#266
ifBars merged 9 commits into
stablefrom
diffuin/244-2c9fc64e

Conversation

@diffuin

@diffuin diffuin Bot commented Aug 13, 2026

Copy link
Copy Markdown

Summary

  • Exposes the eight native NPC awareness callbacks as managed S1API events.
  • Adds the read-only NPCNoiseEvent snapshot and managed NPCNoiseType enum.
  • Subscribes each mod handler directly to its native UnityEvent while converting player, vehicle, and noise arguments at the API boundary.
  • Stores the exact native UnityAction<T> and UnityEvent for independent removal and cleanup on both runtimes.
  • Keeps registration state lazy for joined-client wrappers created without constructors.

Dependency

This branch is stacked on #267 to resolve their shared NPC event and cleanup surface. Merge #267 first; this PR then reduces to the awareness API changes.

Validation

  • MonoMelon full suite: 592 passed.
  • Il2CppMelon full suite: 581 passed.
  • Mono gameplay smoke: all vehicle and awareness scenarios passed in Main against head e6187d4.
  • IL2CPP gameplay smoke: all vehicle and awareness scenarios passed in Main against head e6187d4.
  • Runtime probe covered all five player-awareness events, gunshot and explosion snapshots, hit-by-car conversion, native vehicle entry/exit, duplicate registration, one-at-a-time removal, final unsubscription, and throwing-subscriber isolation.
  • Runtime-neutral contract tests avoid loading Unity runtime internals in the Linux CI host.
  • git diff --check passed.

Closes #244

@ifBars
ifBars merged commit 0e84659 into stable Aug 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Expose managed NPC awareness events

1 participant