From a279bb281efe3d4051aa7652182d94b7aaa45800 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Fri, 10 Apr 2015 21:29:12 -1000 Subject: [PATCH] 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. --- NBTExplorer/Controllers/NodeTreeController.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/NBTExplorer/Controllers/NodeTreeController.cs b/NBTExplorer/Controllers/NodeTreeController.cs index be4f7ff..217b60e 100644 --- a/NBTExplorer/Controllers/NodeTreeController.cs +++ b/NBTExplorer/Controllers/NodeTreeController.cs @@ -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++; } }