]> localhost Git - radev.git/commitdiff
Add a way to restart the game through steam
authormisomosi <[email protected]>
Mon, 18 May 2026 20:06:19 +0000 (16:06 -0400)
committermisomosi <[email protected]>
Mon, 18 May 2026 20:06:19 +0000 (16:06 -0400)
OSFE/RetroAchievements.cs

index dd96cb5bf803555cde8502713c46a9b3e8706f9b..b4a0dbd4262c6602a6db316bb5e9336a44cdb98f 100644 (file)
@@ -1,6 +1,12 @@
 using HarmonyLib;\r
 using System.IO;\r
 using UnityEngine;\r
+using Steamworks;\r
+\r
+static class RetroAchievements\r
+{\r
+       public static uint AppID = 960690u;\r
+};\r
 \r
 // We don't actually care much about hooking LoadItemData, but it's\r
 // called soon after mods are loaded, so it gives us an early entrypoint\r
@@ -17,6 +23,12 @@ internal class EntryPoint
        static EntryPoint()\r
        {\r
                Debug.Log("Hello World!");\r
+#if false\r
+               // This is a way to restart the app immediately through steam\r
+               // Useful for restarting when user wants to switch to hardcore mode\r
+               Application.OpenURL("steam://run/" + RetroAchievements.AppID);\r
+               Application.Quit();\r
+#endif\r
        } \r
        static void Prefix() {}\r
 }\r