mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
Fix splash skip on epic
This commit is contained in:
1 file changed
+22
@@ -1,4 +1,7 @@
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using System;
|
||||
using MonoMod.Utils;
|
||||
|
||||
namespace Reactor.Patches
|
||||
{
|
||||
@@ -10,4 +13,23 @@ namespace Reactor.Patches
|
||||
__instance.minimumSecondsBeforeSceneChange = 0;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(SplashManager), nameof(SplashManager.Update))]
|
||||
internal static class WaitForEpicAuth
|
||||
{
|
||||
private static readonly PropertyInfo? _localUserIdProperty = typeof(EpicManager).GetProperty("localUserId", BindingFlags.Static | BindingFlags.Public);
|
||||
private static readonly Func<object>? _localUserId = _localUserIdProperty == null ? null : _localUserIdProperty.GetMethod.CreateDelegate<Func<object>>();
|
||||
|
||||
private static bool Prefix(SplashManager __instance)
|
||||
{
|
||||
if (__instance.startedSceneLoad) return true;
|
||||
|
||||
if (_localUserId != null && _localUserId() == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user