When opening files directly, try opening as NBT if no registered filetypes were able to open them.

Allows associating *.bpt, *.rs, *.thaum, and other extensions with NBTExplorer.
This commit is contained in:
David Vierra 2015-04-10 21:29:12 -10:00
parent a9f40fc596
commit a279bb281e

View file

@ -229,12 +229,14 @@ namespace NBTExplorer.Controllers
foreach (var item in FileTypeRegistry.RegisteredTypes) {
if (item.Value.NamePatternTest(path))
node = item.Value.NodeCreate(path);
}
if (node != null)
_nodeTree.Nodes.Add(CreateUnexpandedNode(node));
else
failCount++;
}
if (node == null)
node = NbtFileDataNode.TryCreateFrom(path);
if (node != null)
_nodeTree.Nodes.Add(CreateUnexpandedNode(node));
else
failCount++;
}
}