Пример #1
0
        private static int Initialize()
        {
            AppDomain curDomain = AppDomain.CurrentDomain;

            Fixes.UnhandledException.Install(curDomain);
            MelonUtils.Setup(curDomain);
            Assertions.LemonAssertMapping.Setup();

            if (!MonoLibrary.Setup() ||
                !MonoResolveManager.Setup())
            {
                return(1);
            }

            HarmonyInstance = new HarmonyLib.Harmony(BuildInfo.Name);

            Fixes.ForcedCultureInfo.Install();
            Fixes.InstancePatchFix.Install();
            Fixes.ProcessFix.Install();
            PatchShield.Install();

            MelonPreferences.Load();
            MelonLaunchOptions.Load();
            bHaptics.Load();

            MelonCompatibilityLayer.Setup();
            MelonCompatibilityLayer.SetupModules(MelonCompatibilityLayer.SetupType.OnPreInitialization);

            MelonHandler.LoadPlugins();
            MelonHandler.OnPreInitialization();

            return(0);
        }
Пример #2
0
        private static int Initialize()
        {
            Il2CppAssemblyGenerator.Load();
            bHaptics.Load();

            MelonHandler.LoadPlugins();
            MelonHandler.OnPreInitialization();

            return(0);
        }
Пример #3
0
        internal static int Initialize(ConfigFile configFile)
        {
            AppDomain curDomain = AppDomain.CurrentDomain;

            HarmonyInstance = new HarmonyLib.Harmony(BuildInfo.Name);

            if (MelonLaunchOptions.Core.EnableFixes)
            {
                Fixes.UnhandledException.Run(curDomain);
                Fixes.InvariantCurrentCulture.Install();
            }

            try { MelonUtils.Setup(); } catch (Exception ex) { MelonLogger.Error($"MelonUtils.Setup Exception: {ex}"); throw; }

            if (MelonLaunchOptions.Core.EnableFixes)
            {
                Fixes.ApplicationBase.Run(curDomain);
                Fixes.ExtraCleanup.Run();
            }

            MelonPreferences.Load();
            MelonLaunchOptions.Load(configFile);

            if (MelonLaunchOptions.Core.EnableCompatibilityLayers)
            {
                MelonCompatibilityLayer.Setup();
            }

            if (MelonLaunchOptions.Core.EnablePatchShield)
            {
                PatchShield.Install();
            }

            if (MelonLaunchOptions.Core.EnableBHapticsIntegration)
            {
                bHaptics.Load();
            }

            if (MelonLaunchOptions.Core.EnableCompatibilityLayers)
            {
                MelonCompatibilityLayer.SetupModules(MelonCompatibilityLayer.SetupType.OnPreInitialization);
            }

            MelonHandler.LoadPlugins();
            MelonHandler.OnPreInitialization();

            return(0);
        }
Пример #4
0
 private static void Initialize()
 {
     MelonHandler.LoadPlugins();
     Main.LegacySupport();
     MelonHandler.OnPreInitialization();
 }