private void OnBuildUi_Debug() { if (isImguiDebugOpen) { ImGui.SetNextWindowSize(new Vector2(500, 500), ImGuiCond.FirstUseEver); if (ImGui.Begin("JobIcons Debug", ref isImguiDebugOpen)) { ImGui.PushItemWidth(-1); if (ImGui.CollapsingHeader("PartyMembers")) { var headers = new string[] { "Address", "ActorID", "Name", "IsLocalPlayer", "IsParty", "isPC" }; var sizes = new float[headers.Length]; ImGui.Columns(headers.Length); for (int i = 0; i < headers.Length; i++) { DebugTableCell(headers[i], sizes); } ImGui.Separator(); foreach (var actor in plugin.Interface.ClientState.Actors) { var isLocalPlayer = XivApi.IsLocalPlayer(actor.ActorId); var isParty = XivApi.IsPartyMember(actor.ActorId); var isPC = actor is Dalamud.Game.ClientState.Actors.Types.PlayerCharacter; if (isLocalPlayer || isParty) { DebugTableCell($"0x{actor.Address.ToInt64():X}", sizes); DebugTableCell(actor.ActorId.ToString(), sizes); DebugTableCell(actor.Name, sizes); DebugTableCell(isLocalPlayer.ToString(), sizes); DebugTableCell(isParty.ToString(), sizes); DebugTableCell(isPC.ToString(), sizes); } } for (int i = 0; i < sizes.Length; i++) { ImGui.SetColumnWidth(i, sizes[i] + 20); } ImGui.Columns(1); ImGui.NewLine(); } if (ImGui.CollapsingHeader("NamePlateObjects")) { var addon = XivApi.GetSafeAddonNamePlate(); if (addon.Pointer == IntPtr.Zero) { ImGui.Text("Addon not available"); ImGui.NewLine(); } else { var headers = new string[] { "Index", "npObj", "Visible", "isLocalPlayer", "Layer", "XAdjust", "YAdjust", "XPos", "YPos", "XScale", "YScale", "Type", "npInfo", "ActorID", "Name", "isPC", "isParty", "isAlliance", "JobID", "PrefixTitle", "Title", "FcName", "LevelText" }; var sizes = new float[headers.Length]; ImGui.Columns(headers.Length); for (int i = 0; i < headers.Length; i++) { DebugTableCell(headers[i], sizes); } ImGui.Separator(); for (int i = 0; i < 50; i++) { var npObject = addon.GetNamePlateObject(i); if (npObject == null) { for (int c = 0; c < headers.Length; c++) { DebugTableCell("npObj=null", sizes); } continue; } var npInfo = npObject.NamePlateInfo; if (npInfo == null) { for (int c = 0; c < headers.Length; c++) { DebugTableCell("npInfo=null", sizes); } continue; } var imageNode = npObject.IconImageNode; string imageX, imageY, scaleX, scaleY; imageX = imageNode.AtkResNode.X.ToString(); imageY = imageNode.AtkResNode.Y.ToString(); scaleX = imageNode.AtkResNode.ScaleX.ToString(); scaleY = imageNode.AtkResNode.ScaleY.ToString(); DebugTableCell(i.ToString(), sizes); DebugTableCell($"0x{npObject.Pointer.ToInt64():X}", sizes); DebugTableCell(npObject.IsVisible.ToString(), sizes); DebugTableCell(npObject.IsLocalPlayer.ToString(), sizes); DebugTableCell(npObject.Data.Layer.ToString(), sizes); DebugTableCell(npObject.Data.IconXAdjust.ToString(), sizes); DebugTableCell(npObject.Data.IconYAdjust.ToString(), sizes); DebugTableCell(imageX, sizes); DebugTableCell(imageY, sizes); DebugTableCell(scaleX, sizes); DebugTableCell(scaleY, sizes); DebugTableCell(npObject.Data.NameplateKind.ToString(), sizes); DebugTableCell($"0x{npInfo.Pointer.ToInt64():X}", sizes); DebugTableCell(npInfo.Data.ActorID.ToString(), sizes); DebugTableCell(npInfo.Name, sizes); DebugTableCell(XivApi.IsPlayerCharacter(npInfo.Data.ActorID).ToString(), sizes); DebugTableCell(XivApi.IsPartyMember(npInfo.Data.ActorID).ToString(), sizes); DebugTableCell(XivApi.IsAllianceMember(npInfo.Data.ActorID).ToString(), sizes); DebugTableCell(XivApi.GetJobId(npInfo.Data.ActorID).ToString(), sizes); DebugTableCell(npInfo.Data.IsPrefixTitle.ToString(), sizes); DebugTableCell(npInfo.Title, sizes); DebugTableCell(npInfo.FcName, sizes); DebugTableCell(npInfo.LevelText, sizes); } for (int i = 0; i < sizes.Length; i++) { ImGui.SetColumnWidth(i, sizes[i] + 20); } ImGui.Columns(1); ImGui.NewLine(); } } ImGui.PopItemWidth(); } ImGui.End(); } }
public bool IsPlayerCharacter() => XivApi.IsPlayerCharacter(Data.ActorID);