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

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