mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-04 23:39:22 +00:00
[HeadBobbingFix] Rename from DesktopCameraFix
confusing name for some
This commit is contained in:
parent
164de9ea68
commit
13927f1d67
8 changed files with 46 additions and 46 deletions
|
@ -1,37 +0,0 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using MelonLoader;
|
||||
|
||||
namespace NAK.DesktopCameraFix;
|
||||
|
||||
public class DesktopCameraFix : MelonMod
|
||||
{
|
||||
public static readonly MelonPreferences_Category Category =
|
||||
MelonPreferences.CreateCategory(nameof(DesktopCameraFix));
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
|
||||
Category.CreateEntry("Enabled", true, description: "Toggle DesktopCameraFix entirely.");
|
||||
|
||||
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