diff --git a/Dalamud/Configuration/Internal/DalamudConfiguration.cs b/Dalamud/Configuration/Internal/DalamudConfiguration.cs index f623f8007..cce922697 100644 --- a/Dalamud/Configuration/Internal/DalamudConfiguration.cs +++ b/Dalamud/Configuration/Internal/DalamudConfiguration.cs @@ -370,13 +370,21 @@ internal sealed class DalamudConfiguration : IServiceType } /// - /// Save the configuration at the path it was loaded from. + /// Save the configuration at the path it was loaded from, at the next frame. /// public void QueueSave() { this.isSaveQueued = true; } + /// + /// Immediately save the configuration. + /// + public void ForceSave() + { + this.Save(); + } + /// /// Save the file, if needed. Only needs to be done once a frame. /// diff --git a/Dalamud/Dalamud.csproj b/Dalamud/Dalamud.csproj index 5e406acdb..fb9a580e6 100644 --- a/Dalamud/Dalamud.csproj +++ b/Dalamud/Dalamud.csproj @@ -8,7 +8,7 @@ - 7.3.1.0 + 7.3.4.0 XIV Launcher addon framework $(DalamudVersion) $(DalamudVersion) diff --git a/Dalamud/Game/Internal/DXGI/SwapChainVtableResolver.cs b/Dalamud/Game/Internal/DXGI/SwapChainVtableResolver.cs index dda7b6184..ce42f6265 100644 --- a/Dalamud/Game/Internal/DXGI/SwapChainVtableResolver.cs +++ b/Dalamud/Game/Internal/DXGI/SwapChainVtableResolver.cs @@ -68,9 +68,27 @@ public class SwapChainVtableResolver : BaseAddressResolver, ISwapChainAddressRes // DXGISwapChain::handle_device_loss => DXGISwapChain::Present => DXGISwapChain::runtime_present var scanner = new SigScanner(processModule); + var runtimePresentSig = "F6 C2 01 0F 85 ?? ?? ?? ??"; + try { - var p = scanner.ScanText("F6 C2 01 0F 85 ?? ?? ?? ??"); // E8 ?? ?? ?? ?? 45 0F B6 5E ?? + var fileInfo = FileVersionInfo.GetVersionInfo(processModule.FileName); + + // Looks like this sig only works for GShade 4 + if (fileInfo.FileDescription?.Contains("GShade 4.") == true) + { + Log.Verbose("Hooking present for GShade 4"); + runtimePresentSig = "E8 ?? ?? ?? ?? 45 0F B6 5E ??"; + } + } + catch (Exception ex) + { + Log.Error(ex, "Failed to get reshade version info - falling back to default DXGISwapChain::runtime_present signature"); + } + + try + { + var p = scanner.ScanText(runtimePresentSig); Log.Information($"ReShade DLL: {processModule.FileName} with DXGISwapChain::runtime_present at {p:X}"); this.Present = p; diff --git a/Dalamud/Interface/Internal/Windows/BranchSwitcherWindow.cs b/Dalamud/Interface/Internal/Windows/BranchSwitcherWindow.cs index e934f9df6..dd2d911ff 100644 --- a/Dalamud/Interface/Internal/Windows/BranchSwitcherWindow.cs +++ b/Dalamud/Interface/Internal/Windows/BranchSwitcherWindow.cs @@ -103,6 +103,9 @@ public class BranchSwitcherWindow : Window { Pick(); + // If we exit immediately, we need to write out the new config now + Service.Get().ForceSave(); + var appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); var xlPath = Path.Combine(appData, "XIVLauncher", "XIVLauncher.exe"); diff --git a/README.md b/README.md index 22e77f0c6..f98961c3e 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ We are currently working from the following branches. | Name | Purpose | .NET Version | Track | |---|---|---|---| -| *master* | Upgrade to .NET 6 | .NET 6.0.3 (March 2022) | Staging | -| *net5* | Current release branch | .NET 5.0.6 (May 2021) | Release | +| *master* | Current release branch | .NET 6.0.3 (March 2022) | Release & Staging | +| *net7* | Upgrade to .NET 7 | .NET 7.0.0 (November 2022) | net7 | | *api3* | Legacy version, no longer in active use | .NET Framework 4.7.2 (April 2017) | - |