public MakerOptimizations()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            var stilettoInstalled = BepInEx.Bootstrap.Chainloader.PluginInfos.Values.Any(x => x.Metadata.GUID == "com.essu.stiletto");

            DisableNewAnimation = Config.Bind(Utilities.ConfigSectionTweaks, "Disable NEW indicator animation", true, new ConfigDescription("Performance improvement in maker if there are many new items.\nChanges take effect after maker restart."));
            DisableNewIndicator = Config.Bind(Utilities.ConfigSectionTweaks, "Disable NEW indicator", false, new ConfigDescription("Turn off the New! mark on items in character maker that weren't used yet.\nChanges take effect after maker restart."));
            DisableIKCalc       = Config.Bind(Utilities.ConfigSectionTweaks, "Disable IK in maker", !stilettoInstalled, new ConfigDescription("This setting prevents the character's limbs from being readjusted to match body proportions. It can fix weirdly bent limbs on characters that use ABMX sliders, but will break Stiletto if it's installed.\nWarning: This setting will get reset to false if Stiletto is installed to avoid issues!\nChanges take effect after game restart."));
            DisableCharaName    = Config.Bind(Utilities.ConfigSectionTweaks, "Disable character name box in maker", true, new ConfigDescription("Hides the name box in the bottom right part of the maker, giving you a clearer look at the character."));
            DisableHiddenTabs   = Config.Bind(Utilities.ConfigSectionTweaks, "Disable hidden tabs in maker", true, new ConfigDescription("Major performance improvement in chara maker.\nRecommended to be used together with list virtualization, otherwise switching between tabs becomes slower.\nChanges take effect after maker restart."));
            ManageCursor        = Config.Bind(Utilities.ConfigSectionTweaks, "Manage cursor in maker", true, new ConfigDescription("Lock and hide the cursor when moving the camera in maker."));
            ListWidth           = Config.Bind(Utilities.ConfigSectionTweaks, "Width of maker item lists", 3, new ConfigDescription("How many items fit horizontally in a single row of the item lists in character maker.\n Changes require a restart of character maker.", new AcceptableValueRange <int>(3, 8)));
            var virtualize = Config.Bind(Utilities.ConfigSectionTweaks, "Virtualize maker lists", true, "Major load time reduction and performance improvement in character maker. Eliminates lag when switching tabs.\nCan cause some compatibility issues with other plugins.\nChanges take effect after game restart.");

            if (virtualize.Value)
            {
                VirtualizeMakerLists.InstallHooks();
            }

            if (DisableIKCalc.Value && BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("com.essu.stiletto"))
            {
                Logger.Log(LogLevel.Warning, "Stiletto is installed but Disable maker IK is enabled! Heels will not work properly in character maker until this setting is turned off");
            }
        }
        internal void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            AsyncClothesLoading  = Config.Bind(Utilities.ConfigSectionTweaks, "Async clothes loading", true, new ConfigDescription("Spread loading of clothes in school roam mode over multiple frames. Greatly reduces seemingly random stutters when characters change clothes somewhere in the world.\nWarning: In rare cases can cause some visual glitches like 2 coordinates loaded at once."));
            PreloadCharacters    = Config.Bind(Utilities.ConfigSectionTweaks, "Preload characters on initial load", true, new ConfigDescription("Forces all characters to load during initial load into school mode. Slightly longer loading time but eliminates large stutters when unseen characters enter current map."));
            ThrottleCharaUpdates = Config.Bind(Utilities.ConfigSectionTweaks, "Throttle chara blend shape updates", true, new ConfigDescription("Reduces the amount of unnecessary blend shape updates. Performance improvement in main game, especially with over 20 characters in one room."));

            HarmonyWrapper.PatchAll(typeof(MainGameOptimizations));

            SceneManager.sceneLoaded += (arg0, mode) =>
            {
                try
                {
                    _runningReloadCoroutines.Clear();
                    _insideRoamingMode = arg0.name == "Action" || Scene.Instance.LoadSceneName == "Action";
                    foreach (var boneListItem in _boneList.Keys.ToList())
                    {
                        if (!boneListItem)
                        {
                            _boneList.Remove(boneListItem);
                        }
                    }
                }
                catch (Exception e)
                {
                    UnityEngine.Debug.LogException(e);
                }
            };
        }
        public static int DefaultPersonality = 8; // 8 - Pure

        private void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            HarmonyWrapper.PatchAll(typeof(Hooks));
        }
        private void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            SceneManager.sceneLoaded += (s, m) => StartCoroutine(DelayedStart());
        }
Esempio n. 5
0
        private void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            _instance = this;
            Hooks.InstallHooks();
        }
Esempio n. 6
0
        internal void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            ManageCursor = Config.Bind(Utilities.ConfigSectionTweaks, "Manage cursor in maker", true, new ConfigDescription("Lock and hide the cursor when moving the camera in maker."));

            SceneManager.sceneLoaded += SceneLoaded;
        }
        private void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            if (!CommonCode.InsideKoikatsuParty) //Not currently compatible with Koikatsu Party
            {
                HarmonyWrapper.PatchAll(typeof(Hooks));
            }
        }
Esempio n. 8
0
        internal void Start()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            if (DisableIKCalc.Value && BepInEx.Bootstrap.Chainloader.PluginInfos.Values.Any(x => x.Metadata.GUID == "com.essu.stiletto"))
            {
                DisableIKCalc.Value = false;
                Utilities.Logger.Log(LogLevel.Warning | LogLevel.Message, "Stiletto detected, disabling the DisableIKCalc optimization for compatibility");
            }
        }
        protected void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            SceneManager.sceneLoaded           += SceneLoaded;
            DisableCameraTarget.SettingChanged += (sender, args) => ApplyPatches();
            DisableCharaName.SettingChanged    += (sender, args) => ApplyPatches();

            Hooks.InstallHooks();
        }
Esempio n. 10
0
        public MakerOptimizations()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            DisableNewAnimation = Config.Bind(Utilities.ConfigSectionTweaks, "Disable NEW indicator animation", true, new ConfigDescription("Good performance improvement in maker if there are many new items.\nChanges take effect after maker restart."));
            DisableNewIndicator = Config.Bind(Utilities.ConfigSectionTweaks, "Disable NEW indicator for new items", true, new ConfigDescription("visual glitches like 2 coordinates loaded at once."));
            DisableIKCalc       = Config.Bind(Utilities.ConfigSectionTweaks, "Disable maker IK", true, new ConfigDescription("Improves performance and reduces stuttering at the cost of not recalculating positions of some body parts.\nMost noticeable on characters with wide hips where the hands are not moving with the hip line.\nWarning: This setting will get reset to false if Stiletto is installed to avoid issues!\nChanges take effect after game restart."));
            DisableCharaName    = Config.Bind(Utilities.ConfigSectionTweaks, "Disable character name box in maker", true, new ConfigDescription("Hides the name box in the bottom right part of the maker, giving you a clearer look at the character."));
            DisableHiddenTabs   = Config.Bind(Utilities.ConfigSectionTweaks, "Deactivate hidden tabs in maker", SystemInfo.processorFrequency < 2700, new ConfigDescription("Major performance improvement at the cost of slower switching between tabs in maker.\nChanges take effect after maker restart."));
            ManageCursor        = Config.Bind(Utilities.ConfigSectionTweaks, "Manage cursor in maker", true, new ConfigDescription("Lock and hide the cursor when moving the camera in maker."));
        }
Esempio n. 11
0
        internal void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }
            DisableUnload = Config.Bind(Utilities.ConfigSectionTweaks, "Disable Resource Unload", false, new ConfigDescription("Disables all resource unloading. Requires large amounts of RAM or will likely crash your game.", null, new ConfigurationManagerAttributes {
                IsAdvanced = true
            }));

            StartCoroutine(CleanupCo());

            InstallHooks();
        }
        internal void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            DisableUnload = Config.Bind(Utilities.ConfigSectionTweaks, "Disable Resource Unload", false, new ConfigDescription("Disables all resource unloading. Requires large amounts of RAM or will likely crash your game.", null, new ConfigurationManagerAttributes {
                IsAdvanced = true
            }));
            OptimizeMemoryUsage = Config.Bind(Utilities.ConfigSectionTweaks, "Optimize Memory Usage", true, new ConfigDescription("Use more memory (if available) in order to load the game faster and reduce random stutter."));

            StartCoroutine(CleanupCo());

            InstallHooks();
        }
Esempio n. 13
0
        private void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }
            if (CommonCode.InsideStudio)
            {
                return;
            }
            if (!Utilities.FixesConfig.Wrap(Utilities.ConfigSectionFixes, "Fix shader dropdown menu",
                                            "Fixes the shader selection menu going off-screen when there are many modded shaders installed.", true).Value)
            {
                return;
            }

            SceneManager.sceneLoaded += (s, m) => StartCoroutine(DelayedStart());
        }
Esempio n. 14
0
        private void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            if (CommonCode.InsideStudio)
            {
                return;
            }

            AsyncClothesLoading = Utilities.FixesConfig.Wrap(Utilities.ConfigSectionTweaks, "Async clothes loading", "Spread loading of clothes in school roam mode over multiple frames. Greatly reduces seemingly random stutters when characters change clothes somewhere in the world.\nWarning: In rare cases can cause some visual glitches like 2 coordinates loaded at once.", true);
            PreloadCharacters   = Utilities.FixesConfig.Wrap(Utilities.ConfigSectionTweaks, "Preload characters on initial load", "Forces all characters to load during initial load into school mode. Slightly longer loading time but eliminates large stutters when unseen characters enter current map.", true);

            HarmonyWrapper.PatchAll(typeof(MainGameOptimizations));

            SceneManager.sceneLoaded += (arg0, mode) => _runningReloadCoroutines.Clear();
        }
        internal void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            SceneManager.sceneLoaded += SceneLoaded;

            DisableCharaName.SettingChanged += (sender, args) =>
            {
                if (FindObjectOfType <CustomScene>())
                {
                    ToggleCharaName();
                }
            };

            Hooks.InstallHooks();
        }
Esempio n. 16
0
        private void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            var harmony          = HarmonyWrapper.PatchAll(typeof(ModdedHeadEyelinerFix));
            var getTextureMethod = typeof(ChaControl).GetMethod("GetTexture", AccessTools.all);

            if (getTextureMethod == null)
            {
                throw new ArgumentException("Could not find ChaControl.GetTexture");
            }
            if (getTextureMethod.GetParameters().Any(x => x.Name == "addStr"))
            {
                harmony.Patch(typeof(ChaControl).GetMethod("GetTexture", AccessTools.all), null, new HarmonyMethod(typeof(ModdedHeadEyelinerFix).GetMethod(nameof(GetTexture), AccessTools.all)));
            }
        }
        internal void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            var h = HarmonyWrapper.PatchAll(typeof(Hooks));

            // The VR classes are only available in VR module so they can't be directly referenced
            var vrType = Type.GetType("VR.VRClassRoomCharaFile, Assembly-CSharp");

            if (vrType != null)
            {
                h.Patch(vrType.GetMethod("InitializeList", AccessTools.all),
                        prefix: new HarmonyMethod(typeof(Hooks), nameof(Hooks.ClassRoomCharaFileInitializeListPrefix)),
                        postfix: new HarmonyMethod(typeof(Hooks), nameof(Hooks.ClassRoomCharaFileInitializeListPostfix)));
                h.Patch(vrType.GetMethod("Start", AccessTools.all),
                        postfix: new HarmonyMethod(typeof(Hooks), nameof(Hooks.ClassRoomCharaFileStartPostfix)));
            }
        }
        internal void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            //Test setup.xml for validity, delete if it has junk data
            if (File.Exists("UserData/setup.xml"))
            {
                TestSetupXml();
            }

            //Create a setup.xml if there isn't one
            if (!File.Exists("UserData/setup.xml"))
            {
                CreateSetupXml();
            }

            Hooks.Apply();
        }
Esempio n. 19
0
        internal void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            //Test setup.xml for validity, delete if it has junk data
            if (File.Exists("UserData/setup.xml"))
            {
                TestSetupXml();
            }

            //Create a setup.xml if there isn't one
            if (!File.Exists("UserData/setup.xml"))
            {
                CreateSetupXml();
            }

            HarmonyWrapper.PatchAll(typeof(SettingsVerifier_PH));
        }
Esempio n. 20
0
        private void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            Logger = base.Logger;

            var h = HarmonyWrapper.PatchAll(typeof(Hooks));

            // Catch nullref exceptions inside of Change***Async methods to prevent bad clothes completely crashing game logic
            // Finalizer only affects the start of the coroutines while postfix affects the proceeding steps
            var finalizer = new HarmonyMethod(typeof(NullChecks), nameof(MethodNullRefEater));
            var postfix   = new HarmonyMethod(typeof(NullChecks), nameof(CoroutineNullRefEater));

            foreach (var methodInfo in typeof(ChaControl).GetMethods(AccessTools.all)
                     .Where(x => x.Name.StartsWith("Change", StringComparison.Ordinal) && x.Name.EndsWith("Async", StringComparison.Ordinal) && x.ReturnType == typeof(IEnumerator)))
            {
                h.Patch(methodInfo, null, postfix, null, finalizer);
            }
        }
Esempio n. 21
0
        private void Awake()
        {
            if (IncompatiblePluginDetector.AnyIncompatiblePlugins())
            {
                return;
            }

            //Test setup.xml for validity, delete if it has junk data
            if (File.Exists("UserData/setup.xml"))
            {
                TestSetupXml();
            }

            //Create a setup.xml if there isn't one
            if (!File.Exists("UserData/setup.xml"))
            {
                CreateSetupXml();
            }

            _instance = this;

            HarmonyWrapper.PatchAll(typeof(Hooks));
        }