mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
init
This commit is contained in:
parent
304efd4302
commit
8c780bb72b
6 changed files with 189 additions and 0 deletions
40
ClearHudNotifications/Main.cs
Normal file
40
ClearHudNotifications/Main.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using ABI_RC.Core.UI;
|
||||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.Melons.ClearHudNoficiations;
|
||||
|
||||
public class ClearHudNoficiations : MelonMod
|
||||
{
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
ApplyPatches(typeof(HarmonyPatches.CohtmlHudPatches));
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.F4))
|
||||
{
|
||||
ClearHudNotifications();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ClearHudNotifications()
|
||||
{
|
||||
// sending an immediate notification clears buffer
|
||||
CohtmlHud.Instance?.ViewDropTextImmediate("(Local) Client", "Notifications Cleared!", "Cleared Hud Notifications!");
|
||||
}
|
||||
|
||||
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