mirror of
https://github.com/jaquadro/NBTExplorer.git
synced 2025-01-10 01:46:24 +00:00
NBT fix in Substrate; Error reporting on file load failure; Open file dialog type filtering
This commit is contained in:
parent
f956912dfb
commit
2c0ce45b37
3 changed files with 12 additions and 2 deletions
|
@ -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.
|
@ -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 ()
|
||||||
|
|
Loading…
Reference in a new issue