Ejemplo n.º 1
0
        private void Awake()
        {
            Logger.LogInfo("Plugin starting");
            Log.Instance           = new Log(Logger);
            ContentServer.Instance = new ContentServer();

            Log.Instance.Info("Loading configuration and indexes");
            ContentServer.Instance.LoadConfiguration();
            ContentServer.Instance.LoadBundleIndexes();

            Log.Instance.Info("peppersprayContentBundleLoader items:");
            foreach (var item in ContentServer.Instance.ListItems <ContentItem>())
            {
                Log.Instance.Info(item.Mountpoint);
            }

            Log.Instance.Info("Patching game");
            var harmony = HarmonyWrapper.PatchAll();

            harmony.PatchAll();
        }
Ejemplo n.º 2
0
        private void Main()
        {
            //Get the juice texture used by females
            try
            {
                var mat = CommonLib.LoadAsset <Material>("chara/mm_base.unity3d", "cf_m_body");
                LiquidMask = mat.GetTexture("_liquidmask");
            }
            catch
            {
                Logger.LogError($"[{nameof(KK_MaleJuice)}] Could not load juice textures.");
            }

            if (LiquidMask == null)
            {
                return;
            }

            CharacterApi.RegisterExtraBehaviour <MaleJuiceCharaController>(GUID);
            HarmonyWrapper.PatchAll(typeof(KK_MaleJuice));
        }
Ejemplo n.º 3
0
        private void Main()
        {
            Logger = base.Logger;

            GenderBender              = Config.GetSetting("Config", "Genderbender Allowed", true, new ConfigDescription("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."));
            DefaultMaleBody           = Config.GetSetting("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."));
            DefaultMalePenis          = Config.GetSetting("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."));
            DefaultMaleBalls          = Config.GetSetting("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."));
            DefaultFemaleBody         = Config.GetSetting("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."));
            DefaultFemalePenis        = Config.GetSetting("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."));
            DefaultFemaleBalls        = Config.GetSetting("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."));
            DefaultFemaleDisplayBalls = Config.GetSetting("Config", "Default Female Balls Display", false, new ConfigDescription("Whether balls will be displayed on females if not otherwise configured."));

            PopulateUncensorLists();

            MakerAPI.RegisterCustomSubCategories += MakerAPI_RegisterCustomSubCategories;
            MakerAPI.MakerFinishedLoading        += MakerAPI_MakerFinishedLoading;
            CharacterApi.RegisterExtraBehaviour <UncensorSelectorController>(GUID);

            HarmonyWrapper.PatchAll(typeof(Hooks));
        }
        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(Hooks));
        }
        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)));
            }
        }
Ejemplo n.º 6
0
        internal void Awake()
        {
            Logger   = base.Logger;
            Instance = this;

            ShowSubtitles = Config.Bind("Config", "Show Subtitles", true, new ConfigDescription("Enable or disable showing subtitles.", null, new ConfigurationManagerAttributes {
                Order = 10
            }));
            SubtitleDirectory = Config.Bind("Config", "Subtitle Directory", $"Translation\\{PluginNameInternal}", new ConfigDescription("Directory containing subtitle xml info, relative to the BepInEx folder.", null, new ConfigurationManagerAttributes {
                Order = 9
            }));
            FontSize = Config.Bind("Config", "Font Size", -5, new ConfigDescription("Font size of subtitles.", null, new ConfigurationManagerAttributes {
                Order = 8
            }));
            FontStyle = Config.Bind("Config", "Font Style", UnityEngine.FontStyle.Bold, new ConfigDescription("Font style of subtitles, i.e. bold, italic, etc.", null, new ConfigurationManagerAttributes {
                Order = 7
            }));
            TextAlign = Config.Bind("Config", "Text Align", TextAnchor.LowerCenter, new ConfigDescription("Text alignment of subtitles.", null, new ConfigurationManagerAttributes {
                Order = 6
            }));
            TextOffset = Config.Bind("Config", "Text Offset", 10, new ConfigDescription("Distance from edge of the screen.", null, new ConfigurationManagerAttributes {
                Order = 5
            }));
            OutlineThickness = Config.Bind("Config", "Outline Thickness", 2, new ConfigDescription("Outline thickness for subtitle text.", null, new ConfigurationManagerAttributes {
                Order = 4
            }));
            TextColor = Config.Bind("Config", "Text Color", ColorUtility.TryParseHtmlString("#FFCCFFFF", out Color color) ? color : Color.magenta, new ConfigDescription("Subtitle text color.", null, new ConfigurationManagerAttributes {
                Order = 3
            }));
            OutlineColor = Config.Bind("Config", "Outline Color", Color.black, new ConfigDescription("Subtitle text outline color.", null, new ConfigurationManagerAttributes {
                Order = 2
            }));

            TextAlign.SettingChanged += TextAlign_SettingChanged;

            LoadSubtitles();

            HarmonyWrapper.PatchAll(typeof(Hooks));
        }
Ejemplo n.º 7
0
        public static void Subscribe(SubscriptionBundle bundle)
        {
            if (bundle.update != null)
            {
                updates.Add(bundle);
            }

            if (bundle.lateUpdate != null)
            {
                lateUpdates.Add(bundle);
            }

            if (bundle.onGUI != null)
            {
                onGUIs.Add(bundle);
            }

            if (bundle.patch)
            {
                bundle.harmony = HarmonyWrapper.PatchAll(bundle.source);
            }
        }
Ejemplo n.º 8
0
        private void Awake()
        {
            heightEnabled = Config.AddSetting("Config", "Edit Male Height", true, new ConfigDescription("If the male height can be edited. \nRequires passing a loading screen to take effect. \nDisabling this will also prevent any male cards from\nbeing loaded with edited heights.", null, new ConfigurationManagerAttributes {
                Order = 3
            }));

            hairEnabled = Config.AddSetting("Config", "Edit Male Underhair", true, new ConfigDescription("If the male underhair can be edited. \n Requires passing a loading screen to take effect.", null, new ConfigurationManagerAttributes {
                Order = 2
            }));

            compatabilityMode = Config.AddSetting("Config", "Compatability Mode", true, new ConfigDescription("When enabled, male characters not specifically saved with edited\nheights will be defaulted to 60 (the default behaviour for the game).", null, new ConfigurationManagerAttributes {
                IsAdvanced = true, Order = 1
            }));

            instance = this;

            Hooks.isDark = typeof(ChaControl).GetProperties(AccessTools.all).Any(p => p.Name == "exType");

            CharacterApi.RegisterExtraBehaviour <MaleHeightCompatabilityController>(GUID);

            HarmonyWrapper.PatchAll(typeof(Hooks));
        }
Ejemplo n.º 9
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);
            }
        }
Ejemplo n.º 10
0
        private void Awake()
        {
            Logger = base.Logger;
            HarmonyWrapper.PatchAll();

            if (File.Exists(savePath))
            {
                try
                {
                    var json = File.ReadAllText(savePath);
                    data = JSONSerializer.Deserialize <ParamData>(json);
                }
                catch (Exception ex)
                {
                    Logger.Log(LogLevel.Error, $"[DefaultParamEditor] Failed to load settings from {savePath} with error: " + ex);
                    data = new ParamData();
                }
            }

            CharacterParam.Init(data.charaParamData);
            SceneParam.Init(data.sceneParamData);
        }
Ejemplo n.º 11
0
        private void Start()
        {
            _logsource = Logger;
            HarmonyWrapper.PatchAll(typeof(Hooks));

            GenderBender = Config.Wrap("Config", "Genderbender Allowed", "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.", true);
            DefaultMaleBody = Config.Wrap("Config", "Default Male Body", "Body to use if the character does not have one set. " +
                                          "The censored body will not be selected randomly if there are any alternatives.", "Random");
            DefaultMalePenis = Config.Wrap("Config", "Default Male Penis", "Penis to use if the character does not have one set. " +
                                           "The mosaic penis will not be selected randomly if there are any alternatives.", "Random");
            DefaultMaleBalls = Config.Wrap("Config", "Default Male Balls", "Balls to use if the character does not have one set. " +
                                           "The mosaic penis will not be selected randomly if there are any alternatives.", "Random");
            DefaultFemaleBody = Config.Wrap("Config", "Default Female Body", "Body to use if the character does not have one set. " +
                                            "The censored body will not be selected randomly if there are any alternatives.", "Random");
            DefaultFemalePenis = Config.Wrap("Config", "Default Female Penis", "Penis to use if the character does not have one set. " +
                                             "The mosaic penis will not be selected randomly if there are any alternatives.", "Random");
            DefaultFemaleBalls = Config.Wrap("Config", "Default Female Balls", "Balls to use if the character does not have one set. " +
                                             "The mosaic penis will not be selected randomly if there are any alternatives.", "Random");
            DefaultFemaleDisplayBalls = Config.Wrap("Config", "Default Female Balls Display", "Whether balls will be displayed on females if not otherwise configured.", false);
        }
Ejemplo n.º 12
0
        private void Start()
        {
            Logger    = base.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(AIHeelz));

            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.º 13
0
        public static void Initialize()
        {
            if (!Configuration.I2Translation.DumpTexts.Value)
            {
                return;
            }

            if (!initialized)
            {
                HarmonyWrapper.PatchAll(typeof(I2TranslationDump));
            }

            initialized = true;
            DumpedTerms.Clear();

            var langPath = Path.Combine(Paths.TranslationsRoot, Core.CurrentSelectedLanguage);
            var dumpPath = Path.Combine(langPath, "UI_Dump");

            extractPath = Path.Combine(dumpPath, DateTime.Now.ToString("yyyy_MM_dd__HHmmss"));

            Core.Logger.LogInfo($"[I2Loc] creating UI dumps to {extractPath}");
            Directory.CreateDirectory(extractPath);
        }
        internal void Main()
        {
            MakerAPI.RegisterCustomSubCategories += MakerAPI_RegisterCustomSubCategories;
            MakerAPI.MakerExiting += (s, e) => CharacterSliderTemplate = new Dictionary <string, float>();

            foreach (var type in typeof(CvsAccessory).Assembly.GetTypes())
            {
                if (type.Name.StartsWith("Cvs", StringComparison.OrdinalIgnoreCase) && type != typeof(CvsDrawCtrl) && type != typeof(CvsColor))
                {
                    var fields = type.GetFields(AccessTools.all);

                    var sliders = fields.Where(x => typeof(Slider).IsAssignableFrom(x.FieldType)).ToList();
                    if (sliders.Count == 0)
                    {
                        continue;
                    }

                    CharaMakerSliders.Add(new CharaMakerSlider(type, sliders));
                }
            }

            HarmonyWrapper.PatchAll(typeof(KK_RandomCharacterGenerator));
        }
Ejemplo n.º 15
0
        private void Awake()
        {
            MOVE_RATIO   = Config.AddSetting(SECTION_GENERAL, "Move ratio", 2.5f, new ConfigDescription("", new AcceptableValueRange <float>(0f, 10f)));
            ROTATE_RATIO = Config.AddSetting(SECTION_GENERAL, "Rotate ratio", 90f, new ConfigDescription("", new AcceptableValueRange <float>(0f, 360f)));
            SCALE_RATIO  = Config.AddSetting(SECTION_GENERAL, "Scaling ratio", 0.5f, new ConfigDescription("", new AcceptableValueRange <float>(0f, 2f)));

            KEY_OBJ_MOVE_XZ = Config.AddSetting(SECTION_HOTKEYS, "Move XZ", new KeyboardShortcut(KeyCode.G));
            KEY_OBJ_MOVE_Y  = Config.AddSetting(SECTION_HOTKEYS, "Move Y", new KeyboardShortcut(KeyCode.H));

            KEY_OBJ_ROT_X   = Config.AddSetting(SECTION_HOTKEYS, "Rotate X (Local)", new KeyboardShortcut(KeyCode.G, KeyCode.LeftShift));
            KEY_OBJ_ROT_Y   = Config.AddSetting(SECTION_HOTKEYS, "Rotate Y (Local)", new KeyboardShortcut(KeyCode.H, KeyCode.LeftShift));
            KEY_OBJ_ROT_Z   = Config.AddSetting(SECTION_HOTKEYS, "Rotate Z (Local)", new KeyboardShortcut(KeyCode.Y, KeyCode.LeftShift));
            KEY_OBJ_ROT_X_2 = Config.AddSetting(SECTION_HOTKEYS, "Rotate X (World)", new KeyboardShortcut(KeyCode.G));
            KEY_OBJ_ROT_Y_2 = Config.AddSetting(SECTION_HOTKEYS, "Rotate Y (World)", new KeyboardShortcut(KeyCode.H));
            KEY_OBJ_ROT_Z_2 = Config.AddSetting(SECTION_HOTKEYS, "Rotate Z (World)", new KeyboardShortcut(KeyCode.Y));

            KEY_OBJ_SCALE_ALL = Config.AddSetting(SECTION_HOTKEYS, "Scale All", new KeyboardShortcut(KeyCode.T));
            KEY_OBJ_SCALE_X   = Config.AddSetting(SECTION_HOTKEYS, "Scale X", new KeyboardShortcut(KeyCode.G));
            KEY_OBJ_SCALE_Y   = Config.AddSetting(SECTION_HOTKEYS, "Scale Y", new KeyboardShortcut(KeyCode.H));
            KEY_OBJ_SCALE_Z   = Config.AddSetting(SECTION_HOTKEYS, "Scale Z", new KeyboardShortcut(KeyCode.Y));

            bepinex = gameObject;
            harmony = HarmonyWrapper.PatchAll(typeof(Hooks));
        }
Ejemplo n.º 16
0
        internal void Main()
        {
            Logger = base.Logger;
            Directory.CreateDirectory(ExportPath);

            MakerAPI.MakerBaseLoaded                   += MakerAPI_MakerBaseLoaded;
            MakerAPI.RegisterCustomSubCategories       += MakerAPI_RegisterCustomSubCategories;
            AccessoriesApi.SelectedMakerAccSlotChanged += AccessoriesApi_SelectedMakerAccSlotChanged;
            AccessoriesApi.AccessoryKindChanged        += AccessoriesApi_AccessoryKindChanged;
            AccessoriesApi.AccessoryTransferred        += AccessoriesApi_AccessoryTransferred;

            CharacterApi.RegisterExtraBehaviour <MaterialEditorCharaController>(GUID);

#if KK
            SceneManager.sceneLoaded         += (s, lsm) => InitStudioUI(s.name);
            AccessoriesApi.AccessoriesCopied += AccessoriesApi_AccessoriesCopied;
            StudioSaveLoadApi.RegisterExtraBehaviour <MaterialEditorSceneController>(GUID);
#endif

            AdvancedMode = Config.AddSetting("Config", "Enable advanced editing", false, "Enables advanced editing of characters in the character maker. Note: Some textures and colors will override chracter maker selections but will not always appear to do so, especially after changing them from the in game color pickers. Save and reload to see the real effects.\nUse at your own risk.");

            LoadXML();
            var harmony = HarmonyWrapper.PatchAll(typeof(Hooks));

#if AI
            foreach (var method in typeof(CharaCustom.CustomClothesPatternSelect).GetMethods().Where(x => x.Name.Contains("<ChangeLink>")))
            {
                harmony.Patch(method, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.OverrideHook), AccessTools.all)));
            }

            foreach (var method in typeof(CharaCustom.CustomClothesColorSet).GetMethods().Where(x => x.Name.Contains("<Initialize>")))
            {
                harmony.Patch(method, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.OverrideHook), AccessTools.all)));
            }
#endif
        }
Ejemplo n.º 17
0
        public static void InstallHooks()
        {
            if (!StudioAPI.InsideStudio)
            {
                var instance = HarmonyWrapper.PatchAll(typeof(HSceneTriggers));

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

                    // 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.º 18
0
        private void Awake()
        {
            CaptureWidth      = Config.Bind("Rendered screenshots", "Screenshot width", Screen.width, new ConfigDescription("Screenshot width in pixels", new AcceptableValueRange <int>(1, 10000)));
            CaptureHeight     = Config.Bind("Rendered screenshots", "Screenshot height", Screen.height, new ConfigDescription("Screenshot height in pixels", new AcceptableValueRange <int>(1, 10000)));
            Downscaling       = Config.Bind("Rendered screenshots", "Upsampling ratio", 2, new ConfigDescription("Render the scene in x times larger resolution, then downscale it to the correct size. Improves screenshot quality at cost of more RAM usage and longer capture times.\n\nBE CAREFUL, SETTING THIS TOO HIGH CAN AND WILL CRASH THE GAME BY RUNNING OUT OF RAM.", new AcceptableValueRange <int>(1, 4)));
            Alpha             = Config.Bind("Rendered screenshots", nameof(Alpha), true, new ConfigDescription("When capturing the screenshot make the background transparent. Only works if the background is a 2D image, not a 3D object like a map."));
            ScreenshotMessage = Config.Bind("General", "Show messages on screen", true, new ConfigDescription("Whether screenshot messages will be displayed on screen. Messages will still be written to the log."));

            CustomShadowResolution = Config.Bind("Rendered screenshots", "Shadow resolution override", 8192, new ConfigDescription("By default, shadow map resolution is computed from its importance on screen. Setting this to a value greater than zero will override that behavior. Please note that the shadow map resolution will still be capped by memory and hardware limits.", new AcceptableValueList <int>(0, 4096, 8192, 16384, 32768)));

            ShadowCascadeOverride = Config.Bind("Rendered screenshots", "Shadow cascade override", ShadowCascades.Four, new ConfigDescription("When capturing screenshots, different shadow cascade values may look better. Override it or keep the current value."));
            DisableAO             = Config.Bind("Rendered screenshots", "Disable AO", DisableAOSetting.WhenUpsampling, new ConfigDescription("When capturing screenshots, upsampling can cause ambient occlusion to start banding and produce weird effects on the end image. Change this setting to disable AO when capturing the screenshot."));

            KeyCaptureNormal = Config.Bind("Hotkeys", "Capture normal screenshot", new KeyboardShortcut(KeyCode.F9), "Capture a screenshot \"as you see it\". Includes interface and such.");
            KeyCaptureRender = Config.Bind("Hotkeys", "Capture rendered screenshot", new KeyboardShortcut(KeyCode.F11), "Capture a rendered screenshot with no interface. Controlled by other settings.");

            var ab = AssetBundle.LoadFromMemory(Properties.Resources.composite);

            _matComposite = new Material(ab.LoadAsset <Shader>("composite"));
            _matScale     = new Material(ab.LoadAsset <Shader>("resize"));
            ab.Unload(false);

            HarmonyWrapper.PatchAll(typeof(Hooks));
        }
Ejemplo n.º 19
0
        internal void Main()
        {
            Logger = base.Logger;
            Directory.CreateDirectory(ExportPath);

            MakerAPI.MakerBaseLoaded                   += MakerAPI_MakerBaseLoaded;
            MakerAPI.RegisterCustomSubCategories       += MakerAPI_RegisterCustomSubCategories;
            AccessoriesApi.SelectedMakerAccSlotChanged += AccessoriesApi_SelectedMakerAccSlotChanged;
            AccessoriesApi.AccessoryKindChanged        += AccessoriesApi_AccessoryKindChanged;

            CharacterApi.RegisterExtraBehaviour <MaterialEditorCharaController>(GUID);

#if KK || AI
            SceneManager.sceneLoaded += (s, lsm) => InitStudioUI(s.name);
            StudioSaveLoadApi.RegisterExtraBehaviour <MaterialEditorSceneController>(GUID);
#endif
#if KK
            AccessoriesApi.AccessoryTransferred += AccessoriesApi_AccessoryTransferred;
            AccessoriesApi.AccessoriesCopied    += AccessoriesApi_AccessoriesCopied;
#endif

            LoadXML();
            var harmony = HarmonyWrapper.PatchAll(typeof(Hooks));

#if AI
            foreach (var method in typeof(CharaCustom.CustomClothesPatternSelect).GetMethods().Where(x => x.Name.Contains("<ChangeLink>")))
            {
                harmony.Patch(method, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.OverrideHook), AccessTools.all)));
            }

            foreach (var method in typeof(CharaCustom.CustomClothesColorSet).GetMethods().Where(x => x.Name.Contains("<Initialize>")))
            {
                harmony.Patch(method, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.OverrideHook), AccessTools.all)));
            }
#endif
        }
Ejemplo n.º 20
0
        internal void Start()
        {
            Logger   = base.Logger;
            instance = this;

            CharacterApi.RegisterExtraBehaviour <AccStateSyncController>(GUID);
            MoreAccessories_Support.LoadAssembly();

            CoroutineSlotChangeDelay = Config.Bind("Maker", "Slot Change Delay", 1f, new ConfigDescription("", null, new ConfigurationManagerAttributes {
                IsAdvanced = true, Order = 2
            }));
            CoroutineCounterMax = Config.Bind("Maker", "Maximun Coroutine Counter", 30f, new ConfigDescription("", null, new ConfigurationManagerAttributes {
                IsAdvanced = true, Order = 1
            }));
            CharaMakerPreview = Config.Bind("Maker", "CharaMaker Force Preview", true, new ConfigDescription("", null, new ConfigurationManagerAttributes {
                Order = 10
            }));
            CharaMakerPreview.SettingChanged += (sender, args) =>
            {
                if (MakerAPI.InsideMaker)
                {
                    CharaMakerPreviewSidebarToggle.Value = CharaMakerPreview.Value;
                    if (CharaMakerPreviewSidebarToggle.Value)
                    {
                        GetController(MakerAPI.GetCharacterControl()).SyncAllAccToggle();
                    }
                }
            };

//			MakerAPI.MakerBaseLoaded += MakerAPI_MakerBaseLoaded;
            MakerAPI.MakerFinishedLoading += (object sender, EventArgs e) => CreateMakerInterface();

            AccessoriesApi.SelectedMakerAccSlotChanged += (object sender, AccessorySlotEventArgs eventArgs) => GetController(MakerAPI.GetCharacterControl()).AccSlotChangedHandler(eventArgs.SlotIndex);
            AccessoriesApi.AccessoryTransferred        += (object sender, AccessoryTransferEventArgs eventArgs) => GetController(MakerAPI.GetCharacterControl()).AccessoryTransferredHandler(eventArgs.SourceSlotIndex, eventArgs.DestinationSlotIndex);
            AccessoriesApi.AccessoriesCopied           += (object sender, AccessoryCopyEventArgs eventArgs) => GetController(MakerAPI.GetCharacterControl()).AccessoriesCopiedHandler((int)eventArgs.CopySource, (int)eventArgs.CopyDestination, eventArgs.CopiedSlotIndexes.ToList());

            MakerAPI.RegisterCustomSubCategories += (sender, e) =>
            {
                CharaMakerPreviewSidebarToggle = e.AddSidebarControl(new SidebarToggle("Force Preview", CharaMakerPreview.Value, this));
                CharaMakerPreviewSidebarToggle.ValueChanged.Subscribe(b => CharaMakerPreview.Value = b);
            };
            MakerAPI.MakerExiting += (sender, e) =>
            {
                CharaMakerPreviewSidebarToggle = null;
            };

            StudioAPI.StudioLoadedChanged += (sender, e) => RegisterStudioControls();
            GameAPI.StartH += (sender, e) => { InsideHScene = true; UpdateHUI(); };
            GameAPI.EndH   += (sender, e) => { InsideHScene = false; HSprites.Clear(); };

            HarmonyWrapper.PatchAll(typeof(Hooks));

            if (UnityEngine.Application.dataPath.EndsWith("KoikatuVR_Data"))
            {
                HarmonyWrapper.PatchAll(typeof(HooksVR));
            }

            foreach (var key in System.Enum.GetValues(typeof(ChaAccessoryDefine.AccessoryParentKey)))
            {
                AccParentNames[key.ToString()] = ChaAccessoryDefine.dictAccessoryParent[(int)key];
            }
        }
Ejemplo n.º 21
0
 private void Awake() => HarmonyWrapper.PatchAll(GetType());
 internal static void InstallHooks() => HarmonyWrapper.PatchAll(typeof(Hooks));
Ejemplo n.º 23
0
 public static void Init()
 {
     HarmonyWrapper.PatchAll(typeof(Hooks));
 }
 public static void Init()
 {
     HarmonyWrapper.PatchAll(typeof(VoicePitchUnlocker));
 }
Ejemplo n.º 25
0
 private void Awake()
 {
     HarmonyWrapper.PatchAll(typeof(StudioOptimizations));
 }
Ejemplo n.º 26
0
 internal void Start() => HarmonyWrapper.PatchAll(typeof(Hooks));
Ejemplo n.º 27
0
 internal void Main() => HarmonyWrapper.PatchAll(typeof(KK_AnimationOverdrive));
Ejemplo n.º 28
0
        internal void Start()
        {
            Logger = base.Logger;

            ConfigEnablePushup = Config.Bind("Config", "Enable Pushup By Default", false, new ConfigDescription("Whether the pushup effect is enabled by default when a bra is worn.", null, new ConfigurationManagerAttributes {
                Order = 10
            }));
            ConfigFirmnessDefault = Config.Bind("Config", "Firmness Default Value", 0.9f, new ConfigDescription("Firmness of the breasts. More firm means less bounce.", new AcceptableValueRange <float>(0f, 1f), new ConfigurationManagerAttributes {
                Order = 9
            }));
            ConfigLiftDefault = Config.Bind("Config", "Lift Default Value", 0.6f, new ConfigDescription("Lift of the breasts. Lift is the minimum height position of the breasts when a bra is worn.", new AcceptableValueRange <float>(0f, 1f), new ConfigurationManagerAttributes {
                Order = 8
            }));
            ConfigPushTogetherDefault = Config.Bind("Config", "Push Together Default Value", 0.55f, new ConfigDescription("How much the breasts will be pushed together when a bra is worn, if they are set far apart.", new AcceptableValueRange <float>(0f, 1f), new ConfigurationManagerAttributes {
                Order = 7
            }));
            ConfigSqueezeDefault = Config.Bind("Config", "Squeeze Default Value", 0.6f, new ConfigDescription("Long breasts will be flattened by this amount.", new AcceptableValueRange <float>(0f, 1f), new ConfigurationManagerAttributes {
                Order = 6
            }));
            ConfigNippleCenteringDefault = Config.Bind("Config", "Nipple Centering Default Value", 0.5f, new ConfigDescription("If the nipples point up or down, wearing a bra will make them point forwards.", new AcceptableValueRange <float>(0f, 1f), new ConfigurationManagerAttributes {
                Order = 5
            }));
            ConfigFlattenNipplesDefault = Config.Bind("Config", "Flatten Nipples Default", true, new ConfigDescription("Flatten nipples while a bra is worn.", null, new ConfigurationManagerAttributes {
                Order = 4
            }));
            ConfigSliderMin = Config.Bind("Config", "Advanced Mode Slider Minimum", -100, new ConfigDescription("Minimum value of advanced mode sliders.", new AcceptableValueRange <int>(-500, 0), new ConfigurationManagerAttributes {
                Order = 3
            }));
            ConfigSliderMax = Config.Bind("Config", "Advanced Mode Slider Maximum", 200, new ConfigDescription("Maximum value of advanced mode sliders.", new AcceptableValueRange <int>(100, 500), new ConfigurationManagerAttributes {
                Order = 2
            }));

            CharacterApi.RegisterExtraBehaviour <PushupController>(GUID);
            MakerAPI.RegisterCustomSubCategories += RegisterCustomSubCategories;
            MakerAPI.ReloadCustomInterface       += ReloadCustomInterface;
            MakerAPI.MakerExiting         += MakerExiting;
            MakerAPI.MakerFinishedLoading += MakerFinishedLoading;
            RegisterStudioControls();

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

            //Patch all the slider onValueChanged events to return false and cancel original code
            //Pushup adds its own onValueChanged event that manages this stuff
            foreach (var anonType in typeof(ChaCustom.CvsBreast).GetNestedTypes(AccessTools.all).Where(x => x.Name.Contains("<Start>")))
            {
                foreach (var anonTypeMethod in anonType.GetMethods(AccessTools.all).Where(x => x.Name.Contains("<>m")))
                {
                    if (anonTypeMethod.GetParameters().Any(x => x.ParameterType == typeof(float)))
                    {
                        harmony.Patch(anonTypeMethod, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.SliderHook), AccessTools.all)));
                    }
                }
            }

            var sliders = typeof(ChaCustom.CvsBreast).GetMethods(AccessTools.all).Where(x => x.Name.Contains("<Start>") && x.GetParameters().Any(y => y.ParameterType == typeof(float))).ToList();

            //Don't patch areola size or nipple gloss since they are not managed by this plugin
            foreach (var slider in sliders)
            {
                if (Application.productName == Constants.MainGameProcessName)
                {
                    if (slider.Name == "<Start>m__E")
                    {
                    }                                    //areola size
                    else if (slider.Name == "<Start>m__14")
                    {
                    }                                          //nipple gloss
                    else
                    {
                        harmony.Patch(slider, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.SliderHook), AccessTools.all)));
                    }
                }
                else if (Application.productName == Constants.MainGameProcessNameSteam)
                {
                    if (slider.Name == "<Start>m__10")
                    {
                    }                                     //areola size
                    else if (slider.Name == "<Start>m__17")
                    {
                    }                                          //nipple gloss
                    else
                    {
                        harmony.Patch(slider, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.SliderHook), AccessTools.all)));
                    }
                }
            }
        }
Ejemplo n.º 29
0
 public StudioCharaFolders()
 {
     HarmonyWrapper.PatchAll(typeof(StudioCharaFolders));
 }
Ejemplo n.º 30
0
 public static void Init()
 {
     HarmonyWrapper.PatchAll(typeof(HairUnlocker));
 }