├── Wiki Content ├── 1-1.png ├── 1-2.png ├── 1-3.png ├── 1-4.png ├── 1-5.png ├── 1-6.png ├── Example Zipmod.zip └── Example zipmod step-by-step guide.zip ├── lib └── PostProcessingRuntime.dll ├── src ├── Core_Screencap │ ├── Resources │ │ ├── screencap.unity3d │ │ └── EquirectangularConverter.unity3d │ ├── Pngcs │ │ ├── Zlib │ │ │ ├── EDeflateCompressStrategy.cs │ │ │ ├── DeflateCompressLevel.cs │ │ │ ├── ZlibInputStreamIs.cs │ │ │ ├── ZlibStreamFactory.cs │ │ │ ├── Adler32.cs │ │ │ ├── ZlibOutputStreamIs.cs │ │ │ ├── AZlibInputStream.cs │ │ │ ├── CRC32.cs │ │ │ └── AZlibOutputStream.cs │ │ ├── Chunks │ │ │ ├── PngChunkMultiple.cs │ │ │ ├── ChunkPredicateId.cs │ │ │ ├── ChunkPredicate.cs │ │ │ ├── ChunkPredicateId2.cs │ │ │ ├── PngChunkSingle.cs │ │ │ ├── ChunkLoadBehaviour.cs │ │ │ ├── ChunkPredicateEquiv.cs │ │ │ ├── PngChunkIEND.cs │ │ │ ├── PngChunkIDAT.cs │ │ │ ├── ChunkCopyBehaviour.cs │ │ │ ├── PngChunkIHDR.cs │ │ │ └── PngMetadata.cs │ │ ├── PngjException.cs │ │ ├── PngjOutputException.cs │ │ ├── PngjExceptionInternal.cs │ │ ├── PngjUnsupportedException.cs │ │ ├── PngCsUtils.cs │ │ ├── PngIDatChunkOutputStream.cs │ │ ├── FileHelper.cs │ │ ├── FilterType.cs │ │ └── ProgressiveOutputStream.cs │ ├── Config │ │ ├── NameFormat.cs │ │ ├── CameraGuideLinesType.cs │ │ └── AlphaMode.cs │ ├── Extensions.cs │ ├── Core_Screencap.shproj │ ├── shader_source │ │ ├── opaque_screencap.shader │ │ ├── rgAlpha2.shader │ │ ├── composite.shader │ │ ├── 3d_screencap.shader │ │ ├── Resize.shader │ │ └── EquirectangularConverter.shader │ └── BundleLoader.cs ├── Core_Screencap_KKEC │ ├── Resources │ │ ├── blackout.unity3d │ │ ├── composite.unity3d │ │ └── rgalpha.unity3d │ ├── Core_Screencap_KKEC.shproj │ ├── Core_Screencap.projitems │ └── ScreenshotManager.KKEC.Hooks.cs ├── Core_Screencap_AIHS2 │ ├── Resources │ │ └── composite.unity3d │ ├── AIHS2_Core_Screencap.projitems │ ├── Core_Screencap_AIHS2.shproj │ └── ScreenshotManager.AIHS2.Hooks.cs ├── EC_MessageCenter │ ├── EC.MessageCenter.cs │ └── Properties │ │ └── AssemblyInfo.cs ├── EC_Screencap │ ├── EC.ScreenshotManager.cs │ ├── EC.ScreenshotManager.Hooks.cs │ └── EC_Screencap.csproj ├── EC_ColorCorrector │ ├── EC.ColorCorrector.cs │ └── EC_ColorCorrector.csproj ├── EC_InputUnlocker │ ├── EC.InputUnlocker.cs │ └── EC_InputUnlocker.csproj ├── EC_SliderUnlocker │ ├── EC.SliderUnlocker.cs │ └── EC_SliderUnlocker.csproj ├── KKS_ColorCorrector │ ├── KKS.ColorCorrector.cs │ └── KKS_ColorCorrector.csproj ├── install.ps1 ├── Core_Sideloader │ ├── Core.Sideloader.ReflectionHelper.cs │ ├── UniversalAutoResolver │ │ ├── Core.UAR.MigrationType.cs │ │ ├── Core.UAR.FaceSkinInfo.cs │ │ └── Core.UAR.StructValue.cs │ ├── Core_Sideloader.shproj │ └── Core_Sideloader.projitems ├── KKS_Screencap │ ├── KKS.ScreenshotManager.cs │ └── KKS.ScreenshotManagerHooks.cs ├── AI_InputUnlocker │ ├── AI.InputUnlocker.cs │ └── AI_InputUnlocker.csproj ├── AI_ExtensibleSaveFormat │ ├── AI.ExtendedSave.cs │ ├── AI.ExtendedSave.Hooks.cs │ └── AI_ExtensibleSaveFormat.csproj ├── AI_Screencap │ ├── AI.ScreenshotManager.cs │ ├── AI.ScreenshotManager.Hooks.cs │ ├── shader_source │ │ ├── composite.shader │ │ └── Resize.shader │ └── AI_Screencap.csproj ├── IMGUIModule.Il2Cpp.CoreCLR.Patcher │ ├── Replacements │ │ ├── GUI.SliderState.cs │ │ ├── GUIStateObjects.cs │ │ ├── GUI.GUIStateObjects.cs │ │ └── GUILayoutGroup.cs │ ├── IMGUIModule.Il2Cpp.CoreCLR.Patcher.csproj.DotSettings │ └── IMGUIModule.Il2Cpp.CoreCLR.Patcher.csproj ├── HS2_InputUnlocker │ ├── HS2.InputUnlocker.cs │ └── HS2_InputUnlocker.csproj ├── KKS_InputUnlocker │ ├── KKS.InputUnlocker.cs │ └── KKS_InputUnlocker.csproj ├── HS2_ExtensibleSaveFormat │ ├── HS2.ExtendedSave.cs │ ├── HS2.ExtendedSave.Hooks.cs │ └── HS2_ExtensibleSaveFormat.csproj ├── HS2_Screencap │ ├── HS2.ScreenshotManager.cs │ └── HS2.ScreenshotManager.Hooks.cs ├── KK_Screencap │ ├── KK.ScreenshotManager.cs │ ├── KK.ScreenshotManagerHooks.cs │ └── KK_Screencap.csproj ├── KK_ColorCorrector │ ├── KK.ColorCorrector.cs │ └── KK_ColorCorrector.csproj ├── KKS_SliderUnlocker │ ├── KKS.SliderUnlocker.cs │ ├── KKS.SliderUnlocker.VoicePitch.cs │ └── KKS_SliderUnlocker.csproj ├── KK_InputUnlocker │ ├── KK.InputUnlocker.cs │ └── KK_InputUnlocker.csproj ├── KK_ExtensibleSaveFormat │ ├── KK.ExtendedSave.cs │ └── KK_ExtensibleSaveFormat.csproj ├── KKS_ExtensibleSaveFormat │ ├── KKS.ExtendedSave.cs │ ├── KKS.ExtendedSave.Events.cs │ └── KKS_ExtensibleSaveFormat.csproj ├── AI_Sideloader │ └── AI.Sideloader.cs ├── AC_BGMLoader │ └── AC_BGMLoader.csproj ├── Core_Sideloader_Studio │ ├── Core.Sideloader.Studio.cs │ ├── Core_Sideloader_Studio.shproj │ └── Core_Sideloader_Studio.projitems ├── KK_SliderUnlocker │ ├── KK.SliderUnlocker.cs │ ├── KK_SliderUnlocker.csproj │ └── KK.SliderUnlocker.VoicePitch.cs ├── HS2_Sideloader │ └── HS2.Sideloader.cs ├── Core_InputUnlocker │ ├── Core_InputUnlocker.projitems │ ├── Core_InputUnlocker.shproj │ └── Core.InputUnlocker.cs ├── Core_ColorCorrector │ ├── Core_ColorCorrector.projitems │ └── Core_ColorCorrector.shproj ├── KK_Sideloader │ └── KK.Sideloader.cs ├── Core_BGMLoader │ ├── Core.BGMLoader.AudioLoader.cs │ ├── Core_BGMLoader.projitems │ └── Core_BGMLoader.shproj ├── PH_SliderUnlocker │ ├── PH.SliderUnlocker.Hooks.cs │ └── PH_SliderUnlocker.csproj ├── Core_ExtensibleSaveFormat_Patcher │ ├── Core_ExtensibleSaveFormat_Patcher.projitems │ └── Core_ExtensibleSaveFormat_Patcher.shproj ├── HS_SliderUnlocker │ └── HS_SliderUnlocker.csproj ├── PH_ConfigurationManager │ └── PH_ConfigurationManager.csproj ├── PH_ExtensibleSaveFormat │ ├── ExtendedSave.PluginData.cs │ └── PH_ExtensibleSaveFormat.csproj ├── Core_ExtensibleSaveFormat │ ├── Core.ExtendedSave.PluginData.cs │ ├── Core_ExtensibleSaveFormat.projitems │ └── Core_ExtensibleSaveFormat.shproj ├── Core_SliderUnlocker │ ├── Core_SliderUnlocker.projitems │ └── Core_SliderUnlocker.shproj ├── AC_ConfigurationManager │ └── AC_ConfigurationManager.csproj ├── Core_ExtensibleSaveFormat_Studio │ ├── Core_ExtensibleSaveFormat_Studio.projitems │ └── Core_ExtensibleSaveFormat_Studio.shproj ├── AI_ExtensibleSaveFormat_Patcher │ └── AI_ExtensibleSaveFormat_Patcher.csproj ├── KKS_ExtensibleSaveFormat_Patcher │ └── KKS_ExtensibleSaveFormat_Patcher.csproj ├── KK_BGMLoader │ ├── KK_BGMLoader.csproj │ ├── KK.BGMLoader.cs │ └── README.md ├── EC_ExtensibleSaveFormat_Patcher │ └── EC_ExtensibleSaveFormat_Patcher.csproj ├── KK_ExtensibleSaveFormat_Patcher │ └── KK_ExtensibleSaveFormat_Patcher.csproj ├── HS2_ExtensibleSaveFormat_Patcher │ └── HS2_ExtensibleSaveFormat_Patcher.csproj ├── HS_ConfigurationManager │ └── HS_ConfigurationManager.csproj ├── KK_ConfigurationManager │ └── KK_ConfigurationManager.csproj ├── Shared │ ├── Shared.projitems │ ├── Lazy.cs │ ├── Shared.shproj │ └── ResourceUtils.cs ├── HC_BGMLoader │ └── HC_BGMLoader.csproj ├── AI_SliderUnlocker │ ├── AI.SliderUnlocker.VoicePitch.cs │ └── AI_SliderUnlocker.csproj ├── EC_BGMLoader │ ├── EC.BGMLoader.cs │ └── EC_BGMLoader.csproj ├── SVS_BGMLoader │ └── SVS_BGMLoader.csproj ├── AI_BGMLoader │ ├── AI.BGMLoader.cs │ └── AI_BGMLoader.csproj ├── AI_ConfigurationManager │ └── AI_ConfigurationManager.csproj ├── HS2_SliderUnlocker │ ├── HS2_SliderUnlocker.csproj │ └── HS2.SliderUnlocker.VoicePitch.cs ├── HC_ConfigurationManager │ └── HC_ConfigurationManager.csproj ├── KKS_BGMLoader │ ├── KKS.BGMLoader.cs │ └── KKS_BGMLoader.csproj ├── EC_ConfigurationManager │ └── EC_ConfigurationManager.csproj ├── SVS_ConfigurationManager │ └── SVS_ConfigurationManager.csproj ├── HS2_BGMLoader │ ├── HS2_BGMLoader.csproj │ └── HS2.BGMLoader.cs ├── HS2_ConfigurationManager │ └── HS2_ConfigurationManager.csproj ├── EC_Sideloader │ └── EC.Sideloader.cs ├── KKS_ConfigurationManager │ └── KKS_ConfigurationManager.csproj ├── KKS_Sideloader │ └── KKS.Sideloader.cs └── EC_ExtensibleSaveFormat │ └── EC_ExtensibleSaveFormat.csproj ├── nuget.config └── .github ├── ISSUE_TEMPLATE ├── feature_request.md └── bug_report.md └── workflows └── nuget.yml /Wiki Content/1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/Wiki Content/1-1.png -------------------------------------------------------------------------------- /Wiki Content/1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/Wiki Content/1-2.png -------------------------------------------------------------------------------- /Wiki Content/1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/Wiki Content/1-3.png -------------------------------------------------------------------------------- /Wiki Content/1-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/Wiki Content/1-4.png -------------------------------------------------------------------------------- /Wiki Content/1-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/Wiki Content/1-5.png -------------------------------------------------------------------------------- /Wiki Content/1-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/Wiki Content/1-6.png -------------------------------------------------------------------------------- /Wiki Content/Example Zipmod.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/Wiki Content/Example Zipmod.zip -------------------------------------------------------------------------------- /lib/PostProcessingRuntime.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/lib/PostProcessingRuntime.dll -------------------------------------------------------------------------------- /src/Core_Screencap/Resources/screencap.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/src/Core_Screencap/Resources/screencap.unity3d -------------------------------------------------------------------------------- /Wiki Content/Example zipmod step-by-step guide.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/Wiki Content/Example zipmod step-by-step guide.zip -------------------------------------------------------------------------------- /src/Core_Screencap_KKEC/Resources/blackout.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/src/Core_Screencap_KKEC/Resources/blackout.unity3d -------------------------------------------------------------------------------- /src/Core_Screencap_KKEC/Resources/composite.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/src/Core_Screencap_KKEC/Resources/composite.unity3d -------------------------------------------------------------------------------- /src/Core_Screencap_KKEC/Resources/rgalpha.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/src/Core_Screencap_KKEC/Resources/rgalpha.unity3d -------------------------------------------------------------------------------- /src/Core_Screencap_AIHS2/Resources/composite.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/src/Core_Screencap_AIHS2/Resources/composite.unity3d -------------------------------------------------------------------------------- /src/Core_Screencap/Resources/EquirectangularConverter.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IllusionMods/BepisPlugins/HEAD/src/Core_Screencap/Resources/EquirectangularConverter.unity3d -------------------------------------------------------------------------------- /src/EC_MessageCenter/EC.MessageCenter.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | 3 | namespace BepisPlugins 4 | { 5 | [BepInPlugin(GUID, PluginName, Version)] 6 | public partial class MessageCenter : BaseUnityPlugin { } 7 | } -------------------------------------------------------------------------------- /src/EC_Screencap/EC.ScreenshotManager.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace Screencap 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | public partial class ScreenshotManager { } 8 | } 9 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Zlib/EDeflateCompressStrategy.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Zlib 2 | { 3 | // DEFLATE compression strategy 4 | internal enum EDeflateCompressStrategy 5 | { 6 | Filtered, 7 | Huffman, 8 | Default 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/EC_ColorCorrector/EC.ColorCorrector.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace ColorCorrector 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInPlugin(GUID, PluginName, Version)] 8 | public partial class ColorCorrector : BaseUnityPlugin { } 9 | } -------------------------------------------------------------------------------- /src/EC_InputUnlocker/EC.InputUnlocker.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace InputUnlocker 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInPlugin(GUID, PluginName, Version)] 8 | internal partial class InputUnlocker : BaseUnityPlugin { } 9 | } 10 | -------------------------------------------------------------------------------- /src/EC_SliderUnlocker/EC.SliderUnlocker.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace SliderUnlocker 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInPlugin(GUID, PluginName, Version)] 8 | public partial class SliderUnlocker : BaseUnityPlugin { } 9 | } 10 | -------------------------------------------------------------------------------- /src/KKS_ColorCorrector/KKS.ColorCorrector.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace ColorCorrector 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInPlugin(GUID, PluginName, Version)] 8 | public partial class ColorCorrector : BaseUnityPlugin { } 9 | } 10 | -------------------------------------------------------------------------------- /src/install.ps1: -------------------------------------------------------------------------------- 1 | param($installPath, $toolsPath, $package, $project) 2 | $asms = $package.AssemblyReferences | %{$_.Name} 3 | foreach ($reference in $project.Object.References) 4 | { 5 | if ($asms -contains $reference.Name + ".dll") 6 | { 7 | $reference.CopyLocal = $false; 8 | } 9 | } -------------------------------------------------------------------------------- /src/Core_Sideloader/Core.Sideloader.ReflectionHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | namespace Sideloader 4 | { 5 | internal static class ReflectionHelper 6 | { 7 | internal static T GetValue(this FieldInfo info, object instance) => (T)info.GetValue(instance); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/KKS_Screencap/KKS.ScreenshotManager.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace Screencap 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.StudioProcessName)] 8 | [BepInProcess(Constants.VRProcessName)] 9 | public partial class ScreenshotManager { } 10 | } 11 | -------------------------------------------------------------------------------- /src/AI_InputUnlocker/AI.InputUnlocker.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace InputUnlocker 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.StudioProcessName)] 8 | [BepInPlugin(GUID, PluginName, Version)] 9 | internal partial class InputUnlocker : BaseUnityPlugin { } 10 | } -------------------------------------------------------------------------------- /src/AI_ExtensibleSaveFormat/AI.ExtendedSave.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace ExtensibleSaveFormat 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.StudioProcessName)] 8 | [BepInPlugin(GUID, PluginName, Version)] 9 | public partial class ExtendedSave : BaseUnityPlugin { } 10 | } -------------------------------------------------------------------------------- /src/AI_Screencap/AI.ScreenshotManager.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace Screencap 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.StudioProcessName)] 8 | [BepInIncompatibility("Screencap")] 9 | [BepInIncompatibility("EdgeDestroyer")] 10 | public partial class ScreenshotManager { } 11 | } 12 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Zlib/DeflateCompressLevel.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Zlib 2 | { 3 | // DEFLATE compression levels 0-9 4 | internal class DeflateCompressLevel 5 | { 6 | public const int NO_COMPRESSION = 0; 7 | public const int FASTEST = 3; 8 | public const int DEFAULT = 6; 9 | public const int OPTIMAL = 9; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/IMGUIModule.Il2Cpp.CoreCLR.Patcher/Replacements/GUI.SliderState.cs: -------------------------------------------------------------------------------- 1 | namespace IMGUIModule.Il2Cpp.CoreCLR 2 | { 3 | internal partial class GUI 4 | { 5 | private class SliderState 6 | { 7 | public float dragStartPos; 8 | public float dragStartValue; 9 | public bool isDragging; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/HS2_InputUnlocker/HS2.InputUnlocker.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace InputUnlocker 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.StudioProcessName)] 8 | [BepInProcess(Constants.VRProcessName)] 9 | [BepInPlugin(GUID, PluginName, Version)] 10 | internal partial class InputUnlocker : BaseUnityPlugin { } 11 | } -------------------------------------------------------------------------------- /src/KKS_InputUnlocker/KKS.InputUnlocker.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace InputUnlocker 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.VRProcessName)] 8 | [BepInProcess(Constants.StudioProcessName)] 9 | [BepInPlugin(GUID, PluginName, Version)] 10 | internal partial class InputUnlocker : BaseUnityPlugin { } 11 | } -------------------------------------------------------------------------------- /src/HS2_ExtensibleSaveFormat/HS2.ExtendedSave.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace ExtensibleSaveFormat 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.StudioProcessName)] 8 | [BepInProcess(Constants.VRProcessName)] 9 | [BepInPlugin(GUID, PluginName, Version)] 10 | public partial class ExtendedSave : BaseUnityPlugin { } 11 | } -------------------------------------------------------------------------------- /src/HS2_Screencap/HS2.ScreenshotManager.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace Screencap 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.StudioProcessName)] 8 | [BepInProcess(Constants.VRProcessName)] 9 | [BepInIncompatibility("Screencap")] 10 | [BepInIncompatibility("EdgeDestroyer")] 11 | public partial class ScreenshotManager { } 12 | } 13 | -------------------------------------------------------------------------------- /src/KK_Screencap/KK.ScreenshotManager.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace Screencap 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.GameProcessNameSteam)] 8 | [BepInProcess(Constants.VRProcessName)] 9 | [BepInProcess(Constants.VRProcessNameSteam)] 10 | [BepInProcess(Constants.StudioProcessName)] 11 | public partial class ScreenshotManager { } 12 | } 13 | -------------------------------------------------------------------------------- /src/KK_ColorCorrector/KK.ColorCorrector.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace ColorCorrector 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.GameProcessNameSteam)] 8 | [BepInProcess(Constants.VRProcessName)] 9 | [BepInProcess(Constants.VRProcessNameSteam)] 10 | [BepInPlugin(GUID, PluginName, Version)] 11 | public partial class ColorCorrector : BaseUnityPlugin { } 12 | } 13 | -------------------------------------------------------------------------------- /src/KKS_SliderUnlocker/KKS.SliderUnlocker.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace SliderUnlocker 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.VRProcessName)] 8 | [BepInProcess(Constants.StudioProcessName)] 9 | [BepInPlugin(GUID, PluginName, Version)] 10 | public partial class SliderUnlocker : BaseUnityPlugin 11 | { 12 | internal void Main() => VoicePitchUnlocker.Init(); 13 | } 14 | } -------------------------------------------------------------------------------- /src/IMGUIModule.Il2Cpp.CoreCLR.Patcher/Replacements/GUIStateObjects.cs: -------------------------------------------------------------------------------- 1 | using static UnityEngine.GUIStateObjects; 2 | 3 | namespace IMGUIModule.Il2Cpp.CoreCLR 4 | { 5 | internal class GUIStateObjects 6 | { 7 | public static Il2CppSystem.Object QueryStateObject(Il2CppSystem.Type t, int controlID) 8 | { 9 | Il2CppSystem.Object o = s_StateCache[controlID]; 10 | return t.IsInstanceOfType(o) ? o : null; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Chunks/PngChunkMultiple.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Chunks 2 | { 3 | /// 4 | /// A Chunk type that allows duplicate in an image 5 | /// 6 | internal abstract class PngChunkMultiple : PngChunk 7 | { 8 | internal PngChunkMultiple(string id, ImageInfo imgInfo) : base(id, imgInfo) { } 9 | 10 | public sealed override bool AllowsMultiple() 11 | { 12 | return true; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/KK_InputUnlocker/KK.InputUnlocker.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace InputUnlocker 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.GameProcessNameSteam)] 8 | [BepInProcess(Constants.VRProcessName)] 9 | [BepInProcess(Constants.VRProcessNameSteam)] 10 | [BepInProcess(Constants.StudioProcessName)] 11 | [BepInPlugin(GUID, PluginName, Version)] 12 | internal partial class InputUnlocker : BaseUnityPlugin { } 13 | } -------------------------------------------------------------------------------- /nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/KK_ExtensibleSaveFormat/KK.ExtendedSave.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace ExtensibleSaveFormat 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.GameProcessNameSteam)] 8 | [BepInProcess(Constants.VRProcessName)] 9 | [BepInProcess(Constants.VRProcessNameSteam)] 10 | [BepInProcess(Constants.StudioProcessName)] 11 | [BepInPlugin(GUID, PluginName, Version)] 12 | public partial class ExtendedSave : BaseUnityPlugin { } 13 | } -------------------------------------------------------------------------------- /src/KKS_ExtensibleSaveFormat/KKS.ExtendedSave.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace ExtensibleSaveFormat 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | //[BepInProcess(Constants.GameProcessNameSteam)] 8 | [BepInProcess(Constants.VRProcessName)] 9 | //[BepInProcess(Constants.VRProcessNameSteam)] 10 | [BepInProcess(Constants.StudioProcessName)] 11 | [BepInPlugin(GUID, PluginName, Version)] 12 | public partial class ExtendedSave : BaseUnityPlugin { } 13 | } -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Chunks/ChunkPredicateId.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Chunks 2 | { 3 | /// 4 | /// Match if have same Chunk Id 5 | /// 6 | internal class ChunkPredicateId : IChunkPredicate 7 | { 8 | private readonly string id; 9 | public ChunkPredicateId(string id) 10 | { 11 | this.id = id; 12 | } 13 | public bool Matches(PngChunk c) 14 | { 15 | return c.Id.Equals(id); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/EC_Screencap/EC.ScreenshotManager.Hooks.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace Screencap 4 | { 5 | internal static partial class Hooks 6 | { 7 | [HarmonyPrefix, HarmonyPatch(typeof(EmocreScreenShot), nameof(EmocreScreenShot.ScreenShot))] 8 | private static bool EmocreScreenShotPreHook() => false; 9 | 10 | [HarmonyPrefix, HarmonyPatch(typeof(GameScreenShot), nameof(GameScreenShot.UnityCapture))] 11 | private static bool UnityCapturePreHook() => false; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/IMGUIModule.Il2Cpp.CoreCLR.Patcher/IMGUIModule.Il2Cpp.CoreCLR.Patcher.csproj.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | True -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Chunks/ChunkPredicate.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Chunks 2 | { 3 | /// 4 | /// Decides if another chunk "matches", according to some criterion 5 | /// 6 | internal interface IChunkPredicate 7 | { 8 | /// 9 | /// The other chunk matches with this one 10 | /// 11 | /// The other chunk 12 | /// true if matches 13 | bool Matches(PngChunk chunk); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/AI_Sideloader/AI.Sideloader.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | using Sideloader.AutoResolver; 4 | using System.Collections.Generic; 5 | 6 | namespace Sideloader 7 | { 8 | [BepInProcess(Constants.GameProcessName)] 9 | [BepInProcess(Constants.StudioProcessName)] 10 | public partial class Sideloader : BaseUnityPlugin 11 | { 12 | internal static readonly string[] GameNameList = { "aigirl", "ai girl" }; 13 | 14 | private static string FindKoiZipmodDir() => string.Empty; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/PngjException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Pngcs 4 | { 5 | /// 6 | /// Gral exception class for PNGCS library 7 | /// 8 | [Serializable] 9 | internal class PngjException : Exception 10 | { 11 | public PngjException(string message, Exception cause) : base(message, cause) { } 12 | 13 | public PngjException(string message) : base(message) { } 14 | 15 | public PngjException(Exception cause) : base(cause.Message, cause) { } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/AC_BGMLoader/AC_BGMLoader.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | enable 5 | BGMLoader 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/AI_Screencap/AI.ScreenshotManager.Hooks.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace Screencap 4 | { 5 | /// 6 | /// Disable built-in screenshots 7 | /// 8 | internal static partial class Hooks 9 | { 10 | // Hook here instead of hooking GameScreenShot.Capture to not affect the Photo functionality 11 | [HarmonyPrefix, HarmonyPatch(typeof(AIProject.Scene.MapScene), nameof(AIProject.Scene.MapScene.CaptureSS))] 12 | private static bool CaptureSSOverride() => false; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Core_Sideloader_Studio/Core.Sideloader.Studio.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Sideloader 4 | { 5 | public partial class Sideloader 6 | { 7 | internal static readonly HashSet StudioListResolveBlacklist = new HashSet() 8 | { 9 | "itemcategory", 10 | "animecategory", 11 | "voicecategory", 12 | "itemgroup", 13 | "animegroup", 14 | "voicegroup", 15 | "bone", 16 | "mapcategory" 17 | }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/PngjOutputException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Pngcs 4 | { 5 | /// 6 | /// Exception associated with input (reading) operations 7 | /// 8 | [Serializable] 9 | internal class PngjOutputException : PngjException 10 | { 11 | public PngjOutputException(string message, Exception cause) : base(message, cause) { } 12 | 13 | public PngjOutputException(string message) : base(message) { } 14 | 15 | public PngjOutputException(Exception cause) : base(cause) { } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/KK_SliderUnlocker/KK.SliderUnlocker.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace SliderUnlocker 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.GameProcessNameSteam)] 8 | [BepInProcess(Constants.VRProcessName)] 9 | [BepInProcess(Constants.VRProcessNameSteam)] 10 | [BepInProcess(Constants.StudioProcessName)] 11 | [BepInPlugin(GUID, PluginName, Version)] 12 | public partial class SliderUnlocker : BaseUnityPlugin 13 | { 14 | internal void Main() => VoicePitchUnlocker.Init(); 15 | } 16 | } -------------------------------------------------------------------------------- /src/Core_Screencap/Config/NameFormat.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member 2 | 3 | namespace Screencap 4 | { 5 | /// 6 | /// Screenshot file name formats. 7 | /// Name - Name of the application. Cane be overriden by a setting. 8 | /// Date - Current date and time. 9 | /// Type - Type of the screenshot taken. 10 | /// 11 | public enum NameFormat 12 | { 13 | NameDate, 14 | NameTypeDate, 15 | NameDateType, 16 | TypeDate, 17 | TypeNameDate, 18 | Date 19 | } 20 | } -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/PngjExceptionInternal.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs 2 | { 3 | /// Exception for internal problems 4 | [System.Serializable] 5 | internal class PngjExceptionInternal : System.Exception 6 | { 7 | public PngjExceptionInternal() : base() { } 8 | 9 | public PngjExceptionInternal(string message, System.Exception cause) : base(message, cause) { } 10 | 11 | public PngjExceptionInternal(string message) : base(message) { } 12 | 13 | public PngjExceptionInternal(System.Exception cause) : base(cause.Message, cause) { } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/HS2_Sideloader/HS2.Sideloader.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | using Sideloader.AutoResolver; 4 | using System.Collections.Generic; 5 | 6 | namespace Sideloader 7 | { 8 | [BepInProcess(Constants.GameProcessName)] 9 | [BepInProcess(Constants.StudioProcessName)] 10 | [BepInProcess(Constants.VRProcessName)] 11 | public partial class Sideloader : BaseUnityPlugin 12 | { 13 | internal static readonly string[] GameNameList = { "hs2", "honeyselect2", "honey select 2" }; 14 | 15 | private static string FindKoiZipmodDir() => string.Empty; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/PngjUnsupportedException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Pngcs 4 | { 5 | /// 6 | /// Exception for unsupported operation or feature 7 | /// 8 | [Serializable] 9 | internal class PngjUnsupportedException : Exception 10 | { 11 | public PngjUnsupportedException() : base() { } 12 | 13 | public PngjUnsupportedException(string message, Exception cause) : base(message, cause) { } 14 | 15 | public PngjUnsupportedException(string message) : base(message) { } 16 | 17 | public PngjUnsupportedException(Exception cause) : base(cause.Message, cause) { } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Core_InputUnlocker/Core_InputUnlocker.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 134e383f-6e78-460d-b76a-3baab8ebf54b 7 | 8 | 9 | Core_InputUnlocker 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Core_ColorCorrector/Core_ColorCorrector.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | c9f5729a-c6e2-4e2f-a68d-4fdf757b2e58 7 | 8 | 9 | Core_ColorCorrector 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/KK_Sideloader/KK.Sideloader.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | 4 | namespace Sideloader 5 | { 6 | [BepInProcess(Constants.GameProcessName)] 7 | [BepInProcess(Constants.GameProcessNameSteam)] 8 | [BepInProcess(Constants.VRProcessName)] 9 | [BepInProcess(Constants.VRProcessNameSteam)] 10 | [BepInProcess(Constants.StudioProcessName)] 11 | [BepInIncompatibility("com.bepis.bepinex.resourceredirector")] 12 | public partial class Sideloader : BaseUnityPlugin 13 | { 14 | internal static readonly string[] GameNameList = { "koikatsu", "koikatu", "コイカツ" }; 15 | 16 | private static string FindKoiZipmodDir() => string.Empty; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Core_Sideloader/UniversalAutoResolver/Core.UAR.MigrationType.cs: -------------------------------------------------------------------------------- 1 | namespace Sideloader.AutoResolver 2 | { 3 | /// 4 | /// Type of migration that will be performed 5 | /// 6 | public enum MigrationType 7 | { 8 | /// 9 | /// Change the old GUID to the new GUID and the old ID to the new ID 10 | /// 11 | Migrate, 12 | /// 13 | /// Change the old GUID to the new GUID for all IDs 14 | /// 15 | MigrateAll, 16 | /// 17 | /// Remove the GUID and perform compatibility resolve 18 | /// 19 | StripAll 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /src/Core_BGMLoader/Core.BGMLoader.AudioLoader.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace BGMLoader 4 | { 5 | public static class AudioLoader 6 | { 7 | public static AudioClip LoadAudioClip(string path) 8 | { 9 | #pragma warning disable 618 // Disable the obsolete warning 10 | using (WWW www = new WWW(BepInEx.Utility.ConvertToWWWFormat(path))) 11 | #pragma warning restore 618 12 | { 13 | AudioClip clip = www.GetAudioClip(); 14 | 15 | //Wait for the clip to be loaded before returning it 16 | while (clip.loadState != AudioDataLoadState.Loaded) { } 17 | 18 | return clip; 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Core_BGMLoader/Core_BGMLoader.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | e1074dcd-cc19-4c67-b799-eb534c885018 7 | 8 | 9 | Core_BGMLoader 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[Game name] - [Brief description]" 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /src/KK_InputUnlocker/KK_InputUnlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | InputUnlocker 6 | InputUnlocker 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/PH_SliderUnlocker/PH.SliderUnlocker.Hooks.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace SliderUnlocker 4 | { 5 | public static partial class Hooks 6 | { 7 | [HarmonyPostfix, HarmonyPatch(typeof(EditMode), nameof(EditMode.Setup))] 8 | private static void EditModeSetup(EditMode __instance) 9 | { 10 | SliderUnlocker.SetAllSliders(__instance); 11 | } 12 | 13 | [HarmonyPrefix, HarmonyPatch(typeof(InputSliderUI), nameof(InputSliderUI.OnChanged), typeof(float), typeof(bool))] 14 | private static void EditModeSetup(InputSliderUI __instance, float val) 15 | { 16 | if (__instance.slider.maxValue >= val) return; 17 | SliderUnlocker.UnlockSliderPH(__instance, val); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Core_ExtensibleSaveFormat_Patcher/Core_ExtensibleSaveFormat_Patcher.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 5fbb99f7-d478-4bf1-bce4-47f0b1501142 7 | 8 | 9 | Core_ExtensibleSaveFormat_Patcher 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/PH_SliderUnlocker/PH_SliderUnlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | SliderUnlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/HS_SliderUnlocker/HS_SliderUnlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | SliderUnlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/PngCsUtils.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs 2 | { 3 | /// 4 | /// Utility functions for C# porting 5 | /// 6 | internal class PngCsUtils 7 | { 8 | internal static bool ArraysEqual4(byte[] ar1, byte[] ar2) 9 | { 10 | return (ar1[0] == ar2[0]) && 11 | (ar1[1] == ar2[1]) && 12 | (ar1[2] == ar2[2]) && 13 | (ar1[3] == ar2[3]); 14 | } 15 | 16 | internal static bool ArraysEqual(byte[] a1, byte[] a2) 17 | { 18 | if (a1.Length != a2.Length) 19 | return false; 20 | 21 | for (int i = 0; i < a1.Length; i++) 22 | if (a1[i] != a2[i]) 23 | return false; 24 | 25 | return true; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/PH_ConfigurationManager/PH_ConfigurationManager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | ConfigurationManagerWrapper 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/HS2_Screencap/HS2.ScreenshotManager.Hooks.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace Screencap 4 | { 5 | /// 6 | /// Disable built-in screenshots 7 | /// 8 | internal static partial class Hooks 9 | { 10 | public static bool SoundWasPlayed; 11 | 12 | [HarmonyPrefix, HarmonyPatch(typeof(GameScreenShot), nameof(GameScreenShot.Capture), typeof(string))] 13 | private static bool CaptureOverride() 14 | { 15 | SoundWasPlayed = true; 16 | return false; 17 | } 18 | 19 | [HarmonyPrefix, HarmonyPatch(typeof(GameScreenShot), nameof(GameScreenShot.UnityCapture), typeof(string))] 20 | private static bool CaptureOverride2() 21 | { 22 | SoundWasPlayed = true; 23 | return false; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/IMGUIModule.Il2Cpp.CoreCLR.Patcher/Replacements/GUI.GUIStateObjects.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace IMGUIModule.Il2Cpp.CoreCLR 5 | { 6 | internal partial class GUI 7 | { 8 | private class GUIStateObjects 9 | { 10 | private static Dictionary s_StateCache = new Dictionary(); 11 | 12 | public static object GetStateObject(Type t, int controlID) 13 | { 14 | object obj; 15 | if (!s_StateCache.TryGetValue(controlID, out obj) || obj.GetType() != t) 16 | { 17 | obj = Activator.CreateInstance(t); 18 | s_StateCache[controlID] = obj; 19 | } 20 | return obj; 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/PH_ExtensibleSaveFormat/ExtendedSave.PluginData.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using System.Collections.Generic; 3 | 4 | namespace ExtensibleSaveFormat 5 | { 6 | /// 7 | /// An object containing data saved to and loaded from cards. 8 | /// 9 | [MessagePackObject] 10 | public class PluginData 11 | { 12 | /// 13 | /// Version of the plugin data saved to the card. Get or set this if ever your plugin data format changes and use it to differentiate. 14 | /// 15 | [Key(0)] 16 | public int version; 17 | /// 18 | /// Dictionary of objects saved to or loaded loaded from the card. 19 | /// 20 | [Key(1)] 21 | public Dictionary data = new Dictionary(); 22 | } 23 | } -------------------------------------------------------------------------------- /src/Core_ExtensibleSaveFormat/Core.ExtendedSave.PluginData.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | using System.Collections.Generic; 3 | 4 | namespace ExtensibleSaveFormat 5 | { 6 | /// 7 | /// An object containing data saved to and loaded from cards. 8 | /// 9 | [MessagePackObject] 10 | public class PluginData 11 | { 12 | /// 13 | /// Version of the plugin data saved to the card. Get or set this if ever your plugin data format changes and use it to differentiate. 14 | /// 15 | [Key(0)] 16 | public int version; 17 | /// 18 | /// Dictionary of objects saved to or loaded loaded from the card. 19 | /// 20 | [Key(1)] 21 | public Dictionary data = new Dictionary(); 22 | } 23 | } -------------------------------------------------------------------------------- /src/Core_SliderUnlocker/Core_SliderUnlocker.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 7cba15ab-52d1-4506-a7bf-9d23060ecf5d 7 | 8 | 9 | Core_SliderUnlocker 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/AC_ConfigurationManager/AC_ConfigurationManager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | enable 5 | ConfigurationManagerWrapper 6 | 7 | 8 | 9 | 10 | 11 | NU1701 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Core_ExtensibleSaveFormat_Studio/Core_ExtensibleSaveFormat_Studio.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 20fd60f3-3086-4a25-876b-e977bda46687 7 | 8 | 9 | Core_ExtensibleSaveFormat_Studio 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Core_Sideloader/UniversalAutoResolver/Core.UAR.FaceSkinInfo.cs: -------------------------------------------------------------------------------- 1 | using MessagePack; 2 | 3 | #pragma warning disable CS1591 // TODO Missing XML comment for publicly visible type or member 4 | 5 | #if AI || HS2 6 | namespace Sideloader.AutoResolver 7 | { 8 | [MessagePackObject] 9 | public class FaceSkinInfo 10 | { 11 | [Key(0)] public int SkinSlot; 12 | [Key(1)] public string SkinGUID; 13 | [Key(2)] public int HeadSlot; 14 | [Key(3)] public string HeadGUID; 15 | [IgnoreMember] public int SkinLocalSlot; 16 | 17 | [SerializationConstructor] 18 | public FaceSkinInfo(int skinID, string skinGUID, int headID, string headGUID) 19 | { 20 | SkinSlot = skinID; 21 | SkinGUID = skinGUID; 22 | HeadSlot = headID; 23 | HeadGUID = headGUID; 24 | } 25 | } 26 | } 27 | #endif -------------------------------------------------------------------------------- /src/KK_ColorCorrector/KK_ColorCorrector.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | ColorCorrector 6 | ColorCorrector 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/AI_ExtensibleSaveFormat_Patcher/AI_ExtensibleSaveFormat_Patcher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ExtensibleSaveFormat 6 | ..\..\bin\BepInEx\patchers\ 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/KKS_ExtensibleSaveFormat_Patcher/KKS_ExtensibleSaveFormat_Patcher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ExtensibleSaveFormat 6 | ..\..\bin\BepInEx\patchers\ 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/KK_BGMLoader/KK_BGMLoader.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | BGMLoader 6 | BGMLoader 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/EC_ExtensibleSaveFormat_Patcher/EC_ExtensibleSaveFormat_Patcher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ExtensibleSaveFormat 6 | ..\..\bin\BepInEx\patchers\ 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/KK_ExtensibleSaveFormat_Patcher/KK_ExtensibleSaveFormat_Patcher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | ExtensibleSaveFormat 6 | ..\..\bin\BepInEx\patchers\ 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Chunks/ChunkPredicateId2.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Chunks 2 | { 3 | /// 4 | /// match if have same id and, if Text (or SPLT) if have the asame key 5 | /// 6 | /// 7 | /// This is the same as ChunkPredicateEquivalent, the only difference is that does not requires 8 | /// a chunk at construction time 9 | /// 10 | internal class ChunkPredicateId2 : IChunkPredicate 11 | { 12 | private readonly string id; 13 | internal readonly string innerid; 14 | 15 | public ChunkPredicateId2(string id, string inner) 16 | { 17 | this.id = id; 18 | innerid = inner; 19 | } 20 | 21 | public bool Matches(PngChunk c) 22 | { 23 | if (!c.Id.Equals(id)) 24 | return false; 25 | 26 | return true; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Core_Screencap_AIHS2/AIHS2_Core_Screencap.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | cfc6ee58-cd1b-4a21-b281-c6e9d5d0390d 7 | 8 | 9 | AIHS2_Core_Screencap 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/HS2_ExtensibleSaveFormat_Patcher/HS2_ExtensibleSaveFormat_Patcher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ExtensibleSaveFormat 6 | ..\..\bin\BepInEx\patchers\ 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Chunks/PngChunkSingle.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Chunks 2 | { 3 | /// 4 | /// A Chunk type that does not allow duplicate in an image 5 | /// 6 | internal abstract class PngChunkSingle : PngChunk 7 | { 8 | public PngChunkSingle(string id, ImageInfo imgInfo) : base(id, imgInfo) { } 9 | 10 | public sealed override bool AllowsMultiple() 11 | { 12 | return false; 13 | } 14 | 15 | public override int GetHashCode() 16 | { 17 | int prime = 31; 18 | int result = 1; 19 | result = prime * result + ((Id == null) ? 0 : Id.GetHashCode()); 20 | return result; 21 | } 22 | 23 | public override bool Equals(object obj) 24 | { 25 | return obj is PngChunkSingle single && Id != null && Id.Equals(single.Id); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Chunks/ChunkLoadBehaviour.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Chunks 2 | { 3 | /// 4 | /// Defines what to do with non critical chunks when reading 5 | /// 6 | internal enum ChunkLoadBehaviour 7 | { 8 | /// 9 | /// all non-critical chunks are skippped 10 | /// 11 | LOAD_CHUNK_NEVER, 12 | /// 13 | /// load chunk if 'known' (registered with the factory) 14 | /// 15 | LOAD_CHUNK_KNOWN, 16 | /// 17 | /// load chunk if 'known' or safe to copy 18 | /// 19 | LOAD_CHUNK_IF_SAFE, 20 | /// 21 | /// load chunks always 22 | /// 23 | /// Notice that other restrictions might apply, see PngReader.SkipChunkMaxSize PngReader.SkipChunkIds 24 | /// 25 | LOAD_CHUNK_ALWAYS, 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/AI_InputUnlocker/AI_InputUnlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | InputUnlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/HS_ConfigurationManager/HS_ConfigurationManager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | ConfigurationManagerWrapper 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/KK_SliderUnlocker/KK_SliderUnlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | SliderUnlocker 6 | SliderUnlocker 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Chunks/ChunkPredicateEquiv.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Chunks 2 | { 3 | /// 4 | /// An ad-hoc criterion, perhaps useful, for equivalence. 5 | /// 6 | /// 7 | internal class ChunkPredicateEquiv : IChunkPredicate 8 | { 9 | private readonly PngChunk chunk; 10 | /// 11 | /// Creates predicate based of reference chunk 12 | /// 13 | /// 14 | public ChunkPredicateEquiv(PngChunk chunk) 15 | { 16 | this.chunk = chunk; 17 | } 18 | /// 19 | /// Check for match 20 | /// 21 | /// 22 | /// 23 | public bool Matches(PngChunk c) 24 | { 25 | return ChunkHelper.Equivalent(c, chunk); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/HS2_InputUnlocker/HS2_InputUnlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | InputUnlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/EC_InputUnlocker/EC_InputUnlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | InputUnlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/KK_ConfigurationManager/KK_ConfigurationManager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | ConfigurationManagerWrapper 6 | ConfigurationManagerKK 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Core_Screencap/Extensions.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Screencap 4 | { 5 | internal static class Extensions 6 | { 7 | public static void ClearRenderTexture(this RenderTexture rt) 8 | { 9 | var origTex = RenderTexture.active; 10 | RenderTexture.active = rt; 11 | GL.Clear(true, true, new Color(0f, 0f, 0f, 0f)); 12 | RenderTexture.active = origTex; 13 | } 14 | 15 | public static Texture2D CopyToTexture2D(this RenderTexture renderTexture) 16 | { 17 | var currentActiveRT = RenderTexture.active; 18 | RenderTexture.active = renderTexture; 19 | var tex = new Texture2D(renderTexture.width, renderTexture.height, TextureFormat.ARGB32, false); 20 | tex.ReadPixels(new Rect(0, 0, tex.width, tex.height), 0, 0); 21 | tex.Apply(); 22 | RenderTexture.active = currentActiveRT; 23 | return tex; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Shared/Shared.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 356eb041-d692-45b5-acf6-0f393a62cb4b 7 | 8 | 9 | BepisPlugins 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Chunks/PngChunkIEND.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Chunks 2 | { 3 | /// 4 | /// IEND chunk http://www.w3.org/TR/PNG/#11IEND 5 | /// 6 | internal class PngChunkIEND : PngChunkSingle 7 | { 8 | public const string ID = ChunkHelper.IEND; 9 | 10 | public PngChunkIEND(ImageInfo info) 11 | : base(ID, info) 12 | { 13 | } 14 | 15 | public override ChunkOrderingConstraint GetOrderingConstraint() 16 | { 17 | return ChunkOrderingConstraint.NA; 18 | } 19 | 20 | public override ChunkRaw CreateRawChunk() 21 | { 22 | ChunkRaw c = new ChunkRaw(0, ChunkHelper.b_IEND, false); 23 | return c; 24 | } 25 | 26 | public override void ParseFromRaw(ChunkRaw c) 27 | { 28 | // this is not used 29 | } 30 | 31 | public override void CloneDataFromRead(PngChunk other) 32 | { 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/HC_BGMLoader/HC_BGMLoader.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | enable 5 | BGMLoader 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Core_Screencap/Config/CameraGuideLinesType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | 4 | #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member 5 | 6 | namespace Screencap 7 | { 8 | /// 9 | /// Available modes for camera guide lines. 10 | /// Can be combined using flags. 11 | /// 12 | [Flags] 13 | public enum CameraGuideLinesType 14 | { 15 | [Description("No guide lines")] 16 | None = 0, 17 | [Description("Cropped area")] 18 | Framing = 1 << 0, 19 | [Description("Rule of thirds")] 20 | GridThirds = 1 << 1, 21 | [Description("Golden ratio")] 22 | GridPhi = 1 << 2, 23 | [Description("Grid border")] 24 | Border = 1 << 3, 25 | [Description("X lines")] 26 | CrossOut = 1 << 4, 27 | [Description("Side V lines")] 28 | SideV = 1 << 5, 29 | [Description("Center lines")] 30 | CenterLines = 1 << 6 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Shared/Lazy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Shared 4 | { 5 | internal class LazyCustom 6 | { 7 | private T _object; 8 | private Func Factory { get; set; } 9 | 10 | private LazyCustom(Func factory) => Factory = factory; 11 | 12 | public T Instance 13 | { 14 | get 15 | { 16 | Initialize(); 17 | return _object; 18 | } 19 | } 20 | 21 | public void Initialize() 22 | { 23 | if (_object == null || _object.ToString() == "null") 24 | _object = Factory(); 25 | } 26 | 27 | public static implicit operator T(LazyCustom lazy) => lazy.Instance; 28 | 29 | public static LazyCustom Create() 30 | where TClass : new() => new LazyCustom(() => new TClass()); 31 | 32 | public static LazyCustom Create(Func factory) => new LazyCustom(factory); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/AI_SliderUnlocker/AI.SliderUnlocker.VoicePitch.cs: -------------------------------------------------------------------------------- 1 | using AIChara; 2 | using HarmonyLib; 3 | 4 | namespace SliderUnlocker 5 | { 6 | internal static class VoicePitchUnlocker 7 | { 8 | private const float VanillaPitchLower = 0.94f; 9 | private const float VanillaPitchUpper = 1.06f; 10 | private const float VanillaPitchRange = VanillaPitchUpper - VanillaPitchLower; 11 | 12 | public static void Init() 13 | { 14 | Harmony.CreateAndPatchAll(typeof(VoicePitchUnlocker), nameof(VoicePitchUnlocker)); 15 | } 16 | 17 | [HarmonyPrefix, HarmonyPatch(typeof(ChaFileParameter), nameof(ChaFileParameter.voicePitch), MethodType.Getter)] 18 | private static bool VoicePitchHook(ChaFileParameter __instance, ref float __result) 19 | { 20 | // Replace line return Mathf.Lerp(0.94f, 1.06f, this.voiceRate); 21 | __result = VanillaPitchLower + __instance.voiceRate * VanillaPitchRange; 22 | return false; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Core_ExtensibleSaveFormat/Core_ExtensibleSaveFormat.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 61e63b45-1d21-44f7-9b01-f5209c05ffb4 7 | 8 | 9 | Core_ExtensibleSaveFormat 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /.github/workflows/nuget.yml: -------------------------------------------------------------------------------- 1 | name: Push to nuget feed on release 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: windows-latest 13 | 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v1 17 | 18 | - name: Setup Nuget 19 | uses: nuget/setup-nuget@v1 20 | 21 | - name: Nuget pack 22 | run: | 23 | nuget restore 24 | gci -Path src -Recurse -Filter *.nuspec | foreach { nuget pack "$($_.DirectoryName)\$($_.BaseName).csproj" -build -properties Configuration=Release } 25 | 26 | - name: Nuget push 27 | env: 28 | NUGET_URL: https://pkgs.dev.azure.com/IllusionMods/Nuget/_packaging/IllusionMods/nuget/v3/index.json 29 | NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} 30 | run: | 31 | nuget sources update -name "IllusionMods" -username "token" -password ${env:NUGET_TOKEN} 32 | nuget push *.nupkg -apikey key -noninteractive -skipduplicate -src ${env:NUGET_URL} 33 | -------------------------------------------------------------------------------- /src/EC_BGMLoader/EC.BGMLoader.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | using XUnity.ResourceRedirector; 4 | 5 | namespace BGMLoader 6 | { 7 | [BepInProcess(Constants.GameProcessName)] 8 | [BepInPlugin(GUID, PluginName, Version)] 9 | [BepInDependency(XUnity.ResourceRedirector.Constants.PluginData.Identifier)] 10 | public partial class BGMLoader : BaseUnityPlugin 11 | { 12 | private static bool TryGetOverrideFileName(IAssetLoadingContext context, out string overrideFileName) 13 | { 14 | var isBgm = context.Parameters.Name.Length == 6 && context.Parameters.Name.StartsWith("bgm", System.StringComparison.InvariantCultureIgnoreCase); 15 | if (!isBgm) 16 | { 17 | overrideFileName = null; 18 | return false; 19 | } 20 | int bgmTrack = int.Parse(context.Parameters.Name.Substring(context.Parameters.Name.Length - 2, 2)); 21 | overrideFileName = $"BGM{bgmTrack:00}.ogg"; 22 | return true; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/SVS_BGMLoader/SVS_BGMLoader.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | enable 5 | BGMLoader 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/AI_BGMLoader/AI.BGMLoader.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | using XUnity.ResourceRedirector; 4 | 5 | namespace BGMLoader 6 | { 7 | [BepInProcess(Constants.GameProcessName)] 8 | [BepInPlugin(GUID, PluginName, Version)] 9 | [BepInDependency(XUnity.ResourceRedirector.Constants.PluginData.Identifier)] 10 | public partial class BGMLoader : BaseUnityPlugin 11 | { 12 | private static bool TryGetOverrideFileName(IAssetLoadingContext context, out string overrideFileName) 13 | { 14 | var isBgm = context.Parameters.Name.Length == 9 && context.Parameters.Name.StartsWith("ai_bgm", System.StringComparison.InvariantCultureIgnoreCase); 15 | if (!isBgm) 16 | { 17 | overrideFileName = null; 18 | return false; 19 | } 20 | int bgmTrack = int.Parse(context.Parameters.Name.Substring(context.Parameters.Name.Length - 2, 2)); 21 | overrideFileName = $"BGM{bgmTrack:00}.ogg"; 22 | return true; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/KKS_Screencap/KKS.ScreenshotManagerHooks.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace Screencap 4 | { 5 | internal static partial class Hooks 6 | { 7 | /// 8 | /// Cancel the vanilla screenshot 9 | /// 10 | [HarmonyPrefix, HarmonyPatch(typeof(Studio.GameScreenShot), nameof(Studio.GameScreenShot.Capture))] 11 | private static bool StudioCapturePreHook() => false; 12 | 13 | [HarmonyPrefix, HarmonyPatch(typeof(Studio.GameScreenShot), nameof(Studio.GameScreenShot.CreatePngScreen))] 14 | private static bool CreatePngScreenPrefix(ref int _width, ref int _height) 15 | { 16 | //Multiply up render resolution. 17 | _width *= CardRenderRate; 18 | _height *= CardRenderRate; 19 | return true; 20 | } 21 | 22 | [HarmonyPostfix, HarmonyPatch(typeof(Studio.GameScreenShot), nameof(Studio.GameScreenShot.CreatePngScreen))] 23 | private static void CreatePngScreenPostfix(ref byte[] __result) => DownscaleEncoded(ref __result); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/KK_Screencap/KK.ScreenshotManagerHooks.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace Screencap 4 | { 5 | internal static partial class Hooks 6 | { 7 | /// 8 | /// Cancel the vanilla screenshot 9 | /// 10 | [HarmonyPrefix, HarmonyPatch(typeof(Studio.GameScreenShot), nameof(Studio.GameScreenShot.Capture))] 11 | private static bool StudioCapturePreHook() => false; 12 | 13 | [HarmonyPrefix, HarmonyPatch(typeof(Studio.GameScreenShot), nameof(Studio.GameScreenShot.CreatePngScreen))] 14 | private static bool CreatePngScreenPrefix(ref int _width, ref int _height) 15 | { 16 | //Multiply up render resolution. 17 | _width *= CardRenderRate; 18 | _height *= CardRenderRate; 19 | return true; 20 | } 21 | 22 | [HarmonyPostfix, HarmonyPatch(typeof(Studio.GameScreenShot), nameof(Studio.GameScreenShot.CreatePngScreen))] 23 | private static void CreatePngScreenPostfix(ref byte[] __result) => DownscaleEncoded(ref __result); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/KKS_SliderUnlocker/KKS.SliderUnlocker.VoicePitch.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Code by essu 3 | * ~ can you hear me now? ~ 4 | */ 5 | using HarmonyLib; 6 | 7 | namespace SliderUnlocker 8 | { 9 | internal static class VoicePitchUnlocker 10 | { 11 | private const float VanillaPitchLower = 0.94f; 12 | private const float VanillaPitchUpper = 1.06f; 13 | private const float VanillaPitchRange = VanillaPitchUpper - VanillaPitchLower; 14 | 15 | public static void Init() 16 | { 17 | Harmony.CreateAndPatchAll(typeof(VoicePitchUnlocker), nameof(VoicePitchUnlocker)); 18 | } 19 | 20 | [HarmonyPrefix, HarmonyPatch(typeof(ChaFileParameter), nameof(ChaFileParameter.voicePitch), MethodType.Getter)] 21 | private static bool VoicePitchHook(ChaFileParameter __instance, ref float __result) 22 | { 23 | // Replace line return Mathf.Lerp(0.94f, 1.06f, this.voiceRate); 24 | __result = VanillaPitchLower + __instance.voiceRate * VanillaPitchRange; 25 | return false; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Shared/Shared.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 356eb041-d692-45b5-acf6-0f393a62cb4b 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/EC_ColorCorrector/EC_ColorCorrector.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ColorCorrector 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Core_BGMLoader/Core_BGMLoader.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | e1074dcd-cc19-4c67-b799-eb534c885018 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Core_Screencap/Core_Screencap.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | e416e580-db6c-46b0-a51c-6fef22036204 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Core_Sideloader/Core_Sideloader.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ce5a9fab-c188-4919-a296-d9b1422169e9 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[Game name] - [Brief description]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Before submitting 11 | - Update to latest BepisPlugins and supported version of BepInEx. 12 | - Update your game to latest version. 13 | - Make sure no other plugins are crashing or having issues (remove them for testing and see if your issue is fixed.) 14 | 15 | **Describe the bug** 16 | - What game you are running. 17 | - A clear and concise description of what the bug is. 18 | - If you can, add any exceptions/errors you see in your output_log.txt or BepInEx console that might be related to the issue. You might be asked to send the whole log file if there's not enough information. 19 | - Add screenshots if you think they will make it easier to explain. 20 | 21 | **To Reproduce** 22 | Steps to reproduce the behavior: 23 | 1. Go to '...' 24 | 2. Click on '....' 25 | 3. Scroll down to '....' 26 | 4. See error 27 | 28 | **Expected behavior** 29 | A clear and concise description of what you expected to happen. 30 | -------------------------------------------------------------------------------- /src/Core_InputUnlocker/Core_InputUnlocker.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 134e383f-6e78-460d-b76a-3baab8ebf54b 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Chunks/PngChunkIDAT.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Chunks 2 | { 3 | /// 4 | /// IDAT chunk http://www.w3.org/TR/PNG/#11IDAT 5 | /// 6 | /// This object is dummy placeholder - We treat this chunk in a very different way than ancillary chnks 7 | /// 8 | internal class PngChunkIDAT : PngChunkMultiple 9 | { 10 | public const string ID = ChunkHelper.IDAT; 11 | 12 | public PngChunkIDAT(ImageInfo i, int len, long offset) : base(ID, i) 13 | { 14 | Length = len; 15 | Offset = offset; 16 | } 17 | 18 | public override ChunkOrderingConstraint GetOrderingConstraint() 19 | { 20 | return ChunkOrderingConstraint.NA; 21 | } 22 | 23 | public override ChunkRaw CreateRawChunk() 24 | {// does nothing 25 | return null; 26 | } 27 | 28 | public override void ParseFromRaw(ChunkRaw c) 29 | { // does nothing 30 | } 31 | 32 | public override void CloneDataFromRead(PngChunk other) 33 | { 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Core_Screencap_KKEC/Core_Screencap_KKEC.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | eabcca02-ea25-4451-935b-b293d8bd02dd 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Core_ColorCorrector/Core_ColorCorrector.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | c9f5729a-c6e2-4e2f-a68d-4fdf757b2e58 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Core_Screencap_AIHS2/Core_Screencap_AIHS2.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | cfc6ee58-cd1b-4a21-b281-c6e9d5d0390d 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Core_SliderUnlocker/Core_SliderUnlocker.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7cba15ab-52d1-4506-a7bf-9d23060ecf5d 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/AI_SliderUnlocker/AI_SliderUnlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | SliderUnlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Core_Sideloader_Studio/Core_Sideloader_Studio.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 66214bd2-6da6-49cd-8c74-63da9e643259 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Core_ExtensibleSaveFormat/Core_ExtensibleSaveFormat.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 61e63b45-1d21-44f7-9b01-f5209c05ffb4 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/AI_ConfigurationManager/AI_ConfigurationManager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ConfigurationManagerWrapper 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Core_Screencap_KKEC/Core_Screencap.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | eabcca02-ea25-4451-935b-b293d8bd02dd 7 | 8 | 9 | Core_Screencap 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Core_ExtensibleSaveFormat_Patcher/Core_ExtensibleSaveFormat_Patcher.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5fbb99f7-d478-4bf1-bce4-47f0b1501142 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Core_ExtensibleSaveFormat_Studio/Core_ExtensibleSaveFormat_Studio.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20fd60f3-3086-4a25-876b-e977bda46687 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/HS2_SliderUnlocker/HS2_SliderUnlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | SliderUnlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/KKS_InputUnlocker/KKS_InputUnlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | InputUnlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/KKS_ColorCorrector/KKS_ColorCorrector.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ColorCorrector 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/KK_BGMLoader/KK.BGMLoader.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | using XUnity.ResourceRedirector; 4 | 5 | namespace BGMLoader 6 | { 7 | [BepInProcess(Constants.GameProcessName)] 8 | [BepInProcess(Constants.GameProcessNameSteam)] 9 | [BepInProcess(Constants.VRProcessName)] 10 | [BepInProcess(Constants.VRProcessNameSteam)] 11 | [BepInPlugin(GUID, PluginName, Version)] 12 | [BepInDependency(XUnity.ResourceRedirector.Constants.PluginData.Identifier)] 13 | public partial class BGMLoader : BaseUnityPlugin 14 | { 15 | private static bool TryGetOverrideFileName(IAssetLoadingContext context, out string overrideFileName) 16 | { 17 | var isBgm = context.Parameters.Name.Length == 6 && context.Parameters.Name.StartsWith("bgm", System.StringComparison.InvariantCultureIgnoreCase); 18 | if (!isBgm) 19 | { 20 | overrideFileName = null; 21 | return false; 22 | } 23 | int bgmTrack = int.Parse(context.Parameters.Name.Substring(context.Parameters.Name.Length - 2, 2)); 24 | overrideFileName = $"BGM{bgmTrack:00}.ogg"; 25 | return true; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/PngIDatChunkOutputStream.cs: -------------------------------------------------------------------------------- 1 | using Pngcs.Chunks; 2 | using System.IO; 3 | 4 | namespace Pngcs 5 | { 6 | /// 7 | /// outputs the stream for IDAT chunk , fragmented at fixed size (32k default). 8 | /// 9 | /// 10 | internal class PngIDatChunkOutputStream : ProgressiveOutputStream 11 | { 12 | private const int SIZE_DEFAULT = 32768;// 32k 13 | private readonly Stream outputStream; 14 | 15 | public PngIDatChunkOutputStream(Stream outputStream_0) : this(outputStream_0, SIZE_DEFAULT) { } 16 | 17 | public PngIDatChunkOutputStream(Stream outputStream_0, int size) : base(size > 8 ? size : SIZE_DEFAULT) 18 | { 19 | outputStream = outputStream_0; 20 | } 21 | 22 | protected override void FlushBuffer(byte[] b, int len) 23 | { 24 | ChunkRaw c = new ChunkRaw(len, ChunkHelper.b_IDAT, false) { Data = b }; 25 | c.WriteChunk(outputStream); 26 | } 27 | 28 | public override void Close() 29 | { 30 | // closing the IDAT stream only flushes it, it does not close the underlying stream 31 | Flush(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/HC_ConfigurationManager/HC_ConfigurationManager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | enable 5 | ConfigurationManagerWrapper 6 | 7 | 8 | 9 | 10 | 11 | NU1701 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/KKS_BGMLoader/KKS.BGMLoader.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | using XUnity.ResourceRedirector; 4 | 5 | namespace BGMLoader 6 | { 7 | [BepInProcess(Constants.GameProcessName)] 8 | [BepInPlugin(GUID, PluginName, Version)] 9 | [BepInDependency(XUnity.ResourceRedirector.Constants.PluginData.Identifier)] 10 | public partial class BGMLoader : BaseUnityPlugin 11 | { 12 | private static bool TryGetOverrideFileName(IAssetLoadingContext context, out string overrideFileName) 13 | { 14 | overrideFileName = null; 15 | 16 | //kks_song_00 or kks_bgm_00 17 | var isBgm = context.Parameters.Name.Length == 10 && context.Parameters.Name.StartsWith("kks_bgm", System.StringComparison.InvariantCultureIgnoreCase) || 18 | context.Parameters.Name.Length == 11 && context.Parameters.Name.StartsWith("kks_song", System.StringComparison.InvariantCultureIgnoreCase); 19 | if (!isBgm) return false; 20 | 21 | var parts = context.Parameters.Name.Split('_'); 22 | if (parts.Length != 3) return false; 23 | 24 | overrideFileName = $"{parts[1].ToUpper()}{int.Parse(parts[2]):00}.ogg"; 25 | return true; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Zlib/ZlibInputStreamIs.cs: -------------------------------------------------------------------------------- 1 | 2 | #if SHARPZIPLIB 3 | 4 | // ONLY IF SHARPZIPLIB IS AVAILABLE 5 | namespace Pngcs.Zlib 6 | { 7 | /// 8 | /// Zip input (inflater) based on ShaprZipLib 9 | /// 10 | class ZlibInputStreamIs : AZlibInputStream 11 | { 12 | 13 | private InflaterInputStream ist; 14 | 15 | public ZlibInputStreamIs(Stream st, bool leaveOpen) 16 | : base(st, leaveOpen) 17 | { 18 | ist = new InflaterInputStream(st); 19 | ist.IsStreamOwner = !leaveOpen; 20 | } 21 | 22 | public override int Read(byte[] array, int offset, int count) 23 | { 24 | return ist.Read(array, offset, count); 25 | } 26 | 27 | public override int ReadByte() 28 | { 29 | return ist.ReadByte(); 30 | } 31 | 32 | public override void Close() 33 | { 34 | ist.Close(); 35 | } 36 | 37 | 38 | public override void Flush() 39 | { 40 | ist.Flush(); 41 | } 42 | 43 | public override String getImplementationId() 44 | { 45 | return "Zlib inflater: SharpZipLib"; 46 | } 47 | } 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/EC_SliderUnlocker/EC_SliderUnlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | SliderUnlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Core_Screencap/shader_source/opaque_screencap.shader: -------------------------------------------------------------------------------- 1 | // By RikkiBallboa 2 | Shader "Unlit/composite" 3 | { 4 | Properties 5 | { 6 | _MainTex("MainTex", 2D) = "white" {} 7 | } 8 | 9 | SubShader 10 | { 11 | Pass 12 | { 13 | Name "Unlit" 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | 18 | uniform sampler2D _MainTex; 19 | 20 | struct VertexInput { 21 | float4 vertex : POSITION; 22 | float2 texcoord0 : TEXCOORD0; 23 | }; 24 | struct VertexOutput { 25 | float4 pos : SV_POSITION; 26 | float2 uv0 : TEXCOORD0; 27 | }; 28 | VertexOutput vert (VertexInput v) { 29 | VertexOutput o; 30 | o.uv0 = v.texcoord0; 31 | o.pos = UnityObjectToClipPos(v.vertex); 32 | return o; 33 | } 34 | 35 | fixed4 frag (VertexOutput i) : COLOR 36 | { 37 | float4 mt = tex2D(_MainTex, i.uv0); 38 | mt.a = 1; 39 | 40 | return mt; 41 | } 42 | ENDCG 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/EC_ConfigurationManager/EC_ConfigurationManager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ConfigurationManagerWrapper 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/KKS_SliderUnlocker/KKS_SliderUnlocker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | SliderUnlocker 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/EC_BGMLoader/EC_BGMLoader.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | BGMLoader 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/FileHelper.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs 2 | { 3 | using System.IO; 4 | 5 | /// 6 | /// A few utility static methods to read and write files 7 | /// 8 | internal class FileHelper 9 | { 10 | public static Stream OpenFileForWriting(string file, bool allowOverwrite) 11 | { 12 | if (File.Exists(file) && !allowOverwrite) 13 | throw new PngjOutputException($"File already exists ({ file }) and overwrite=false"); 14 | Stream osx = new FileStream(file, FileMode.Create, FileAccess.Write, FileShare.None); 15 | return osx; 16 | } 17 | 18 | /// 19 | /// Given a filename and a ImageInfo, produces a PngWriter object, ready for writing. 20 | /// Path of file 21 | /// ImageInfo object 22 | /// Flag: if false and file exists, a PngjOutputException is thrown 23 | /// A PngWriter object, ready for writing 24 | public static PngWriter CreatePngWriter(string fileName, ImageInfo imgInfo, bool allowOverwrite) 25 | { 26 | return new PngWriter(OpenFileForWriting(fileName, allowOverwrite), imgInfo, fileName); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/AI_BGMLoader/AI_BGMLoader.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | BGMLoader 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/AI_ExtensibleSaveFormat/AI.ExtendedSave.Hooks.cs: -------------------------------------------------------------------------------- 1 | using AIProject.UI; 2 | using CharaCustom; 3 | using HarmonyLib; 4 | 5 | namespace ExtensibleSaveFormat 6 | { 7 | public partial class ExtendedSave 8 | { 9 | internal static partial class Hooks 10 | { 11 | //Override ExtSave for list loading at game startup 12 | [HarmonyPrefix] 13 | [HarmonyPatch(typeof(CustomCharaFileInfoAssist), nameof(CustomCharaFileInfoAssist.CreateCharaFileInfoList))] 14 | [HarmonyPatch(typeof(CustomClothesFileInfoAssist), nameof(CustomClothesFileInfoAssist.CreateClothesFileInfoList))] 15 | [HarmonyPatch(typeof(GameCoordinateFileInfoAssist), nameof(GameCoordinateFileInfoAssist.CreateCoordinateFileInfoList))] 16 | private static void CreateListPrefix() => LoadEventsEnabled = false; 17 | [HarmonyPostfix] 18 | [HarmonyPatch(typeof(CustomCharaFileInfoAssist), nameof(CustomCharaFileInfoAssist.CreateCharaFileInfoList))] 19 | [HarmonyPatch(typeof(CustomClothesFileInfoAssist), nameof(CustomClothesFileInfoAssist.CreateClothesFileInfoList))] 20 | [HarmonyPatch(typeof(GameCoordinateFileInfoAssist), nameof(GameCoordinateFileInfoAssist.CreateCoordinateFileInfoList))] 21 | private static void CreateListPostfix() => LoadEventsEnabled = true; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/SVS_ConfigurationManager/SVS_ConfigurationManager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | enable 5 | ConfigurationManagerWrapper 6 | 7 | 8 | 9 | 10 | 11 | NU1701 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/AI_Screencap/shader_source/composite.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/composite" 2 | { 3 | Properties 4 | { 5 | _MainTex("MainTex", 2D) = "white" {} 6 | _Overlay("Overlay", 2D) = "white" {} 7 | } 8 | 9 | SubShader 10 | { 11 | Tags 12 | { 13 | "Queue"="Transparent" 14 | "RenderType"="Transparent" 15 | } 16 | Pass 17 | { 18 | ZWrite Off 19 | Blend SrcAlpha OneMinusSrcAlpha 20 | 21 | CGPROGRAM 22 | #pragma vertex vert 23 | #pragma fragment frag 24 | 25 | uniform sampler2D _MainTex; 26 | uniform sampler2D _Overlay; 27 | 28 | struct VertexInput { 29 | float4 vertex : POSITION; 30 | float2 texcoord0 : TEXCOORD0; 31 | }; 32 | struct VertexOutput { 33 | float4 pos : SV_POSITION; 34 | float2 uv0 : TEXCOORD0; 35 | }; 36 | VertexOutput vert (VertexInput v) { 37 | VertexOutput o; 38 | o.uv0 = v.texcoord0; 39 | o.pos = UnityObjectToClipPos(v.vertex); 40 | return o; 41 | } 42 | 43 | float4 frag (VertexOutput i) : COLOR 44 | { 45 | float4 mt = tex2D(_MainTex, i.uv0); 46 | float4 ol = tex2D(_Overlay, i.uv0); 47 | return float4(mt.rgb, ol.a); 48 | } 49 | ENDCG 50 | } 51 | } 52 | FallBack "Diffuse" 53 | } -------------------------------------------------------------------------------- /src/Core_InputUnlocker/Core.InputUnlocker.cs: -------------------------------------------------------------------------------- 1 | using BepisPlugins; 2 | using UnityEngine.SceneManagement; 3 | using UnityEngine.UI; 4 | 5 | namespace InputUnlocker 6 | { 7 | /// 8 | /// Unlocks the length of input fields. Particularly important for the character Name fields which only allow 8 characters. 9 | /// 10 | internal partial class InputUnlocker 11 | { 12 | public const string GUID = "com.bepis.bepinex.inputunlocker"; 13 | public const string PluginName = "Input Length Unlocker"; 14 | public const string Version = Constants.Version; 15 | 16 | protected void Awake() 17 | { 18 | foreach (var inputFieldObject in FindObjectsOfType()) 19 | UnlockInput(inputFieldObject); 20 | } 21 | 22 | private void LevelFinishedLoading(Scene scene, LoadSceneMode mode) 23 | { 24 | foreach (var obj in scene.GetRootGameObjects()) 25 | foreach (var inputFieldObject in obj.GetComponentsInChildren(true)) 26 | UnlockInput(inputFieldObject); 27 | } 28 | 29 | private void UnlockInput(InputField input) => input.characterLimit = 999; 30 | 31 | protected void OnEnable() => SceneManager.sceneLoaded += LevelFinishedLoading; 32 | 33 | protected void OnDisable() => SceneManager.sceneLoaded -= LevelFinishedLoading; 34 | } 35 | } -------------------------------------------------------------------------------- /src/Core_Sideloader_Studio/Core_Sideloader_Studio.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 66214bd2-6da6-49cd-8c74-63da9e643259 7 | 8 | 9 | Core_Sideloader_Studio 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/KK_BGMLoader/README.md: -------------------------------------------------------------------------------- 1 | ## BGMLoader 2 | Loads custom BGMs and clips played on game startup. Stock audio is replaced during runtime by custom clips from BepInEx\BGM and BepInEx\IntroClips directories. 3 | 4 | ### Intro clips 5 | Intro clips replace the "Koikatsu!" voice clips when the game starts. They have to be placed inside BepInEx\IntroClips and be in .wav format. They can have any filenames, as long as they have the .wav extension, e.g. `\Koikatsu\BepInEx\IntroClips\evil-laugh.wav` 6 | 7 | ### BGM clips 8 | BGM clips replace the background music played in the game. They have to be placed inside BepInEx\BGM and be in .ogg format. Their filenames need to be in BGMxx.ogg format, where xx is the number of the background music, e.g. `\Koikatsu\BepInEx\BGM\BGM00.ogg` 9 | 10 | #### List of background clips used by the game 11 | ``` 12 | BGM00 - Title 13 | BGM01 - MapMoveDay 14 | BGM02 - MapMoveEve 15 | BGM03 - Custom 16 | BGM04 - Communication 17 | BGM05 - Encounter 18 | BGM06 - Lover 19 | BGM07 - Anger 20 | BGM08 - HSceneGentle 21 | BGM09 - HScene 22 | BGM10 - HScenePeep 23 | BGM11 - Sad 24 | BGM12 - Reminiscence 25 | BGM13 - Date 26 | BGM14 - MorningMenu 27 | BGM15 - NightMenu 28 | BGM16 - SystemMenu 29 | BGM17 - StaffRoom 30 | BGM18 - Daytime 31 | BGM19 - Evening 32 | BGM20 - Memories 33 | BGM21 - StaffRoom_01 34 | BGM22 - NightMenu_01 35 | BGM23 - Cool 36 | BGM24 - Lively 37 | BGM25 - Park 38 | BGM26 - Caffe 39 | BGM27 - Config 40 | ``` -------------------------------------------------------------------------------- /src/HS2_BGMLoader/HS2_BGMLoader.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | BGMLoader 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/HS2_ConfigurationManager/HS2_ConfigurationManager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ConfigurationManagerWrapper 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/HS2_SliderUnlocker/HS2.SliderUnlocker.VoicePitch.cs: -------------------------------------------------------------------------------- 1 | using AIChara; 2 | using HarmonyLib; 3 | 4 | namespace SliderUnlocker 5 | { 6 | internal static class VoicePitchUnlocker 7 | { 8 | private const float VanillaPitchLower = 0.94f; 9 | private const float VanillaPitchUpper = 1.06f; 10 | private const float VanillaPitchRange = VanillaPitchUpper - VanillaPitchLower; 11 | 12 | public static void Init() 13 | { 14 | Harmony.CreateAndPatchAll(typeof(VoicePitchUnlocker), nameof(VoicePitchUnlocker)); 15 | } 16 | 17 | [HarmonyPrefix, HarmonyPatch(typeof(ChaFileParameter), nameof(ChaFileParameter.voicePitch), MethodType.Getter)] 18 | private static bool VoicePitchHook(ChaFileParameter __instance, ref float __result) 19 | { 20 | // Replace line return Mathf.Lerp(0.94f, 1.06f, this.voiceRate); 21 | __result = VanillaPitchLower + __instance.voiceRate * VanillaPitchRange; 22 | return false; 23 | } 24 | 25 | [HarmonyPrefix, HarmonyPatch(typeof(ChaFileParameter2), nameof(ChaFileParameter2.voicePitch), MethodType.Getter)] 26 | private static bool VoicePitchHook2(ChaFileParameter2 __instance, ref float __result) 27 | { 28 | // Replace line return Mathf.Lerp(0.94f, 1.06f, this.voiceRate); 29 | __result = VanillaPitchLower + __instance.voiceRate * VanillaPitchRange; 30 | return false; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/HS2_BGMLoader/HS2.BGMLoader.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | using XUnity.ResourceRedirector; 4 | 5 | namespace BGMLoader 6 | { 7 | [BepInProcess(Constants.GameProcessName)] 8 | [BepInPlugin(GUID, PluginName, Version)] 9 | [BepInDependency(XUnity.ResourceRedirector.Constants.PluginData.Identifier)] 10 | public partial class BGMLoader : BaseUnityPlugin 11 | { 12 | private static bool TryGetOverrideFileName(IAssetLoadingContext context, out string overrideFileName) 13 | { 14 | overrideFileName = null; 15 | //hs2_bgm_10 or hs2a_bgm_00 or ai_bgm_10 16 | var isBgm = context.Parameters.Name.Length == 10 && context.Parameters.Name.StartsWith("hs2_bgm", System.StringComparison.InvariantCultureIgnoreCase) || 17 | context.Parameters.Name.Length == 11 && context.Parameters.Name.StartsWith("hs2a_bgm", System.StringComparison.InvariantCultureIgnoreCase) || 18 | context.Parameters.Name.Length == 9 && context.Parameters.Name.StartsWith("ai_bgm", System.StringComparison.InvariantCultureIgnoreCase); 19 | if (!isBgm) return false; 20 | 21 | var parts = context.Parameters.Name.Split('_'); 22 | if (parts.Length != 3) return false; 23 | //AI_BGM_10.ogg or HS2A_BGM_00.ogg or HS2_BGM_00.ogg 24 | overrideFileName = $"{parts[0].ToUpper()}_{parts[1].ToUpper()}_{int.Parse(parts[2]):00}.ogg"; 25 | return true; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/EC_Sideloader/EC.Sideloader.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepisPlugins; 3 | using Microsoft.Win32; 4 | using System; 5 | using System.IO; 6 | 7 | namespace Sideloader 8 | { 9 | [BepInProcess(Constants.GameProcessName)] 10 | public partial class Sideloader : BaseUnityPlugin 11 | { 12 | internal static readonly string[] GameNameList = { "emotioncreators", "emotion creators" }; 13 | 14 | private static string FindKoiZipmodDir() 15 | { 16 | try 17 | { 18 | // Don't look for the KK modpack if a copy of it is already installed in EC 19 | if (Directory.Exists(Path.Combine(Paths.GameRootPath, @"mods\Sideloader Modpack"))) 20 | return string.Empty; 21 | 22 | using (var key = Registry.CurrentUser.OpenSubKey(@"Software\Illusion\Koikatu\koikatu")) 23 | { 24 | if (key?.GetValue("INSTALLDIR") is string dir) 25 | { 26 | dir = Path.Combine(dir, @"mods\Sideloader Modpack"); 27 | if (Directory.Exists(dir)) 28 | return dir; 29 | } 30 | } 31 | } 32 | catch (Exception e) 33 | { 34 | Logger.LogError("Crash when trying to find Koikatsu mods directory"); 35 | Logger.LogError(e); 36 | } 37 | return string.Empty; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/KKS_BGMLoader/KKS_BGMLoader.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | BGMLoader 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/KKS_ConfigurationManager/KKS_ConfigurationManager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ConfigurationManagerWrapper 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/Core_Screencap/shader_source/rgAlpha2.shader: -------------------------------------------------------------------------------- 1 | Shader "rgAlpha" { 2 | Properties { 3 | _green("green", 2D) = "white" {} 4 | _MainTex("red", 2D) = "white" {} 5 | } 6 | SubShader { 7 | Pass { 8 | Name "Unlit" 9 | CGPROGRAM 10 | #pragma vertex vert 11 | #pragma fragment frag 12 | 13 | uniform sampler2D _green; 14 | uniform sampler2D _MainTex; 15 | 16 | struct VertexInput { 17 | float4 vertex : POSITION; 18 | float2 texcoord0 : TEXCOORD0; 19 | }; 20 | 21 | struct VertexOutput { 22 | float4 pos : SV_POSITION; 23 | float2 uv0 : TEXCOORD0; 24 | }; 25 | 26 | VertexOutput vert (VertexInput v) { 27 | VertexOutput o; 28 | o.uv0 = v.texcoord0; 29 | o.pos = UnityObjectToClipPos(v.vertex); 30 | return o; 31 | } 32 | 33 | fixed4 frag (VertexOutput i) : COLOR 34 | { 35 | float4 green = tex2D(_green, i.uv0); 36 | float4 red = tex2D(_MainTex, i.uv0); 37 | float3 comp = float3(green.r, red.g, min(red.b, green.b)); 38 | float3 diff = abs(red.rgb - green.rgb); 39 | float alpha = max(max(diff.x, diff.y), diff.z); 40 | return float4(alpha, alpha, alpha, 1); 41 | } 42 | ENDCG 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/EC_MessageCenter/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("EC_MessageCenter")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany(BepisPlugins.Metadata.CompanyName)] 11 | [assembly: AssemblyProduct("EC_MessageCenter")] 12 | [assembly: AssemblyCopyright("Copyright © 2019")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("8f93ac6a-525f-4b14-b119-5c87f067eb04")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion(BepisPlugins.MessageCenter.Version)] 36 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Zlib/ZlibStreamFactory.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace Pngcs.Zlib 4 | { 5 | internal class ZlibStreamFactory 6 | { 7 | public static AZlibInputStream CreateZlibInputStream(Stream st, bool leaveOpen) 8 | { 9 | //#if NET45 10 | return new ZlibInputStreamMs(st, leaveOpen); 11 | //#endif 12 | //#if SHARPZIPLIB 13 | // return new ZlibInputStreamIs(st, leaveOpen); 14 | //#endif 15 | } 16 | 17 | public static AZlibInputStream CreateZlibInputStream(Stream st) 18 | { 19 | return CreateZlibInputStream(st, false); 20 | } 21 | 22 | public static AZlibOutputStream CreateZlibOutputStream(Stream st, int compressLevel, EDeflateCompressStrategy strat, bool leaveOpen) 23 | { 24 | //#if NET45 25 | return new ZlibOutputStreamMs(st, compressLevel, strat, leaveOpen); 26 | //#endif 27 | //#if SHARPZIPLIB 28 | // return new ZlibOutputStreamIs(st, compressLevel, strat, leaveOpen); 29 | //#endif 30 | } 31 | 32 | public static AZlibOutputStream CreateZlibOutputStream(Stream st) 33 | { 34 | return CreateZlibOutputStream(st, false); 35 | } 36 | 37 | public static AZlibOutputStream CreateZlibOutputStream(Stream st, bool leaveOpen) 38 | { 39 | return CreateZlibOutputStream(st, DeflateCompressLevel.DEFAULT, EDeflateCompressStrategy.Default, leaveOpen); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/PH_ExtensibleSaveFormat/PH_ExtensibleSaveFormat.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | ExtensibleSaveFormat 6 | true 7 | 8 | ExtensibleSaveFormat.PlayHome 9 | $(Version) 10 | Allows additional data to be saved to character, coordinate and scene cards 11 | https://gitgoon.dev/IllusionMods/BepisPlugins 12 | GPL-3.0-only 13 | $(Copyright) 14 | IllusionMods 15 | https://gitgoon.dev/IllusionMods/BepisPlugins 16 | git 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/Core_Screencap/shader_source/composite.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/composite" 2 | { 3 | Properties 4 | { 5 | _MainTex("MainTex", 2D) = "white" {} 6 | _Overlay("Overlay", 2D) = "white" {} 7 | } 8 | 9 | SubShader 10 | { 11 | Pass 12 | { 13 | Name "Unlit" 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | 18 | uniform sampler2D _MainTex; 19 | uniform sampler2D _Overlay; 20 | 21 | struct VertexInput { 22 | float4 vertex : POSITION; 23 | float2 texcoord0 : TEXCOORD0; 24 | }; 25 | struct VertexOutput { 26 | float4 pos : SV_POSITION; 27 | float2 uv0 : TEXCOORD0; 28 | }; 29 | VertexOutput vert (VertexInput v) { 30 | VertexOutput o; 31 | o.uv0 = v.texcoord0; 32 | o.pos = UnityObjectToClipPos(v.vertex); 33 | return o; 34 | } 35 | 36 | fixed4 frag (VertexOutput i) : COLOR 37 | { 38 | float4 mt = tex2D(_MainTex, i.uv0); 39 | float4 o = tex2D(_Overlay, i.uv0); 40 | mt.rgb *= mt.a; 41 | o.rgb *= o.a; 42 | float3 rgb = o.rgb + (mt.rgb * (1 - o.a)); 43 | float a = o.a + mt.rgb * (1.0 - o.a); 44 | return float4(rgb, a); 45 | } 46 | ENDCG 47 | } 48 | } 49 | CustomEditor "ASEMaterialInspector" 50 | } 51 | -------------------------------------------------------------------------------- /src/KKS_Sideloader/KKS.Sideloader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using BepInEx; 4 | using BepisPlugins; 5 | using Microsoft.Win32; 6 | 7 | namespace Sideloader 8 | { 9 | [BepInProcess(Constants.GameProcessName)] 10 | [BepInProcess(Constants.VRProcessName)] 11 | [BepInProcess(Constants.StudioProcessName)] 12 | public partial class Sideloader : BaseUnityPlugin 13 | { 14 | internal static readonly string[] GameNameList = { "koikatsu sunshine", "koikatu sunshine", "コイカツ sunshine" }; 15 | 16 | private static string FindKoiZipmodDir() 17 | { 18 | try 19 | { 20 | // Don't look for the KK modpack if a copy of it is already installed in KKS 21 | if (Directory.Exists(Path.Combine(Paths.GameRootPath, @"mods\Sideloader Modpack"))) 22 | return string.Empty; 23 | 24 | using (var key = Registry.CurrentUser.OpenSubKey(@"Software\Illusion\Koikatu\koikatu")) 25 | { 26 | if (key?.GetValue("INSTALLDIR") is string dir) 27 | { 28 | dir = Path.Combine(dir, @"mods\Sideloader Modpack"); 29 | if (Directory.Exists(dir)) 30 | return dir; 31 | } 32 | } 33 | } 34 | catch (Exception e) 35 | { 36 | Logger.LogError("Crash when trying to find Koikatsu mods directory"); 37 | Logger.LogError(e); 38 | } 39 | return string.Empty; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Core_Screencap/shader_source/3d_screencap.shader: -------------------------------------------------------------------------------- 1 | // By RikkiBallboa 2 | Shader "3d_screencap" 3 | { 4 | Properties 5 | { 6 | _MainTex("MainTex", 2D) = "white" {} 7 | _TextureTwo("TextureTwo", 2D) = "white" {} 8 | _OverlapOffset("OverlapOffset", float) = 0.2 9 | } 10 | 11 | SubShader 12 | { 13 | Pass 14 | { 15 | Name "Unlit" 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | 20 | uniform sampler2D _MainTex; 21 | uniform sampler2D _TextureTwo; 22 | float _OverlapOffset; 23 | 24 | struct VertexInput { 25 | float4 vertex : POSITION; 26 | float2 texcoord0 : TEXCOORD0; 27 | }; 28 | struct VertexOutput { 29 | float4 pos : SV_POSITION; 30 | float2 uv0 : TEXCOORD0; 31 | }; 32 | VertexOutput vert (VertexInput v) { 33 | VertexOutput o; 34 | o.uv0 = v.texcoord0; 35 | o.pos = UnityObjectToClipPos(v.vertex); 36 | return o; 37 | } 38 | 39 | fixed4 frag (VertexOutput i) : COLOR 40 | { 41 | float4 mt = tex2D(_MainTex, i.uv0 * float2(2 - _OverlapOffset * 2, 1)); 42 | float4 t2 = tex2D(_TextureTwo, i.uv0 * float2(2 - _OverlapOffset * 2, 1) - float2(-_OverlapOffset * 2, 0)); 43 | return lerp(mt, t2, floor(i.uv0.x + 0.5)); 44 | } 45 | ENDCG 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /src/AI_Screencap/shader_source/Resize.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/VFXToolbox/ImageSequencer/Resize" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | _KernelAndSize("_KernelAndSize", Vector) = (1.0,1.0,1.0,1.0) 7 | } 8 | SubShader 9 | { 10 | // No culling or depth 11 | Cull Off ZWrite Off ZTest Always 12 | 13 | Pass 14 | { 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | 19 | struct appdata 20 | { 21 | float4 vertex : POSITION; 22 | float2 uv : TEXCOORD0; 23 | }; 24 | 25 | struct v2f 26 | { 27 | float2 uv : TEXCOORD0; 28 | float4 vertex : SV_POSITION; 29 | }; 30 | 31 | sampler2D _MainTex; 32 | float4 _KernelAndSize; 33 | 34 | v2f vert (appdata v) 35 | { 36 | v2f o; 37 | o.vertex = UnityObjectToClipPos(v.vertex); 38 | o.uv = v.uv; 39 | return o; 40 | } 41 | 42 | fixed4 frag (v2f i) : SV_Target 43 | { 44 | float2 ratio = _KernelAndSize.xy; 45 | float2 outSize = _KernelAndSize.zw; 46 | float2 inSize = ratio * outSize; 47 | float2 kernelSize = 1.0f / outSize; 48 | float2 texcoord = i.uv; 49 | 50 | int NUM_U = (int)ceil(ratio.x); 51 | int NUM_V = (int)ceil(ratio.y); 52 | 53 | float4 c = float4(0, 0, 0, 0); 54 | 55 | for (int i = 0; i < NUM_U; i++) 56 | for (int j = 0; j < NUM_V; j++) 57 | { 58 | float2 offset = float2((float)(i+1) / (NUM_U+1),(float)(j+1) / (NUM_V+1))-0.5f; 59 | float2 samplePos = texcoord + (kernelSize * offset); 60 | c += tex2Dlod(_MainTex, float4(samplePos, 0, 0)); 61 | } 62 | 63 | c /= (NUM_U * NUM_V); 64 | 65 | return c; 66 | } 67 | ENDCG 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/FilterType.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs 2 | { 3 | /// 4 | /// Internal PNG predictor filter, or a strategy to select it. 5 | /// 6 | public enum FilterType 7 | { 8 | /// 9 | /// No filtering 10 | /// 11 | FILTER_NONE = 0, 12 | /// 13 | /// SUB filter: uses same row 14 | /// 15 | FILTER_SUB = 1, 16 | /// 17 | /// UP filter: uses previous row 18 | /// 19 | FILTER_UP = 2, 20 | /// 21 | ///AVERAGE filter: uses neighbors 22 | /// 23 | FILTER_AVERAGE = 3, 24 | /// 25 | /// PAETH predictor 26 | /// 27 | FILTER_PAETH = 4, 28 | /// 29 | /// Default strategy: select one of the standard filters depending on global image parameters 30 | /// 31 | FILTER_DEFAULT = -1, 32 | /// 33 | /// Aggressive strategy: select dinamically the filters, trying every 8 rows 34 | /// 35 | FILTER_AGGRESSIVE = -2, 36 | /// 37 | /// Very aggressive and slow strategy: tries all filters for each row 38 | /// 39 | FILTER_VERYAGGRESSIVE = -3, 40 | /// 41 | /// Uses all fiters, one for lines, in cyclic way. Only useful for testing. 42 | /// 43 | FILTER_CYCLIC = -50, 44 | /// 45 | /// Not specified, placeholder for unknown or NA filters. 46 | /// 47 | FILTER_UNKNOWN = -100 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/IMGUIModule.Il2Cpp.CoreCLR.Patcher/IMGUIModule.Il2Cpp.CoreCLR.Patcher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | disable 5 | IMGUIModule.Il2Cpp.CoreCLR 6 | IMGUIModule.Il2Cpp.CoreCLR.Patcher 7 | ..\..\bin\BepInEx\patchers\ 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/KK_ExtensibleSaveFormat/KK_ExtensibleSaveFormat.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | ExtensibleSaveFormat 6 | ExtensibleSaveFormat 7 | true 8 | 9 | ExtensibleSaveFormat.Koikatu 10 | $(Version) 11 | Allows additional data to be saved to character, coordinate and scene cards 12 | https://gitgoon.dev/IllusionMods/BepisPlugins 13 | GPL-3.0-only 14 | $(Copyright) 15 | IllusionMods 16 | https://gitgoon.dev/IllusionMods/BepisPlugins 17 | git 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/Core_Screencap/BundleLoader.cs: -------------------------------------------------------------------------------- 1 | using BepisPlugins; 2 | using UnityEngine; 3 | 4 | namespace Screencap 5 | { 6 | internal static class BundleLoader 7 | { 8 | private static Material _matOpaque; 9 | private static Material _mat3d; 10 | 11 | public static Material MatOpaque 12 | { 13 | get 14 | { 15 | if (!_matOpaque) LoadBundleScreencap(); 16 | return _matOpaque; 17 | } 18 | } 19 | 20 | public static Material Mat3d 21 | { 22 | get 23 | { 24 | if (!_mat3d) LoadBundleScreencap(); 25 | return _mat3d; 26 | } 27 | } 28 | 29 | private static void LoadBundleScreencap() 30 | { 31 | var opaqAb = AssetBundle.LoadFromMemory(ResourceUtils.GetEmbeddedResource("screencap.unity3d")); 32 | _matOpaque = new Material(opaqAb.LoadAsset("opaque_screencap.shader")); 33 | _mat3d = new Material(opaqAb.LoadAsset("3d_screencap.shader")); 34 | opaqAb.Unload(false); 35 | } 36 | 37 | public static RenderTexture StitchImages(RenderTexture capture, RenderTexture capture2, float overlapOffset) 38 | { 39 | var xAdjust = (int)(capture.width * overlapOffset); 40 | var result = RenderTexture.GetTemporary((capture.width - xAdjust) * 2, capture.height, 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Default, 1); 41 | 42 | Mat3d.SetTexture("_TextureTwo", capture2); 43 | Mat3d.SetFloat("_OverlapOffset", overlapOffset); 44 | Graphics.Blit(capture, result, Mat3d); 45 | 46 | return result; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Zlib/Adler32.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Zlib 2 | { 3 | internal class Adler32 4 | { 5 | private uint a = 1; 6 | private uint b = 0; 7 | private const int _base = 65521; /* largest prime smaller than 65536 */ 8 | private const int _nmax = 5550; 9 | private int pend = 0; // how many bytes have I read witouth computing modulus 10 | 11 | public void Update(byte data) 12 | { 13 | if (pend >= _nmax) UpdateModulus(); 14 | a += data; 15 | b += a; 16 | pend++; 17 | } 18 | 19 | public void Update(byte[] data) 20 | { 21 | Update(data, 0, data.Length); 22 | } 23 | 24 | public void Update(byte[] data, int offset, int length) 25 | { 26 | int nextJToComputeModulus = _nmax - pend; 27 | for (int j = 0; j < length; j++) 28 | { 29 | if (j == nextJToComputeModulus) 30 | { 31 | UpdateModulus(); 32 | nextJToComputeModulus = j + _nmax; 33 | } 34 | unchecked 35 | { 36 | a += data[j + offset]; 37 | } 38 | b += a; 39 | pend++; 40 | } 41 | } 42 | 43 | public void Reset() 44 | { 45 | a = 1; 46 | b = 0; 47 | pend = 0; 48 | } 49 | 50 | private void UpdateModulus() 51 | { 52 | a %= _base; 53 | b %= _base; 54 | pend = 0; 55 | } 56 | 57 | public uint GetValue() 58 | { 59 | if (pend > 0) UpdateModulus(); 60 | return (b << 16) | a; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/Core_Screencap/Config/AlphaMode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Linq; 4 | 5 | #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member 6 | 7 | namespace Screencap 8 | { 9 | /// 10 | /// Different types of transparency used in screenshots. 11 | /// 12 | public enum AlphaMode 13 | { 14 | [Description("No transparency")] 15 | None = 0, 16 | #if HS2 || AI 17 | [Description("Composite")] 18 | composite = 1 19 | #else 20 | [Description("Cutout transparency (hard edges)")] 21 | blackout = 1, 22 | [Description("Gradual transparency (has issues with some effects)")] 23 | rgAlpha = 2, 24 | #endif 25 | } 26 | 27 | internal static class AlphaModeUtils 28 | { 29 | private static string GetDisplayName(this AlphaMode mode) 30 | { 31 | switch (mode) 32 | { 33 | case AlphaMode.None: 34 | return "No"; 35 | #if HS2 || AI 36 | case AlphaMode.composite: 37 | return "Composite"; 38 | #else 39 | case AlphaMode.blackout: 40 | return "Cutout"; 41 | case AlphaMode.rgAlpha: 42 | return "Gradual"; 43 | #endif 44 | default: 45 | return null; 46 | }; 47 | } 48 | 49 | public static readonly AlphaMode Default = 50 | #if HS2 || AI 51 | AlphaMode.composite; 52 | #else 53 | AlphaMode.rgAlpha; 54 | #endif 55 | 56 | public static readonly string[] AllModes = Enum.GetValues(typeof(AlphaMode)).Cast().OrderBy(x => (int)x).Select(x => x.GetDisplayName()).ToArray(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Core_Screencap/shader_source/Resize.shader: -------------------------------------------------------------------------------- 1 | //From: https://github.com/Unity-Technologies/VFXToolbox/blob/master/com.unity.vfx-toolbox/ImageSequencer/Editor/Shaders/Resize.shader 2 | 3 | Shader "Hidden/VFXToolbox/ImageSequencer/Resize" 4 | { 5 | Properties 6 | { 7 | _MainTex ("Texture", 2D) = "white" {} 8 | _KernelAndSize("_KernelAndSize", Vector) = (1.0,1.0,1.0,1.0) 9 | } 10 | SubShader 11 | { 12 | // No culling or depth 13 | Cull Off ZWrite Off ZTest Always 14 | 15 | Pass 16 | { 17 | CGPROGRAM 18 | #pragma vertex vert 19 | #pragma fragment frag 20 | 21 | struct appdata 22 | { 23 | float4 vertex : POSITION; 24 | float2 uv : TEXCOORD0; 25 | }; 26 | 27 | struct v2f 28 | { 29 | float2 uv : TEXCOORD0; 30 | float4 vertex : SV_POSITION; 31 | }; 32 | 33 | sampler2D _MainTex; 34 | float4 _KernelAndSize; 35 | 36 | v2f vert (appdata v) 37 | { 38 | v2f o; 39 | o.vertex = UnityObjectToClipPos(v.vertex); 40 | o.uv = v.uv; 41 | return o; 42 | } 43 | 44 | fixed4 frag (v2f i) : SV_Target 45 | { 46 | float2 ratio = _KernelAndSize.xy; 47 | float2 outSize = _KernelAndSize.zw; 48 | float2 inSize = ratio * outSize; 49 | float2 kernelSize = 1.0f / outSize; 50 | float2 texcoord = i.uv; 51 | 52 | int NUM_U = (int)ceil(ratio.x); 53 | int NUM_V = (int)ceil(ratio.y); 54 | 55 | float4 c = float4(0, 0, 0, 0); 56 | 57 | for (int i = 0; i < NUM_U; i++) 58 | for (int j = 0; j < NUM_V; j++) 59 | { 60 | float2 offset = float2((float)(i+1) / (NUM_U+1),(float)(j+1) / (NUM_V+1))-0.5f; 61 | float2 samplePos = texcoord + (kernelSize * offset); 62 | c += tex2Dlod(_MainTex, float4(samplePos, 0, 0)); 63 | } 64 | 65 | c /= (NUM_U * NUM_V); 66 | 67 | return c; 68 | } 69 | ENDCG 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Chunks/ChunkCopyBehaviour.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Chunks 2 | { 3 | /// 4 | /// Behaviours for chunks transfer when reading and writing. 5 | /// 6 | /// 7 | /// They are bitmasks, can be OR-ed 8 | /// 9 | internal class ChunkCopyBehaviour 10 | { 11 | /// 12 | /// Don't copy any chunk 13 | /// 14 | public static readonly int COPY_NONE = 0; 15 | 16 | /// 17 | /// Copy the Palette, if present 18 | /// 19 | public static readonly int COPY_PALETTE = 1; 20 | 21 | /// 22 | /// Copy all SAFE chunks 23 | /// 24 | public static readonly int COPY_ALL_SAFE = 1 << 2; 25 | 26 | /// 27 | /// Copy all chunks (includes palette) 28 | /// 29 | public static readonly int COPY_ALL = 1 << 3; 30 | 31 | /// 32 | /// Copy Physical resolution (DPI) 33 | /// 34 | public static readonly int COPY_PHYS = 1 << 4; 35 | 36 | /// 37 | /// Copy all textual chunks (not safe) 38 | /// 39 | public static readonly int COPY_TEXTUAL = 1 << 5; 40 | 41 | /// 42 | /// Copy transparency (not safe) 43 | /// 44 | public static readonly int COPY_TRANSPARENCY = 1 << 6; // 45 | 46 | /// 47 | /// Copy chunks unknown by our factory 48 | /// 49 | public static readonly int COPY_UNKNOWN = 1 << 7; 50 | 51 | /// 52 | /// Copy all known, except HIST, TIME and textual 53 | /// 54 | public static readonly int COPY_ALMOSTALL = 1 << 8; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/KKS_ExtensibleSaveFormat/KKS.ExtendedSave.Events.cs: -------------------------------------------------------------------------------- 1 | using BepInEx.Logging; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace ExtensibleSaveFormat 6 | { 7 | public partial class ExtendedSave 8 | { 9 | /// ImportEventHandler 10 | public delegate void ImportEventHandler(Dictionary importedExtendedData, Dictionary coordinateMapping); 11 | 12 | /// 13 | /// Contains all extended data read from the KK card. Key is data GUID. Convert your data and write it back to the dictionary to get it saved. 14 | /// coordinateMapping.Key is the index of KK coordinate, and Value is the new index of KKS coordinate. If Value is null the coordinate will be discarded. 15 | /// You can convert your data by simply switching coordinate IDs from Key to Value in your data. If Value is null you should remove data for that coordinate. 16 | /// 17 | public static event ImportEventHandler CardBeingImported; 18 | 19 | private static void CardImportEvent(Dictionary data, Dictionary coordinateMapping) 20 | { 21 | if (CardBeingImported != null) 22 | { 23 | foreach (var entry in CardBeingImported.GetInvocationList()) 24 | { 25 | var handler = (ImportEventHandler)entry; 26 | try 27 | { 28 | handler.Invoke(data, coordinateMapping); 29 | } 30 | catch (Exception ex) 31 | { 32 | Logger.Log(LogLevel.Error, $"Subscriber crash in {nameof(ExtendedSave)}.{nameof(CardBeingLoaded)} - {ex}"); 33 | } 34 | } 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Zlib/ZlibOutputStreamIs.cs: -------------------------------------------------------------------------------- 1 | 2 | #if SHARPZIPLIB 3 | // ONLY IF SHARPZIPLIB IS AVAILABLE 4 | 5 | namespace Pngcs.Zlib 6 | { 7 | /// 8 | /// Zlib output (deflater) based on ShaprZipLib 9 | /// 10 | class ZlibOutputStreamIs : AZlibOutputStream 11 | { 12 | private DeflaterOutputStream ost; 13 | private Deflater deflater; 14 | 15 | public ZlibOutputStreamIs(Stream st, int compressLevel, EDeflateCompressStrategy strat, bool leaveOpen) 16 | : base(st, compressLevel, strat, leaveOpen) 17 | { 18 | deflater = new Deflater(compressLevel); 19 | setStrat(strat); 20 | ost = new DeflaterOutputStream(st, deflater); 21 | ost.IsStreamOwner = !leaveOpen; 22 | } 23 | 24 | public void setStrat(EDeflateCompressStrategy strat) 25 | { 26 | if (strat == EDeflateCompressStrategy.Filtered) 27 | deflater.SetStrategy(DeflateStrategy.Filtered); 28 | else if (strat == EDeflateCompressStrategy.Huffman) 29 | deflater.SetStrategy(DeflateStrategy.HuffmanOnly); 30 | else deflater.SetStrategy(DeflateStrategy.Default); 31 | } 32 | 33 | public override void Write(byte[] buffer, int offset, int count) 34 | { 35 | ost.Write(buffer, offset, count); 36 | } 37 | 38 | public override void WriteByte(byte value) 39 | { 40 | ost.WriteByte(value); 41 | } 42 | 43 | public override void Close() 44 | { 45 | ost.Close(); 46 | } 47 | 48 | public override void Flush() 49 | { 50 | ost.Flush(); 51 | } 52 | 53 | public override String getImplementationId() 54 | { 55 | return "Zlib deflater: SharpZipLib"; 56 | } 57 | } 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/IMGUIModule.Il2Cpp.CoreCLR.Patcher/Replacements/GUILayoutGroup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace IMGUIModule.Il2Cpp.CoreCLR 5 | { 6 | internal class GUILayoutGroup : UnityEngine.GUILayoutGroup 7 | { 8 | public GUILayoutGroup() : base() { } 9 | public GUILayoutGroup(IntPtr pointer) : base(pointer) { } 10 | 11 | public new Rect PeekNext() 12 | { 13 | int cursor = m_Cursor; 14 | int count = entries.Count; 15 | if (cursor < count) 16 | return entries[cursor].rect; 17 | throw new ArgumentException(string.Concat( 18 | "Getting control ", 19 | cursor, 20 | "'s position in a group with only ", 21 | count, 22 | " controls when doing ", 23 | Event.current.rawType, 24 | "\nAborting")); 25 | } 26 | 27 | public new Rect GetLast() 28 | { 29 | int cursor = m_Cursor; 30 | if (cursor != 0) 31 | { 32 | int count = entries.Count; 33 | if (cursor <= count) 34 | return entries[cursor - 1].rect; 35 | UnityEngine.Debug.LogError(string.Concat( 36 | "Getting control ", 37 | cursor, 38 | "'s position in a group with only ", 39 | count, 40 | " controls when doing ", 41 | Event.current.type)); 42 | } 43 | else 44 | UnityEngine.Debug.LogError("You cannot call GetLast immediately after beginning a group."); 45 | return kDummyRect; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/EC_ExtensibleSaveFormat/EC_ExtensibleSaveFormat.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ExtensibleSaveFormat 6 | true 7 | 8 | ExtensibleSaveFormat.EmotionCreators 9 | $(Version) 10 | Allows additional data to be saved to character, coordinate and scene cards 11 | https://gitgoon.dev/IllusionMods/BepisPlugins 12 | GPL-3.0-only 13 | $(Copyright) 14 | IllusionMods 15 | https://gitgoon.dev/IllusionMods/BepisPlugins 16 | git 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/Core_Screencap_AIHS2/ScreenshotManager.AIHS2.Hooks.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection.Emit; 4 | using HarmonyLib; 5 | using UnityEngine; 6 | 7 | namespace Screencap 8 | { 9 | /// 10 | /// Disable built-in screenshots 11 | /// 12 | internal static partial class Hooks 13 | { 14 | public static void InstallHooks() 15 | { 16 | var h = Harmony.CreateAndPatchAll(typeof(Hooks), ScreenshotManager.GUID); 17 | 18 | var msvoType = System.Type.GetType("UnityEngine.Rendering.PostProcessing.MultiScaleVO, Unity.Postprocessing.Runtime"); 19 | if (msvoType == null) throw new ArgumentNullException(nameof(msvoType)); 20 | h.Patch(AccessTools.Method(msvoType, "PushAllocCommands"), transpiler: new HarmonyMethod(typeof(Hooks), nameof(AoBandingFix))); 21 | } 22 | 23 | // Separate screenshot class for the studio 24 | [HarmonyPrefix, HarmonyPatch(typeof(Studio.GameScreenShot), nameof(Studio.GameScreenShot.Capture), typeof(string))] 25 | private static bool StudioCaptureOverride() 26 | { 27 | return false; 28 | } 29 | 30 | // Fix AO banding in downscaled screenshots 31 | private static IEnumerable AoBandingFix(IEnumerable instructions) 32 | { 33 | foreach (var i in instructions) 34 | { 35 | if (i.opcode == OpCodes.Ldc_I4_S) 36 | { 37 | if ((int)RenderTextureFormat.RHalf == Convert.ToInt32(i.operand)) 38 | i.operand = (sbyte)RenderTextureFormat.RFloat; 39 | else if ((int)RenderTextureFormat.RGHalf == Convert.ToInt32(i.operand)) 40 | i.operand = (sbyte)RenderTextureFormat.RGFloat; 41 | } 42 | yield return i; 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/AI_ExtensibleSaveFormat/AI_ExtensibleSaveFormat.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ExtensibleSaveFormat 6 | true 7 | 8 | ExtensibleSaveFormat.AIGirl 9 | $(Version) 10 | Allows additional data to be saved to character, coordinate and scene cards 11 | https://gitgoon.dev/IllusionMods/BepisPlugins 12 | GPL-3.0-only 13 | $(Copyright) 14 | IllusionMods 15 | https://gitgoon.dev/IllusionMods/BepisPlugins 16 | git 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/KK_Screencap/KK_Screencap.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net35 4 | Library 5 | Screencap 6 | true 7 | Screencap 8 | 9 | ScreenshotManager.Koikatu 10 | $(Version) 11 | Utility for capturing screenshots 12 | https://gitgoon.dev/IllusionMods/BepisPlugins 13 | GPL-3.0-only 14 | $(Copyright) 15 | IllusionMods 16 | https://gitgoon.dev/IllusionMods/BepisPlugins 17 | git 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ..\..\lib\PostProcessingRuntime.dll 32 | False 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/Core_Screencap/shader_source/EquirectangularConverter.shader: -------------------------------------------------------------------------------- 1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' 2 | 3 | // Credit: https://github.com/Mapiarz/CubemapToEquirectangular/blob/master/Assets/Shaders/CubemapToEquirectangular.shader 4 | 5 | Shader "Hidden/CubemapToEquirectangular" { 6 | Properties { 7 | _MainTex ("Cubemap (RGB)", CUBE) = "" {} 8 | } 9 | 10 | Subshader { 11 | Pass { 12 | ZTest Always Cull Off ZWrite Off 13 | Fog { Mode off } 14 | 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | #pragma fragmentoption ARB_precision_hint_fastest 19 | //#pragma fragmentoption ARB_precision_hint_nicest 20 | #include "UnityCG.cginc" 21 | 22 | #define PI 3.141592653589793 23 | #define TWOPI 6.283185307179587 24 | 25 | float4x4 _CameraRotationMatrix = (1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1); 26 | int _is180 = 0; 27 | 28 | struct v2f { 29 | float4 pos : POSITION; 30 | float2 uv : TEXCOORD0; 31 | }; 32 | 33 | samplerCUBE _MainTex; 34 | 35 | v2f vert( appdata_img v ) 36 | { 37 | v2f o; 38 | o.pos = UnityObjectToClipPos(v.vertex); 39 | if (_is180 == 1){ 40 | o.uv = v.texcoord.xy * float2(PI, PI); 41 | }else{ 42 | o.uv = v.texcoord.xy * float2(TWOPI, PI); 43 | } 44 | return o; 45 | } 46 | 47 | fixed4 frag(v2f i) : COLOR 48 | { 49 | float theta = i.uv.y; 50 | float phi = i.uv.x; 51 | if (_is180 == 1){ 52 | phi = i.uv.x+PI/2; 53 | } 54 | float3 unit = float3(0,0,0); 55 | unit.x = sin(phi) * sin(theta) * -1; 56 | unit.y = cos(theta) * -1; 57 | unit.z = cos(phi) * sin(theta) * -1; 58 | 59 | // Rotate the unit vector by the camera rotation matrix so it aligns with the camera direction 60 | unit = mul(_CameraRotationMatrix, float4(unit.x, unit.y, unit.z, 0)).xyz; 61 | 62 | return texCUBE(_MainTex, unit); 63 | } 64 | ENDCG 65 | } 66 | } 67 | Fallback Off 68 | } -------------------------------------------------------------------------------- /src/HS2_ExtensibleSaveFormat/HS2.ExtendedSave.Hooks.cs: -------------------------------------------------------------------------------- 1 | using CharaCustom; 2 | using CoordinateFileSystem; 3 | using HarmonyLib; 4 | using HS2; 5 | using System.Collections; 6 | 7 | namespace ExtensibleSaveFormat 8 | { 9 | public partial class ExtendedSave 10 | { 11 | internal static partial class Hooks 12 | { 13 | //Override ExtSave for list loading at game startup 14 | [HarmonyPrefix] 15 | [HarmonyPatch(typeof(Config.ConfigCharaSelectUI), "CreateList")] 16 | [HarmonyPatch(typeof(CustomCharaFileInfoAssist), nameof(CustomCharaFileInfoAssist.CreateCharaFileInfoList))] 17 | [HarmonyPatch(typeof(CustomClothesFileInfoAssist), nameof(CustomClothesFileInfoAssist.CreateClothesFileInfoList))] 18 | [HarmonyPatch(typeof(CoordinateFileInfoAssist), nameof(CoordinateFileInfoAssist.CreateCharaFileInfoList))] 19 | private static void CreateListPrefix() => LoadEventsEnabled = false; 20 | [HarmonyPostfix] 21 | [HarmonyPatch(typeof(Config.ConfigCharaSelectUI), "CreateList")] 22 | [HarmonyPatch(typeof(CustomCharaFileInfoAssist), nameof(CustomCharaFileInfoAssist.CreateCharaFileInfoList))] 23 | [HarmonyPatch(typeof(CustomClothesFileInfoAssist), nameof(CustomClothesFileInfoAssist.CreateClothesFileInfoList))] 24 | [HarmonyPatch(typeof(CoordinateFileInfoAssist), nameof(CoordinateFileInfoAssist.CreateCharaFileInfoList))] 25 | private static void CreateListPostfix() => LoadEventsEnabled = true; 26 | 27 | [HarmonyPostfix, HarmonyPatch(typeof(TitleScene), nameof(TitleScene.LoadChara))] 28 | private static void FixTitleLoadCharaRace(ref IEnumerator __result) 29 | { 30 | // Title character gets loaded in Start and causes a race condition with extended data stuff. Delay the load 1 frame to avoid this 31 | var orig = __result; 32 | __result = new[] { null, orig }.GetEnumerator(); 33 | } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /src/KKS_ExtensibleSaveFormat/KKS_ExtensibleSaveFormat.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ExtensibleSaveFormat 6 | true 7 | 8 | ExtensibleSaveFormat.KoikatsuSunshine 9 | $(Version) 10 | Allows additional data to be saved to character, coordinate and scene cards 11 | https://gitgoon.dev/IllusionMods/BepisPlugins 12 | GPL-3.0-only 13 | $(Copyright) 14 | IllusionMods 15 | https://gitgoon.dev/IllusionMods/BepisPlugins 16 | git 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Zlib/AZlibInputStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace Pngcs.Zlib 5 | { 6 | internal abstract class AZlibInputStream : Stream 7 | { 8 | protected readonly Stream rawStream; 9 | protected readonly bool leaveOpen; 10 | 11 | public AZlibInputStream(Stream st, bool leaveOpen) 12 | { 13 | rawStream = st; 14 | this.leaveOpen = leaveOpen; 15 | } 16 | 17 | public override bool CanRead 18 | { 19 | get { return true; } 20 | } 21 | 22 | public override bool CanWrite 23 | { 24 | get { return false; } 25 | } 26 | 27 | public override void SetLength(long value) 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | 32 | public override bool CanSeek 33 | { 34 | get { return false; } 35 | } 36 | 37 | public override long Seek(long offset, SeekOrigin origin) 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | 42 | public override long Position 43 | { 44 | get 45 | { 46 | throw new NotImplementedException(); 47 | } 48 | set 49 | { 50 | throw new NotImplementedException(); 51 | } 52 | } 53 | 54 | public override long Length 55 | { 56 | get { throw new NotImplementedException(); } 57 | } 58 | 59 | 60 | public override void Write(byte[] buffer, int offset, int count) 61 | { 62 | throw new NotImplementedException(); 63 | } 64 | 65 | public override bool CanTimeout 66 | { 67 | get 68 | { 69 | return false; 70 | } 71 | } 72 | 73 | /// 74 | /// mainly for debugging 75 | /// 76 | /// 77 | public abstract string GetImplementationId(); 78 | } 79 | } 80 | 81 | -------------------------------------------------------------------------------- /src/Core_Screencap_KKEC/ScreenshotManager.KKEC.Hooks.cs: -------------------------------------------------------------------------------- 1 | using ChaCustom; 2 | using HarmonyLib; 3 | using UnityEngine; 4 | 5 | namespace Screencap 6 | { 7 | internal static partial class Hooks 8 | { 9 | /// Chara card Render/Downsample rate. 10 | private static int CardRenderRate => ScreenshotManager.CardDownscalingRate.Value; 11 | 12 | public static void InstallHooks() => Harmony.CreateAndPatchAll(typeof(Hooks), ScreenshotManager.GUID); 13 | /// 14 | /// Cancel the vanilla screenshot 15 | /// 16 | [HarmonyPrefix, HarmonyPatch(typeof(GameScreenShot), nameof(GameScreenShot.Capture))] 17 | private static bool CapturePrefix() => false; 18 | 19 | [HarmonyPrefix, HarmonyPatch(typeof(CustomCapture), nameof(CustomCapture.CreatePng))] 20 | private static bool CreatePngPrefix(ref int createW, ref int createH) 21 | { 22 | //Multiply up render resolution. 23 | createW *= CardRenderRate; 24 | createH *= CardRenderRate; 25 | return true; 26 | } 27 | 28 | [HarmonyPostfix, HarmonyPatch(typeof(CustomCapture), nameof(CustomCapture.CreatePng))] 29 | private static void CreatePngPostfix(ref byte[] pngData) => DownscaleEncoded(ref pngData); 30 | 31 | private static void DownscaleEncoded(ref byte[] encoded) 32 | { 33 | if (CardRenderRate <= 1) return; 34 | 35 | //Texture buffer for fullres. 36 | var t2d = new Texture2D(2, 2); 37 | t2d.LoadImage(encoded); 38 | 39 | //New width/height after downsampling. 40 | var nw = t2d.width / CardRenderRate; 41 | var nh = t2d.height / CardRenderRate; 42 | 43 | //Downsample texture 44 | var result = alphaShot.AlphaShot2.LanczosTex(t2d, nw, nh); 45 | var result2D = result.CopyToTexture2D(); 46 | RenderTexture.ReleaseTemporary(result); 47 | encoded = result2D.EncodeToPNG(); 48 | GameObject.DestroyImmediate(result2D); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Chunks/PngChunkIHDR.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Pngcs.Chunks 4 | { 5 | /// 6 | /// IHDR chunk: http://www.w3.org/TR/PNG/#11IHDR 7 | /// 8 | internal class PngChunkIHDR : PngChunkSingle 9 | { 10 | public const string ID = ChunkHelper.IHDR; 11 | public int Cols { get; set; } 12 | public int Rows { get; set; } 13 | public int Bitspc { get; set; } 14 | public int Colormodel { get; set; } 15 | public int Compmeth { get; set; } 16 | public int Filmeth { get; set; } 17 | public int Interlaced { get; set; } 18 | 19 | public PngChunkIHDR(ImageInfo info) : base(ID, info) { } 20 | 21 | public override ChunkOrderingConstraint GetOrderingConstraint() 22 | { 23 | return ChunkOrderingConstraint.NA; 24 | } 25 | 26 | public override ChunkRaw CreateRawChunk() 27 | { 28 | ChunkRaw c = new ChunkRaw(13, ChunkHelper.b_IHDR, true); 29 | int offset = 0; 30 | PngHelperInternal.WriteInt4tobytes(Cols, c.Data, offset); 31 | offset += 4; 32 | PngHelperInternal.WriteInt4tobytes(Rows, c.Data, offset); 33 | offset += 4; 34 | c.Data[offset++] = (byte)Bitspc; 35 | c.Data[offset++] = (byte)Colormodel; 36 | c.Data[offset++] = (byte)Compmeth; 37 | c.Data[offset++] = (byte)Filmeth; 38 | c.Data[offset++] = (byte)Interlaced; 39 | return c; 40 | } 41 | 42 | public override void CloneDataFromRead(PngChunk other) 43 | { 44 | PngChunkIHDR otherx = (PngChunkIHDR)other; 45 | Cols = otherx.Cols; 46 | Rows = otherx.Rows; 47 | Bitspc = otherx.Bitspc; 48 | Colormodel = otherx.Colormodel; 49 | Compmeth = otherx.Compmeth; 50 | Filmeth = otherx.Filmeth; 51 | Interlaced = otherx.Interlaced; 52 | } 53 | 54 | public override void ParseFromRaw(ChunkRaw c) 55 | { 56 | throw new NotImplementedException(); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/EC_Screencap/EC_Screencap.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | Screencap 6 | true 7 | 8 | ScreenshotManager.EmotionCreators 9 | $(Version) 10 | Utility for capturing screenshots 11 | https://gitgoon.dev/IllusionMods/BepisPlugins 12 | GPL-3.0-only 13 | $(Copyright) 14 | IllusionMods 15 | https://gitgoon.dev/IllusionMods/BepisPlugins 16 | git 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/HS2_ExtensibleSaveFormat/HS2_ExtensibleSaveFormat.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Library 5 | ExtensibleSaveFormat 6 | true 7 | 8 | ExtensibleSaveFormat.HoneySelect2 9 | $(Version) 10 | Allows additional data to be saved to character, coordinate and scene cards 11 | https://gitgoon.dev/IllusionMods/BepisPlugins 12 | GPL-3.0-only 13 | $(Copyright) 14 | IllusionMods 15 | https://gitgoon.dev/IllusionMods/BepisPlugins 16 | git 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/Shared/ResourceUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Linq; 4 | using System.Reflection; 5 | 6 | namespace BepisPlugins 7 | { 8 | /// 9 | /// Utility methods for working with embedded resources. 10 | /// 11 | internal static class ResourceUtils 12 | { 13 | /// 14 | /// Read all bytes starting at current position and ending at the end of the stream. 15 | /// 16 | public static byte[] ReadAllBytes(this Stream input) 17 | { 18 | var buffer = new byte[16 * 1024]; 19 | using (var ms = new MemoryStream()) 20 | { 21 | int read; 22 | while ((read = input.Read(buffer, 0, buffer.Length)) > 0) 23 | ms.Write(buffer, 0, read); 24 | return ms.ToArray(); 25 | } 26 | } 27 | 28 | /// 29 | /// Get a file set as "Embedded Resource" from the assembly that is calling this code, or optionally from a specified assembly. 30 | /// The filename is matched to the end of the resource path, no need to give the full path. 31 | /// If 0 or more than 1 resources match the provided filename, an exception is thrown. 32 | /// For example if you have a file "ProjectRoot\Resources\icon.png" set as "Embedded Resource", you can use this to load it by 33 | /// doing GetEmbeddedResource("icon.png"), assuming that no other embedded files have the same name. 34 | /// 35 | public static byte[] GetEmbeddedResource(string resourceFileName, Assembly containingAssembly = null) 36 | { 37 | if (containingAssembly == null) 38 | containingAssembly = Assembly.GetCallingAssembly(); 39 | 40 | var resourceName = containingAssembly.GetManifestResourceNames().Single(str => str.EndsWith(resourceFileName)); 41 | 42 | using (var stream = containingAssembly.GetManifestResourceStream(resourceName)) 43 | return ReadAllBytes(stream ?? throw new InvalidOperationException($"The resource {resourceFileName} was not found")); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Chunks/PngMetadata.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Chunks 2 | { 3 | 4 | /// Image Metadata, wrapper over a ChunksList 5 | /// 6 | /// Additional image info, apart from the ImageInfo and the pixels themselves. 7 | /// Includes Palette and ancillary chunks. 8 | /// This class provides a wrapper over the collection of chunks of a image (read or to write) and provides some high 9 | /// level methods to access them 10 | /// 11 | internal class PngMetadata 12 | { 13 | private readonly ChunksList chunkList; 14 | private readonly bool ReadOnly;// readonly 15 | 16 | internal PngMetadata(ChunksList chunks) 17 | { 18 | chunkList = chunks; 19 | if (chunks is ChunksListForWrite) 20 | { 21 | ReadOnly = false; 22 | } 23 | else 24 | { 25 | ReadOnly = true; 26 | } 27 | } 28 | 29 | /// Queues the chunk at the writer 30 | /// Chunk, ready for write 31 | /// Ovewrite lazily equivalent chunks 32 | /// Warning: the overwriting applies to equivalent chunks, see ChunkPredicateEquiv 33 | /// and will only make sense for queued (not yet writen) chunks 34 | /// 35 | public void QueueChunk(PngChunk chunk, bool lazyOverwrite) 36 | { 37 | ChunksListForWrite cl = GetChunkListW(); 38 | if (ReadOnly) { throw new PngjException("cannot set chunk : readonly metadata"); } 39 | if (lazyOverwrite) 40 | { 41 | ChunkHelper.TrimList(cl.GetQueuedChunks(), new ChunkPredicateEquiv(chunk)); 42 | } 43 | cl.Queue(chunk); 44 | } 45 | 46 | /// Queues the chunk at the writer 47 | /// Chunk, ready for write 48 | public void QueueChunk(PngChunk chunk) => QueueChunk(chunk, true); 49 | 50 | private ChunksListForWrite GetChunkListW() => (ChunksListForWrite)chunkList; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Zlib/CRC32.cs: -------------------------------------------------------------------------------- 1 | namespace Pngcs.Zlib 2 | { 3 | internal class CRC32 4 | { // based on http://damieng.com/blog/2006/08/08/calculating_crc32_in_c_and_net 5 | 6 | private const uint defaultPolynomial = 0xedb88320; 7 | private const uint defaultSeed = 0xffffffff; 8 | private static uint[] defaultTable; 9 | 10 | private uint hash; 11 | private readonly uint seed; 12 | private readonly uint[] table; 13 | 14 | public CRC32() : this(defaultPolynomial, defaultSeed) { } 15 | 16 | public CRC32(uint polynomial, uint seed) 17 | { 18 | table = InitializeTable(polynomial); 19 | this.seed = seed; 20 | hash = seed; 21 | } 22 | 23 | public void Update(byte[] buffer) 24 | { 25 | Update(buffer, 0, buffer.Length); 26 | } 27 | 28 | public void Update(byte[] buffer, int start, int length) 29 | { 30 | for (int i = 0, j = start; i < length; i++, j++) 31 | { 32 | unchecked 33 | { 34 | hash = (hash >> 8) ^ table[buffer[j] ^ hash & 0xff]; 35 | } 36 | } 37 | } 38 | 39 | public uint GetValue() 40 | { 41 | return ~hash; 42 | } 43 | 44 | public void Reset() 45 | { 46 | hash = seed; 47 | } 48 | 49 | private static uint[] InitializeTable(uint polynomial) 50 | { 51 | if (polynomial == defaultPolynomial && defaultTable != null) 52 | return defaultTable; 53 | uint[] createTable = new uint[256]; 54 | for (int i = 0; i < 256; i++) 55 | { 56 | uint entry = (uint)i; 57 | for (int j = 0; j < 8; j++) 58 | if ((entry & 1) == 1) 59 | entry = (entry >> 1) ^ polynomial; 60 | else 61 | entry = entry >> 1; 62 | createTable[i] = entry; 63 | } 64 | if (polynomial == defaultPolynomial) 65 | defaultTable = createTable; 66 | return createTable; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/Zlib/AZlibOutputStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace Pngcs.Zlib 5 | { 6 | internal abstract class AZlibOutputStream : Stream 7 | { 8 | protected readonly Stream rawStream; 9 | protected readonly bool leaveOpen; 10 | protected int compressLevel; 11 | protected EDeflateCompressStrategy strategy; 12 | 13 | public AZlibOutputStream(Stream st, int compressLevel, EDeflateCompressStrategy strat, bool leaveOpen) 14 | { 15 | rawStream = st; 16 | this.leaveOpen = leaveOpen; 17 | strategy = strat; 18 | this.compressLevel = compressLevel; 19 | } 20 | 21 | public override void SetLength(long value) 22 | { 23 | throw new NotImplementedException(); 24 | } 25 | 26 | public override bool CanSeek 27 | { 28 | get { return false; } 29 | } 30 | 31 | public override long Seek(long offset, SeekOrigin origin) 32 | { 33 | throw new NotImplementedException(); 34 | } 35 | 36 | public override long Position 37 | { 38 | get 39 | { 40 | throw new NotImplementedException(); 41 | } 42 | set 43 | { 44 | throw new NotImplementedException(); 45 | } 46 | } 47 | 48 | public override long Length 49 | { 50 | get { throw new NotImplementedException(); } 51 | } 52 | 53 | public override int Read(byte[] buffer, int offset, int count) 54 | { 55 | throw new NotImplementedException(); 56 | } 57 | 58 | public override bool CanRead 59 | { 60 | get { return false; } 61 | } 62 | 63 | public override bool CanWrite 64 | { 65 | get { return true; } 66 | } 67 | 68 | public override bool CanTimeout 69 | { 70 | get 71 | { 72 | return false; 73 | } 74 | } 75 | 76 | /// 77 | /// mainly for debugging 78 | /// 79 | /// 80 | public abstract string GetImplementationId(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/KK_SliderUnlocker/KK.SliderUnlocker.VoicePitch.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Code by essu 3 | * ~ can you hear me now? ~ 4 | */ 5 | using ChaCustom; 6 | using HarmonyLib; 7 | using System.Collections.Generic; 8 | using System.Reflection.Emit; 9 | 10 | namespace SliderUnlocker 11 | { 12 | internal static class VoicePitchUnlocker 13 | { 14 | private const float VanillaPitchLower = 0.94f; 15 | private const float VanillaPitchUpper = 1.06f; 16 | private const float VanillaPitchRange = VanillaPitchUpper - VanillaPitchLower; 17 | 18 | private const int ExtendedRangeLower = -500; 19 | private const int ExtendedRangeUpper = 500; 20 | 21 | public static void Init() 22 | { 23 | var harmony = Harmony.CreateAndPatchAll(typeof(VoicePitchUnlocker), nameof(VoicePitchUnlocker)); 24 | 25 | var iteratorType = typeof(CvsChara).GetNestedType("c__Iterator0", AccessTools.all); 26 | var iteratorMethod = AccessTools.Method(iteratorType, "MoveNext"); 27 | var transpiler = new HarmonyMethod(typeof(VoicePitchUnlocker), nameof(VoicePitchTpl)); 28 | harmony.Patch(iteratorMethod, null, null, transpiler); 29 | } 30 | 31 | [HarmonyPrefix, HarmonyPatch(typeof(ChaFileParameter), nameof(ChaFileParameter.voicePitch), MethodType.Getter)] 32 | private static bool VoicePitchHook(ChaFileParameter __instance, ref float __result) 33 | { 34 | // Replace line return Mathf.Lerp(0.94f, 1.06f, this.voiceRate); 35 | __result = VanillaPitchLower + __instance.voiceRate * VanillaPitchRange; 36 | return false; 37 | } 38 | 39 | public static IEnumerable VoicePitchTpl(IEnumerable _instructions) 40 | { 41 | // Changes constants in line this.inpPitchPow.text = CustomBase.ConvertTextFromRate(0, 100, this.param.voiceRate); 42 | var instructions = new List(_instructions).ToArray(); 43 | instructions[25].opcode = OpCodes.Ldc_I4; 44 | instructions[25].operand = ExtendedRangeLower; 45 | instructions[26].opcode = OpCodes.Ldc_I4; 46 | instructions[26].operand = ExtendedRangeUpper; 47 | return instructions; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/AI_Screencap/AI_Screencap.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net46 4 | Screencap 5 | true 6 | 7 | ScreenshotManager.AIGirl 8 | $(Version) 9 | Utility for capturing screenshots 10 | https://gitgoon.dev/IllusionMods/BepisPlugins 11 | GPL-3.0-only 12 | $(Copyright) 13 | IllusionMods 14 | https://gitgoon.dev/IllusionMods/BepisPlugins 15 | git 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/Core_Sideloader/Core_Sideloader.projitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | ce5a9fab-c188-4919-a296-d9b1422169e9 7 | 8 | 9 | Core_Sideloader 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/Core_Sideloader/UniversalAutoResolver/Core.UAR.StructValue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Reflection.Emit; 4 | 5 | namespace Sideloader.AutoResolver 6 | { 7 | internal class StructValue 8 | { 9 | internal SetterDelegate SetMethod { get; set; } 10 | internal GetterDelegate GetMethod { get; set; } 11 | internal Type StructType { get; set; } 12 | 13 | internal StructValue(PropertyInfo info) 14 | { 15 | var getter = CreateGetter(info); 16 | var setter = CreateSetter(info); 17 | 18 | SetMethod = setter; 19 | GetMethod = getter; 20 | } 21 | 22 | internal StructValue(FieldInfo info) 23 | { 24 | SetMethod = (obj, value) => info.SetValue(obj, value); 25 | GetMethod = (obj) => (TValue)info.GetValue(obj); 26 | } 27 | 28 | internal StructValue(SetterDelegate setMethod, GetterDelegate getMethod) 29 | { 30 | SetMethod = setMethod; 31 | GetMethod = getMethod; 32 | } 33 | 34 | #region Dynamics 35 | 36 | internal delegate TValue GetterDelegate(object obj); 37 | 38 | internal delegate void SetterDelegate(object obj, TValue value); 39 | 40 | private static GetterDelegate CreateGetter(PropertyInfo property) 41 | { 42 | DynamicMethod method = new DynamicMethod($"{property} Getter", typeof(TValue), new[] { typeof(object) }, true); 43 | var il = method.GetILGenerator(); 44 | 45 | il.Emit(OpCodes.Ldarg_0); 46 | il.Emit(OpCodes.Call, property.GetGetMethod(true)); 47 | il.Emit(OpCodes.Ret); 48 | 49 | return (GetterDelegate)method.CreateDelegate(typeof(GetterDelegate)); 50 | } 51 | 52 | private static SetterDelegate CreateSetter(PropertyInfo property) 53 | { 54 | DynamicMethod method = new DynamicMethod($"{property} Setter", typeof(void), new[] { typeof(object), typeof(TValue) }, true); 55 | var il = method.GetILGenerator(); 56 | 57 | il.Emit(OpCodes.Ldarg_0); 58 | il.Emit(OpCodes.Ldarg_1); 59 | il.Emit(OpCodes.Call, property.GetSetMethod(true)); 60 | il.Emit(OpCodes.Ret); 61 | 62 | return (SetterDelegate)method.CreateDelegate(typeof(SetterDelegate)); 63 | } 64 | 65 | #endregion 66 | } 67 | } -------------------------------------------------------------------------------- /src/Core_Screencap/Pngcs/ProgressiveOutputStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace Pngcs 5 | { 6 | /// 7 | /// stream that outputs to memory and allows to flush fragments every 'size' 8 | /// bytes to some other destination 9 | /// 10 | /// 11 | internal abstract class ProgressiveOutputStream : MemoryStream 12 | { 13 | private readonly int size; 14 | private long countFlushed = 0; 15 | 16 | public ProgressiveOutputStream(int size_0) 17 | { 18 | size = size_0; 19 | if (size < 8) throw new PngjException("bad size for ProgressiveOutputStream: " + size); 20 | } 21 | 22 | public override void Close() 23 | { 24 | Flush(); 25 | base.Close(); 26 | } 27 | 28 | public override void Flush() 29 | { 30 | base.Flush(); 31 | CheckFlushBuffer(true); 32 | } 33 | 34 | public override void Write(byte[] b, int off, int len) 35 | { 36 | base.Write(b, off, len); 37 | CheckFlushBuffer(false); 38 | } 39 | 40 | public void Write(byte[] b) 41 | { 42 | Write(b, 0, b.Length); 43 | CheckFlushBuffer(false); 44 | } 45 | 46 | /// 47 | /// if it's time to flush data (or if forced==true) calls abstract method 48 | /// flushBuffer() and cleans those bytes from own buffer 49 | /// 50 | /// 51 | private void CheckFlushBuffer(bool forced) 52 | { 53 | int count = (int)Position; 54 | byte[] buf = GetBuffer(); 55 | while (forced || count >= size) 56 | { 57 | int nb = size; 58 | if (nb > count) 59 | nb = count; 60 | if (nb == 0) 61 | return; 62 | FlushBuffer(buf, nb); 63 | countFlushed += nb; 64 | int bytesleft = count - nb; 65 | count = bytesleft; 66 | Position = count; 67 | if (bytesleft > 0) 68 | Array.Copy(buf, nb, buf, 0, bytesleft); 69 | } 70 | } 71 | 72 | protected abstract void FlushBuffer(byte[] b, int n); 73 | 74 | public long GetCountFlushed() 75 | { 76 | return countFlushed; 77 | } 78 | } 79 | } 80 | --------------------------------------------------------------------------------