/* Initialize/Uninitialize when Controller Hook Loading/Unloading */ private void ModLoading(IModV1 mod, IModConfigV1 modConfig) { if (modConfig.ModId == ControllerHookModId) { Initialize(); } }
private void ModUnloading(IModV1 mod, IModConfigV1 modConfig) { if (modConfig.ModId == ControllerHookModId) { DoSuspend(); } }
/* Events */ private void OnRedirectorLoaded(IModV1 arg1, IModConfigV1 arg2) { if (arg2.ModId.Equals("reloaded.universal.redirector", StringComparison.OrdinalIgnoreCase)) { _swapper.SetRedirector(_modLoader.GetController <IRedirectorController>()); } }
private void ModLoaded(IModV1 mod, IModConfigV1 modConfig) { if (modConfig.ModId == RedirectorId) { SetupEventFromRedirector(); } }
/// <summary> /// Add stage mods requiring this. /// </summary> private void ModLoading(IModV1 mod, IModConfigV1 modConfig) { if (modConfig.ModDependencies.Contains(ThisModId)) { _collection.AddMod(modConfig.ModId); } }
private void ModLoaded(IModV1 modInstance, IModConfigV1 modConfig) { if (modConfig.ModId == HookModId) { SetupController(); } }
/* Native Mods */ public ModInstance(IModV1 mod, IModConfig config) { Mod = mod; ModConfig = config; CanSuspend = mod.CanSuspend(); CanUnload = mod.CanUnload(); }
/* Dll Mods */ public ModInstance(LoadContext context, IModV1 mod, IModConfig config) { Context = context; Mod = mod; ModConfig = config; CanSuspend = mod.CanSuspend(); CanUnload = mod.CanUnload(); }
/* Dll Mods */ public ModInstance(PluginLoader loader, IModV1 mod, IModConfig config) { Loader = loader; Mod = mod; ModConfig = config; CanSuspend = mod.CanSuspend(); CanUnload = mod.CanUnload(); }
private void AutoDisposeController_NoInline(IModV1 modToRemove) { foreach (var mapping in _controllerModMapping.ToArray()) { var mod = mapping.Value.Mod; if (mod.Equals(modToRemove)) { _controllerModMapping.Remove(mapping.Key, out _); } } }
private void AutoDisposePlugin(IModV1 modToRemove, IModConfigV1 modConfigToRemove) { // Note: Assumes no copying takes place. foreach (var mapping in _interfaceModMapping.ToArray()) { var mod = mapping.Value.Mod; if (mod.Equals(modToRemove)) { _interfaceModMapping.Remove(mapping.Key, out _); } } }
private void AutoDisposePlugin_NoInline(IModV1 modToRemove) { foreach (var modMapping in _interfaceModMapping.ToArray()) { foreach (var mapping in modMapping.Value.ToArray()) { if (mapping.Mod.Equals(modToRemove)) { modMapping.Value.Remove(mapping); } } } }
private void OnModLoading(IModV1 modInstance, IModConfigV1 modConfig) => _afsHook.OnModLoading(_modLoader.GetDirectoryForModId(modConfig.ModId));
public void AddOrReplaceController <T>(IModV1 owner, T instance) { _controllerModMapping[typeof(T)] = new ModGenericTuple <object>(owner, instance); }
private void ModLoading(IModV1 mod, IModConfigV1 config) => _redirector.Add(config);
private void ModUnloading(IModV1 mod, IModConfigV1 config) => _redirector.Remove(config);
private void AutoDisposePlugin(IModV1 modToRemove, IModConfigV1 modConfigToRemove) { // Note: Assumes no copying takes place. AutoDisposePlugin_NoInline(modToRemove); GC.Collect(); }
public ModGenericTuple(IModV1 mod, T generic) { Mod = mod; Generic = generic; }