mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
26 lines
No EOL
1,011 B
C#
26 lines
No EOL
1,011 B
C#
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;
|
|
}
|
|
} |