NBT fix in Substrate; Error reporting on file load failure; Open file dialog type filtering

This commit is contained in:
Justin Aquadro 2013-05-24 23:30:58 -04:00
parent f956912dfb
commit 2c0ce45b37
3 changed files with 12 additions and 2 deletions

View file

@ -70,9 +70,9 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Substrate, Version=1.3.7.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Substrate, Version=1.3.8.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>References\Substrate.dll</HintPath> <HintPath>..\Substrate\SubstrateCS\bin\Debug\Substrate.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />

Binary file not shown.

View file

@ -138,6 +138,8 @@ namespace NBTExplorer.Windows
OpenFileDialog ofd = new OpenFileDialog(); OpenFileDialog ofd = new OpenFileDialog();
ofd.RestoreDirectory = true; ofd.RestoreDirectory = true;
ofd.Multiselect = true; ofd.Multiselect = true;
ofd.Filter = "All Files|*|NBT Files (*.dat, *.schematic)|*.dat;*.nbt;*.schematic|Region Files (*.mca, *.mcr)|*.mca;*.mcr";
ofd.FilterIndex = 0;
if (ofd.ShowDialog() == DialogResult.OK) { if (ofd.ShowDialog() == DialogResult.OK) {
OpenPaths(ofd.FileNames); OpenPaths(ofd.FileNames);
@ -167,6 +169,8 @@ namespace NBTExplorer.Windows
{ {
_nodeTree.Nodes.Clear(); _nodeTree.Nodes.Clear();
int failCount = 0;
foreach (string path in paths) { foreach (string path in paths) {
if (Directory.Exists(path)) { if (Directory.Exists(path)) {
DirectoryDataNode node = new DirectoryDataNode(path); DirectoryDataNode node = new DirectoryDataNode(path);
@ -185,6 +189,8 @@ namespace NBTExplorer.Windows
_nodeTree.Nodes.Add(CreateUnexpandedNode(node)); _nodeTree.Nodes.Add(CreateUnexpandedNode(node));
AddPathToHistory(GetRecentFiles(), path); AddPathToHistory(GetRecentFiles(), path);
} }
else
failCount++;
} }
} }
@ -194,6 +200,10 @@ namespace NBTExplorer.Windows
UpdateUI(); UpdateUI();
UpdateOpenMenu(); UpdateOpenMenu();
if (failCount > 0) {
MessageBox.Show("One or more selected files failed to open.");
}
} }
private void OpenMinecraftDirectory () private void OpenMinecraftDirectory ()