diff --git a/src/XIVLauncher.Core/Components/MainPage/MainPage.cs b/src/XIVLauncher.Core/Components/MainPage/MainPage.cs index 20e8ac3b..89173b8d 100644 --- a/src/XIVLauncher.Core/Components/MainPage/MainPage.cs +++ b/src/XIVLauncher.Core/Components/MainPage/MainPage.cs @@ -676,6 +676,17 @@ public async Task StartGameAndAddon(Launcher.LoginResult loginResult, b IGameRunner runner; + // Set LD_PRELOAD to value of XL_PRELOAD if we're running as a steam compatibility tool. + // This check must be done before the FixLDP check so that it will still work. + if (CoreEnvironmentSettings.IsSteamCompatTool) + { + var ldpreload = System.Environment.GetEnvironmentVariable("LD_PRELOAD") ?? ""; + var xlpreload = System.Environment.GetEnvironmentVariable("XL_PRELOAD") ?? ""; + ldpreload = (ldpreload + ":" + xlpreload).Trim(':'); + if (!string.IsNullOrEmpty(ldpreload)) + System.Environment.SetEnvironmentVariable("LD_PRELOAD", ldpreload); + } + // Hack: Force C.utf8 to fix incorrect unicode paths if (App.Settings.FixLocale == true && !string.IsNullOrEmpty(Program.CType)) { diff --git a/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabGame.cs b/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabGame.cs index 0ed46625..2418c2d9 100644 --- a/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabGame.cs +++ b/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabGame.cs @@ -33,7 +33,10 @@ public class SettingsTabGame : SettingsTab new SettingsEntry("Game DPI Awareness", "Select the game's DPI Awareness. Change this if the game's scaling looks wrong.", () => Program.Config.DpiAwareness ?? DpiAwareness.Unaware, x => Program.Config.DpiAwareness = x), new SettingsEntry("Free Trial Account", "Check this if you are using a free trial account.", () => Program.Config.IsFt ?? false, x => Program.Config.IsFt = x), new SettingsEntry("Use XIVLauncher authenticator/OTP macros", "Check this if you want to use the XIVLauncher authenticator app or macros.", () => Program.Config.IsOtpServer ?? false, x => Program.Config.IsOtpServer = x), - new SettingsEntry("Ignore Steam", "Check this if you do not want XIVLauncher to communicate with Steam (Requires Restart).", () => Program.Config.IsIgnoringSteam ?? false, x => Program.Config.IsIgnoringSteam = x), + new SettingsEntry("Ignore Steam", "Check this if you do not want XIVLauncher to communicate with Steam (Requires Restart).", () => Program.Config.IsIgnoringSteam ?? false, x => Program.Config.IsIgnoringSteam = x) + { + CheckVisibility = () => !CoreEnvironmentSettings.IsSteamCompatTool, + }, new SettingsEntry("Use Experimental UID Cache", "Tries to save your login token for the next start. Can result in launching with expired sessions.\nDisable if receiving FFXIV error 1012 or 500X.", () => Program.Config.IsUidCacheEnabled ?? false, x => Program.Config.IsUidCacheEnabled = x), }; diff --git a/src/XIVLauncher.Core/CoreEnvironmentSettings.cs b/src/XIVLauncher.Core/CoreEnvironmentSettings.cs index 69b0e706..0d067b25 100644 --- a/src/XIVLauncher.Core/CoreEnvironmentSettings.cs +++ b/src/XIVLauncher.Core/CoreEnvironmentSettings.cs @@ -15,6 +15,7 @@ public static class CoreEnvironmentSettings public static bool ClearLogs => CheckEnvBool("XL_CLEAR_LOGS"); public static bool ClearAll => CheckEnvBool("XL_CLEAR_ALL"); public static bool? UseSteam => CheckEnvBoolOrNull("XL_USE_STEAM"); // Fix for Steam Deck users who lock themselves out + public static bool IsSteamCompatTool => CheckEnvBool("XL_SCT"); private static bool CheckEnvBool(string key) { diff --git a/src/XIVLauncher.Core/Program.cs b/src/XIVLauncher.Core/Program.cs index 08131a8e..b37dabaa 100644 --- a/src/XIVLauncher.Core/Program.cs +++ b/src/XIVLauncher.Core/Program.cs @@ -225,7 +225,7 @@ private static void Main(string[] args) default: throw new PlatformNotSupportedException(); } - if (!Config.IsIgnoringSteam ?? true) + if (Config.IsIgnoringSteam != true || CoreEnvironmentSettings.IsSteamCompatTool) { try {