interface: make swapchain hooking mode into a console command instead

This commit is contained in:
goat 2024-07-23 19:37:19 +02:00
parent 22eea4b0de
commit 7e709d98cf
2 changed files with 24 additions and 0 deletions

View file

@ -190,6 +190,28 @@ internal class DalamudInterface : IInternalDisposableService
this.creditsDarkeningAnimation.Point1 = Vector2.Zero;
this.creditsDarkeningAnimation.Point2 = new Vector2(CreditsDarkeningMaxAlpha);
// This is temporary, until we know the repercussions of vtable hooking mode
consoleManager.AddCommand(
"dalamud.interface.swapchain_mode",
"Set swapchain hooking mode",
(string mode) =>
{
switch (mode)
{
case "vtable":
this.configuration.SwapChainHookMode = SwapChainHelper.HookMode.VTable;
break;
case "bytecode":
this.configuration.SwapChainHookMode = SwapChainHelper.HookMode.ByteCode;
break;
default:
Log.Error("Unknown swapchain mode: {Mode}", mode);
break;
}
this.configuration.QueueSave();
});
}
private delegate nint CrashDebugDelegate(nint self);

View file

@ -109,6 +109,7 @@ public class SettingsTabExperimental : SettingsTab
},
},
/* // Making this a console command instead, for now
new GapSettingsEntry(5, true),
new EnumSettingsEntry<SwapChainHelper.HookMode>(
@ -119,6 +120,7 @@ public class SettingsTabExperimental : SettingsTab
c => c.SwapChainHookMode,
(v, c) => c.SwapChainHookMode = v,
fallbackValue: SwapChainHelper.HookMode.ByteCode),
*/
/* Disabling profiles after they've been enabled doesn't make much sense, at least not if the user has already created profiles.
new GapSettingsEntry(5, true),