Sort blocks by initial value

allows some lumping of similar-value blocks for easier analysis
This commit is contained in:
Kurt
2020-01-28 19:08:26 -08:00
parent d260249b5e
commit b35d53368f

View File

@@ -44,10 +44,16 @@ private static string GetSortKey(in ComboItem item)
private string GetBlockHint(SCBlock z, int i)
{
var blockName = GetBlockName(z, out _);
var type = (z.Type.IsBoolean() ? "Bool" : z.Type.ToString());
var isBool = z.Type.IsBoolean();
var type = (isBool ? "Bool" : z.Type.ToString());
if (blockName != null)
return $"*{type} {blockName}";
return $"{z.Key:X8} - {i:0000} {type}";
var result = $"{z.Key:X8} - {i:0000} {type}";
if (z.Type == SCTypeCode.Object || z.Type == SCTypeCode.Array)
result += $" 0x{z.Data.Length:X3}";
else if (!isBool)
result += $" {z.GetValue()}";
return result;
}
public string? GetBlockName(SCBlock block, out SaveBlock? saveBlock)