Skip to content

Commit

Permalink
Added unlocking bras/skirts for all clothing
Browse files Browse the repository at this point in the history
  • Loading branch information
DeathWeasel1337 committed Apr 4, 2019
1 parent 050457f commit 984f821
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
41 changes: 31 additions & 10 deletions KK_ClothingUnlocker/KK_ClothingUnlocker.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// Removes gender restrictions for clothes
/// Removes restrictions for clothes
/// </summary>
[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<bool> 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<bool> 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<bool> EnableSkirts { get; private set; }

private void Main()
{
var harmony = HarmonyInstance.Create(GUID);
harmony.PatchAll(typeof(KK_ClothingUnlocker));

EnableCrossdressing = new ConfigWrapper<bool>(nameof(EnableCrossdressing), nameof(KK_ClothingUnlocker), true);
EnableBras = new ConfigWrapper<bool>(nameof(EnableBras), nameof(KK_ClothingUnlocker), false);
EnableSkirts = new ConfigWrapper<bool>(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;
}
}
}
4 changes: 4 additions & 0 deletions KK_ClothingUnlocker/KK_ClothingUnlocker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
<HintPath>..\lib\BepInEx.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ConfigurationManager">
<HintPath>..\lib\ConfigurationManager.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand Down
4 changes: 2 additions & 2 deletions KK_ClothingUnlocker/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

0 comments on commit 984f821

Please sign in to comment.