Jump recover option

Preserve late update pose
Upcoming mod support
This commit is contained in:
SDraw 2023-05-02 11:22:17 +03:00
parent 988abd7d53
commit 4e0ddaadd4
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
7 changed files with 102 additions and 28 deletions

View file

@ -21,7 +21,8 @@ namespace ml_prm
RecoverDelay,
Slipperiness,
Bounciness,
ViewVelocity
ViewVelocity,
JumpRecover
}
public static bool Hotkey { get; private set; } = true;
@ -37,6 +38,7 @@ namespace ml_prm
public static bool Slipperiness { get; private set; } = false;
public static bool Bounciness { get; private set; } = false;
public static bool ViewVelocity { get; private set; } = false;
public static bool JumpRecover { get; private set; } = false;
static public event Action<bool> HotkeyChange;
static public event Action<float> VelocityMultiplierChange;
@ -51,6 +53,7 @@ namespace ml_prm
static public event Action<bool> SlipperinessChange;
static public event Action<bool> BouncinessChange;
static public event Action<bool> ViewVelocityChange;
static public event Action<bool> JumpRecoverChange;
static MelonLoader.MelonPreferences_Category ms_category = null;
static List<MelonLoader.MelonPreferences_Entry> ms_entries = null;
@ -72,7 +75,8 @@ namespace ml_prm
ms_category.CreateEntry(ModSetting.RecoverDelay.ToString(), RecoverDelay),
ms_category.CreateEntry(ModSetting.Slipperiness.ToString(), Slipperiness),
ms_category.CreateEntry(ModSetting.Bounciness.ToString(), Bounciness),
ms_category.CreateEntry(ModSetting.ViewVelocity.ToString(), ViewVelocity)
ms_category.CreateEntry(ModSetting.ViewVelocity.ToString(), ViewVelocity),
ms_category.CreateEntry(ModSetting.JumpRecover.ToString(), JumpRecover)
};
Hotkey = (bool)ms_entries[(int)ModSetting.Hotkey].BoxedValue;
@ -88,6 +92,7 @@ namespace ml_prm
Slipperiness = (bool)ms_entries[(int)ModSetting.Slipperiness].BoxedValue;
Bounciness = (bool)ms_entries[(int)ModSetting.Bounciness].BoxedValue;
ViewVelocity = (bool)ms_entries[(int)ModSetting.ViewVelocity].BoxedValue;
JumpRecover = (bool)ms_entries[(int)ModSetting.JumpRecover].BoxedValue;
}
public static void SetSetting(ModSetting p_settings, object p_value)
@ -158,6 +163,13 @@ namespace ml_prm
}
break;
case ModSetting.JumpRecover:
{
JumpRecover = (bool)p_value;
JumpRecoverChange?.Invoke((bool)p_value);
}
break;
// Floats
case ModSetting.VelocityMultiplier:
{