Skip to content

Commit

Permalink
Fixed breaking skirt FK in AI/HS2 studio
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Mar 12, 2021
1 parent 4a5c3a8 commit 3b81360
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Core_OverlayMods/Clothes/KoiClothesOverlayController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@
using MessagePack;
using UnityEngine;
using ExtensibleSaveFormat;
using HarmonyLib;
using KKAPI.Utilities;
#if KK
using CoordinateType = ChaFileDefine.CoordinateType;
using KKAPI.Studio;
using Studio;
#elif EC
using CoordinateType = KoikatsuCharaFile.ChaFileDefine.CoordinateType;
#elif AI || HS2
using AIChara;
using KKAPI.Studio;
using Studio;
#endif

namespace KoiClothesOverlayX
Expand Down Expand Up @@ -343,6 +348,8 @@ public void RefreshTexture(string texType)
public void RefreshAllTextures()
{
ChaControl.ChangeClothes(true);

if (StudioAPI.InsideStudio) FixSkirtFk();
}

public void RefreshTexture(string texType)
Expand All @@ -360,6 +367,17 @@ public void RefreshTexture(string texType)
// Fall back if the specific tex couldn't be refreshed
RefreshAllTextures();
}

private void FixSkirtFk()
{
var ocic = ChaControl.GetOCIChar();
//ocic.female.UpdateBustSoftnessAndGravity();
var active = ocic.oiCharInfo.activeFK[6];
ocic.ActiveFK(OIBoneInfo.BoneGroup.Skirt, false, ocic.oiCharInfo.enableFK);
Traverse.Create(ocic.fkCtrl).Method("ResetUsedBone", new[] {typeof(OCIChar)}).GetValue(ocic);
ocic.skirtDynamic = AddObjectFemale.GetSkirtDynamic(ocic.charInfo.objClothes);
ocic.ActiveFK(OIBoneInfo.BoneGroup.Skirt, active, ocic.oiCharInfo.enableFK);
}
#endif

protected override void OnCardBeingSaved(GameMode currentGameMode)
Expand Down

0 comments on commit 3b81360

Please sign in to comment.