public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; _modLoader.GetController <IReloadedHooks>().TryGetTarget(out var hooks); /* Your mod code starts here. */ _afsHook = new AfsHook(NativeFunctions.GetInstance(hooks)); _modLoader.ModLoading += OnModLoading; _modLoader.OnModLoaderInitialized += OnModLoaderInitialized; }
public void StartEx(IModLoaderV1 loader, IModConfigV1 config) { _modLoader = (IModLoader)loader; _modLoader.GetController <IReloadedHooks>().TryGetTarget(out _hooks); var modDirectory = _modLoader.GetDirectoryForModId(config.ModId); var configDirectory = _modLoader.GetModConfigDirectory(config.ModId); /* Your mod code starts here. */ _debugBoot = new DebugBoot(modDirectory, configDirectory, _hooks); }
public void Start(IModLoaderV1 loader) { #if DEBUG Debugger.Launch(); #endif ModLoader = (IModLoader)loader; /* Your mod code starts here. */ _graphicsEssentials = new GraphicsEssentials(ModLoader.GetDirectoryForModId(MyModId)); }
public ModPipeline(IModLocator modLocator, IModParser modParser, IModLoader modLoader, IModIntegrityChecker integrityChecker, IAssemblyResolver resolver, ILoadOrderCalculator orderer) { ModLocator = modLocator; ModParser = modParser; ModLoader = modLoader; IntegrityChecker = integrityChecker; Resolver = resolver; OrderCalculator = orderer; _mods = new List <IMod>(); }
private static byte[] _jmpSkipOneInstance = { 0xEB, 0x28 }; // jmp 0x2A public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; // Ignore launcher check result. Memory.CurrentProcess.SafeWriteRaw((IntPtr)0x005118CF, _jmpSkipLauncher); // Ignore only one instance check result. Memory.CurrentProcess.SafeWriteRaw((IntPtr)0x0051190F, _jmpSkipOneInstance); }
/// <summary> /// Entry point for your mod. /// </summary> public async void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; _logger = (ILogger)_modLoader.GetLogger(); _modLoader.GetController <IReloadedHooks>().TryGetTarget(out _hooks); /* Your mod code starts here. */ SDK.Init(_hooks); _imguiHook = await ImguiHook.Create(RenderTestWindow); }
public void Start(IModLoaderV1 loader) { #if DEBUG Debugger.Launch(); #endif _modLoader = (IModLoader)loader; _modLoader.GetController <IReloadedHooks>().TryGetTarget(out _reloadedHooks); /* Your mod code starts here. */ _graphicsEssentials = new GraphicsEssentials(_modLoader.GetDirectoryForModId(MyModId), _reloadedHooks); }
/// <summary> /// Entry point for your mod. /// </summary> public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; _logger = (ILogger)_modLoader.GetLogger(); /* Your mod code starts here. */ _input = new Input(_modLoader.GetDirectoryForModId(MyModId)); _modLoader.ModLoaded += ModLoaded; SetupController(); }
public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; _modLoader.GetController <IReloadedHooks>().TryGetTarget(out _hooks); SDK.Init(_hooks, null); /* Your mod code starts here. */ _modLoader.ModLoading += ModLoading; _modLoader.ModUnloading += ModUnloading; _collection = new StageCollection(_modLoader); }
public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; _reloadedHooks = _modLoader.GetController <IReloadedHooks>(); /* Your mod code starts here. */ if (_reloadedHooks.TryGetTarget(out var hooks)) { SDK.Init(hooks, null); _heroesRpc = new HeroesRPC(); } }
public void Start(IModLoaderV1 loader) { #if DEBUG Debugger.Launch(); #endif _modLoader = (IModLoader)loader; _logger = (ILogger)_modLoader.GetLogger(); // Auto-subscribe on loaded redirector. _modLoader.ModLoaded += ModLoaded; SetupEventFromRedirector(); }
public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; ModDirectory = _modLoader.GetDirectoryForModId("dolphin.shadowthehedgehog.rpc"); var settings = Settings.GetSettings(); settings.ToFile(); _shadowRpc = new ShadowRpc(Process.GetCurrentProcess(), settings); }
private static void LoadFailed(IModLoader loader, Exception ex) { if (loader != null) { if (loader.LoadError != null) { throw new Exception(loader.LoadError, ex); } } throw new Exception("Failed to load", ex); }
public void Start(IModLoaderV1 loader) { ModLoader = (IModLoader)loader; ModLoader.GetController <IReloadedHooks>().TryGetTarget(out var hooks); Hooks = hooks; /* Your mod code starts here. */ var logger = (ILogger)ModLoader.GetLogger(); SDK.Init(Hooks, new PrsInstance()); _server = new Server(logger); }
public void StartEx(IModLoaderV1 loader, IModConfigV1 config) { _modLoader = (IModLoader)loader; _modLoader.GetController <IReloadedHooks>().TryGetTarget(out var reloadedHooks); SDK.SDK.Init(reloadedHooks, null); /* Your mod code starts here. */ var modFolder = _modLoader.GetDirectoryForModId(config.ModId); var configFolder = _modLoader.GetModConfigDirectory(config.ModId); _graphicsEssentials = new GraphicsEssentials(modFolder, configFolder, reloadedHooks); }
public StageCollection(IModLoader loader, IReloadedHooks hooks) { _modLoader = loader; _logger = (ILogger)_modLoader.GetLogger(); _redirectorController = _modLoader.GetController <IRedirectorController>(); _hooks = new Hooks.Hooks(hooks, InitSplineImpl, GetStartPositionImpl, GetEndPositionImpl, GetBragPositionImpl); // Populate Default Stages foreach (StageId stageId in (StageId[])Enum.GetValues(typeof(StageId))) { _allStages.Add(new DefaultStage(stageId)); } }
public void Start(IModLoaderV1 loader) { #if DEBUG Debugger.Launch(); #endif ModLoader = (IModLoader)loader; Logger = (ILogger)ModLoader.GetLogger(); /* Your mod code starts here. */ _postProcess = new PostProcess(ModLoader.GetDirectoryForModId(MyModId)); ModLoader.ModLoaded += ModLoaded; SetupController(); }
/// <summary> /// Asynchronously starts the host. /// </summary> public static LiteNetLibServer Create(ILogger logger, IModLoader modLoader, Config config) { var mod = new LiteNetLibServer(logger, modLoader); mod.Host = new LiteNetLibHost <MessageDispatcher <LiteNetLibState> >(true, new MessageDispatcher <LiteNetLibState>()); mod.Host.ConnectionRequestEvent += mod.HandleConnectionRequest; new SetModState().AddToDispatcher(mod, ref mod.Host.Dispatcher); new GetLoadedMods().AddToDispatcher(mod, ref mod.Host.Dispatcher); mod.RestartWithConfig(config); return(mod); }
public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; /* Your mod code starts here. */ _reloadedHooksLegacy = new ReloadedHooks(); _reloadedHooks = _reloadedHooksLegacy; _utilities = new ReloadedHooksUtilities(); _modLoader.AddOrReplaceController(this, _reloadedHooks); _modLoader.AddOrReplaceController(this, _reloadedHooksLegacy); _modLoader.AddOrReplaceController(this, _utilities); }
/// <summary> /// Entry point for your mod. /// </summary> public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; _logger = (ILogger)_modLoader.GetLogger(); _modLoader.GetController <IReloadedHooks>().TryGetTarget(out _hooks); _modLoader.GetController <IReloadedHooksUtilities>().TryGetTarget(out _hooksUtilities); /* Your mod code starts here. */ SDK.Init(_hooks); _hook = new ControllerHook(_hooks); _fourPlayerPatch = new FourPlayerPatch(_hooks, _hooksUtilities); _modLoader.AddOrReplaceController <IControllerHook>(this, _hook); }
public void Start(IModLoaderV1 loader) { #if DEBUG Debugger.Launch(); #endif ModLoader = (IModLoader)loader; Logger = (ILogger)ModLoader.GetLogger(); /* Your mod code starts here. */ string modDirectory = ModLoader.GetDirectoryForModId(MyModId); _xInput = new XInput(modDirectory); ModLoader.ModLoaded += ModLoaded; SetupController(); }
public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; _logger = (ILogger)_modLoader.GetLogger(); /* Your mod code starts here. */ var modFolder = _modLoader.GetDirectoryForModId(ModId); var configurator = new Configurator(modFolder); var configuration = configurator.GetConfiguration <Config>(0); var redirector = _modLoader.GetController <IRedirectorController>(); _swapper = new CharacterSwapper(_logger, configuration, modFolder, redirector); _modLoader.ModLoaded += OnRedirectorLoaded; }
public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; Logger = (ILogger)_modLoader.GetLogger(); // Your config file is in Config.json. // Need more configurations? See `_configurator.MakeConfigurations` _configurator = new Configurator(_modLoader.GetDirectoryForModId(ModId)); Configuration = _configurator.GetConfiguration <Config>(0); Configuration.ConfigurationUpdated += OnConfigurationUpdated; /* Your mod code starts here. */ _twitchBot.Connect(); EnableHooks(); }
public void Start(IModLoaderV1 loader) { #if DEBUG Debugger.Launch(); #endif ModLoader = (IModLoader)loader; Logger = (ILogger)ModLoader.GetLogger(); ModLoader.GetController <IReloadedHooks>().TryGetTarget(out ReloadedHooks); SDK.SDK.Init(ReloadedHooks, null); /* Your mod code starts here. */ _hook = new ControllerHook(ModLoader.GetDirectoryForModId(ThisModId)); ModLoader.AddOrReplaceController <IControllerHook>(this, _hook); }
public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; _modLoader.GetController <IReloadedHooks>().TryGetTarget(out var hooks); _modLoader.GetController <IPrsInstance>().TryGetTarget(out var prsInstance); Logger = (ILogger)_modLoader.GetLogger(); SDK.Init(hooks, prsInstance); /* Your mod code starts here. */ var configurator = new Configurator(_modLoader.GetDirectoryForModId("sonicheroes.utils.oneredirector")); var config = configurator.GetConfiguration <Config>(0); _oneHook = new OneHook(Logger, config, NativeFunctions.GetInstance(hooks)); _modLoader.ModLoading += OnModLoading; _modLoader.ModUnloading += OnModUnloading; }
public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; // Print controls. var logger = (ILogger)_modLoader.GetLogger(); logger.WriteLine(Freecam.Controls); // Handle controller hook load and unload. _modLoader.ModUnloading += ModUnloading; _modLoader.ModLoading += ModLoading; /* Your mod code starts here. */ Initialize(); }
/// <summary> /// Entry point for your mod. /// </summary> public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; _logger = (ILogger)_modLoader.GetLogger(); _modLoader.GetController <IReloadedHooks>().TryGetTarget(out _hooks); /* Your mod code starts here. */ _modLoader = (IModLoader)loader; _logger = (ILogger)_modLoader.GetLogger(); _modLoader.GetController <IReloadedHooks>().TryGetTarget(out _hooks); /* Your mod code starts here. */ _mod = new Mod(_logger, _hooks); }
public unsafe void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; _logger = (ILogger)_modLoader.GetLogger(); _modDirectory = _modLoader.GetDirectoryForModId(ThisModId); /* Your mod code starts here. */ _config = Config.Config.FromJson(_modDirectory); _config.ToJson(_modDirectory); Initialize(); var configDirectory = Path.GetDirectoryName(Config.Config.FilePath(_modDirectory)); var fileName = Path.GetFileName(Config.Config.FilePath(_modDirectory)); _watcher = new FileSystemWatcher(configDirectory, fileName); _watcher.EnableRaisingEvents = true; _watcher.Changed += WatcherOnChanged; }
public void Start(IModLoaderV1 loader) { _modLoader = (IModLoader)loader; _logger = (ILogger)_modLoader.GetLogger(); /* Your mod code starts here. */ // Your config file is in Config.json. // Need more configurations? See `_configurator.MakeConfigurations` _configurator = new Configurator(_modLoader.GetDirectoryForModId(ModId)); _configuration = _configurator.GetConfiguration <Config>(0); _configuration.ConfigurationUpdated += OnConfigurationUpdated; // Execute mod code. _modLoader.GetController <IReloadedHooks>().TryGetTarget(out _hooks); _modLoader.GetController <IReloadedHooksUtilities>().TryGetTarget(out _utilities); _drawDistanceHook = new DrawDistanceHook(_configuration, _hooks, _utilities); }
/// <summary> /// Entry point for your mod. /// </summary> public void Start(IModLoaderV1 loader) { _modLoader = ( IModLoader )loader; _logger = ( ILogger )_modLoader.GetLogger(); _modLoader.GetController <IReloadedHooks>().TryGetTarget(out _hooks); // Your config file is in Config.json. // Need a different name, format or more configurations? Modify the `Configurator`. // If you do not want a config, remove Configuration folder and Config class. var configurator = new Configurator(_modLoader.GetDirectoryForModId(MyModId)); _configuration = configurator.GetConfiguration <Config>(0); _configuration.ConfigurationUpdated += OnConfigurationUpdated; /* Your mod code starts here. */ _P4GPCModLoader = new P4GPCModLoader(_logger, _configuration, _hooks); _P4GPCModLoader.Activate(); }