diff --git a/ml_amt/Main.cs b/ml_amt/Main.cs index 9c2d33d..c6aeae2 100644 --- a/ml_amt/Main.cs +++ b/ml_amt/Main.cs @@ -239,12 +239,12 @@ namespace ml_amt static bool OnAnimationOverride_Prefix() { - return false; + return !Settings.OverrideFix; } static bool OnAnimationOverrideRestore_Prefix() { - return false; + return !Settings.OverrideFix; } } } diff --git a/ml_amt/README.md b/ml_amt/README.md index 6e5482a..c49dd7d 100644 --- a/ml_amt/README.md +++ b/ml_amt/README.md @@ -29,6 +29,8 @@ Available mod's settings in `Settings - IK - Avatar Motion Tweaker`: * **Adjusted locomotion mass center:** automatically changes IK locomotion center if avatar has toe bones; default value - `true`. * Note: Compatible with [DesktopVRIK](https://github.com/NotAKidOnSteam/DesktopVRIK) and [FuckToes](https://github.com/NotAKidOnSteam/FuckToes). * **Alternative avatar collider scale:** applies slightly different approach to avatar collider size change; default value - `true` +* **Prevent Unity animation override:** disables overriding of animations at runtime for avatars with AAS; default value - `false`. + * Note: This options is made for "fix" of [broken animator issues with chairs and combat worlds](https://feedback.abinteractive.net/p/gestures-getting-stuck-locally-upon-entering-vehicles-chairs). Available additional parameters for AAS animator: * **`Upright`:** defines linear coefficient between current viewpoint height and avatar's viewpoint height; float, range - [0.0, 1.0]. diff --git a/ml_amt/Settings.cs b/ml_amt/Settings.cs index 12d0d83..c01f273 100644 --- a/ml_amt/Settings.cs +++ b/ml_amt/Settings.cs @@ -20,7 +20,8 @@ namespace ml_amt DetectEmotes, FollowHips, CollisionScale, - MassCenter + MassCenter, + OverrideFix }; static bool ms_ikOverrideCrouch = true; @@ -35,6 +36,7 @@ namespace ml_amt static bool ms_followHips = true; static bool ms_collisionScale = true; static bool ms_massCenter = true; + static bool ms_overrideFix = false; static MelonLoader.MelonPreferences_Category ms_category = null; static List ms_entries = null; @@ -51,6 +53,7 @@ namespace ml_amt static public event Action FollowHipsChange; static public event Action CollisionScaleChange; static public event Action MassCenterChange; + static public event Action OverrideFixChange; internal static void Init() { @@ -69,7 +72,8 @@ namespace ml_amt ms_category.CreateEntry(ModSetting.DetectEmotes.ToString(), true), ms_category.CreateEntry(ModSetting.FollowHips.ToString(), true), ms_category.CreateEntry(ModSetting.CollisionScale.ToString(), true), - ms_category.CreateEntry(ModSetting.MassCenter.ToString(), true) + ms_category.CreateEntry(ModSetting.MassCenter.ToString(), true), + ms_category.CreateEntry(ModSetting.OverrideFix.ToString(), false) }; Load(); @@ -113,6 +117,7 @@ namespace ml_amt ms_followHips = (bool)ms_entries[(int)ModSetting.FollowHips].BoxedValue; ms_collisionScale = (bool)ms_entries[(int)ModSetting.CollisionScale].BoxedValue; ms_massCenter = (bool)ms_entries[(int)ModSetting.MassCenter].BoxedValue; + ms_overrideFix = (bool)ms_entries[(int)ModSetting.OverrideFix].BoxedValue; } static void OnSliderUpdate(string p_name, string p_value) @@ -213,7 +218,15 @@ namespace ml_amt { ms_massCenter = bool.Parse(p_value); MassCenterChange?.Invoke(ms_massCenter); - } break; + } + break; + + case ModSetting.OverrideFix: + { + ms_overrideFix = bool.Parse(p_value); + OverrideFixChange?.Invoke(ms_overrideFix); + } + break; } ms_entries[(int)l_setting].BoxedValue = bool.Parse(p_value); @@ -268,5 +281,9 @@ namespace ml_amt { get => ms_massCenter; } + public static bool OverrideFix + { + get => ms_overrideFix; + } } } diff --git a/ml_amt/resources/menu.js b/ml_amt/resources/menu.js index 72c85c1..8e1e71c 100644 --- a/ml_amt/resources/menu.js +++ b/ml_amt/resources/menu.js @@ -263,6 +263,13 @@ function inp_toggle_mod_amt(_obj, _callbackName) {
+ +
+
Prevent Unity animation override (chairs, etc.):
+
+
+
+
`; document.getElementById('settings-ik').appendChild(l_block);