Skip to content

Commit

Permalink
[AI/HS2] Fix body masks breaking on scene load in studio
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Feb 24, 2023
1 parent 71aa126 commit 2ce466c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Shared_AIHS2/Clothes/KoiClothesOverlayController.Hooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ internal static class Hooks
public static void Init()
{
Harmony.CreateAndPatchAll(typeof(Hooks), nameof(KoiClothesOverlayController));

// bug: Something related to overlay mod causes body masks to get messed up in studio on scene load even if chara doesn't use overlays.
// It's hard to pinpoint what causes it, could be caused by another plugin. This is a band aid fix to the issue, seems to work fine.
KKAPI.Studio.SaveLoad.StudioSaveLoadApi.SceneLoad += (sender, args) =>
{
foreach (var cl in UnityEngine.Object.FindObjectsOfType<KoiClothesOverlayController>())
{
cl.ChaControl.updateAlphaMask = true;
cl.ChaControl.updateAlphaMask2 = true;
}
};
}

#region Main tex overlays
Expand Down

0 comments on commit 2ce466c

Please sign in to comment.