diff --git a/src/XIVLauncher.Common.Unix/Compatibility/CompatibilityTools.cs b/src/XIVLauncher.Common.Unix/Compatibility/CompatibilityTools.cs index 33b6759be..0cac814dc 100644 --- a/src/XIVLauncher.Common.Unix/Compatibility/CompatibilityTools.cs +++ b/src/XIVLauncher.Common.Unix/Compatibility/CompatibilityTools.cs @@ -173,6 +173,7 @@ private Process RunInPrefix(ProcessStartInfo psi, string workingDirectory, IDict Dxvk.DxvkHudType.None => "0", Dxvk.DxvkHudType.Fps => "fps", Dxvk.DxvkHudType.Full => "full", + Dxvk.DxvkHudType.Custom => Settings.DxvkHudCustomString, _ => throw new ArgumentOutOfRangeException() }; diff --git a/src/XIVLauncher.Common.Unix/Compatibility/Dxvk.cs b/src/XIVLauncher.Common.Unix/Compatibility/Dxvk.cs index 50fa98d9e..ff809820a 100644 --- a/src/XIVLauncher.Common.Unix/Compatibility/Dxvk.cs +++ b/src/XIVLauncher.Common.Unix/Compatibility/Dxvk.cs @@ -51,5 +51,8 @@ public enum DxvkHudType [SettingsDescription("Full", "Show everything")] Full, + + [SettingsDescription("Custom", "Custom dxvk hud string")] + Custom, } } \ No newline at end of file diff --git a/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs b/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs index 9b122f7aa..96f66ef47 100644 --- a/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs +++ b/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs @@ -15,6 +15,7 @@ public class WineSettings { public WineStartupType StartupType { get; private set; } public string CustomBinPath { get; private set; } + public string DxvkHudCustomString { get; private set; } public string EsyncOn { get; private set; } public string FsyncOn { get; private set; } @@ -24,10 +25,11 @@ public class WineSettings public DirectoryInfo Prefix { get; private set; } - public WineSettings(WineStartupType? startupType, string customBinPath, string debugVars, FileInfo logFile, DirectoryInfo prefix, bool? esyncOn, bool? fsyncOn) + public WineSettings(WineStartupType? startupType, string customBinPath, string dxvkHudCustomString, string debugVars, FileInfo logFile, DirectoryInfo prefix, bool? esyncOn, bool? fsyncOn) { this.StartupType = startupType ?? WineStartupType.Custom; this.CustomBinPath = customBinPath; + this.DxvkHudCustomString = dxvkHudCustomString; this.EsyncOn = (esyncOn ?? false) ? "1" : "0"; this.FsyncOn = (fsyncOn ?? false) ? "1" : "0"; this.DebugVars = debugVars; diff --git a/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs b/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs index 10d5f9d17..3aba8e84f 100644 --- a/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs +++ b/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs @@ -9,6 +9,7 @@ namespace XIVLauncher.Core.Components.SettingsPage.Tabs; public class SettingsTabWine : SettingsTab { private SettingsEntry startupTypeSetting; + private SettingsEntry dxvkOverlaySetting; public SettingsTabWine() { @@ -52,7 +53,13 @@ public SettingsTabWine() } }, - new SettingsEntry("DXVK Overlay", "Configure how much of the DXVK overlay is to be shown.", () => Program.Config.DxvkHudType, type => Program.Config.DxvkHudType = type), + dxvkOverlaySetting = new SettingsEntry("DXVK Overlay", "Configure how much of the DXVK overlay is to be shown.", () => Program.Config.DxvkHudType, type => Program.Config.DxvkHudType = type), + new SettingsEntry("DXVK custom Overlay", + "Custom DXVK Overlay string. For example fps,frametimes,gpuload,version", + () => Program.Config.DxvkHudCustomString, s => Program.Config.DxvkHudCustomString = s) + { + CheckVisibility = () => dxvkOverlaySetting.Value == Dxvk.DxvkHudType.Custom + }, new SettingsEntry("WINEDEBUG Variables", "Configure debug logging for wine. Useful for troubleshooting.", () => Program.Config.WineDebugVars ?? string.Empty, s => Program.Config.WineDebugVars = s) }; } @@ -108,7 +115,7 @@ public override void Draw() public override void Save() { base.Save(); - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) Program.CreateCompatToolsInstance(); } } \ No newline at end of file diff --git a/src/XIVLauncher.Core/Configuration/ILauncherConfig.cs b/src/XIVLauncher.Core/Configuration/ILauncherConfig.cs index bd72c4e2e..6fc20c489 100644 --- a/src/XIVLauncher.Core/Configuration/ILauncherConfig.cs +++ b/src/XIVLauncher.Core/Configuration/ILauncherConfig.cs @@ -74,6 +74,8 @@ public interface ILauncherConfig public Dxvk.DxvkHudType DxvkHudType { get; set; } + public string? DxvkHudCustomString { get; set; } + public string? WineDebugVars { get; set; } #endregion diff --git a/src/XIVLauncher.Core/Program.cs b/src/XIVLauncher.Core/Program.cs index 010eac228..d7fd2646c 100644 --- a/src/XIVLauncher.Core/Program.cs +++ b/src/XIVLauncher.Core/Program.cs @@ -115,6 +115,7 @@ private static void LoadConfig(Storage storage) Config.DxvkAsyncEnabled ??= true; Config.ESyncEnabled ??= true; Config.FSyncEnabled ??= false; + Config.DxvkHudCustomString ??= "fps,frametimes,gpuload,version"; Config.WineStartupType ??= WineStartupType.Managed; Config.WineBinaryPath ??= "/usr/bin"; @@ -276,7 +277,7 @@ public static void CreateCompatToolsInstance() { var wineLogFile = new FileInfo(Path.Combine(storage.GetFolder("logs").FullName, "wine.log")); var winePrefix = storage.GetFolder("wineprefix"); - var wineSettings = new WineSettings(Config.WineStartupType, Config.WineBinaryPath, Config.WineDebugVars, wineLogFile, winePrefix, Config.ESyncEnabled, Config.FSyncEnabled); + var wineSettings = new WineSettings(Config.WineStartupType, Config.WineBinaryPath, Config.DxvkHudCustomString, Config.WineDebugVars, wineLogFile, winePrefix, Config.ESyncEnabled, Config.FSyncEnabled); var toolsFolder = storage.GetFolder("compatibilitytool"); CompatibilityTools = new CompatibilityTools(wineSettings, Config.DxvkHudType, Config.GameModeEnabled, Config.DxvkAsyncEnabled, toolsFolder); }