Update project structure

main
ilitirit 1 year ago
parent 6fee291df8
commit da4af1de0c

@ -25,8 +25,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\ExpediencePlugin\Expedience.Models\Expedience.Models.csproj" />
<ProjectReference Include="..\Expedience.Infrastructure\Expedience.Infrastructure.csproj" /> <ProjectReference Include="..\Expedience.Infrastructure\Expedience.Infrastructure.csproj" />
<ProjectReference Include="..\Expedience.Models\Expedience.Models.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Expedience.Models
{
public class ClientInfo
{
public string GameVersion { get; set; }
public string GameLanguage { get; set; }
public string PluginVersion { get; set; }
}
}

@ -1,30 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Expedience.Models
{
public class CompletionTimeInfo
{
public CompletionTimeInfo()
{
}
public CompletionTimeInfo(TimeSpan completionTime)
{
Hours = completionTime.Hours;
Minutes = completionTime.Minutes;
Seconds = completionTime.Seconds;
Milliseconds = completionTime.Milliseconds;
CompletionTimeText = completionTime.ToString(@"hh\:mm\:ss\.fff");
}
public int Hours { get; set; }
public int Minutes { get; set; }
public int Seconds { get; set; }
public int Milliseconds { get; set; }
public string CompletionTimeText { get; set; }
}
}

@ -1,40 +0,0 @@
using System;
using System.Diagnostics;
namespace Expedience.Models
{
public class CurrentDutyInfo
{
public CurrentDutyInfo(Stopwatch stopwatch)
{
_stopwatch = stopwatch;
StartTime = DateTime.UtcNow;
}
private Stopwatch _stopwatch;
public PlayerInfo Player { get; set; }
public int TerritoryId { get; set; }
public string PlaceName { get; set; }
public string ContentName { get; set; }
public List<GroupMemberInfo> PartyMembers { get; set; } = new();
public DateTime StartTime { get; }
public DateTime EndTime { get; private set; }
public bool IsUnrestricted { get; set; }
public bool HasNpcMembers { get; set; }
public bool HasEcho { get; set; }
public string DataCenter { get; set; }
public bool IsMinILevel { get; set; }
public void EndDuty()
{
_stopwatch.Stop();
EndTime = DateTime.UtcNow;
}
public TimeSpan GetDuration()
{
return _stopwatch.Elapsed;
}
}
}

@ -1,74 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Expedience.Models
{
public class DutyCompletionResult
{
public DutyCompletionResult()
{
}
public DutyCompletionResult(CurrentDutyInfo currentDuty, ClientInfo clientInfo, UserInfo userInfo)
{
DutyInfo = new DutyInfo
{
TerritoryId = currentDuty.TerritoryId,
PlaceName = currentDuty.PlaceName,
ContentName = currentDuty.ContentName,
IsUnrestricted = currentDuty.IsUnrestricted,
IsMinILevel = currentDuty.IsMinILevel,
IsNpcSupported = currentDuty.PartyMembers.Any(p => p.IsNpc),
HasEcho = currentDuty.HasEcho,
};
PlayerInfo = new PlayerInfo
{
ClassJob = currentDuty.Player.ClassJob,
Level = currentDuty.Player.Level,
};
GroupMembers = currentDuty.PartyMembers.Select(p => new GroupMemberInfo
{
ClassJob = p.ClassJob,
Level = p.Level,
GroupNumber = p.GroupNumber,
IsNpc = p.IsNpc,
IsPlayer = p.IsPlayer,
}).ToList();
ClientInfo = new ClientInfo
{
GameVersion = clientInfo.GameVersion,
GameLanguage = clientInfo.GameLanguage,
PluginVersion = clientInfo.PluginVersion,
};
UserInfo = new UserInfo
{
UserId = userInfo.UserId,
WorldId = userInfo.WorldId,
WorldName = userInfo.WorldName,
};
CompletionTimeInfo = new CompletionTimeInfo(currentDuty.GetDuration());
DutyStartDateUtc = currentDuty.StartTime;
DutyCompletionDateUtc = currentDuty.EndTime;
DataCenter = currentDuty.DataCenter;
}
public Guid UploadId { get; set; }
public DutyInfo DutyInfo { get; set; }
public CompletionTimeInfo CompletionTimeInfo { get; set; }
public PlayerInfo PlayerInfo { get; set; }
public List<GroupMemberInfo> GroupMembers { get; set; }
public DateTime DutyStartDateUtc { get; set; }
public DateTime DutyCompletionDateUtc { get; set; }
public ClientInfo ClientInfo { get; set; }
public UserInfo UserInfo{ get; set; }
public DateTime UploadDateUtc { get; set; }
public string DataCenter { get; set; }
}
}

@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Expedience.Models
{
public class DutyInfo
{
public int TerritoryId { get; set; }
public string ContentName { get; set; }
public bool IsUnrestricted { get; set; }
public bool HasEcho { get; set; }
public bool IsNpcSupported { get; set; }
public bool IsMinILevel { get; set; }
public string PlaceName { get; set; }
}
}

@ -1,9 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Expedience.Models
{
public class GroupMemberInfo
{
public string ClassJob { get; set; }
public bool IsNpc { get; set; }
public int Level { get; set; }
public int GroupNumber { get; set; }
public bool IsPlayer { get; set; }
}
}

@ -1,14 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Expedience.Models
{
public class PlayerInfo
{
public string ClassJob { get; set; }
public uint Level { get; set; }
}
}

@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Expedience.Models
{
public class UserInfo
{
public string UserId { get; set; }
public int WorldId { get; set; }
public string WorldName { get; set; }
public string UserName { get; set; }
}
}

@ -3,16 +3,16 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.5.33424.131 VisualStudioVersion = 17.5.33424.131
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Plugin", "Expedience.Plugin\Expedience.Plugin.csproj", "{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Api", "Expedience.Api\Expedience.Api.csproj", "{B385491B-A14F-4971-8486-66146592794A}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Api", "Expedience.Api\Expedience.Api.csproj", "{B385491B-A14F-4971-8486-66146592794A}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Models", "Expedience.Models\Expedience.Models.csproj", "{1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Web", "Expedience.Web\Expedience.Web.csproj", "{F0C4E623-C9D0-470A-A7CE-423D84261C82}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Web", "Expedience.Web\Expedience.Web.csproj", "{F0C4E623-C9D0-470A-A7CE-423D84261C82}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Infrastructure", "Expedience.Infrastructure\Expedience.Infrastructure.csproj", "{22193E16-7B41-44A7-8A40-523963CF2963}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Infrastructure", "Expedience.Infrastructure\Expedience.Infrastructure.csproj", "{22193E16-7B41-44A7-8A40-523963CF2963}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Plugin", "..\ExpediencePlugin\Expedience.Plugin\Expedience.Plugin.csproj", "{B0BAD212-3F8F-4A7A-B767-4219F1278813}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Models", "..\ExpediencePlugin\Expedience.Models\Expedience.Models.csproj", "{00B139BD-77E6-43FC-A532-7C59D0B84408}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -21,14 +21,6 @@ Global
Release|x64 = Release|x64 Release|x64 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Debug|Any CPU.ActiveCfg = Debug|x64
{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Debug|Any CPU.Build.0 = Debug|x64
{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Debug|x64.ActiveCfg = Debug|x64
{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Debug|x64.Build.0 = Debug|x64
{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Release|Any CPU.ActiveCfg = Release|x64
{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Release|Any CPU.Build.0 = Release|x64
{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Release|x64.ActiveCfg = Release|x64
{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Release|x64.Build.0 = Release|x64
{B385491B-A14F-4971-8486-66146592794A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B385491B-A14F-4971-8486-66146592794A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B385491B-A14F-4971-8486-66146592794A}.Debug|Any CPU.Build.0 = Debug|Any CPU {B385491B-A14F-4971-8486-66146592794A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B385491B-A14F-4971-8486-66146592794A}.Debug|x64.ActiveCfg = Debug|Any CPU {B385491B-A14F-4971-8486-66146592794A}.Debug|x64.ActiveCfg = Debug|Any CPU
@ -37,14 +29,6 @@ Global
{B385491B-A14F-4971-8486-66146592794A}.Release|Any CPU.Build.0 = Release|Any CPU {B385491B-A14F-4971-8486-66146592794A}.Release|Any CPU.Build.0 = Release|Any CPU
{B385491B-A14F-4971-8486-66146592794A}.Release|x64.ActiveCfg = Release|Any CPU {B385491B-A14F-4971-8486-66146592794A}.Release|x64.ActiveCfg = Release|Any CPU
{B385491B-A14F-4971-8486-66146592794A}.Release|x64.Build.0 = Release|Any CPU {B385491B-A14F-4971-8486-66146592794A}.Release|x64.Build.0 = Release|Any CPU
{1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Debug|x64.ActiveCfg = Debug|Any CPU
{1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Debug|x64.Build.0 = Debug|Any CPU
{1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Release|Any CPU.Build.0 = Release|Any CPU
{1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Release|x64.ActiveCfg = Release|Any CPU
{1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Release|x64.Build.0 = Release|Any CPU
{F0C4E623-C9D0-470A-A7CE-423D84261C82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F0C4E623-C9D0-470A-A7CE-423D84261C82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0C4E623-C9D0-470A-A7CE-423D84261C82}.Debug|Any CPU.Build.0 = Debug|Any CPU {F0C4E623-C9D0-470A-A7CE-423D84261C82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0C4E623-C9D0-470A-A7CE-423D84261C82}.Debug|x64.ActiveCfg = Debug|Any CPU {F0C4E623-C9D0-470A-A7CE-423D84261C82}.Debug|x64.ActiveCfg = Debug|Any CPU
@ -61,6 +45,22 @@ Global
{22193E16-7B41-44A7-8A40-523963CF2963}.Release|Any CPU.Build.0 = Release|Any CPU {22193E16-7B41-44A7-8A40-523963CF2963}.Release|Any CPU.Build.0 = Release|Any CPU
{22193E16-7B41-44A7-8A40-523963CF2963}.Release|x64.ActiveCfg = Release|Any CPU {22193E16-7B41-44A7-8A40-523963CF2963}.Release|x64.ActiveCfg = Release|Any CPU
{22193E16-7B41-44A7-8A40-523963CF2963}.Release|x64.Build.0 = Release|Any CPU {22193E16-7B41-44A7-8A40-523963CF2963}.Release|x64.Build.0 = Release|Any CPU
{B0BAD212-3F8F-4A7A-B767-4219F1278813}.Debug|Any CPU.ActiveCfg = Debug|x64
{B0BAD212-3F8F-4A7A-B767-4219F1278813}.Debug|Any CPU.Build.0 = Debug|x64
{B0BAD212-3F8F-4A7A-B767-4219F1278813}.Debug|x64.ActiveCfg = Debug|x64
{B0BAD212-3F8F-4A7A-B767-4219F1278813}.Debug|x64.Build.0 = Debug|x64
{B0BAD212-3F8F-4A7A-B767-4219F1278813}.Release|Any CPU.ActiveCfg = Release|x64
{B0BAD212-3F8F-4A7A-B767-4219F1278813}.Release|Any CPU.Build.0 = Release|x64
{B0BAD212-3F8F-4A7A-B767-4219F1278813}.Release|x64.ActiveCfg = Release|x64
{B0BAD212-3F8F-4A7A-B767-4219F1278813}.Release|x64.Build.0 = Release|x64
{00B139BD-77E6-43FC-A532-7C59D0B84408}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00B139BD-77E6-43FC-A532-7C59D0B84408}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00B139BD-77E6-43FC-A532-7C59D0B84408}.Debug|x64.ActiveCfg = Debug|Any CPU
{00B139BD-77E6-43FC-A532-7C59D0B84408}.Debug|x64.Build.0 = Debug|Any CPU
{00B139BD-77E6-43FC-A532-7C59D0B84408}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00B139BD-77E6-43FC-A532-7C59D0B84408}.Release|Any CPU.Build.0 = Release|Any CPU
{00B139BD-77E6-43FC-A532-7C59D0B84408}.Release|x64.ActiveCfg = Release|Any CPU
{00B139BD-77E6-43FC-A532-7C59D0B84408}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -1,280 +0,0 @@
using Dalamud.Logging;
using FFXIVClientStructs.FFXIV.Component.GUI;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Runtime.InteropServices;
namespace MgAl2O4.Utils
{
// Dalamud.Interface.UIDebug is amazing
public class GUINodeUtils
{
public static unsafe AtkResNode* PickChildNode(AtkResNode* maybeCompNode, int childIdx, int expectedNumChildren)
{
if (maybeCompNode != null && (int)maybeCompNode->Type >= 1000)
{
var compNode = (AtkComponentNode*)maybeCompNode;
if (compNode->Component->UldManager.NodeListCount == expectedNumChildren && childIdx < expectedNumChildren)
{
return compNode->Component->UldManager.NodeList[childIdx];
}
}
return null;
}
public static unsafe AtkResNode* PickChildNode(AtkComponentBase* compPtr, int childIdx, int expectedNumChildren)
{
if (compPtr != null && compPtr->UldManager.NodeListCount == expectedNumChildren && childIdx < expectedNumChildren)
{
return compPtr->UldManager.NodeList[childIdx];
}
return null;
}
public static unsafe AtkResNode*[] GetImmediateChildNodes(AtkResNode* node)
{
var listAddr = new List<ulong>();
if (node != null && node->ChildNode != null)
{
listAddr.Add((ulong)node->ChildNode);
node = node->ChildNode;
while (node->PrevSiblingNode != null)
{
listAddr.Add((ulong)node->PrevSiblingNode);
node = node->PrevSiblingNode;
}
}
return ConvertToNodeArr(listAddr);
}
public static unsafe AtkResNode*[] GetAllChildNodes(AtkResNode* node)
{
if (node != null)
{
var list = new List<ulong>();
RecursiveAppendChildNodes(node, list);
return ConvertToNodeArr(list);
}
return null;
}
private static unsafe void RecursiveAppendChildNodes(AtkResNode* node, List<ulong> listAddr)
{
if (node != null)
{
listAddr.Add((ulong)node);
// step inside
if (node->ChildNode != null)
{
RecursiveAppendChildNodes(node->ChildNode, listAddr);
AtkResNode* linkNode = node->ChildNode;
while (linkNode->PrevSiblingNode != null)
{
RecursiveAppendChildNodes(linkNode->PrevSiblingNode, listAddr);
linkNode = linkNode->PrevSiblingNode;
}
// no need to check next siblings here?
}
}
}
private static unsafe AtkResNode*[] ConvertToNodeArr(List<ulong> listAddr)
{
if (listAddr.Count > 0)
{
var typedArr = new AtkResNode*[listAddr.Count];
for (int idx = 0; idx < listAddr.Count; idx++)
{
typedArr[idx] = (AtkResNode*)listAddr[idx];
}
return typedArr;
}
return null;
}
public static unsafe AtkResNode* PickNode(AtkResNode*[] nodes, int nodeIdx, int expectedNumNodes)
{
if (nodes != null && nodes.Length == expectedNumNodes && nodeIdx < expectedNumNodes)
{
return nodes[nodeIdx];
}
return null;
}
public static unsafe AtkResNode* GetChildNode(AtkResNode* node)
{
return node != null ? node->ChildNode : null;
}
public static unsafe string GetNodeTexturePath(AtkResNode* maybeImageNode)
{
if (maybeImageNode != null && maybeImageNode->Type == NodeType.Image)
{
var imageNode = (AtkImageNode*)maybeImageNode;
if (imageNode->PartsList != null && imageNode->PartId <= imageNode->PartsList->PartCount)
{
var textureInfo = imageNode->PartsList->Parts[imageNode->PartId].UldAsset;
var texType = textureInfo->AtkTexture.TextureType;
if (texType == TextureType.Resource)
{
var texFileNameStdString = &textureInfo->AtkTexture.Resource->TexFileResourceHandle->ResourceHandle.FileName;
var texString = texFileNameStdString->Length < 16
? Marshal.PtrToStringAnsi((IntPtr)texFileNameStdString->Buffer)
: Marshal.PtrToStringAnsi((IntPtr)texFileNameStdString->BufferPtr);
return texString;
}
}
}
return null;
}
public static unsafe string GetNodeText(AtkResNode* maybeTextNode)
{
if (maybeTextNode != null && maybeTextNode->Type == NodeType.Text)
{
var textNode = (AtkTextNode*)maybeTextNode;
var text = Marshal.PtrToStringUTF8(new IntPtr(textNode->NodeText.StringPtr));
return text;
}
return null;
}
public static unsafe Vector2 GetNodePosition(AtkResNode* node)
{
var pos = new Vector2(node->X, node->Y);
var par = node->ParentNode;
while (par != null)
{
pos *= new Vector2(par->ScaleX, par->ScaleY);
pos += new Vector2(par->X, par->Y);
par = par->ParentNode;
}
return pos;
}
public static unsafe Vector2 GetNodeScale(AtkResNode* node)
{
if (node == null) return new Vector2(1, 1);
var scale = new Vector2(node->ScaleX, node->ScaleY);
while (node->ParentNode != null)
{
node = node->ParentNode;
scale *= new Vector2(node->ScaleX, node->ScaleY);
}
return scale;
}
public static unsafe (Vector2, Vector2) GetNodePosAndSize(AtkResNode* node)
{
if (node != null)
{
var pos = GetNodePosition(node);
var scale = GetNodeScale(node);
var size = new Vector2(node->Width * scale.X, node->Height * scale.Y);
return (pos, size);
}
return (Vector2.Zero, Vector2.Zero);
}
#if DEBUG
private class ParsableNode
{
public ulong nodeAddr;
public string content;
public int childIdx;
public int numChildren;
public int depth;
public NodeType type;
public string debugPath;
}
private static unsafe bool RecursiveAppendParsableChildNodes(AtkResNode* node, int depth, int childIdx, List<ParsableNode> list, string debugPath)
{
bool hasParsableChildNodes = false;
bool hasContent = false;
if (node != null)
{
// check if this node is interesting for parser (empty string is still interesting)
string content = GetNodeText(node);
content = (content != null) ? content : GetNodeTexturePath(node);
hasContent = (content != null);
int numChildNodes = 0;
int insertIdx = list.Count;
if ((int)node->Type < 1000)
{
// step inside
if (node->ChildNode != null)
{
hasParsableChildNodes = RecursiveAppendParsableChildNodes(node->ChildNode, depth + 1, numChildNodes, list, debugPath + "," + numChildNodes);
numChildNodes++;
AtkResNode* linkNode = node->ChildNode;
while (linkNode->PrevSiblingNode != null)
{
var hasParsableSibling = RecursiveAppendParsableChildNodes(linkNode->PrevSiblingNode, depth + 1, numChildNodes, list, debugPath + "," + numChildNodes);
hasParsableChildNodes = hasParsableChildNodes || hasParsableSibling;
linkNode = linkNode->PrevSiblingNode;
numChildNodes++;
}
// no need to check next siblings here?
}
}
else
{
var compNode = (AtkComponentNode*)node;
for (int idx = 0; idx < compNode->Component->UldManager.NodeListCount; idx++)
{
hasParsableChildNodes = RecursiveAppendParsableChildNodes(compNode->Component->UldManager.NodeList[idx], depth + 1, numChildNodes, list, debugPath + "," + numChildNodes);
numChildNodes++;
}
}
if (hasParsableChildNodes || hasContent)
{
list.Insert(insertIdx, new ParsableNode() { nodeAddr = (ulong)node, content = content, childIdx = childIdx, numChildren = numChildNodes, depth = depth, debugPath = debugPath, type = node->Type });
}
}
return hasParsableChildNodes || hasContent;
}
public static unsafe void LogParsableNodes(AtkResNode* node)
{
var list = new List<ParsableNode>();
RecursiveAppendParsableChildNodes(node, 0, 0, list, "");
foreach (var entry in list)
{
var prefix = entry.depth > 0 ? new string(' ', entry.depth * 2) : "";
PluginLog.Log($"{prefix}> '{entry.content}' idx:{entry.childIdx}, children:{entry.numChildren}, type:{entry.type}, addr:{entry.nodeAddr:X}, path:{entry.debugPath}");
}
}
#endif // DEBUG
}
}
Loading…
Cancel
Save