the pain begins

This commit is contained in:
JohnCorby 2023-06-09 20:57:38 -07:00
parent b936c5fd2f
commit c841e1958d
2 changed files with 4 additions and 10 deletions

View File

@ -118,8 +118,6 @@ public class QSBCore : ModBehaviour
public void Awake() public void Awake()
{ {
SteamRerouter.ModSide.Interop.Go();
// no, we cant localize this - languages are loaded after the splash screen // no, we cant localize this - languages are loaded after the splash screen
UIHelper.ReplaceUI(UITextType.PleaseUseController, UIHelper.ReplaceUI(UITextType.PleaseUseController,
"<color=orange>Quantum Space Buddies</color> is best experienced with friends..."); "<color=orange>Quantum Space Buddies</color> is best experienced with friends...");
@ -156,6 +154,8 @@ public class QSBCore : ModBehaviour
} }
else else
{ {
SteamRerouter.ModSide.Interop.Go();
DebugLog.ToConsole($"Is steam - overriding AppID"); DebugLog.ToConsole($"Is steam - overriding AppID");
OverrideAppId(); OverrideAppId();
} }

View File

@ -15,19 +15,13 @@ public static class Interop
public static void Go() public static void Go()
{ {
if (typeof(EpicPlatformManager).GetField("_platformInterface", BindingFlags.NonPublic | BindingFlags.Instance) == null)
{
Log("not epic. don't reroute");
return;
}
Log("go"); Log("go");
Patches.Apply(); Patches.Apply();
var processPath = Path.Combine( var processPath = Path.Combine(
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!,
"EpicRerouter.exe" "SteamRerouter.exe"
); );
Log($"process path = {processPath}"); Log($"process path = {processPath}");
var gamePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(typeof(EpicPlatformManager).Assembly.Location)!, "..")); var gamePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(typeof(EpicPlatformManager).Assembly.Location)!, ".."));
@ -64,5 +58,5 @@ public static class Interop
Log($"error:\n{process.StandardError.ReadToEnd()}"); Log($"error:\n{process.StandardError.ReadToEnd()}");
} }
public static void Log(object msg) => Debug.Log($"[EpicRerouter] {msg}"); public static void Log(object msg) => Debug.Log($"[SteamRerouter] {msg}");
} }