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
26
ClearHudNotifications/HarmonyPatches.cs
Normal file
26
ClearHudNotifications/HarmonyPatches.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using ABI_RC.Core.Savior;
|
||||
using ABI_RC.Core.UI;
|
||||
using cohtml;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace NAK.Melons.ClearHudNoficiations.HarmonyPatches;
|
||||
|
||||
internal static class CohtmlHudPatches
|
||||
{
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(CohtmlHud), nameof(CohtmlHud.ViewDropText), new Type[] { typeof(string), typeof(string), typeof(string) })]
|
||||
private static bool Prefix_CohtmlHud_ViewDropText(string cat, string headline, string small, ref CohtmlHud __instance)
|
||||
{
|
||||
if (!headline.Contains(MetaPort.Instance.username)) return true; // we only want our username notification
|
||||
|
||||
if (small == "A user has joined your Instance." && !MetaPort.Instance.settings.GetSettingsBool("HUDCustomizationPlayerJoins", false))
|
||||
{
|
||||
ClearHudNoficiations.ClearHudNotifications();
|
||||
return false;
|
||||
}
|
||||
|
||||
// clears buffer
|
||||
if (__instance._isReady) __instance.hudView.View.TriggerEvent("DisplayHudMessageImmediately", cat, headline, small, 3);
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue