mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
GrabbableSteeringWheel: commit
This commit is contained in:
parent
39da88d3d3
commit
3a00ff104a
9 changed files with 825 additions and 0 deletions
61
GrabbableSteeringWheel/Main.cs
Normal file
61
GrabbableSteeringWheel/Main.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
using MelonLoader;
|
||||
using NAK.GrabbableSteeringWheel.Patches;
|
||||
|
||||
namespace NAK.GrabbableSteeringWheel;
|
||||
|
||||
public class GrabbableSteeringWheelMod : MelonMod
|
||||
{
|
||||
internal static MelonLogger.Instance Logger;
|
||||
|
||||
#region Melon Preferences
|
||||
|
||||
// private static readonly MelonPreferences_Category Category =
|
||||
// MelonPreferences.CreateCategory(nameof(GrabbableSteeringWheelMod));
|
||||
//
|
||||
// private static readonly MelonPreferences_Entry<bool> EntryEnabled =
|
||||
// Category.CreateEntry(
|
||||
// "use_legacy_mitigation",
|
||||
// true,
|
||||
// "Enabled",
|
||||
// description: "Enable legacy content camera hack when in Legacy worlds.");
|
||||
|
||||
#endregion Melon Preferences
|
||||
|
||||
#region Melon Events
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
Logger = LoggerInstance;
|
||||
|
||||
ApplyPatches(typeof(RCCCarControllerV3_Patches));
|
||||
ApplyPatches(typeof(CVRInputManager_Patches));
|
||||
}
|
||||
|
||||
#endregion Melon Events
|
||||
|
||||
#region Melon Mod Utilities
|
||||
|
||||
private static void InitializeIntegration(string modName, Action integrationAction)
|
||||
{
|
||||
if (RegisteredMelons.All(it => it.Info.Name != modName))
|
||||
return;
|
||||
|
||||
Logger.Msg($"Initializing {modName} integration.");
|
||||
integrationAction.Invoke();
|
||||
}
|
||||
|
||||
private void ApplyPatches(Type type)
|
||||
{
|
||||
try
|
||||
{
|
||||
HarmonyInstance.PatchAll(type);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LoggerInstance.Msg($"Failed while patching {type.Name}!");
|
||||
LoggerInstance.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Melon Mod Utilities
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue