Override prevention option

This commit is contained in:
SDraw 2023-02-13 11:47:53 +03:00
parent cb26ab1e6c
commit 24699622e5
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
4 changed files with 31 additions and 5 deletions

View file

@ -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;
}
}
}

View file

@ -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].

View file

@ -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<MelonLoader.MelonPreferences_Entry> ms_entries = null;
@ -51,6 +53,7 @@ namespace ml_amt
static public event Action<bool> FollowHipsChange;
static public event Action<bool> CollisionScaleChange;
static public event Action<bool> MassCenterChange;
static public event Action<bool> 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;
}
}
}

View file

@ -263,6 +263,13 @@ function inp_toggle_mod_amt(_obj, _callbackName) {
<div id="CollisionScale" class ="inp_toggle no-scroll" data-current="true"></div>
</div>
</div>
<div class ="row-wrapper">
<div class ="option-caption">Prevent Unity animation override (chairs, etc.): </div>
<div class ="option-input">
<div id="OverrideFix" class ="inp_toggle no-scroll" data-current="false"></div>
</div>
</div>
`;
document.getElementById('settings-ik').appendChild(l_block);