From deb208642f4cbb53e03a88fa827f152c48e2837b Mon Sep 17 00:00:00 2001 From: meli <57847713+ff-meli@users.noreply.github.com> Date: Mon, 20 Jan 2020 09:58:31 -0800 Subject: [PATCH 1/3] Super quick cleanup of cursor changes, pull in associated ImGuiScene changes --- Dalamud/Interface/InterfaceManager.cs | 5 +---- lib/ImGuiScene | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Dalamud/Interface/InterfaceManager.cs b/Dalamud/Interface/InterfaceManager.cs index 1787717d9..dbff054b9 100644 --- a/Dalamud/Interface/InterfaceManager.cs +++ b/Dalamud/Interface/InterfaceManager.cs @@ -1,9 +1,6 @@ using System; -using System.Diagnostics; -using System.Linq; using System.Runtime.InteropServices; using Dalamud.Game; -using Dalamud.Game.Internal; using Dalamud.Game.Internal.DXGI; using Dalamud.Hooking; using EasyHook; @@ -130,7 +127,7 @@ namespace Dalamud.Interface private IntPtr SetCursorDetour(IntPtr hCursor) { Log.Debug($"hCursor: {hCursor.ToInt64():X} WantCapture: {this.lastWantCapture}"); - if (this.lastWantCapture == true && ImGui_Input_Impl_Direct.Cursors != null && !ImGui_Input_Impl_Direct.Cursors.Contains(hCursor)) + if (this.lastWantCapture == true && (!scene?.IsImGuiCursor(hCursor) ?? false)) return IntPtr.Zero; return this.setCursorHook.Original(hCursor); diff --git a/lib/ImGuiScene b/lib/ImGuiScene index f1a6ea14c..1ccd799d8 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit f1a6ea14c354ecc65d36ab212de3d3ce91b60556 +Subproject commit 1ccd799d8f264523ec5473b4ae18e87be0093653 From 7321819961817cfb471c04f9c73465957484b12b Mon Sep 17 00:00:00 2001 From: meli <57847713+ff-meli@users.noreply.github.com> Date: Mon, 20 Jan 2020 11:16:53 -0800 Subject: [PATCH 2/3] pull in minor ImGuiScene cleanup --- Dalamud/Interface/InterfaceManager.cs | 4 ---- lib/ImGuiScene | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Dalamud/Interface/InterfaceManager.cs b/Dalamud/Interface/InterfaceManager.cs index dbff054b9..68f0eef74 100644 --- a/Dalamud/Interface/InterfaceManager.cs +++ b/Dalamud/Interface/InterfaceManager.cs @@ -81,16 +81,12 @@ namespace Dalamud.Interface { this.setCursorHook.Enable(); this.presentHook.Enable(); - - this.scene?.Enable(); } private void Disable() { this.setCursorHook.Disable(); this.presentHook.Disable(); - - this.scene?.Disable(); } public void Dispose() diff --git a/lib/ImGuiScene b/lib/ImGuiScene index 1ccd799d8..4fcf95dcd 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit 1ccd799d8f264523ec5473b4ae18e87be0093653 +Subproject commit 4fcf95dcd06524b278d42dfa8a9aa1853e375d94 From 3ca7c6c19c566d4fb3b31893390458a21b6a1f2c Mon Sep 17 00:00:00 2001 From: meli <57847713+ff-meli@users.noreply.github.com> Date: Mon, 20 Jan 2020 13:25:05 -0800 Subject: [PATCH 3/3] Set path for imgui's ini file to the general dalamud data directory, so it won't conflict with other imgui applications and is obvious to users that it is part of dalamud --- Dalamud/Dalamud.cs | 2 +- Dalamud/Interface/InterfaceManager.cs | 7 ++++++- lib/ImGuiScene | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dalamud/Dalamud.cs b/Dalamud/Dalamud.cs index f5e04cac6..e09c58717 100644 --- a/Dalamud/Dalamud.cs +++ b/Dalamud/Dalamud.cs @@ -84,7 +84,7 @@ namespace Dalamud { this.WinSock2 = new WinSockHandlers(); - this.InterfaceManager = new InterfaceManager(this.sigScanner); + this.InterfaceManager = new InterfaceManager(this, this.sigScanner); this.InterfaceManager.OnDraw += BuildDalamudUi; this.InterfaceManager.Enable(); } diff --git a/Dalamud/Interface/InterfaceManager.cs b/Dalamud/Interface/InterfaceManager.cs index 68f0eef74..6b08c4b5f 100644 --- a/Dalamud/Interface/InterfaceManager.cs +++ b/Dalamud/Interface/InterfaceManager.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Runtime.InteropServices; using Dalamud.Game; using Dalamud.Game.Internal.DXGI; @@ -35,6 +36,7 @@ namespace Dalamud.Interface private ISwapChainAddressResolver Address { get; } + private Dalamud dalamud; private RawDX11Scene scene; /// @@ -42,8 +44,10 @@ namespace Dalamud.Interface /// public event RawDX11Scene.BuildUIDelegate OnDraw; - public InterfaceManager(SigScanner scanner) + public InterfaceManager(Dalamud dalamud, SigScanner scanner) { + this.dalamud = dalamud; + try { var sigResolver = new SwapChainSigResolver(); sigResolver.Setup(scanner); @@ -109,6 +113,7 @@ namespace Dalamud.Interface if (this.scene == null) { this.scene = new RawDX11Scene(swapChain); + this.scene.ImGuiIniPath = Path.Combine(Path.GetDirectoryName(this.dalamud.StartInfo.ConfigurationPath), "dalamudUI.ini"); this.scene.OnBuildUI += Display; } diff --git a/lib/ImGuiScene b/lib/ImGuiScene index 4fcf95dcd..09dde468e 160000 --- a/lib/ImGuiScene +++ b/lib/ImGuiScene @@ -1 +1 @@ -Subproject commit 4fcf95dcd06524b278d42dfa8a9aa1853e375d94 +Subproject commit 09dde468ea8a6a1729fc8dd334379d1514264742