From c8f5b1137fd82371fef83d90158232466a88b39f Mon Sep 17 00:00:00 2001 From: eki Date: Thu, 25 Aug 2022 13:10:39 +0300 Subject: [PATCH 1/8] custom dxvk hud --- .../Compatibility/CompatibilityTools.cs | 1 + src/XIVLauncher.Common.Unix/Compatibility/Dxvk.cs | 3 +++ .../Components/SettingsPage/Tabs/SettingsTabWine.cs | 10 ++++++++-- src/XIVLauncher.Core/Configuration/ILauncherConfig.cs | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/XIVLauncher.Common.Unix/Compatibility/CompatibilityTools.cs b/src/XIVLauncher.Common.Unix/Compatibility/CompatibilityTools.cs index 33b6759be..f9e8c7ebc 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.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs b/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs index 10d5f9d17..71dd6cc3b 100644 --- a/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs +++ b/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs @@ -52,7 +52,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 == 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 +114,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..d05bd22c5 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 From 7bdd7ae9f0115f8dd98bde762c9198072b14d130 Mon Sep 17 00:00:00 2001 From: eki Date: Thu, 25 Aug 2022 13:53:12 +0300 Subject: [PATCH 2/8] add missing definitions --- src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs b/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs index 9b122f7aa..53bf3901b 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 debugVars, string dxvkHudCustomString, 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; From 16c88a9c19188a6912878010b8c9cdfb6906824e Mon Sep 17 00:00:00 2001 From: eki Date: Thu, 25 Aug 2022 13:56:39 +0300 Subject: [PATCH 3/8] fix missing var --- .../Components/SettingsPage/Tabs/SettingsTabWine.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs b/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs index 71dd6cc3b..cdbdd8335 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() { From ba7aabff59c05de0e15ceb6f5f19dbf1e91fb7c3 Mon Sep 17 00:00:00 2001 From: eki Date: Thu, 25 Aug 2022 13:59:25 +0300 Subject: [PATCH 4/8] fix missing parameter --- src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs b/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs index 53bf3901b..06ea83353 100644 --- a/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs +++ b/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs @@ -25,7 +25,7 @@ public class WineSettings public DirectoryInfo Prefix { get; private set; } - public WineSettings(WineStartupType? startupType, string customBinPath, string debugVars, string dxvkHudCustomString, 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; From 77ae3a874714e5677bfe1027525084ed3ed94dc8 Mon Sep 17 00:00:00 2001 From: eki Date: Thu, 25 Aug 2022 14:07:16 +0300 Subject: [PATCH 5/8] add missing default value --- src/XIVLauncher.Core/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/XIVLauncher.Core/Program.cs b/src/XIVLauncher.Core/Program.cs index 010eac228..4dc005907 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); } From 6d108f54b2dfd5a110cb0c7476907081272e786d Mon Sep 17 00:00:00 2001 From: eki Date: Thu, 25 Aug 2022 14:11:17 +0300 Subject: [PATCH 6/8] test --- .../Components/SettingsPage/Tabs/SettingsTabWine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs b/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs index cdbdd8335..ad604a1b1 100644 --- a/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs +++ b/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs @@ -58,7 +58,7 @@ public SettingsTabWine() "Custom DXVK Overlay string. For example fps,frametimes,gpuload,version", () => Program.Config.DxvkHudCustomString, s => Program.Config.DxvkHudCustomString = s) { - CheckVisibility = () => dxvkOverlaySetting.Value == DxvkHudType.Custom + 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) }; From 31d377db65f2793e1c8ef9ff41eb39d6c50ccc18 Mon Sep 17 00:00:00 2001 From: eki Date: Thu, 25 Aug 2022 14:17:54 +0300 Subject: [PATCH 7/8] fix formatting --- .../Compatibility/CompatibilityTools.cs | 2 +- src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs | 4 ++-- .../Components/SettingsPage/Tabs/SettingsTabWine.cs | 2 +- src/XIVLauncher.Core/Configuration/ILauncherConfig.cs | 2 +- src/XIVLauncher.Core/Program.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/XIVLauncher.Common.Unix/Compatibility/CompatibilityTools.cs b/src/XIVLauncher.Common.Unix/Compatibility/CompatibilityTools.cs index f9e8c7ebc..0cac814dc 100644 --- a/src/XIVLauncher.Common.Unix/Compatibility/CompatibilityTools.cs +++ b/src/XIVLauncher.Common.Unix/Compatibility/CompatibilityTools.cs @@ -173,7 +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, + Dxvk.DxvkHudType.Custom => Settings.DxvkHudCustomString, _ => throw new ArgumentOutOfRangeException() }; diff --git a/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs b/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs index 06ea83353..96f66ef47 100644 --- a/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs +++ b/src/XIVLauncher.Common.Unix/Compatibility/WineSettings.cs @@ -15,7 +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 DxvkHudCustomString { get; private set; } public string EsyncOn { get; private set; } public string FsyncOn { get; private set; } @@ -29,7 +29,7 @@ public WineSettings(WineStartupType? startupType, string customBinPath, string d { this.StartupType = startupType ?? WineStartupType.Custom; this.CustomBinPath = customBinPath; - this.DxvkHudCustomString = dxvkHudCustomString; + 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 ad604a1b1..3b714fe0f 100644 --- a/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs +++ b/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs @@ -54,7 +54,7 @@ public SettingsTabWine() }, 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", + new SettingsEntry("DXVK custom Overlay", "Custom DXVK Overlay string. For example fps,frametimes,gpuload,version", () => Program.Config.DxvkHudCustomString, s => Program.Config.DxvkHudCustomString = s) { diff --git a/src/XIVLauncher.Core/Configuration/ILauncherConfig.cs b/src/XIVLauncher.Core/Configuration/ILauncherConfig.cs index d05bd22c5..6fc20c489 100644 --- a/src/XIVLauncher.Core/Configuration/ILauncherConfig.cs +++ b/src/XIVLauncher.Core/Configuration/ILauncherConfig.cs @@ -74,7 +74,7 @@ public interface ILauncherConfig public Dxvk.DxvkHudType DxvkHudType { get; set; } - public string? DxvkHudCustomString { get; set; } + public string? DxvkHudCustomString { get; set; } public string? WineDebugVars { get; set; } diff --git a/src/XIVLauncher.Core/Program.cs b/src/XIVLauncher.Core/Program.cs index 4dc005907..d7fd2646c 100644 --- a/src/XIVLauncher.Core/Program.cs +++ b/src/XIVLauncher.Core/Program.cs @@ -115,7 +115,7 @@ private static void LoadConfig(Storage storage) Config.DxvkAsyncEnabled ??= true; Config.ESyncEnabled ??= true; Config.FSyncEnabled ??= false; - Config.DxvkHudCustomString ??= "fps,frametimes,gpuload,version"; + Config.DxvkHudCustomString ??= "fps,frametimes,gpuload,version"; Config.WineStartupType ??= WineStartupType.Managed; Config.WineBinaryPath ??= "/usr/bin"; From a3ed5a189b80eb3ea2cff1ec8d80f6d2224d31fd Mon Sep 17 00:00:00 2001 From: eki Date: Thu, 25 Aug 2022 14:19:36 +0300 Subject: [PATCH 8/8] more formatting fixes --- .../Components/SettingsPage/Tabs/SettingsTabWine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs b/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs index 3b714fe0f..3aba8e84f 100644 --- a/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs +++ b/src/XIVLauncher.Core/Components/SettingsPage/Tabs/SettingsTabWine.cs @@ -9,7 +9,7 @@ namespace XIVLauncher.Core.Components.SettingsPage.Tabs; public class SettingsTabWine : SettingsTab { private SettingsEntry startupTypeSetting; - private SettingsEntry dxvkOverlaySetting; + private SettingsEntry dxvkOverlaySetting; public SettingsTabWine() {