fix(UXAssist): start late-discovered mod features

This commit is contained in:
2026-07-11 14:25:46 +08:00
parent 15c5bbdd72
commit 66ecebaca7
8 changed files with 82 additions and 57 deletions
+5 -6
View File
@@ -250,10 +250,9 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
object[] parameters = [_harmony];
_compats?.Do(type => type.GetMethod("Init")?.Invoke(null, parameters));
// Register UXAssist's own features (Init runs eagerly here, preserving the original Awake timing
// that keybind registration relies on). Dependent mods register theirs during their own Awake
// phase. Start is deferred to UXAssist.Start below so that all dependents have registered before
// any feature starts.
// Register UXAssist's own features. Init runs eagerly here, preserving the original Awake timing
// that keybind registration relies on. The registry immediately starts any dependent feature that
// is discovered after UXAssist begins the deferred lifecycle below.
ModFeatureRegistry.Discover(Assembly.GetExecutingAssembly());
I18N.Apply();
@@ -264,8 +263,8 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
MyWindowManager.InitBaseObjects();
MyWindowManager.Enable(true);
// UXAssist is the sole lifecycle driver. All dependents have already registered (and initialized)
// their features during their Awake phase (BepInEx runs every plugin's Awake before any plugin's Start).
// UXAssist is the sole lifecycle driver. The registry also starts features discovered later so a
// dependent cannot miss this one-time transition.
ModFeatureRegistry.StartAll();
_patches?.Do(type => type.GetMethod("Start")?.Invoke(null, null));