internal void Main()
        {
            Logger = base.Logger;

            Female1GuideObject = Config.Bind("Keyboard Shortcuts", "Show Female 1 Guide Object", new KeyboardShortcut(KeyCode.O), new ConfigDescription("Show the guide object for adjusting girl 1 position", null, new ConfigurationManagerAttributes {
                Order = 6
            }));
            Female2GuideObject = Config.Bind("Keyboard Shortcuts", "Show Female 2 Guide Object", new KeyboardShortcut(KeyCode.P), new ConfigDescription("Show the guide object for adjusting girl 2 position", null, new ConfigurationManagerAttributes {
                Order = 5
            }));
            MaleGuideObject = Config.Bind("Keyboard Shortcuts", "Show Male Guide Object", new KeyboardShortcut(KeyCode.I), new ConfigDescription("Show the guide object for adjusting the boy's position", null, new ConfigurationManagerAttributes {
                Order = 4
            }));
            Female1GuideObjectReset = Config.Bind("Keyboard Shortcuts", "Reset Female 1 Position", new KeyboardShortcut(KeyCode.O, KeyCode.RightControl), new ConfigDescription("Reset adjustments for girl 1 position", null, new ConfigurationManagerAttributes {
                Order = 3
            }));
            Female2GuideObjectReset = Config.Bind("Keyboard Shortcuts", "Reset Female 2 Position", new KeyboardShortcut(KeyCode.P, KeyCode.RightControl), new ConfigDescription("Reset adjustments for girl 2 position", null, new ConfigurationManagerAttributes {
                Order = 2
            }));
            MaleGuideObjectReset = Config.Bind("Keyboard Shortcuts", "Reset Male Position", new KeyboardShortcut(KeyCode.I, KeyCode.RightControl), new ConfigDescription("Reset adjustments for girl 2 position", null, new ConfigurationManagerAttributes {
                Order = 1
            }));

            HarmonyWrapper.PatchAll(typeof(Hooks));
            CharacterApi.RegisterExtraBehaviour <HCharaAdjustmentController>(GUID);
        }
        private void Start()
        {
            _logger = Logger;

            // UserData is universal across games. Run in Start to let the game create the dir. Don't use UserData.Path since it's broken in EC
            _fullUserDataPath = Path.GetFullPath(Path.Combine(Paths.GameRootPath, "UserData"));

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

            // Patch all FileStream to account for differences in internals of different framework versions
            var hook = new HarmonyMethod(typeof(RemoveToRecycleBin), nameof(FileStreamHook));

            if (hook == null)
            {
                throw new ArgumentNullException(nameof(hook));
            }
            foreach (var m in AccessTools.GetDeclaredConstructors(typeof(FileStream)))
            {
                var args = m.GetParameters();
                if (args.Any(x => x.ParameterType == typeof(FileMode)) && args.Any(x => x.ParameterType == typeof(FileAccess)))
                {
                    h.Patch(m, hook);
                    //_logger.LogDebug("Patching " + m);
                }
            }
        }
Ejemplo n.º 3
0
        public ClassroomFolders()
        {
            _folderTreeView = new FolderTreeView(Utils.NormalizePath(UserData.Path), Path.Combine(Utils.NormalizePath(UserData.Path), "chara/female/"));
            _folderTreeView.CurrentFolderChanged = OnFolderChanged;

            HarmonyWrapper.PatchAll(typeof(ClassroomFolders));
        }
Ejemplo n.º 4
0
        public void Awake()
        {
            Enabled = Config.Bind("", "Enable Crossfade", Mode.On, "Enable smooth fade between animations. \nChoose \"VR only\" if you only want it enabled in official VR");

            DebugFix = Config.Bind("Advanced", "Debugger Crash Workaround", true, new ConfigDescription(
                                       "Disable crossfade in non-VR 3P intercourse to prevent conflict with the mono.dll used for dnSpy debugging." +
                                       "\nKeep this enabled unless you're sure that you do not have the modified dll in place." +
                                       "\nRequires restarting the game to take effect.",
                                       null, new ConfigurationManagerAttributes {
                IsAdvanced = true, Order = 0
            }));

            try
            {
                HarmonyWrapper.PatchAll(typeof(Hooks));

                if (dataPathVR = Application.dataPath.EndsWith("KoikatuVR_Data"))
                {
                    HarmonyWrapper.PatchAll(typeof(Hooks_VR));
                    HarmonyWrapper.PatchAll(typeof(Hooks_H3PSonyu));
                    Sonyu3PPatched = true;
                }
                else if (!DebugFix.Value)
                {
                    HarmonyWrapper.PatchAll(typeof(Hooks_H3PSonyu));
                    Sonyu3PPatched = true;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Ejemplo n.º 5
0
 internal void Main()
 {
     Enabled = Config.AddSetting("Settings", "Enabled", true, "Whether the plugin is enabled");
     Enabled.SettingChanged += Enabled_SettingChanged;
     _enabled = Enabled.Value;
     HarmonyWrapper.PatchAll(typeof(Demosaic));
 }
Ejemplo n.º 6
0
        private void Start()
        {
            _logsource = Logger;
            HarmonyWrapper.PatchAll(typeof(InvisibleBody));

            HideHairAccessories = Config.Wrap("Config", "Hide built-in hair accessories", "Whether or not to hide accesories (such as scrunchies) attached to back hairs.", true);
        }
        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);
                }
            };
        }
Ejemplo n.º 8
0
        private void Awake()
        {
            harmony = HarmonyWrapper.PatchAll(GetType());
            var soundDir = Path.Combine(Path.GetDirectoryName(Info.Location), PluginName);

            slaps = Directory.GetFiles(soundDir, "*.wav").Select(ExternalAudioClip.Load).ToList();
        }
Ejemplo n.º 9
0
        internal void Main()
        {
            Logger = base.Logger;

            PopulateUncensorLists();

#if KK
            _GenderBender = Config.AddSetting("Config", "Genderbender Allowed", true, "Whether or not genderbender characters are allowed. When disabled, girls will always have a female body with no penis, boys will always have a male body and a penis. Genderbender characters will still load in Studio for scene compatibility.");
#endif
            DefaultMaleBody           = Config.AddSetting("Config", "Default Male Body", "Random", new ConfigDescription("Body to use if the character does not have one set. The censored body will not be selected randomly if there are any alternatives.", new AcceptableValueList <string>(GetConfigBodyList())));
            DefaultMalePenis          = Config.AddSetting("Config", "Default Male Penis", "Random", new ConfigDescription("Penis to use if the character does not have one set. The mosaic penis will not be selected randomly if there are any alternatives.", new AcceptableValueList <string>(GetConfigPenisList())));
            DefaultMaleBalls          = Config.AddSetting("Config", "Default Male Balls", "Random", new ConfigDescription("Balls to use if the character does not have one set. The mosaic penis will not be selected randomly if there are any alternatives.", new AcceptableValueList <string>(GetConfigBallsList())));
            DefaultFemaleBody         = Config.AddSetting("Config", "Default Female Body", "Random", new ConfigDescription("Body to use if the character does not have one set. The censored body will not be selected randomly if there are any alternatives.", new AcceptableValueList <string>(GetConfigBodyList())));
            DefaultFemalePenis        = Config.AddSetting("Config", "Default Female Penis", "Random", new ConfigDescription("Penis to use if the character does not have one set. The mosaic penis will not be selected randomly if there are any alternatives.", new AcceptableValueList <string>(GetConfigPenisList())));
            DefaultFemaleBalls        = Config.AddSetting("Config", "Default Female Balls", "Random", new ConfigDescription("Balls to use if the character does not have one set. The mosaic penis will not be selected randomly if there are any alternatives.", new AcceptableValueList <string>(GetConfigBallsList())));
            DefaultFemaleDisplayBalls = Config.AddSetting("Config", "Default Female Balls Display", false, "Whether balls will be displayed on females if not otherwise configured.");

            MakerAPI.RegisterCustomSubCategories += MakerAPI_RegisterCustomSubCategories;
            MakerAPI.MakerFinishedLoading        += MakerAPI_MakerFinishedLoading;
            CharacterApi.RegisterExtraBehaviour <UncensorSelectorController>(GUID);
#if !EC
            RegisterStudioControls();
#endif

            HarmonyWrapper.PatchAll(typeof(Hooks));
        }
Ejemplo n.º 10
0
 public void Awake()
 {
     Logger = base.Logger;
     UIUtility.Init();
     HarmonyWrapper.PatchAll(typeof(Patches));
     HarmonyWrapper.PatchAll(typeof(Hooks));
 }
Ejemplo n.º 11
0
        public static void InstallHooks()
        {
            var harmony = HarmonyWrapper.PatchAll(typeof(Hooks));

            harmony.Patch(typeof(GlobalMethod).GetMethod(nameof(GlobalMethod.LoadAllFolder), AccessTools.all).MakeGenericMethod(typeof(Object)),
                          null, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(LoadAllFolderPostfix), AccessTools.all)));
        }
Ejemplo n.º 12
0
        public static void InstallHooks()
        {
            if (!StudioAPI.InsideStudio)
            {
                var instance = HarmonyWrapper.PatchAll(typeof(HSceneTriggers));

                if (SkinEffectsPlugin.EnableClothesPersistence.Value)
                {
                    instance.PatchAll(typeof(PersistClothes));
                    instance.PatchAll(typeof(MainGameHooks));

                    // Patch TalkScene.TalkEnd iterator nested class
                    var iteratorType = AccessTools.FirstInner(typeof(TalkScene), x => x.FullName.Contains("<TalkEnd>c__Iterator"));
                    if (iteratorType == null)
                    {
                        SkinEffectsPlugin.Logger.LogError("Could not find TalkEnd iterator to patch.");
                        return;
                    }
                    var iteratorMethod = AccessTools.Method(iteratorType, "MoveNext");
                    var prefix         = new HarmonyMethod(typeof(PersistClothes), nameof(PersistClothes.PreTalkSceneIteratorEndHook));

                    instance.Patch(iteratorMethod, prefix, null, null);
                }
            }
        }
Ejemplo n.º 13
0
        private void Start()
        {
            _manager = GetComponent <ConfigurationManager.ConfigurationManager>();
            _manager.OverrideHotkey = true;

            HarmonyWrapper.PatchAll(typeof(ConfigurationManagerWrapper));
        }
Ejemplo n.º 14
0
 private void Start()
 {
     HarmonyWrapper.PatchAll(typeof(ClothingUnlocker));
     EnableCrossdressing = Config.Wrap("Config", "Enable clothing for either gender", "Allows any clothing to be worn by either gender.", true);
     EnableBras          = Config.Wrap("Config", "Enable bras for all tops", "Enable bras for all tops for all characters. May cause clipping or other undesired effects.", false);
     EnableSkirts        = Config.Wrap("Config", "Enable skirts for all tops", "Enable skirts for all tops for all characters. May cause clipping or other undesired effects.", false);
 }
Ejemplo n.º 15
0
        public FreeHFolders()
        {
            _folderTreeView = new FolderTreeView(Utils.NormalizePath(UserData.Path), Utils.NormalizePath(UserData.Path));
            _folderTreeView.CurrentFolderChanged = OnFolderChanged;

            HarmonyWrapper.PatchAll(typeof(FreeHFolders));
        }
            public static void InstallHooks()
            {
                var harmony = HarmonyWrapper.PatchAll(typeof(Hooks));

                SetupSetting(harmony,
                             typeof(CustomSelectInfoComponent).GetMethod("Disvisible", AccessTools.all),
                             typeof(Hooks).GetMethod(nameof(HarmonyPatch_CustomSelectInfoComponent_Disvisible), AccessTools.all),
                             DisableNewIndicator);

                SetupSetting(harmony,
                             typeof(CustomNewAnime).GetMethod("Update", AccessTools.all),
                             typeof(Hooks).GetMethod(nameof(HarmonyPatch_CustomNewAnime_Update), AccessTools.all),
                             DisableNewAnimation);

                if (DisableIKCalc.Value)
                {
                    var replace = typeof(CustomBase).GetMethod("UpdateIKCalc", AccessTools.all);
                    var prefix  = typeof(Hooks).GetMethod(nameof(HarmonyPatch_CustomBase_UpdateIKCalc), AccessTools.all);
                    harmony.Patch(replace, new HarmonyMethod(prefix), null);
                }

                {
                    var replace = typeof(CustomScene).GetMethod("Start", AccessTools.all);
                    var prefix  = typeof(Hooks).GetMethod(nameof(MakerStartHook), AccessTools.all);
                    harmony.Patch(replace, null, new HarmonyMethod(prefix));
                }
            }
Ejemplo n.º 17
0
        internal void Awake()
        {
            Logger = base.Logger;

            ShowSubtitles    = Config.AddSetting("Config", "Show Subtitles", true, "Enable or disable showing subtitles.");
            FontName         = Config.AddSetting("Config", "Font Name", "Arial", "Name of the font to use for subtitle text.");
            FontSize         = Config.AddSetting("Config", "Font Size", -5, "Font size of subtitles.");
            FontStyle        = Config.AddSetting("Config", "Font Style", UnityEngine.FontStyle.Bold, "Font style of subtitles, i.e. bold, italic, etc.");
            TextAlign        = Config.AddSetting("Config", "Text Align", TextAnchor.LowerCenter, "Text alignment of subtitles.");
            TextOffset       = Config.AddSetting("Config", "Text Offset", 10, "Distance from edge of the screen.");
            OutlineThickness = Config.AddSetting("Config", "Outline Thickness", 2, "Outline thickness for subtitle text.");
            TextColor        = Config.AddSetting("Config", "Text Color", ColorUtility.TryParseHtmlString("#FFCCFFFF", out Color color) ? color : Color.magenta, "Subtitle text color.");
            OutlineColor     = Config.AddSetting("Config", "Outline Color", Color.black, "Subtitle text outline color.");

#if HS
            if (Application.productName != "HoneySelect")
            {
                return;
            }
#endif

            LoadSubtitles();

            HarmonyWrapper.PatchAll(typeof(Hooks));
        }
Ejemplo n.º 18
0
        private void Start()
        {
            Logger             = base.Logger;
            Util.Logger.logger = Logger;

            IsVerbose = Config.Bind("Heelz", "Heelz Verbose Mode", false,
                                    new ConfigDescription("Make Heelz Plugin print all of debug messages in console. Useless for most of users."));
            LoadDevXML = Config.Bind("Heelz", "Load Developer XML", false,
                                     new ConfigDescription("Make Heelz Plugin load heel_manifest.xml file from game root folder. Useful for developing heels. Useless for most of users."));
            CharacterApi.RegisterExtraBehaviour <HeelsController>(GUID);
            HarmonyWrapper.PatchAll(typeof(HSHeelz));

            Logger.LogInfo("[Heelz] Heels mode activated: destroy all foot");
            var loadedManifests = Sideloader.Sideloader.Manifests.Values;

            foreach (var manifest in loadedManifests)
            {
                XMLLoader.LoadXML(manifest.manifestDocument);
            }

            if (LoadDevXML.Value)
            {
                XMLLoader.StartWatchDevXML();
            }
        }
Ejemplo n.º 19
0
 private void Awake()
 {
     bepinex = gameObject;
     harmony = new Harmony($"{GUID}.harmony");
     HarmonyWrapper.PatchAll(typeof(Hooks), harmony);
     StudioSaveLoadApi.RegisterExtraBehaviour <SceneDataController>(GUID);
 }
Ejemplo n.º 20
0
        private void Main()
        {
            Logger = base.Logger;

            //Don't even bother if there's no mods directory
            if (!Directory.Exists(Path.Combine(Paths.GameRootPath, "mods")) || !Directory.Exists(Paths.PluginPath))
            {
                Logger.Log(LogLevel.Warning, "KK_GUIDMigration was not loaded due to missing mods folder.");
                return;
            }

            //Only do migration if there's a .csv file and it has stuff in it
            if (!File.Exists(GUIDMigrationFilePath))
            {
                Logger.Log(LogLevel.Error | LogLevel.Message, "KK_GUIDMigration was not loaded due to missing KK_GUIDMigration.csv file.");
                return;
            }

            GenerateMigrationInfo();
            if (MigrationInfoList.Count == 0)
            {
                Logger.Log(LogLevel.Error | LogLevel.Message, "KK_GUIDMigration was not loaded due to empty KK_GUIDMigration.csv file.");
                return;
            }

            HarmonyWrapper.PatchAll(typeof(Hooks));
        }
        public SceneFolders()
        {
            _folderTreeView = new FolderTreeView(Utils.NormalizePath(UserData.Path), Path.Combine(Utils.NormalizePath(UserData.Path), @"studio\scene"));
            _folderTreeView.CurrentFolderChanged = OnFolderChanged;

            HarmonyWrapper.PatchAll(typeof(SceneFolders));
        }
Ejemplo n.º 22
0
        public HCSLoader()
        {
            Logger = base.Logger;

            var harmonyInstance = HarmonyWrapper.PatchAll();

            harmonyInstance.Patch(AccessTools.Constructor(typeof(Game), Type.EmptyTypes), postfix: new HarmonyMethod(typeof(HCSLoader), nameof(LoadGirlsHook)));

            string modsDirectory = Path.Combine(Paths.GameRootPath, "Mods");

            if (!Directory.Exists(modsDirectory))
            {
                Directory.CreateDirectory(modsDirectory);
            }

            foreach (var subdir in Directory.GetDirectories(modsDirectory, "*", SearchOption.TopDirectoryOnly))
            {
                if (CharacterAdditionMod.TryLoad(subdir, out var addMod))
                {
                    CharacterAdditions.Add(addMod);
                }
                else if (CharacterModificationMod.TryLoad(subdir, out var editMod))
                {
                    CharacterModifications.Add(editMod);
                }
                else
                {
                    Logger.LogWarning($"Unknown mod type for folder '{Path.GetFileName(subdir)}', skipping");
                }
            }

            Logger.Log(LogLevel.Message, $"Found {CharacterAdditions.Count + CharacterModifications.Count} mods.");
        }
Ejemplo n.º 23
0
        private void Start()
        {
            Logger = base.Logger;

            try
            {
                // Load male animation clips for overriding
                var ab   = AssetBundle.LoadFromFile(Application.dataPath + @"\..\abdata\animator\action\male\00.unity3d");
                var anim = ab.LoadAsset <RuntimeAnimatorController>("m_player.controller");
                MaleAnimations = anim.animationClips.ToArray();
                ab.Unload(false);
                Destroy(anim);
            }
            catch (Exception ex)
            {
                Logger.LogError("Failed to read male player animation data - " + ex);
            }

            if (MaleAnimations != null && MaleAnimations.Any())
            {
                CharacterApi.RegisterExtraBehaviour <ReverseTrapController>(GUID);

                MakerAPI.RegisterCustomSubCategories += MakerAPI_RegisterCustomSubCategories;

                HarmonyWrapper.PatchAll(typeof(Hooks));
            }
        }
Ejemplo n.º 24
0
        private void Awake()
        {
            Logger  = base.Logger;
            bepinex = gameObject;

            POVKey           = Config.Bind(SECTION_HOTKEYS, "Toggle POV", new KeyboardShortcut(KeyCode.Backspace), new ConfigDescription(DESCRIPTION_POVHOTKEY));
            POVHotkey        = new KeyboardShortcutHotkey(POVKey.Value, 0.3f);
            DefaultFOV       = Config.Bind(SECTION_GENERAL, "Default FOV", 70f, new ConfigDescription("", new AcceptableValueRange <float>(20f, 120f)));
            MouseSensitivity = Config.Bind(SECTION_GENERAL, "Mouse sensitivity", 1f, new ConfigDescription("", new AcceptableValueRange <float>(0.1f, 2f)));
            DefaultNeckMode  = Config.Bind(SECTION_GENERAL, "Default rotation mode", NeckMode.Both);

            FemaleOffsetX = Config.Bind(SECTION_OFFSETS, "Female offset X", 0f, new ConfigDescription("", null, new ConfigurationManagerAttributes {
                IsAdvanced = true
            }));
            FemaleOffsetY = Config.Bind(SECTION_OFFSETS, "Female offset Y", 0.0315f, new ConfigDescription("", null, new ConfigurationManagerAttributes {
                IsAdvanced = true
            }));
            FemaleOffsetZ = Config.Bind(SECTION_OFFSETS, "Female offset Z", 0f, new ConfigDescription("", null, new ConfigurationManagerAttributes {
                IsAdvanced = true
            }));

            MaleOffsetX = Config.Bind(SECTION_OFFSETS, "Male offset X", 0f, new ConfigDescription("", null, new ConfigurationManagerAttributes {
                IsAdvanced = true
            }));
            MaleOffsetY = Config.Bind(SECTION_OFFSETS, "Male offset Y", 0.092f, new ConfigDescription("", null, new ConfigurationManagerAttributes {
                IsAdvanced = true
            }));
            MaleOffsetZ = Config.Bind(SECTION_OFFSETS, "Male offset Z", 0.12f, new ConfigDescription("", null, new ConfigurationManagerAttributes {
                IsAdvanced = true
            }));

            harmony = HarmonyWrapper.PatchAll();
        }
Ejemplo n.º 25
0
        internal void Main()
        {
            HarmonyWrapper.PatchAll(typeof(KK_EyeShaking));
            CharacterApi.RegisterExtraBehaviour <EyeShakingController>(GUID);

            Enabled = Config.AddSetting("Config", "Enabled", true, "When enabled, virgins in H scenes will appear to have shaking eye highlights");
        }
Ejemplo n.º 26
0
 private void Main()
 {
     Enabled = Config.GetSetting("Settings", "Enabled", true, new ConfigDescription("Whether the plugin is enabled"));
     Enabled.SettingChanged += Enabled_SettingChanged;
     _enabled = Enabled.Value;
     HarmonyWrapper.PatchAll(typeof(Demosaic));
 }
Ejemplo n.º 27
0
        private void Awake()
        {
            HideHead = Config.Bind(SECTION_GENERAL, "Hide Head", true, DESCRIPTION_HIDE_HEAD);

            Sensitivity      = Config.Bind(SECTION_CAMERA, "Camera Sensitivity", 2f);
            FoV              = Config.Bind(SECTION_CAMERA, "Field of View", 70f);
            ZoomFoV          = Config.Bind(SECTION_CAMERA, "Zoom Field of View", 5f);
            OffsetX          = Config.Bind(SECTION_CAMERA, "Offset X", 0f, DESCRIPTION_OFFSET_X);
            OffsetY          = Config.Bind(SECTION_CAMERA, "Offset Y", 0f, DESCRIPTION_OFFSET_Y);
            OffsetZ          = Config.Bind(SECTION_CAMERA, "Offset Z", 0.15f, DESCRIPTION_OFFSET_Z);
            CameraMinX       = Config.Bind(SECTION_CAMERA, "Min Camera Angle X", 80f, DESCRIPTION_CAMERA_MIN_X);
            CameraMaxX       = Config.Bind(SECTION_CAMERA, "Max Camera Angle X", 80f, DESCRIPTION_CAMERA_MAX_X);
            CameraSpanY      = Config.Bind(SECTION_CAMERA, "Camera Angle Span Y", 70f, DESCRIPTION_CAMERA_SPAN_Y);
            CameraNormalize  = Config.Bind(SECTION_CAMERA, "Normalize Camera Z-Axis", false, DESCRIPTION_CAMERA_NORMALIZE);
            CameraSmoothness = Config.Bind(SECTION_CAMERA, "Camera Smoothness", 0, new ConfigDescription(DESCRIPTION_CAMERA_SMOOTHNESS, new AcceptableValueRange <int>(0, 90)));
            CameraHeadRotate = Config.Bind(SECTION_CAMERA, "Rotate Head to Camera", false, DESCRIPTION_CAMERA_HEAD_ROTATE);

            PoVKey          = Config.Bind(SECTION_HOTKEYS, "PoV Toggle Key", new KeyboardShortcut(KeyCode.Comma));
            CharaCycleKey   = Config.Bind(SECTION_HOTKEYS, "Character Cycle Key", new KeyboardShortcut(KeyCode.Period), DESCRIPTION_CHARA_CYCLE_KEY);
            LockOnKey       = Config.Bind(SECTION_HOTKEYS, "Lock-On Key", new KeyboardShortcut(KeyCode.Semicolon), DESCRIPTION_LOCK_ON_KEY);
            CameraDragKey   = Config.Bind(SECTION_HOTKEYS, "Camera Drag Key", new KeyboardShortcut(KeyCode.Mouse0), DESCRIPTION_CAMERA_DRAG_KEY);
            ToggleCursorKey = Config.Bind(SECTION_HOTKEYS, "Toggle Cursor Key", new KeyboardShortcut(KeyCode.LeftControl), DESCRIPTION_TOGGLE_CURSOR_KEY);
            ZoomKey         = Config.Bind(SECTION_HOTKEYS, "Zoom Key", new KeyboardShortcut(KeyCode.X));

            HideHead.SettingChanged += (sender, args) =>
                                       Controller.RefreshChaControl();

            CameraSmoothness.SettingChanged += (sender, args) =>
                                               Controller.cameraSmoothness = CameraSmoothness.Value / 100f;

            Controller.cameraSmoothness = CameraSmoothness.Value / 100f;

            HarmonyWrapper.PatchAll(typeof(HS2_PovX));
        }
Ejemplo n.º 28
0
        private void Awake()
        {
            bepinex = gameObject;
            Logger  = base.Logger;

            TargetData.LoadData();

            TrackingSpeedNormal = Config.Bind(SECTION_GENERAL, "Tracking speed", 0.1f, new ConfigDescription(DESCRIPTION_TRACKSPEED, new AcceptableValueRange <float>(0.01f, 0.3f), new ConfigurationManagerAttributes {
                Order = 10
            }));
            ScrollThroughMalesToo = Config.Bind(SECTION_GENERAL, "Scroll through males too", true, new ConfigDescription(DESCRIPTION_SCROLLMALES, null, new ConfigurationManagerAttributes {
                Order = 8
            }));
            ShowInfoMsg = Config.Bind(SECTION_GENERAL, "Show info messages", false, new ConfigDescription(DESCRIPTION_SHOWINFOMSG, null, new ConfigurationManagerAttributes {
                Order = 6
            }));
            LockLeashLength = Config.Bind(SECTION_GENERAL, "Leash length", 0f, new ConfigDescription(DESCRIPTION_LEASHLENGTH, new AcceptableValueRange <float>(0f, 0.5f), new ConfigurationManagerAttributes {
                Order = 9
            }));
            AutoSwitchLock = Config.Bind(SECTION_GENERAL, "Auto switch lock", false, new ConfigDescription(DESCRIPTION_AUTOLOCK, null, new ConfigurationManagerAttributes {
                Order = 7
            }));

            LockOnKey = Config.Bind(SECTION_HOTKEYS, "Lock on", new KeyboardShortcut(KeyCode.Mouse4), new ConfigDescription("", null, new ConfigurationManagerAttributes {
                Order = 10
            }));
            PrevCharaKey = Config.Bind(SECTION_HOTKEYS, "Select previous character", new KeyboardShortcut(KeyCode.None), new ConfigDescription("", null, new ConfigurationManagerAttributes {
                Order = 8
            }));
            NextCharaKey = Config.Bind(SECTION_HOTKEYS, "Select next character", new KeyboardShortcut(KeyCode.None), new ConfigDescription("", null, new ConfigurationManagerAttributes {
                Order = 9
            }));

            harmony = HarmonyWrapper.PatchAll();
        }
Ejemplo n.º 29
0
            internal static void InstallHooks()
            {
                var harmony = HarmonyWrapper.PatchAll(typeof(Hooks));

                ExtendedSave.CardBeingLoaded += ExtendedCardLoad;
                ExtendedSave.CardBeingSaved  += ExtendedCardSave;

                ExtendedSave.CoordinateBeingLoaded += ExtendedCoordinateLoad;
                ExtendedSave.CoordinateBeingSaved  += ExtendedCoordinateSave;

#if EC
                ExtendedSave.CardBeingImported       += ExtendedCardImport;
                ExtendedSave.CoordinateBeingImported += ExtendedCoordinateImport;
#else
                ExtendedSave.SceneBeingLoaded   += ExtendedSceneLoad;
                ExtendedSave.SceneBeingImported += ExtendedSceneImport;
#endif

#if KK
                harmony.Patch(typeof(Studio.SystemButtonCtrl).GetNestedType("AmplifyColorEffectInfo", AccessTools.all).GetMethod("OnValueChangedLut", AccessTools.all),
                              new HarmonyMethod(typeof(Hooks).GetMethod(nameof(OnValueChangedLutPrefix), AccessTools.all)), null);
                harmony.Patch(typeof(Studio.SystemButtonCtrl).GetNestedType("AmplifyColorEffectInfo", AccessTools.all).GetMethod("UpdateInfo", AccessTools.all), null,
                              new HarmonyMethod(typeof(Hooks).GetMethod(nameof(ACEUpdateInfoPostfix), AccessTools.all)));
                harmony.Patch(typeof(Studio.SystemButtonCtrl).GetNestedType("EtcInfo", AccessTools.all).GetMethod("UpdateInfo", AccessTools.all), null,
                              new HarmonyMethod(typeof(Hooks).GetMethod(nameof(ETCUpdateInfoPostfix), AccessTools.all)));
#endif

#if !EC
                DoingImport = false;
#endif
            }
Ejemplo n.º 30
0
        public void EmitDelegateTest()
        {
            CodeInstruction instruction = HarmonyWrapper.EmitDelegate <Action>(StaticAssets.TestStaticMethod);

            Assert.AreEqual(OpCodes.Call, instruction.opcode);
            Assert.IsTrue(instruction.operand is MethodInfo);

            instruction = HarmonyWrapper.EmitDelegate <Action>(() => StaticAssets.TestStaticField = 5);

            Assert.AreEqual(OpCodes.Call, instruction.opcode);
            Assert.IsTrue(instruction.operand is MethodInfo);

            CompileInstruction(instruction)();

            Assert.AreEqual(5, StaticAssets.TestStaticField);

            int dummy = 0;

            instruction = HarmonyWrapper.EmitDelegate <Action>(() => dummy = 15);

            Assert.AreEqual(OpCodes.Call, instruction.opcode);
            Assert.IsTrue(instruction.operand is MethodInfo);

            CompileInstruction(instruction)();

            Assert.AreEqual(15, dummy);
        }