forked from zombieb/undead-universal-patch-il2cpp
haha forgot to push,,,
This commit is contained in:
30
Patches/Internals/LockerroomOOBEFlow.cs
Normal file
30
Patches/Internals/LockerroomOOBEFlow.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using undead_universal_patch_il2cpp.Core;
|
||||
using UnityEngine;
|
||||
|
||||
namespace undead_universal_patch_il2cpp.Patches.Internals
|
||||
{
|
||||
[HarmonyPatch]
|
||||
public class LockerroomOOBEFlow
|
||||
{
|
||||
static PatchTypesResult patchResult = Util.PreparePatchTypes(
|
||||
"Event patch for changing marquee text in the reccenter",
|
||||
"LockerroomOOBEFlow",
|
||||
"Start"
|
||||
);
|
||||
|
||||
static bool Prepare() => patchResult.Success;
|
||||
static MethodBase TargetMethod() => patchResult.Method;
|
||||
|
||||
static void Postfix()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
45
Patches/Internals/NotificationTargets/MarqueeTexts.cs
Normal file
45
Patches/Internals/NotificationTargets/MarqueeTexts.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using Il2CppInterop.Runtime;
|
||||
using RecNet;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using undead_universal_patch_il2cpp.Core.Config;
|
||||
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet;
|
||||
using UnityEngine;
|
||||
|
||||
namespace undead_universal_patch_il2cpp.Patches.Internals.NotificationTargets
|
||||
{
|
||||
public class MarqueeTexts : MonoBehaviour
|
||||
{
|
||||
void Start()
|
||||
{
|
||||
if (ServerPatchesConfig.CustomMarquee.Value)
|
||||
{
|
||||
UniversalPatchPlugin.Log.LogWarning("CustomMarquee patch is unavailable at this time. A future update may resolve this.");
|
||||
//RecNetInteractions.onNotificationsOpen.Add(OnSocketOpen);
|
||||
}
|
||||
}
|
||||
|
||||
void OnSocketOpen()
|
||||
{
|
||||
var d = DelegateSupport.ConvertDelegate<RecNet.Notifications.NotificationHandler>(OnTextChange);
|
||||
RecNet.Notifications.RegisterHandler("MarqueeTexts", d);
|
||||
}
|
||||
|
||||
void OnTextChange(Dictionary<string, string> args)
|
||||
{
|
||||
GameObject go = GameObject.Find("DynamicObjects/[RecCenter_Marquee]");
|
||||
|
||||
string[] transforms = ["Text", "Now Playing", "SubText"];
|
||||
var texts = transforms.Select(str => go.transform.Find(str).GetComponent<TextMesh>()).ToArray();
|
||||
|
||||
foreach (var t in transforms)
|
||||
{
|
||||
TextMesh tm = go.transform.Find(t).GetComponent<TextMesh>();
|
||||
args.TryGetValue(t, out string res);
|
||||
tm.text = res;
|
||||
}
|
||||
|
||||
Core.Util.ConditionalDebug("Replaced marquee texts");
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Patches/Internals/Notifications.cs
Normal file
28
Patches/Internals/Notifications.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,5 @@ public class AuthenticationEventPatch
|
||||
action();
|
||||
}
|
||||
else RanPostActions = true;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user