feat: implement CheckViewportState() in InterfaceManager

This commit is contained in:
goat 2021-04-12 02:55:36 +02:00
parent 425e9e26e0
commit c4b5abd7b5
No known key found for this signature in database
GPG key ID: F18F057873895461

View file

@ -282,11 +282,25 @@ namespace Dalamud.Interface
// Process information needed by ImGuiHelpers each frame.
ImGuiHelpers.NewFrame();
// Check if we can still enable viewports without any issues.
this.CheckViewportState();
this.scene.Render();
return this.presentHook.Original(swapChain, syncInterval, presentFlags);
}
private void CheckViewportState()
{
if (this.dalamud.Configuration.IsNeverViewport || this.scene.SwapChain.IsFullScreen || ImGui.GetPlatformIO().Monitors.Size == 1)
{
ImGui.GetIO().ConfigFlags &= ~ImGuiConfigFlags.ViewportsEnable;
return;
}
ImGui.GetIO().ConfigFlags |= ImGuiConfigFlags.DockingEnable;
}
public static ImFontPtr DefaultFont { get; private set; }
public static ImFontPtr IconFont { get; private set; }