Пример #1
0
 internal static void Setup()
 {
     WithoutArg["melonloader.disableunityclc"] = () => CleanUnityLogs = false;
     WithArg["melonloader.consolemode"]        = (string arg) =>
     {
         if (int.TryParse(arg, out int valueint))
         {
             Mode = (DisplayMode)MelonUtils.Clamp(valueint, (int)DisplayMode.NORMAL, (int)DisplayMode.LEMON);
         }
     };
 }
Пример #2
0
 internal static void Setup()
 {
     WithoutArg["quitfix"] = () => QuitFix = true;
     WithoutArg["melonloader.disablestartscreen"] = () => StartScreen = false;
     WithArg["melonloader.loadmodeplugins"]       = (string arg) =>
     {
         if (int.TryParse(arg, out int valueint))
         {
             LoadMode_Plugins = (LoadModeEnum)MelonUtils.Clamp(valueint, (int)LoadModeEnum.NORMAL, (int)LoadModeEnum.BOTH);
         }
     };
     WithArg["melonloader.loadmodemods"] = (string arg) =>
     {
         if (int.TryParse(arg, out int valueint))
         {
             LoadMode_Mods = (LoadModeEnum)MelonUtils.Clamp(valueint, (int)LoadModeEnum.NORMAL, (int)LoadModeEnum.BOTH);
         }
     };
 }
Пример #3
0
        internal static void Load()
        {
#if DEBUG
            Core.DebugMode = true;
#endif

            string[] args = Environment.GetCommandLineArgs();
            if ((args == null) ||
                (args.Length <= 0))
            {
                return;
            }

            for (int i = 0; i < args.Length; i++)
            {
                string arg = args[i];
                if (string.IsNullOrEmpty(arg))
                {
                    continue;
                }
                arg = arg.ToLowerInvariant();
                int    valueint = 0;
                string valuestr = null;
                if ((i + 1) < args.Length)
                {
                    valuestr = args[i + 1];
                }
                switch (arg)
                {
#if !DEBUG
                case "--melonloader.debug":
                    Core.DebugMode = true;
                    goto default;
#endif
                case "--quitfix":
                    Core.QuitFix = true;
                    goto default;

                case "--melonloader.agfregenerate":
                    Il2CppAssemblyGenerator.ForceRegeneration = true;
                    goto default;

                case "--melonloader.agfvdumper":
                    if (string.IsNullOrEmpty(valuestr))
                    {
                        goto default;
                    }
                    Il2CppAssemblyGenerator.ForceVersion_Dumper = valuestr;
                    goto default;

                case "--melonloader.agfvunhollower":
                    if (string.IsNullOrEmpty(valuestr))
                    {
                        goto default;
                    }
                    Il2CppAssemblyGenerator.ForceVersion_Il2CppAssemblyUnhollower = valuestr;
                    goto default;

                case "--melonloader.agfvunity":
                    if (string.IsNullOrEmpty(valuestr))
                    {
                        goto default;
                    }
                    Il2CppAssemblyGenerator.ForceVersion_UnityDependencies = valuestr;
                    goto default;

                case "--melonloader.loadmodeplugins":
                    if (string.IsNullOrEmpty(valuestr))
                    {
                        goto default;
                    }
                    if (!int.TryParse(valuestr, out valueint))
                    {
                        goto default;
                    }
                    Core.LoadMode_Plugins = (Core.LoadModeEnum)MelonUtils.Clamp(valueint, (int)Core.LoadModeEnum.NORMAL, (int)Core.LoadModeEnum.BOTH);
                    goto default;

                case "--melonloader.loadmodemods":
                    if ((i + 1) < args.Length)
                    {
                        valuestr = args[i + 1];
                    }
                    if (string.IsNullOrEmpty(valuestr))
                    {
                        goto default;
                    }
                    if (!int.TryParse(valuestr, out valueint))
                    {
                        goto default;
                    }
                    Core.LoadMode_Mods = (Core.LoadModeEnum)MelonUtils.Clamp(valueint, (int)Core.LoadModeEnum.NORMAL, (int)Core.LoadModeEnum.BOTH);
                    goto default;

                default:
                    break;
                }
            }
        }