push broken mod

This commit is contained in:
NotAKidoS 2023-04-26 11:18:40 -05:00
parent 742f816d3d
commit 344e3bb6d6
12 changed files with 500 additions and 0 deletions

48
ChatBoxExtensions/Main.cs Normal file
View 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);
}
}
}