mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
push broken mod
This commit is contained in:
parent
742f816d3d
commit
344e3bb6d6
12 changed files with 500 additions and 0 deletions
48
ChatBoxExtensions/Main.cs
Normal file
48
ChatBoxExtensions/Main.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using MelonLoader;
|
||||
using NAK.Melons.ChatBoxExtensions.InputModules;
|
||||
|
||||
namespace NAK.Melons.ChatBoxExtensions;
|
||||
|
||||
public class ChatBoxExtensions : MelonMod
|
||||
{
|
||||
internal static MelonLogger.Instance Logger;
|
||||
internal static InputModuleChatBoxExtensions InputModule;
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
Logger = LoggerInstance;
|
||||
|
||||
if (!MelonMod.RegisteredMelons.Any(it => it.Info.Name == "ChatBox"))
|
||||
{
|
||||
Logger.Error("ChatBox was not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
ApplyIntegrations();
|
||||
}
|
||||
|
||||
void ApplyIntegrations()
|
||||
{
|
||||
Integrations.ChatBoxCommands.RegisterCommands();
|
||||
Integrations.ChilloutVRBaseCommands.RegisterCommands();
|
||||
ApplyPatches(typeof(HarmonyPatches.CVRInputManagerPatches));
|
||||
|
||||
if (MelonMod.RegisteredMelons.Any(it => it.Info.Name == "PlayerRagdollMod"))
|
||||
{
|
||||
Integrations.PlayerRagdollModCommands.RegisterCommands();
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyPatches(Type type)
|
||||
{
|
||||
try
|
||||
{
|
||||
HarmonyInstance.PatchAll(type);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Msg($"Failed while patching {type.Name}!");
|
||||
Logger.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue