mirror of
https://github.com/aelurum/AssetStudio.git
synced 2026-11-17 03:38:48 -05:00
[GUI] Add tree view for dump
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user