From 984f821269c7f5aad93a48ea6d7507ac235b78c2 Mon Sep 17 00:00:00 2001 From: DeathWeasel1337 Date: Wed, 3 Apr 2019 20:08:57 -0500 Subject: [PATCH] Added unlocking bras/skirts for all clothing --- KK_ClothingUnlocker/KK_ClothingUnlocker.cs | 41 ++++++++++++++----- .../KK_ClothingUnlocker.csproj | 4 ++ .../Properties/AssemblyInfo.cs | 4 +- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/KK_ClothingUnlocker/KK_ClothingUnlocker.cs b/KK_ClothingUnlocker/KK_ClothingUnlocker.cs index 70200ae6..ee31476d 100644 --- a/KK_ClothingUnlocker/KK_ClothingUnlocker.cs +++ b/KK_ClothingUnlocker/KK_ClothingUnlocker.cs @@ -1,33 +1,54 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using BepInEx; +using BepInEx; using Harmony; +using System.ComponentModel; namespace KK_ClothingUnlocker { /// - /// Removes gender restrictions for clothes + /// Removes restrictions for clothes /// [BepInPlugin(GUID, PluginName, Version)] public class KK_ClothingUnlocker : BaseUnityPlugin { public const string GUID = "com.deathweasel.bepinex.clothingunlocker"; public const string PluginName = "Clothing Unlocker"; - public const string Version = "1.0"; + public const string Version = "1.1"; - void Main() + [DisplayName("Enable clothing for either gender")] + [Category("Config")] + [Advanced(true)] + [Description("Allows any clothing to be worn by either gender.")] + public static ConfigWrapper EnableCrossdressing { get; private set; } + [DisplayName("Enable bras for all tops")] + [Category("Config")] + [Advanced(true)] + [Description("Enable bras for all tops for all characters. May cause clipping or other undesired effects.")] + public static ConfigWrapper EnableBras { get; private set; } + [DisplayName("Enable skirts for all tops")] + [Category("Config")] + [Advanced(true)] + [Description("Enable skirts for all tops for all characters. May cause clipping or other undesired effects.")] + public static ConfigWrapper EnableSkirts { get; private set; } + + private void Main() { var harmony = HarmonyInstance.Create(GUID); harmony.PatchAll(typeof(KK_ClothingUnlocker)); + + EnableCrossdressing = new ConfigWrapper(nameof(EnableCrossdressing), nameof(KK_ClothingUnlocker), true); + EnableBras = new ConfigWrapper(nameof(EnableBras), nameof(KK_ClothingUnlocker), false); + EnableSkirts = new ConfigWrapper(nameof(EnableSkirts), nameof(KK_ClothingUnlocker), false); } [HarmonyPostfix, HarmonyPatch(typeof(ListInfoBase), nameof(ListInfoBase.GetInfoInt))] - public static void LoadAsyncPrefix(ChaListDefine.KeyType keyType, ref int __result) + public static void GetInfoIntPostfix(ChaListDefine.KeyType keyType, ref int __result) { - if (keyType == ChaListDefine.KeyType.Sex) + if (keyType == ChaListDefine.KeyType.Sex && EnableCrossdressing.Value) __result = 1; + if (keyType == ChaListDefine.KeyType.NotBra && EnableBras.Value) + __result = 0; + if (keyType == ChaListDefine.KeyType.Coordinate && EnableSkirts.Value) + __result = 0; } } } diff --git a/KK_ClothingUnlocker/KK_ClothingUnlocker.csproj b/KK_ClothingUnlocker/KK_ClothingUnlocker.csproj index eaee47c0..c81b280b 100644 --- a/KK_ClothingUnlocker/KK_ClothingUnlocker.csproj +++ b/KK_ClothingUnlocker/KK_ClothingUnlocker.csproj @@ -44,6 +44,10 @@ ..\lib\BepInEx.dll False + + ..\lib\ConfigurationManager.dll + False + diff --git a/KK_ClothingUnlocker/Properties/AssemblyInfo.cs b/KK_ClothingUnlocker/Properties/AssemblyInfo.cs index c4e828b7..0680aca6 100644 --- a/KK_ClothingUnlocker/Properties/AssemblyInfo.cs +++ b/KK_ClothingUnlocker/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion(KK_ClothingUnlocker.KK_ClothingUnlocker.Version)] +[assembly: AssemblyFileVersion(KK_ClothingUnlocker.KK_ClothingUnlocker.Version)]