mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-18 13:57:43 +01:00
/xldata window refactor (#1257)
Reworks the `/xldata` window so that each individual section is in its own file.
This commit is contained in:
parent
11ea64410e
commit
694159a510
37 changed files with 2701 additions and 1893 deletions
|
|
@ -0,0 +1,88 @@
|
|||
using Dalamud.Game.ClientState;
|
||||
using Dalamud.Game.ClientState.Objects;
|
||||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.Data;
|
||||
|
||||
/// <summary>
|
||||
/// Widget for displaying target info.
|
||||
/// </summary>
|
||||
internal class TargetWidget : IDataWindowWidget
|
||||
{
|
||||
private bool resolveGameData;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public DataKind DataKind { get; init; } = DataKind.Target;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool Ready { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Load()
|
||||
{
|
||||
this.Ready = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Draw()
|
||||
{
|
||||
ImGui.Checkbox("Resolve GameData", ref this.resolveGameData);
|
||||
|
||||
var clientState = Service<ClientState>.Get();
|
||||
var targetMgr = Service<TargetManager>.Get();
|
||||
|
||||
if (targetMgr.Target != null)
|
||||
{
|
||||
Util.PrintGameObject(targetMgr.Target, "CurrentTarget", this.resolveGameData);
|
||||
|
||||
ImGui.Text("Target");
|
||||
Util.ShowGameObjectStruct(targetMgr.Target);
|
||||
|
||||
var tot = targetMgr.Target.TargetObject;
|
||||
if (tot != null)
|
||||
{
|
||||
ImGuiHelpers.ScaledDummy(10);
|
||||
|
||||
ImGui.Separator();
|
||||
ImGui.Text("ToT");
|
||||
Util.ShowGameObjectStruct(tot);
|
||||
}
|
||||
|
||||
ImGuiHelpers.ScaledDummy(10);
|
||||
}
|
||||
|
||||
if (targetMgr.FocusTarget != null)
|
||||
Util.PrintGameObject(targetMgr.FocusTarget, "FocusTarget", this.resolveGameData);
|
||||
|
||||
if (targetMgr.MouseOverTarget != null)
|
||||
Util.PrintGameObject(targetMgr.MouseOverTarget, "MouseOverTarget", this.resolveGameData);
|
||||
|
||||
if (targetMgr.PreviousTarget != null)
|
||||
Util.PrintGameObject(targetMgr.PreviousTarget, "PreviousTarget", this.resolveGameData);
|
||||
|
||||
if (targetMgr.SoftTarget != null)
|
||||
Util.PrintGameObject(targetMgr.SoftTarget, "SoftTarget", this.resolveGameData);
|
||||
|
||||
if (ImGui.Button("Clear CT"))
|
||||
targetMgr.ClearTarget();
|
||||
|
||||
if (ImGui.Button("Clear FT"))
|
||||
targetMgr.ClearFocusTarget();
|
||||
|
||||
var localPlayer = clientState.LocalPlayer;
|
||||
|
||||
if (localPlayer != null)
|
||||
{
|
||||
if (ImGui.Button("Set CT"))
|
||||
targetMgr.SetTarget(localPlayer);
|
||||
|
||||
if (ImGui.Button("Set FT"))
|
||||
targetMgr.SetFocusTarget(localPlayer);
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.Text("LocalPlayer is null.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue