コード例 #1
0
        private void Awake()
        {
            Debug.Log("Starting awake now...");

            @this2 = this;

            //We set our patcher so we can call it back and patch dynamically as needed.
            harmony = Harmony.CreateAndPatchAll(typeof(Main));

            MethodBase menuItemSetConstructor = typeof(SceneEdit)
                                                .GetNestedType("MenuItemSet", BindingFlags.NonPublic)
                                                .GetConstructor(
                new Type[]
                { typeof(GameObject),
                  typeof(SceneEdit.SMenuItem),
                  typeof(string),
                  typeof(bool) });

            MethodBase colorItemSetConstructor = typeof(SceneEdit).GetNestedType("ColorItemSet", BindingFlags.NonPublic).GetConstructor(new Type[] { typeof(GameObject), typeof(SceneEdit.SMenuItem) });

            harmony.PatchAll(typeof(QuickEdit));

            harmony.Patch(menuItemSetConstructor, new HarmonyMethod(typeof(QuickEdit), "MenuItemSet"));
            harmony.Patch(colorItemSetConstructor, new HarmonyMethod(typeof(QuickEdit), "MenuItemSet"));

            @this2.StartCoroutine(GSModMenuLoad.LoadCache());

            UseVanillaCache = Config.Bind("General", "Use Vanilla Cache", false, "This decides whether a vanilla cache is created, maintained and used on load. Kiss has it's own questionable implementation of a cache, but this cache is questionable in it's own right too.");

            ChangeModPriority = Config.Bind("General", "Add 10,000 to Mod Item Priority", false, "This option simply adds 10,000 priority to all mod items loaded. Handy if you don't want mod items mix and matching with vanilla stuff or appearing before the remove button.");

            @this2.StartCoroutine(VanillaMenuLoad.LoadCache());
        }
コード例 #2
0
        private void Awake()
        {
            logger = this.Logger;

            Main.logger.LogDebug("Starting awake now...");

            @this2 = this;

            //We set our patcher so we can call it back and patch dynamically as needed.
            harmony = Harmony.CreateAndPatchAll(typeof(Main));

            MethodBase menuItemSetConstructor = typeof(SceneEdit)
                                                .GetNestedType("MenuItemSet", BindingFlags.NonPublic)
                                                .GetConstructor(
                new Type[]
                { typeof(GameObject),
                  typeof(SceneEdit.SMenuItem),
                  typeof(string),
                  typeof(bool) });

            MethodBase colorItemSetConstructor = typeof(SceneEdit).GetNestedType("ColorItemSet", BindingFlags.NonPublic).GetConstructor(new Type[] { typeof(GameObject), typeof(SceneEdit.SMenuItem) });

            harmony.PatchAll(typeof(QuickEdit));

            harmony.Patch(menuItemSetConstructor, new HarmonyMethod(typeof(QuickEdit), "MenuItemSet"));
            harmony.Patch(colorItemSetConstructor, new HarmonyMethod(typeof(QuickEdit), "MenuItemSet"));

            @this2.StartCoroutine(GSModMenuLoad.LoadCache());

            BreakInterval = Config.Bind("General", "Time Between Breaks in Seconds", 0.5f, "The break interval is the time between each break that the co-routine takes where it returns processing back to the main thread. After one frame, processing is given back to the co-routine. Higher values can help with low-end processing times but can cause instability if set too high. If after all of this you're still confused, leave it alone.");

            UseVanillaCache = Config.Bind("General", "Use Vanilla Cache", false, "This decides whether a vanilla cache is created, maintained and used on load. Kiss has it's own questionable implementation of a cache, but this cache is questionable in it's own right too.");

            ChangeModPriority = Config.Bind("General", "Add 10,000 to Mod Item Priority", false, "This option simply adds 10,000 priority to all mod items loaded. Handy if you don't want mod items mix and matching with vanilla stuff or appearing before the remove button.");

            @this2.StartCoroutine(VanillaMenuLoad.LoadCache());
        }