1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 10:53:31 +08:00
This commit is contained in:
2024-09-23 03:06:27 +08:00
parent 1ab57eb7ca
commit 98a8c94518
4 changed files with 16 additions and 51 deletions

View File

@@ -30,7 +30,7 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
private static bool _initialized;
private static PressKeyBind _toggleKey;
private static ConfigFile _dummyConfig;
private Type[] _patches;
private Type[] _patches, _compats;
#region IModCanSave
private const ushort ModSaveVersion = 1;
@@ -160,6 +160,8 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
_patches = Common.Util.GetTypesInNamespace(Assembly.GetExecutingAssembly(), "UXAssist.Patches");
_patches?.Do(type => type.GetMethod("Init")?.Invoke(null, null));
_compats = Common.Util.GetTypesInNamespace(Assembly.GetExecutingAssembly(), "UXAssist.ModsCompat");
_compats?.Do(type => type.GetMethod("Init")?.Invoke(null, null));
I18N.Apply();
I18N.OnInitialized += RecreateConfigWindow;
@@ -171,9 +173,9 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
UIPatch.Enable(true);
_patches?.Do(type => type.GetMethod("Start")?.Invoke(null, null));
var patch = UIPatch.GetHarmony();
ModsCompat.AuxilaryfunctionWrapper.Init(patch);
ModsCompat.BulletTimeWrapper.Init(patch);
object[] parameters = [UIPatch.GetHarmony()];
_compats?.Do(type => type.GetMethod("Start")?.Invoke(null, parameters));
}
private void OnDestroy()