[ClearHudNotifications] Change getting local username

This commit is contained in:
NotAKidoS 2023-05-17 14:23:29 -05:00
parent ced3f26e8d
commit cfaf1e4b91

View file

@ -2,6 +2,7 @@
using ABI_RC.Core.UI; using ABI_RC.Core.UI;
using cohtml; using cohtml;
using HarmonyLib; using HarmonyLib;
using static ABI_RC.Core.Networking.AuthManager;
namespace NAK.ClearHudNotifications.HarmonyPatches; namespace NAK.ClearHudNotifications.HarmonyPatches;
@ -11,7 +12,7 @@ internal static class CohtmlHudPatches
[HarmonyPatch(typeof(CohtmlHud), nameof(CohtmlHud.ViewDropText), new Type[] { typeof(string), typeof(string), typeof(string) })] [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) 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 (!headline.Contains(username)) return true; // we only want our username notification
if (small == "A user has joined your Instance." && !MetaPort.Instance.settings.GetSettingsBool("HUDCustomizationPlayerJoins", false)) if (small == "A user has joined your Instance." && !MetaPort.Instance.settings.GetSettingsBool("HUDCustomizationPlayerJoins", false))
{ {