feat(UiBuilder): add OverrideGameCursor

This commit is contained in:
goat 2021-04-28 14:19:57 +02:00
parent 7605570fb0
commit 64eb2e60cf
No known key found for this signature in database
GPG key ID: F18F057873895461
4 changed files with 24 additions and 2 deletions

View file

@ -353,6 +353,10 @@ namespace Dalamud.Interface
// ImGui
case 14:
ImGui.Text("Monitor count: " + ImGui.GetPlatformIO().Monitors.Size);
ImGui.Text("OverrideGameCursor: " + this.dalamud.InterfaceManager.OverrideGameCursor);
ImGui.Button("THIS IS A BUTTON###hoverTestButton");
this.dalamud.InterfaceManager.OverrideGameCursor = !ImGui.IsItemHovered();
break;

View file

@ -55,6 +55,15 @@ namespace Dalamud.Interface
public Device Device => this.scene.Device;
public IntPtr WindowHandlePtr => this.scene.WindowHandlePtr;
/// <summary>
/// Gets or sets a value indicating whether or not the game's cursor should be overridden with the ImGui cursor.
/// </summary>
public bool OverrideGameCursor
{
get => this.scene.UpdateCursor;
set => this.scene.UpdateCursor = value;
}
private delegate void InstallRTSSHook();
private string rtssPath;
@ -434,7 +443,7 @@ namespace Dalamud.Interface
private bool lastWantCapture = false;
private IntPtr SetCursorDetour(IntPtr hCursor) {
if (this.lastWantCapture == true && (!scene?.IsImGuiCursor(hCursor) ?? false))
if (this.lastWantCapture == true && (!scene?.IsImGuiCursor(hCursor) ?? false) && this.OverrideGameCursor)
return IntPtr.Zero;
return this.setCursorHook.Original(hCursor);

View file

@ -87,6 +87,15 @@ namespace Dalamud.Interface
/// </summary>
public bool DisableGposeUiHide { get; set; } = false;
/// <summary>
/// Gets or sets a value indicating whether or not the game's cursor should be overridden with the ImGui cursor.
/// </summary>
public bool OverrideGameCursor
{
get => this.dalamud.InterfaceManager.OverrideGameCursor;
set => this.dalamud.InterfaceManager.OverrideGameCursor = value;
}
/// <summary>
/// Gets or sets an action that is called any time ImGui fonts need to be rebuilt.<br/>
/// Any ImFontPtr objects that you store <strong>can be invalidated</strong> when fonts are rebuilt

@ -1 +1 @@
Subproject commit b836ec8ecb5a2292bca03f4746da33ae0e144190
Subproject commit 2f07a5b63fb6863574e6e93c5ead9702efed02dc