Skip to content

Commit

Permalink
[KK/EC/KKS][SU] Fix eye highlight offsets being clamped to 0-100 (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Mar 24, 2024
1 parent 1805973 commit abee07b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Core_SliderUnlocker/Core.SliderUnlocker.Hooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,5 +272,20 @@ private static void SetShapeBodyValueInfoSliderFixPost(ChaControl __instance, bo
AccessTools.Property(typeof(ChaControl), nameof(ChaControl.hiPoly)).SetValue(__instance, __state, null);
}
#endif

#if KK || KKS || EC // Prevent eye highlight position from getting clamped
[HarmonyTranspiler]
[HarmonyPatch(typeof(ChaControl), nameof(ChaControl.ChangeSettingEyeHLUpPosY))]
[HarmonyPatch(typeof(ChaControl), nameof(ChaControl.ChangeSettingEyeHLDownPosY))]
#if !KK
[HarmonyPatch(typeof(ChaControl), nameof(ChaControl.ChangeSettingEyeHLUpPosX))]
[HarmonyPatch(typeof(ChaControl), nameof(ChaControl.ChangeSettingEyeHLDownPosX))]
#endif
private static IEnumerable<CodeInstruction> UnclampChangeEyeHlTpl(IEnumerable<CodeInstruction> instructions)
{
return instructions.MethodReplacer(AccessTools.Method(typeof(Mathf), nameof(Mathf.Lerp)),
AccessTools.Method(typeof(Mathf), nameof(Mathf.LerpUnclamped)));
}
#endif
}
}

0 comments on commit abee07b

Please sign in to comment.