This repository has been archived on 2026-05-30. You can view files and clone it, but cannot push or open issues or pull requests.
Files
undead-universal-patch-il2cpp/Patches/Internals/Notifications.cs
2025-09-11 19:54:25 -04:00

29 lines
895 B
C#

using HarmonyLib;
using Il2CppInterop.Runtime;
using RecNet;
using System.Reflection;
using undead_universal_patch_il2cpp.Core;
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet;
namespace undead_universal_patch_il2cpp.Patches.Internals
{
[HarmonyPatch]
public class Notifications
{
static PatchTypesResult patchResult = Core.Util.PreparePatchTypes(
"Event patch for notification availability",
"RecNet.Notifications",
"OnOpenInternal"
);
static bool Prepare() => patchResult.Success;
static MethodBase TargetMethod() => patchResult.Method;
static void Postfix(ref SignalRHubConnection hub)
{
UniversalPatchPlugin.Log.LogInfo("Running onNotificationsOpen actions");
foreach (var action in RecNetInteractions.onNotificationsOpen) action();
}
}
}