Dalamud/Dalamud/Interface/Internal/Windows/Data/Widgets/PartyListWidget.cs
Haselnussbomber 58fbff7c56
Update text-related ImGui calls (#2337)
* Update text-related ImGui calls

* Use ImU8String for SafeTextColored

* Restore wrapped calls

* Update MenuItem call

* Use ImGui.Text over ImGui.TextUnformatted

* Add ImGui.TextColoredWrapped

* Obsolete SafeText helpers

* Fix obsoleted calls

* SafeTextColored didn't exist before imgui-bindings

* Remove %% replacements
2025-08-04 15:46:43 -07:00

66 lines
1.8 KiB
C#

using Dalamud.Bindings.ImGui;
using Dalamud.Game.ClientState.Party;
using Dalamud.Utility;
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
/// <summary>
/// Widget for displaying information about the current party.
/// </summary>
internal class PartyListWidget : IDataWindowWidget
{
private bool resolveGameData;
/// <inheritdoc/>
public string[]? CommandShortcuts { get; init; } = { "partylist", "party" };
/// <inheritdoc/>
public string DisplayName { get; init; } = "Party List";
/// <inheritdoc/>
public bool Ready { get; set; }
/// <inheritdoc/>
public void Load()
{
this.Ready = true;
}
/// <inheritdoc/>
public void Draw()
{
var partyList = Service<PartyList>.Get();
ImGui.Checkbox("Resolve GameData"u8, ref this.resolveGameData);
ImGui.Text($"GroupManager: {partyList.GroupManagerAddress.ToInt64():X}");
ImGui.Text($"GroupList: {partyList.GroupListAddress.ToInt64():X}");
ImGui.Text($"AllianceList: {partyList.AllianceListAddress.ToInt64():X}");
ImGui.Text($"{partyList.Length} Members");
for (var i = 0; i < partyList.Length; i++)
{
var member = partyList[i];
if (member == null)
{
ImGui.Text($"[{i}] was null");
continue;
}
ImGui.Text($"[{i}] {member.Address.ToInt64():X} - {member.Name} - {member.GameObject?.GameObjectId}");
if (this.resolveGameData)
{
var actor = member.GameObject;
if (actor == null)
{
ImGui.Text("Actor was null"u8);
}
else
{
Util.PrintGameObject(actor, "-", this.resolveGameData);
}
}
}
}
}