mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Merge pull request #27 from ff-meli/interface
Beginnings of ImGuiScene cleanup
This commit is contained in:
commit
f707bbaa06
3 changed files with 9 additions and 11 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using Dalamud.Game;
|
||||
using Dalamud.Game.Internal;
|
||||
using Dalamud.Game.Internal.DXGI;
|
||||
using Dalamud.Hooking;
|
||||
using EasyHook;
|
||||
|
|
@ -38,6 +36,7 @@ namespace Dalamud.Interface
|
|||
|
||||
private ISwapChainAddressResolver Address { get; }
|
||||
|
||||
private Dalamud dalamud;
|
||||
private RawDX11Scene scene;
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -45,8 +44,10 @@ namespace Dalamud.Interface
|
|||
/// </summary>
|
||||
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);
|
||||
|
|
@ -84,16 +85,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()
|
||||
|
|
@ -116,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;
|
||||
}
|
||||
|
||||
|
|
@ -130,7 +128,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);
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit f1a6ea14c354ecc65d36ab212de3d3ce91b60556
|
||||
Subproject commit 09dde468ea8a6a1729fc8dd334379d1514264742
|
||||
Loading…
Add table
Add a link
Reference in a new issue