This commit is contained in:
goaaats 2025-06-22 21:39:38 +02:00
commit 95ec633cc5
163 changed files with 7036 additions and 1585 deletions

View file

@ -58,7 +58,13 @@ internal unsafe class ComponentNodeTree : ResNodeTree
/// <inheritdoc/>
private protected override void PrintChildNodes()
{
base.PrintChildNodes();
var prevNode = this.CompNode->Component->UldManager.RootNode;
while (prevNode != null)
{
GetOrCreate(prevNode, this.AddonTree).Print(null);
prevNode = prevNode->PrevSiblingNode;
}
var count = this.UldManager->NodeListCount;
PrintNodeListAsTree(this.UldManager->NodeList, count, $"Node List [{count}]:", this.AddonTree, new(0f, 0.5f, 0.8f, 1f));
}
@ -92,11 +98,11 @@ internal unsafe class ComponentNodeTree : ResNodeTree
ImGui.TextUnformatted(
$"Text2: {Marshal.PtrToStringAnsi(new(textInputComponent->UnkText02.StringPtr))}");
ImGui.TextUnformatted(
$"Text3: {Marshal.PtrToStringAnsi(new(textInputComponent->UnkText03.StringPtr))}");
$"AvailableLines: {Marshal.PtrToStringAnsi(new(textInputComponent->AvailableLines.StringPtr))}");
ImGui.TextUnformatted(
$"Text4: {Marshal.PtrToStringAnsi(new(textInputComponent->UnkText04.StringPtr))}");
$"HighlightedAutoTranslateOptionColorPrefix: {Marshal.PtrToStringAnsi(new(textInputComponent->HighlightedAutoTranslateOptionColorPrefix.StringPtr))}");
ImGui.TextUnformatted(
$"Text5: {Marshal.PtrToStringAnsi(new(textInputComponent->UnkText05.StringPtr))}");
$"HighlightedAutoTranslateOptionColorSuffix: {Marshal.PtrToStringAnsi(new(textInputComponent->HighlightedAutoTranslateOptionColorSuffix.StringPtr))}");
break;
case List:
case TreeList:

View file

@ -84,7 +84,7 @@ internal unsafe partial class ResNodeTree : IDisposable
/// <returns>An existing or newly-created instance of <see cref="ResNodeTree"/>.</returns>
internal static ResNodeTree GetOrCreate(AtkResNode* node, AddonTree addonTree) =>
addonTree.NodeTrees.TryGetValue((nint)node, out var nodeTree) ? nodeTree
: (int)node->Type > 1000
: (int)node->Type >= 1000
? new ComponentNodeTree(node, addonTree)
: node->Type switch
{

View file

@ -51,9 +51,10 @@ public readonly unsafe partial struct TimelineTree
return;
}
var count = this.Resource->AnimationCount;
var animationCount = this.Resource->AnimationCount;
var labelSetCount = this.Resource->LabelSetCount;
if (count > 0)
if (animationCount > 0)
{
using var tree = ImRaii.TreeNode($"Timeline##{(nint)this.node:X}timeline", SpanFullWidth);
@ -65,22 +66,35 @@ public readonly unsafe partial struct TimelineTree
ShowStruct(this.NodeTimeline);
PrintFieldValuePairs(
("Id", $"{this.NodeTimeline->Resource->Id}"),
("Parent Time", $"{this.NodeTimeline->ParentFrameTime:F2} ({this.NodeTimeline->ParentFrameTime * 30:F0})"),
("Frame Time", $"{this.NodeTimeline->FrameTime:F2} ({this.NodeTimeline->FrameTime * 30:F0})"));
PrintFieldValuePairs(("Active Label Id", $"{this.NodeTimeline->ActiveLabelId}"), ("Duration", $"{this.NodeTimeline->LabelFrameIdxDuration}"), ("End Frame", $"{this.NodeTimeline->LabelEndFrameIdx}"));
ImGui.TextColored(new(0.6f, 0.6f, 0.6f, 1), "Animation List");
for (var a = 0; a < count; a++)
if (this.Resource->Animations is not null)
{
var animation = this.Resource->Animations[a];
var isActive = this.ActiveAnimation != null && &animation == this.ActiveAnimation;
this.PrintAnimation(animation, a, isActive, (nint)(this.NodeTimeline->Resource->Animations + (a * sizeof(AtkTimelineAnimation))));
PrintFieldValuePairs(
("Id", $"{this.NodeTimeline->Resource->Id}"),
("Parent Time", $"{this.NodeTimeline->ParentFrameTime:F2} ({this.NodeTimeline->ParentFrameTime * 30:F0})"),
("Frame Time", $"{this.NodeTimeline->FrameTime:F2} ({this.NodeTimeline->FrameTime * 30:F0})"));
PrintFieldValuePairs(("Active Label Id", $"{this.NodeTimeline->ActiveLabelId}"), ("Duration", $"{this.NodeTimeline->LabelFrameIdxDuration}"), ("End Frame", $"{this.NodeTimeline->LabelEndFrameIdx}"));
ImGui.TextColored(new(0.6f, 0.6f, 0.6f, 1), "Animation List");
for (var a = 0; a < animationCount; a++)
{
var animation = this.Resource->Animations[a];
var isActive = this.ActiveAnimation != null && &animation == this.ActiveAnimation;
this.PrintAnimation(animation, a, isActive, (nint)(this.NodeTimeline->Resource->Animations + a));
}
}
}
}
if (labelSetCount > 0 && this.Resource->LabelSets is not null)
{
using var tree = ImRaii.TreeNode($"Timeline Label Sets##{(nint)this.node:X}LabelSets", SpanFullWidth);
if (tree.Success)
{
this.DrawLabelSets();
}
}
}
private static void GetFrameColumn(Span<AtkTimelineKeyGroup> keyGroups, List<IKeyGroupColumn> columns, ushort endFrame)
@ -380,4 +394,63 @@ public readonly unsafe partial struct TimelineTree
return columns;
}
private void DrawLabelSets()
{
PrintFieldValuePair("LabelSet", $"{(nint)this.NodeTimeline->Resource->LabelSets:X}");
ImGui.SameLine();
ShowStruct(this.NodeTimeline->Resource->LabelSets);
PrintFieldValuePairs(
("StartFrameIdx", $"{this.NodeTimeline->Resource->LabelSets->StartFrameIdx}"),
("EndFrameIdx", $"{this.NodeTimeline->Resource->LabelSets->EndFrameIdx}"));
using var labelSetTable = ImRaii.TreeNode("Entries");
if (labelSetTable.Success)
{
var keyFrameGroup = this.Resource->LabelSets->LabelKeyGroup;
using var table = ImRaii.Table($"##{(nint)this.node}labelSetKeyFrameTable", 7, Borders | SizingFixedFit | RowBg | NoHostExtendX);
if (table.Success)
{
ImGui.TableSetupColumn("Frame ID", WidthFixed);
ImGui.TableSetupColumn("Speed Start", WidthFixed);
ImGui.TableSetupColumn("Speed End", WidthFixed);
ImGui.TableSetupColumn("Interpolation", WidthFixed);
ImGui.TableSetupColumn("Label ID", WidthFixed);
ImGui.TableSetupColumn("Jump Behavior", WidthFixed);
ImGui.TableSetupColumn("Target Label ID", WidthFixed);
ImGui.TableHeadersRow();
for (var l = 0; l < keyFrameGroup.KeyFrameCount; l++)
{
var keyFrame = keyFrameGroup.KeyFrames[l];
ImGui.TableNextColumn();
ImGui.TextUnformatted($"{keyFrame.FrameIdx}");
ImGui.TableNextColumn();
ImGui.TextUnformatted($"{keyFrame.SpeedCoefficient1:F2}");
ImGui.TableNextColumn();
ImGui.TextUnformatted($"{keyFrame.SpeedCoefficient2:F2}");
ImGui.TableNextColumn();
ImGui.TextUnformatted($"{keyFrame.Interpolation}");
ImGui.TableNextColumn();
ImGui.TextUnformatted($"{keyFrame.Value.Label.LabelId}");
ImGui.TableNextColumn();
ImGui.TextUnformatted($"{keyFrame.Value.Label.JumpBehavior}");
ImGui.TableNextColumn();
ImGui.TextUnformatted($"{keyFrame.Value.Label.JumpLabelId}");
}
}
}
}
}