mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-18 22:07:44 +01:00
Add interfaces to non public/sealed classes referenced in public interfaces (#1808)
* Add interfaces to non public/sealed classes referenced in public interfaces * Fixed inheritdocs + made most classes internal * Add missing properties to IFate and Fate, fix documentation --------- Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
This commit is contained in:
parent
3994f528b8
commit
7947b896ea
55 changed files with 1466 additions and 584 deletions
|
|
@ -142,7 +142,7 @@ public static class MapUtil
|
|||
/// <param name="go">The GameObject to get the position for.</param>
|
||||
/// <param name="correctZOffset">Whether to "correct" a Z offset to sane values for maps that don't have one.</param>
|
||||
/// <returns>A Vector3 that represents the X (east/west), Y (north/south), and Z (height) position of this object.</returns>
|
||||
public static unsafe Vector3 GetMapCoordinates(this GameObject go, bool correctZOffset = false)
|
||||
public static unsafe Vector3 GetMapCoordinates(this IGameObject go, bool correctZOffset = false)
|
||||
{
|
||||
var agentMap = AgentMap.Instance();
|
||||
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ public static class Util
|
|||
/// </summary>
|
||||
/// <param name="go">The GameObject to show.</param>
|
||||
/// <param name="autoExpand">Whether or not the struct should start as expanded.</param>
|
||||
public static unsafe void ShowGameObjectStruct(GameObject go, bool autoExpand = true)
|
||||
public static unsafe void ShowGameObjectStruct(IGameObject go, bool autoExpand = true)
|
||||
{
|
||||
switch (go)
|
||||
{
|
||||
|
|
@ -280,8 +280,8 @@ public static class Util
|
|||
case Character chara:
|
||||
ShowStruct(chara.Struct, autoExpand);
|
||||
break;
|
||||
default:
|
||||
ShowStruct(go.Struct, autoExpand);
|
||||
case GameObject gameObject:
|
||||
ShowStruct(gameObject.Struct, autoExpand);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -739,6 +739,40 @@ public static class Util
|
|||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print formatted IGameObject Information to ImGui.
|
||||
/// </summary>
|
||||
/// <param name="actor">IGameObject to Display.</param>
|
||||
/// <param name="tag">Display Tag.</param>
|
||||
/// <param name="resolveGameData">If the IGameObjects data should be resolved.</param>
|
||||
internal static void PrintGameObject(IGameObject actor, string tag, bool resolveGameData)
|
||||
{
|
||||
var actorString =
|
||||
$"{actor.Address.ToInt64():X}:{actor.GameObjectId:X}[{tag}] - {actor.ObjectKind} - {actor.Name} - X{actor.Position.X} Y{actor.Position.Y} Z{actor.Position.Z} D{actor.YalmDistanceX} R{actor.Rotation} - Target: {actor.TargetObjectId:X}\n";
|
||||
|
||||
if (actor is Npc npc)
|
||||
actorString += $" DataId: {npc.DataId} NameId:{npc.NameId}\n";
|
||||
|
||||
if (actor is ICharacter chara)
|
||||
{
|
||||
actorString +=
|
||||
$" Level: {chara.Level} ClassJob: {(resolveGameData ? chara.ClassJob.GameData?.Name : chara.ClassJob.Id.ToString())} CHP: {chara.CurrentHp} MHP: {chara.MaxHp} CMP: {chara.CurrentMp} MMP: {chara.MaxMp}\n Customize: {BitConverter.ToString(chara.Customize).Replace("-", " ")} StatusFlags: {chara.StatusFlags}\n";
|
||||
}
|
||||
|
||||
if (actor is IPlayerCharacter pc)
|
||||
{
|
||||
actorString +=
|
||||
$" HomeWorld: {(resolveGameData ? pc.HomeWorld.GameData?.Name : pc.HomeWorld.Id.ToString())} CurrentWorld: {(resolveGameData ? pc.CurrentWorld.GameData?.Name : pc.CurrentWorld.Id.ToString())} FC: {pc.CompanyTag}\n";
|
||||
}
|
||||
|
||||
ImGui.TextUnformatted(actorString);
|
||||
ImGui.SameLine();
|
||||
if (ImGui.Button($"C##{actor.Address.ToInt64()}"))
|
||||
{
|
||||
ImGui.SetClipboardText(actor.Address.ToInt64().ToString("X"));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print formatted GameObject Information to ImGui.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue