Skip to content

Commit

Permalink
Port MaleJuice to KKS (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco authored May 30, 2022
1 parent 9863720 commit 85c761b
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 7 deletions.
9 changes: 9 additions & 0 deletions KK_Plugins.sln
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HS2.StudioWindowResize", "s
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AI.StudioWindowResize", "src\StudioWindowResize.AI\AI.StudioWindowResize.csproj", "{E5307B24-3898-463A-8DCB-D826802EFC5C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KKS.MaleJuice", "src\MaleJuice.KKS\KKS.MaleJuice.csproj", "{11112067-CFA0-4522-BE2E-0C4D1CF9E36A}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Shared\Shared.projitems*{002aa641-4dc8-4fef-83dd-a7fab3af6daf}*SharedItemsImports = 4
Expand All @@ -568,6 +570,8 @@ Global
src\AccessoryQuickRemove.Core\AccessoryQuickRemove.Core.projitems*{0cd64f6f-4e15-4c9c-a990-4616a8a8ea82}*SharedItemsImports = 4
src\Shared\Shared.projitems*{0cd64f6f-4e15-4c9c-a990-4616a8a8ea82}*SharedItemsImports = 4
src\ClothingUnlocker.Core\Core.ClothingUnlocker.projitems*{0f7181c7-8d52-4576-9bff-d4b7d08f42a2}*SharedItemsImports = 13
src\MaleJuice.Core\MaleJuice.Core.projitems*{11112067-cfa0-4522-be2e-0c4d1cf9e36a}*SharedItemsImports = 4
src\Shared\Shared.projitems*{11112067-cfa0-4522-be2e-0c4d1cf9e36a}*SharedItemsImports = 4
src\ForceHighPoly.Core\ForceHighPoly.Core.projitems*{123d12ea-5526-4d07-ab26-7ab9459b4aeb}*SharedItemsImports = 4
src\Shared\Shared.projitems*{123d12ea-5526-4d07-ab26-7ab9459b4aeb}*SharedItemsImports = 4
src\PoseTools.Core\Core.PoseTools.projitems*{125b3166-da35-4cda-b71a-b5c3f0645062}*SharedItemsImports = 4
Expand Down Expand Up @@ -1669,6 +1673,10 @@ Global
{E5307B24-3898-463A-8DCB-D826802EFC5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5307B24-3898-463A-8DCB-D826802EFC5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5307B24-3898-463A-8DCB-D826802EFC5C}.Release|Any CPU.Build.0 = Release|Any CPU
{11112067-CFA0-4522-BE2E-0C4D1CF9E36A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11112067-CFA0-4522-BE2E-0C4D1CF9E36A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11112067-CFA0-4522-BE2E-0C4D1CF9E36A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11112067-CFA0-4522-BE2E-0C4D1CF9E36A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1892,6 +1900,7 @@ Global
{4AB2E6F6-6B47-4539-8EBA-CDD199A8E0BD} = {3050327B-CAD1-4FD9-8133-FA3B085F3E35}
{1D8216CF-B9F0-4463-B120-02C068CC70B6} = {5ACE49BE-BD8A-49E9-8E54-541A154C87BE}
{E5307B24-3898-463A-8DCB-D826802EFC5C} = {5ACE49BE-BD8A-49E9-8E54-541A154C87BE}
{11112067-CFA0-4522-BE2E-0C4D1CF9E36A} = {0D9A7DD7-BF28-4205-8620-4D554009E96F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D0F79985-4CB7-46CB-BEC2-FF89C476ED20}
Expand Down
6 changes: 3 additions & 3 deletions src/MaleJuice.Core/Core.MaleJuice.Hooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal static class Hooks
private static void SetSiruFlags(ChaFileDefine.SiruParts _parts, byte _state, OCIChar __instance)
{
if (__instance is OCICharMale charMale)
#if KK
#if KK || KKS
charMale.male.SetSiruFlags(_parts, _state);
#else
charMale.male.SetSiruFlag(_parts, _state);
Expand All @@ -32,7 +32,7 @@ private static void SetSiruFlags(ChaFileDefine.SiruParts _parts, byte _state, OC
private static void GetSiruFlags(ChaFileDefine.SiruParts _parts, OCIChar __instance, ref byte __result)
{
if (__instance is OCICharMale charMale)
#if KK
#if KK || KKS
__result = charMale.male.GetSiruFlags(_parts);
#else
__result = charMale.male.GetSiruFlag(_parts);
Expand All @@ -47,7 +47,7 @@ private static void LiquidInfoUpdateInfo(OCIChar _char, MPCharCtrl.LiquidInfo __
__instance.active = true;
__instance.face.select = _char.GetSiruFlags(ChaFileDefine.SiruParts.SiruKao);

#if KK
#if KK || KKS
__instance.breast.select = _char.GetSiruFlags(ChaFileDefine.SiruParts.SiruFrontUp);
__instance.back.select = _char.GetSiruFlags(ChaFileDefine.SiruParts.SiruBackUp);
__instance.belly.select = _char.GetSiruFlags(ChaFileDefine.SiruParts.SiruFrontDown);
Expand Down
8 changes: 4 additions & 4 deletions src/MaleJuice.Core/Core.MaleJuice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public partial class Plugin : BaseUnityPlugin
public const string PluginNameInternal = Constants.Prefix + "_MaleJuice";
public const string PluginVersion = "1.3";

#if KK
#if KK || KKS
private static Texture LiquidMask;
#else
private static Material LiquidMat;
Expand All @@ -42,7 +42,7 @@ private static IEnumerator LoadJuice()

try
{
#if KK
#if KK || KKS
//Get the juice texture used by females
var mat = CommonLib.LoadAsset<Material>("chara/mm_base.unity3d", "cf_m_body");
LiquidMask = mat.GetTexture("_liquidmask");
Expand All @@ -62,7 +62,7 @@ private static IEnumerator LoadJuice()
Logger.LogError("Could not load juice textures.");
}

#if KK
#if KK || KKS
if (LiquidMask == null) yield break;
#else
if (LiquidMat == null) yield break;
Expand All @@ -76,7 +76,7 @@ private static IEnumerator LoadJuice()
/// </summary>
public static void SetJuice(ChaControl chaControl)
{
#if KK
#if KK || KKS
if (chaControl.customMatBody.GetTexture("_liquidmask") == null)
chaControl.customMatBody.SetTexture("_liquidmask", LiquidMask);
#else
Expand Down
Loading

0 comments on commit 85c761b

Please sign in to comment.