mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
feat(UiBuilder): add OverrideGameCursor
This commit is contained in:
parent
7605570fb0
commit
64eb2e60cf
4 changed files with 24 additions and 2 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue