[GUI] Add tree view for dump

This commit is contained in:
VaDiM
2025-01-15 00:41:01 +03:00
parent b7d21e5bd8
commit 58917ab7dc
9 changed files with 417 additions and 92 deletions
+19 -1
View File
@@ -25,7 +25,7 @@ namespace AssetStudio
public uint byteSize;
[JsonIgnore]
public string Name;
private static JsonSerializerOptions jsonOptions;
private static readonly JsonSerializerOptions jsonOptions;
static Object()
{
@@ -95,6 +95,24 @@ namespace AssetStudio
return TypeTreeHelper.ReadType(m_Type, reader);
}
public JsonDocument ToJsonDoc(TypeTree m_Type = null)
{
var typeDict = ToType(m_Type);
try
{
if (typeDict != null)
{
return JsonSerializer.SerializeToDocument(typeDict);
}
return JsonSerializer.SerializeToDocument(this, GetType(), jsonOptions);
}
catch
{
//ignore
}
return null;
}
public byte[] GetRawData()
{
reader.Reset();