Initialize InterfaceManager hooks from Framework.Tick (#901)

This commit is contained in:
kizer 2022-06-27 16:27:47 +09:00 committed by GitHub
parent 6835699912
commit 6ad647235c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -970,9 +970,11 @@ namespace Dalamud.Interface.Internal
} }
[ServiceManager.CallWhenServicesReady] [ServiceManager.CallWhenServicesReady]
private void ContinueConstruction(SigScanner sigScanner) private void ContinueConstruction(SigScanner sigScanner, Framework framework)
{ {
this.address.Setup(sigScanner); this.address.Setup(sigScanner);
framework.RunOnFrameworkThread(() =>
{
this.setCursorHook = Hook<SetCursorDelegate>.FromSymbol("user32.dll", "SetCursor", this.SetCursorDetour, true)!; this.setCursorHook = Hook<SetCursorDelegate>.FromSymbol("user32.dll", "SetCursor", this.SetCursorDetour, true)!;
this.presentHook = new Hook<PresentDelegate>(this.address.Present, this.PresentDetour); this.presentHook = new Hook<PresentDelegate>(this.address.Present, this.PresentDetour);
this.resizeBuffersHook = new Hook<ResizeBuffersDelegate>(this.address.ResizeBuffers, this.ResizeBuffersDetour); this.resizeBuffersHook = new Hook<ResizeBuffersDelegate>(this.address.ResizeBuffers, this.ResizeBuffersDetour);
@ -1003,6 +1005,7 @@ namespace Dalamud.Interface.Internal
{ {
Log.Error(ex, "Could not reload RTSS"); Log.Error(ex, "Could not reload RTSS");
} }
});
} }
private void Disable() private void Disable()