NAK_CVR_Mods/AvatarScale/Main.cs
NotAKidoS d599f57973 [AvatarScaleMod] Mod Network attempt 2.
I lost the first attempt when switching branches.
Lot of this still needs to be redone, as it is just quickly slapped together atm.
2023-09-20 05:24:07 -05:00

40 lines
No EOL
972 B
C#

using MelonLoader;
using NAK.AvatarScaleMod.Networking;
namespace NAK.AvatarScaleMod;
public class AvatarScaleMod : MelonMod
{
internal static MelonLogger.Instance Logger;
public override void OnInitializeMelon()
{
Logger = LoggerInstance;
ApplyPatches(typeof(HarmonyPatches.PlayerSetupPatches));
ApplyPatches(typeof(HarmonyPatches.PuppetMasterPatches));
ApplyPatches(typeof(HarmonyPatches.GesturePlaneTestPatches));
ModNetwork.Subscribe();
ModSettings.InitializeModSettings();
}
public override void OnUpdate()
{
ModNetwork.Update();
ModNetworkDebugger.DoDebugInput();
}
private void ApplyPatches(Type type)
{
try
{
HarmonyInstance.PatchAll(type);
}
catch (Exception e)
{
LoggerInstance.Msg($"Failed while patching {type.Name}!");
LoggerInstance.Error(e);
}
}
}