mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
Move mods to Depricated folder.
This commit is contained in:
parent
e61f119f32
commit
5d1cb2ebec
70 changed files with 44 additions and 119 deletions
37
.DepricatedMods/HeadBobbingFix/Main.cs
Normal file
37
.DepricatedMods/HeadBobbingFix/Main.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using MelonLoader;
|
||||
|
||||
namespace NAK.HeadBobbingFix;
|
||||
|
||||
public class HeadBobbingFix : MelonMod
|
||||
{
|
||||
public static readonly MelonPreferences_Category Category =
|
||||
MelonPreferences.CreateCategory(nameof(HeadBobbingFix));
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
|
||||
Category.CreateEntry("Enabled", true, description: "Toggle HeadBobbingFix entirely. You need full headbobbing enabled for the mod to take effect.");
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
EntryEnabled.OnEntryValueChanged.Subscribe(OnEntryEnabledChanged);
|
||||
ApplyPatches(typeof(HarmonyPatches.PlayerSetupPatches));
|
||||
}
|
||||
|
||||
void OnEntryEnabledChanged(bool newValue, bool oldValue)
|
||||
{
|
||||
if (newValue) PlayerSetup.Instance?.SetViewPointOffset();
|
||||
}
|
||||
|
||||
void ApplyPatches(Type type)
|
||||
{
|
||||
try
|
||||
{
|
||||
HarmonyInstance.PatchAll(type);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LoggerInstance.Msg($"Failed while patching {type.Name}!");
|
||||
LoggerInstance.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue