From 32293266f3af58e0b5fa54e6b37ff81750337097 Mon Sep 17 00:00:00 2001 From: Redageddon <53098956+Redageddon@users.noreply.github.com> Date: Sun, 7 Nov 2021 00:38:53 -0700 Subject: [PATCH 1/2] Made Init be able to use appid instead of needing an steam_appid.txt --- com.rlabrecque.steamworks.net/Runtime/Steam.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/com.rlabrecque.steamworks.net/Runtime/Steam.cs b/com.rlabrecque.steamworks.net/Runtime/Steam.cs index e457c771..12282e0f 100644 --- a/com.rlabrecque.steamworks.net/Runtime/Steam.cs +++ b/com.rlabrecque.steamworks.net/Runtime/Steam.cs @@ -26,7 +26,11 @@ public static class SteamAPI { // SteamAPI_Init must be called before using any other API functions. If it fails, an // error message will be output to the debugger (or stderr) with further information. - public static bool Init() { + public static bool Init(AppId_t appIdT) { + Environment.SetEnvironmentVariable("SteamAppId", appIdT.ToString()); + Environment.SetEnvironmentVariable("SteamOverlayGameId", appIdT.ToString()); + Environment.SetEnvironmentVariable("SteamGameId", appIdT.ToString()); + InteropHelp.TestIfPlatformSupported(); bool ret = NativeMethods.SteamAPI_Init(); From 66b5ce3e0d3ed999bf0dbb458ec15336eb762636 Mon Sep 17 00:00:00 2001 From: Redageddon <53098956+Redageddon@users.noreply.github.com> Date: Mon, 8 Nov 2021 18:44:12 -0800 Subject: [PATCH 2/2] fixed the merge so it doesn't break compatibility --- com.rlabrecque.steamworks.net/Runtime/Steam.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/com.rlabrecque.steamworks.net/Runtime/Steam.cs b/com.rlabrecque.steamworks.net/Runtime/Steam.cs index 12282e0f..50e9edc4 100644 --- a/com.rlabrecque.steamworks.net/Runtime/Steam.cs +++ b/com.rlabrecque.steamworks.net/Runtime/Steam.cs @@ -23,14 +23,19 @@ public static class SteamAPI { // //----------------------------------------------------------------------------------------------------------------------------------------------------------// + public static bool Init(AppId_t appIdT) { + string appId = appIdT.ToString(); + + Environment.SetEnvironmentVariable("SteamAppId", appId); + Environment.SetEnvironmentVariable("SteamOverlayGameId", appId); + Environment.SetEnvironmentVariable("SteamGameId", appId); + + return this.Init(); + } // SteamAPI_Init must be called before using any other API functions. If it fails, an // error message will be output to the debugger (or stderr) with further information. - public static bool Init(AppId_t appIdT) { - Environment.SetEnvironmentVariable("SteamAppId", appIdT.ToString()); - Environment.SetEnvironmentVariable("SteamOverlayGameId", appIdT.ToString()); - Environment.SetEnvironmentVariable("SteamGameId", appIdT.ToString()); - + public static bool Init() { InteropHelp.TestIfPlatformSupported(); bool ret = NativeMethods.SteamAPI_Init();