namespace UXAssist.Common.ModFeatures; /// /// Interface implemented by instance mod features registered with . /// The registry drives the lifecycle; individual mods never call these methods directly. /// /// /// /// Timing contract. The registry guarantees the following relative ordering, which /// feature implementations may rely on: /// /// /// runs eagerly at registration time — synchronously inside /// , normally during the registering mod's BepInEx /// Awake phase. It is the phase for early setup such as keybind registration via CommonAPI's /// CustomKeyBindSystem, whose registered bindings are copied by the game's /// UIOptionWindow._OnCreate only after all plugins finish loading. A late-discovered feature may /// initialize after the host lifecycle has begun, so implementations must not depend on either the game /// being loaded or unloaded here. /// runs once when UXAssist starts the deferred lifecycle. /// This is normally during the host mod's Start; if a feature is registered afterwards, the registry /// starts that feature immediately after . This is the phase for activating behavior that /// requires the game/runtime to be ready. It is driven solely by UXAssist; dependent mods must not start /// features themselves. /// runs during the host's teardown (OnDestroy) and resets the feature /// so it could be started again. /// and are called every frame by UXAssist; the /// registry guarantees at most one invocation per frame even if multiple drivers exist. /// /// /// The same timing contract applies to static features discovered via ; /// see that attribute for details. /// /// public interface IModFeature { /// /// Called eagerly at registration time, normally during the registering mod's Awake phase. /// Use this for early setup such as keybind registration. A late-discovered feature may initialize /// after the host lifecycle has begun, so do not depend on the game being loaded or unloaded here. /// Runs at most once per registration. /// void Init(); /// /// Called once when UXAssist starts the deferred lifecycle. If this feature is registered after the /// lifecycle has already started, the registry invokes this immediately after . Use /// this to activate behavior that requires the game/runtime to be ready. Driven solely by UXAssist; /// runs at most once (a repeated driver call is a no-op for an already-started feature). /// void Start(); /// /// Called during the host's teardown (OnDestroy). Reset any state created in /// / so the feature could be re-started. Runs on every /// registered feature. /// void Uninit(); /// /// Called every frame for input handling. Should be lightweight. The registry guarantees at most /// one invocation per frame. /// void OnInputUpdate(); /// /// Called every frame for general updates. Should be lightweight. The registry guarantees at most /// one invocation per frame. /// void OnUpdate(); }