Class DelayedSubModuleManager
- Namespace
- Bannerlord.ButterLib.DelayedSubModule
- Assembly
- Bannerlord.ButterLib.dll
Allows you to inject your own code into the load / unload sequence of other modules without specifying them directly as a dependency in 'SubModule.xml'.
public static class DelayedSubModuleManager
- Inheritance
-
DelayedSubModuleManager
- Inherited Members
Remarks
Supported methods are: 'OnSubModuleLoad', 'OnSubModuleUnloaded', 'OnBeforeInitialModuleScreenSetAsRoot', 'OnGameStart', 'OnGameEnd'. The basic loading order still applies, so while you can technically subscribe to the 'OnSubModuleLoad' methods of the already loaded modules, it won't affect them as they will be executed before. The delegate passed will still be executed.
Methods
Register(Type)
Registers a module to be a target of the DelayedSubModuleManager.
public static void Register(Type subModule)
Parameters
subModuleTypeThe exact type of the SubModule to be registered.
Register(Type, int, string[]?, string[]?)
Registers a module to be a target of the DelayedSubModuleManager Harmony patching.
public static void Register(Type subModule, int priority, string[]? before, string[]? after)
Parameters
subModuleTypeThe exact type of the SubModule to be patched.
priorityintThe HarmonyLib.HarmonyPriority that would be assigned to the patches that would be made.
beforestring[]A list of HarmonyLib.Harmony.Ids that should come after the patches that would be made.
afterstring[]A list of HarmonyLib.Harmony.Ids that should come before the patches that would be made.
Register<TSubModule>()
Registers a module to be a target of the DelayedSubModuleManager.
public static void Register<TSubModule>() where TSubModule : MBSubModuleBase
Type Parameters
TSubModuleThe exact type of the SubModule to be registered.
Register<TSubModule>(int, string[]?, string[]?)
Registers a module to be a target of the DelayedSubModuleManager Harmony patching.
public static void Register<TSubModule>(int priority, string[]? before, string[]? after) where TSubModule : MBSubModuleBase
Parameters
priorityintThe HarmonyLib.HarmonyPriority that would be assigned to the patches that would be made.
beforestring[]A list of HarmonyLib.Harmony.Ids that should come after the patches that would be made.
afterstring[]A list of HarmonyLib.Harmony.Ids that should come before the patches that would be made.
Type Parameters
TSubModuleThe exact type of the SubModule to be patched.
Subscribe(Type, MBSubModuleBase, string, SubscriptionType, EventHandler<SubscriptionEventArgs>)
public static void Subscribe(Type mbSubModuleType, MBSubModuleBase caller, string method, SubscriptionType subscriptionType, EventHandler<SubscriptionEventArgs> @delegate)
Parameters
mbSubModuleTypeTypecallerMBSubModuleBasemethodstringsubscriptionTypeSubscriptionTypedelegateEventHandler<SubscriptionEventArgs>
Subscribe<T>(MBSubModuleBase, string, SubscriptionType, EventHandler<SubscriptionEventArgs>)
public static void Subscribe<T>(MBSubModuleBase caller, string method, SubscriptionType subscriptionType, EventHandler<SubscriptionEventArgs> @delegate) where T : MBSubModuleBase
Parameters
callerMBSubModuleBasemethodstringsubscriptionTypeSubscriptionTypedelegateEventHandler<SubscriptionEventArgs>
Type Parameters
T
Subscribe<T1, T2>(string, SubscriptionType, EventHandler<SubscriptionEventArgs>)
public static void Subscribe<T1, T2>(string method, SubscriptionType subscriptionType, EventHandler<SubscriptionEventArgs> @delegate) where T1 : MBSubModuleBase where T2 : MBSubModuleBase
Parameters
methodstringsubscriptionTypeSubscriptionTypedelegateEventHandler<SubscriptionEventArgs>
Type Parameters
T1T2
This page was last modified at 02/05/2024 21:56:37 +02:00 (UTC).
Commit Message
Author: Vitalii Mikhailov
Commit: de40919fd63ba363031c633e84090eb52a8c42d6
File scoped namespaces