Compare commits
80 commits
Author | SHA1 | Date | |
---|---|---|---|
|
15b1b2891f | ||
|
e26a29580a | ||
|
d29f249d7e | ||
|
931ac752f5 | ||
|
97386a4e5f | ||
|
9d640079b8 | ||
|
2882fcde17 | ||
|
60a7bbf8e9 | ||
|
27110539a8 | ||
|
5d456cf743 | ||
|
a279bb281e | ||
|
a9f40fc596 | ||
|
3916b8d362 | ||
|
26780b841d | ||
|
f2688a8f9f | ||
|
abde7d87c9 | ||
|
3dc86b8b7c | ||
|
1fd6ec2680 | ||
|
975c11d3d8 | ||
|
7a151d3e6f | ||
|
db5d2a05c0 | ||
|
5c32832281 | ||
|
d8229f7ec5 | ||
|
fc63457d8e | ||
|
d3e53ac559 | ||
|
c9014d8b1f | ||
|
2a043ba09c | ||
|
6412629678 | ||
|
f3304f51a1 | ||
|
3e6240d895 | ||
|
e1096e29ca | ||
|
b303551fa0 | ||
|
16ec47a411 | ||
|
c5debf12d4 | ||
|
d4ad1bd99a | ||
|
a03537bb99 | ||
|
2d70d2af10 | ||
|
5d51967501 | ||
|
ab4e789114 | ||
|
b642b3aee4 | ||
|
400eb1f80a | ||
|
366ec3fe9e | ||
|
b2d54f39a6 | ||
|
ed6b69978e | ||
|
9f44174887 | ||
|
85ca29cb79 | ||
|
ae03136b5b | ||
|
346adf297a | ||
|
14444dd1b5 | ||
|
a8cf67b8f4 | ||
|
26a727e41e | ||
|
168557c8e9 | ||
|
276a5c6747 | ||
|
a700d4c128 | ||
|
db1662dc9b | ||
|
152213e2cf | ||
|
1c654c66d3 | ||
|
48fc7e4d0e | ||
|
feac98b064 | ||
|
1ccf299f9c | ||
|
22a14a9554 | ||
|
563ca5b0a5 | ||
|
e319c519dc | ||
|
119ba72091 | ||
|
09806d5f14 | ||
|
00cc08bb05 | ||
|
2c0ce45b37 | ||
|
f956912dfb | ||
|
19e304ab04 | ||
|
15d27c1ff9 | ||
|
8f092842e9 | ||
|
d27234e2cd | ||
|
24c349ce50 | ||
|
d0f125632f | ||
|
1aea80c7fd | ||
|
1596d3365d | ||
|
b927f06b95 | ||
|
fb6c063d5d | ||
|
d0c521c500 | ||
|
d2025b167e |
5
.gitignore
vendored
|
@ -2,4 +2,7 @@ bin
|
|||
obj
|
||||
*.suo
|
||||
*.user
|
||||
*.cache
|
||||
*.cache
|
||||
*.userprefs
|
||||
Staging/
|
||||
UpgradeLog*.htm
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
using Substrate.Core;
|
||||
|
||||
namespace NBTExplorer.Model
|
||||
{
|
||||
public class CubicRegionFile : RegionFile
|
||||
{
|
||||
private const int _sectorBytes = 256;
|
||||
private static byte[] _emptySector = new byte[_sectorBytes];
|
||||
|
||||
public CubicRegionFile (string path)
|
||||
: base(path)
|
||||
{ }
|
||||
|
||||
protected override int SectorBytes
|
||||
{
|
||||
get { return _sectorBytes; }
|
||||
}
|
||||
|
||||
protected override byte[] EmptySector
|
||||
{
|
||||
get { return _emptySector; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,215 +0,0 @@
|
|||
using Substrate.Nbt;
|
||||
|
||||
namespace NBTExplorer.Model
|
||||
{
|
||||
public class DataNode
|
||||
{
|
||||
private DataNode _parent;
|
||||
private DataNodeCollection _children;
|
||||
|
||||
private bool _expanded;
|
||||
private bool _modified;
|
||||
|
||||
public DataNode ()
|
||||
{
|
||||
_children = new DataNodeCollection(this);
|
||||
}
|
||||
|
||||
public DataNode Parent
|
||||
{
|
||||
get { return _parent; }
|
||||
internal set { _parent = value; }
|
||||
}
|
||||
|
||||
public DataNodeCollection Nodes
|
||||
{
|
||||
get { return _children; }
|
||||
}
|
||||
|
||||
public bool IsModified
|
||||
{
|
||||
get { return _modified; }
|
||||
set
|
||||
{
|
||||
if (value && Parent != null)
|
||||
Parent.IsModified = value;
|
||||
_modified = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsExpanded
|
||||
{
|
||||
get { return _expanded; }
|
||||
private set { _expanded = value; }
|
||||
}
|
||||
|
||||
public void Expand ()
|
||||
{
|
||||
if (!IsExpanded) {
|
||||
ExpandCore();
|
||||
IsExpanded = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void ExpandCore () { }
|
||||
|
||||
public void Collapse ()
|
||||
{
|
||||
if (IsExpanded && !IsModified) {
|
||||
Release();
|
||||
IsExpanded = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Release ()
|
||||
{
|
||||
foreach (DataNode node in Nodes)
|
||||
node.Release();
|
||||
|
||||
ReleaseCore();
|
||||
IsExpanded = false;
|
||||
}
|
||||
|
||||
protected virtual void ReleaseCore ()
|
||||
{
|
||||
Nodes.Clear();
|
||||
}
|
||||
|
||||
public void Save ()
|
||||
{
|
||||
foreach (DataNode node in Nodes)
|
||||
if (node.IsModified)
|
||||
node.Save();
|
||||
|
||||
SaveCore();
|
||||
IsModified = false;
|
||||
}
|
||||
|
||||
protected virtual void SaveCore ()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual string NodeName
|
||||
{
|
||||
get { return ""; }
|
||||
}
|
||||
|
||||
public virtual string NodeDisplay
|
||||
{
|
||||
get { return ""; }
|
||||
}
|
||||
|
||||
public virtual bool HasUnexpandedChildren
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#region Capabilities
|
||||
|
||||
protected virtual NodeCapabilities Capabilities
|
||||
{
|
||||
get { return NodeCapabilities.None; }
|
||||
}
|
||||
|
||||
public virtual bool CanRenameNode
|
||||
{
|
||||
get { return (Capabilities & NodeCapabilities.Rename) != NodeCapabilities.None; }
|
||||
}
|
||||
|
||||
public virtual bool CanEditNode
|
||||
{
|
||||
get { return (Capabilities & NodeCapabilities.Edit) != NodeCapabilities.None; }
|
||||
}
|
||||
|
||||
public virtual bool CanDeleteNode
|
||||
{
|
||||
get { return (Capabilities & NodeCapabilities.Delete) != NodeCapabilities.None; }
|
||||
}
|
||||
|
||||
public virtual bool CanCopyNode
|
||||
{
|
||||
get { return (Capabilities & NodeCapabilities.Copy) != NodeCapabilities.None; }
|
||||
}
|
||||
|
||||
public virtual bool CanCutNode
|
||||
{
|
||||
get { return (Capabilities & NodeCapabilities.Cut) != NodeCapabilities.None; }
|
||||
}
|
||||
|
||||
public virtual bool CanPasteIntoNode
|
||||
{
|
||||
get { return (Capabilities & NodeCapabilities.PasteInto) != NodeCapabilities.None; }
|
||||
}
|
||||
|
||||
public virtual bool CanSearchNode
|
||||
{
|
||||
get { return (Capabilities & NodeCapabilities.Search) != NodeCapabilities.None; }
|
||||
}
|
||||
|
||||
public virtual bool CanReoderNode
|
||||
{
|
||||
get { return (Capabilities & NodeCapabilities.Reorder) != NodeCapabilities.None; }
|
||||
}
|
||||
|
||||
public virtual bool CanMoveNodeUp
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public virtual bool CanMoveNodeDown
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public virtual bool CanCreateTag (TagType type)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Operations
|
||||
|
||||
public virtual bool CreateNode (TagType type)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool RenameNode ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool EditNode ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool DeleteNode ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool CopyNode ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool CutNode ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool PasteNode ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool ChangeRelativePosition (int offset)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
using Substrate.Nbt;
|
||||
|
||||
namespace NBTExplorer.Model
|
||||
{
|
||||
public class ListTagContainer : IOrderedTagContainer
|
||||
{
|
||||
private TagNodeList _tag;
|
||||
|
||||
public ListTagContainer (TagNodeList tag)
|
||||
{
|
||||
_tag = tag;
|
||||
}
|
||||
|
||||
public int TagCount
|
||||
{
|
||||
get { return _tag.Count; }
|
||||
}
|
||||
|
||||
public bool DeleteTag (TagNode tag)
|
||||
{
|
||||
return _tag.Remove(tag);
|
||||
}
|
||||
|
||||
public int GetTagIndex (TagNode tag)
|
||||
{
|
||||
return _tag.IndexOf(tag);
|
||||
}
|
||||
|
||||
public bool InsertTag (TagNode tag, int index)
|
||||
{
|
||||
if (index < 0 || index > _tag.Count)
|
||||
return false;
|
||||
|
||||
_tag.Insert(index, tag);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,141 +0,0 @@
|
|||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using Substrate.Core;
|
||||
using Substrate.Nbt;
|
||||
|
||||
namespace NBTExplorer.Model
|
||||
{
|
||||
public class NbtFileDataNode : DataNode, IMetaTagContainer
|
||||
{
|
||||
private NbtTree _tree;
|
||||
private string _path;
|
||||
private CompressionType _compressionType;
|
||||
|
||||
private CompoundTagContainer _container;
|
||||
|
||||
private static Regex _namePattern = new Regex(@"\.(dat|nbt|schematic)$");
|
||||
|
||||
private NbtFileDataNode (string path, CompressionType compressionType)
|
||||
{
|
||||
_path = path;
|
||||
_compressionType = compressionType;
|
||||
_container = new CompoundTagContainer(new TagNodeCompound());
|
||||
}
|
||||
|
||||
public static NbtFileDataNode TryCreateFrom (string path)
|
||||
{
|
||||
return TryCreateFrom(path, CompressionType.GZip)
|
||||
?? TryCreateFrom(path, CompressionType.None);
|
||||
}
|
||||
|
||||
private static NbtFileDataNode TryCreateFrom (string path, CompressionType compressionType)
|
||||
{
|
||||
try {
|
||||
NBTFile file = new NBTFile(path);
|
||||
NbtTree tree = new NbtTree();
|
||||
tree.ReadFrom(file.GetDataInputStream(compressionType));
|
||||
|
||||
if (tree.Root == null)
|
||||
return null;
|
||||
|
||||
return new NbtFileDataNode(path, compressionType);
|
||||
}
|
||||
catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SupportedNamePattern (string path)
|
||||
{
|
||||
path = Path.GetFileName(path);
|
||||
return _namePattern.IsMatch(path);
|
||||
}
|
||||
|
||||
protected override NodeCapabilities Capabilities
|
||||
{
|
||||
get
|
||||
{
|
||||
return NodeCapabilities.CreateTag
|
||||
| NodeCapabilities.PasteInto
|
||||
| NodeCapabilities.Search;
|
||||
}
|
||||
}
|
||||
|
||||
public override string NodeName
|
||||
{
|
||||
get { return Path.GetFileName(_path); }
|
||||
}
|
||||
|
||||
public override string NodeDisplay
|
||||
{
|
||||
get { return NodeName; }
|
||||
}
|
||||
|
||||
public override bool HasUnexpandedChildren
|
||||
{
|
||||
get { return !IsExpanded; }
|
||||
}
|
||||
|
||||
protected override void ExpandCore ()
|
||||
{
|
||||
if (_tree == null) {
|
||||
NBTFile file = new NBTFile(_path);
|
||||
_tree = new NbtTree();
|
||||
_tree.ReadFrom(file.GetDataInputStream(_compressionType));
|
||||
|
||||
if (_tree.Root != null)
|
||||
_container = new CompoundTagContainer(_tree.Root);
|
||||
}
|
||||
|
||||
foreach (TagNode tag in _tree.Root.Values) {
|
||||
TagDataNode node = TagDataNode.CreateFromTag(tag);
|
||||
if (node != null)
|
||||
Nodes.Add(node);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ReleaseCore ()
|
||||
{
|
||||
_tree = null;
|
||||
Nodes.Clear();
|
||||
}
|
||||
|
||||
protected override void SaveCore ()
|
||||
{
|
||||
NBTFile file = new NBTFile(_path);
|
||||
using (Stream str = file.GetDataOutputStream(_compressionType)) {
|
||||
_tree.WriteTo(str);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsNamedContainer
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public bool IsOrderedContainer
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public INamedTagContainer NamedTagContainer
|
||||
{
|
||||
get { return _container; }
|
||||
}
|
||||
|
||||
public IOrderedTagContainer OrderedTagContainer
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public int TagCount
|
||||
{
|
||||
get { return _container.TagCount; }
|
||||
}
|
||||
|
||||
public bool DeleteTag (TagNode tag)
|
||||
{
|
||||
return _container.DeleteTag(tag);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace NBTExplorer.Model
|
||||
{
|
||||
[Flags]
|
||||
public enum NodeCapabilities
|
||||
{
|
||||
None = 0,
|
||||
Cut = 0x1,
|
||||
Copy = 0x2,
|
||||
PasteInto = 0x4,
|
||||
Rename = 0x8,
|
||||
Edit = 0x10,
|
||||
Delete = 0x20,
|
||||
CreateTag = 0x40,
|
||||
Search = 0x80,
|
||||
Reorder = 0x100,
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
using Substrate.Nbt;
|
||||
|
||||
namespace NBTExplorer.Model
|
||||
{
|
||||
public class TagDoubleDataNode : TagDataNode
|
||||
{
|
||||
public TagDoubleDataNode (TagNodeDouble tag)
|
||||
: base(tag)
|
||||
{ }
|
||||
|
||||
public override bool EditNode ()
|
||||
{
|
||||
return EditScalarValue(Tag);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
using Substrate.Nbt;
|
||||
|
||||
namespace NBTExplorer.Model
|
||||
{
|
||||
public class TagFloatDataNode : TagDataNode
|
||||
{
|
||||
public TagFloatDataNode (TagNodeFloat tag)
|
||||
: base(tag)
|
||||
{ }
|
||||
|
||||
public override bool EditNode ()
|
||||
{
|
||||
return EditScalarValue(Tag);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
using Substrate.Nbt;
|
||||
|
||||
namespace NBTExplorer.Model
|
||||
{
|
||||
public class TagIntDataNode : TagDataNode
|
||||
{
|
||||
public TagIntDataNode (TagNodeInt tag)
|
||||
: base(tag)
|
||||
{ }
|
||||
|
||||
public override bool EditNode ()
|
||||
{
|
||||
return EditScalarValue(Tag);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
using Substrate.Nbt;
|
||||
|
||||
namespace NBTExplorer.Model
|
||||
{
|
||||
public class TagLongDataNode : TagDataNode
|
||||
{
|
||||
public TagLongDataNode (TagNodeLong tag)
|
||||
: base(tag)
|
||||
{ }
|
||||
|
||||
public override bool EditNode ()
|
||||
{
|
||||
return EditScalarValue(Tag);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
using Substrate.Nbt;
|
||||
|
||||
namespace NBTExplorer.Model
|
||||
{
|
||||
public class TagShortDataNode : TagDataNode
|
||||
{
|
||||
public TagShortDataNode (TagNodeShort tag)
|
||||
: base(tag)
|
||||
{ }
|
||||
|
||||
public override bool EditNode ()
|
||||
{
|
||||
return EditScalarValue(Tag);
|
||||
}
|
||||
}
|
||||
}
|
BIN
NBTExplorer.Installer/Bitmaps/Banner.png
Normal file
After Width: | Height: | Size: 938 B |
BIN
NBTExplorer.Installer/Bitmaps/Dialog.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
NBTExplorer.Installer/Icon.ico
Normal file
After Width: | Height: | Size: 99 KiB |
BIN
NBTExplorer.Installer/License.rtf
Normal file
54
NBTExplorer.Installer/NBTExplorer.Installer.wixproj
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>3.8</ProductVersion>
|
||||
<ProjectGuid>a1566071-7cbb-4c54-aae1-4b81b7715db3</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>NBTExplorer</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
||||
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||
<DefineConstants>Debug</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>bin\$(Configuration)\</OutputPath>
|
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Product.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WixExtension Include="WixUtilExtension">
|
||||
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
|
||||
<Name>WixUtilExtension</Name>
|
||||
</WixExtension>
|
||||
<WixExtension Include="WixUIExtension">
|
||||
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
|
||||
<Name>WixUIExtension</Name>
|
||||
</WixExtension>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Bitmaps\Banner.png" />
|
||||
<Content Include="Bitmaps\Dialog.png" />
|
||||
<Content Include="Icon.ico" />
|
||||
<Content Include="License.rtf" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Bitmaps" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(WixTargetsPath)" />
|
||||
<!--
|
||||
To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Wix.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
98
NBTExplorer.Installer/Product.wxs
Normal file
|
@ -0,0 +1,98 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*"
|
||||
Name="NBTExplorer"
|
||||
Language="1033"
|
||||
Version="2.8.0.0"
|
||||
Manufacturer="Justin Aquadro"
|
||||
UpgradeCode="0bfb1026-21f2-4552-ad71-ca90aae10a25">
|
||||
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
|
||||
|
||||
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
|
||||
<MediaTemplate EmbedCab="yes" />
|
||||
|
||||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
|
||||
<UI>
|
||||
<UIRef Id="WixUI_InstallDir" />
|
||||
|
||||
<Publish Dialog="ExitDialog"
|
||||
Control="Finish"
|
||||
Event="DoAction"
|
||||
Value="CA.LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
|
||||
</UI>
|
||||
|
||||
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
|
||||
|
||||
<WixVariable Id="WixUIBannerBmp" Value="Bitmaps/Banner.png" />
|
||||
<WixVariable Id="WixUIDialogBmp" Value="Bitmaps/Dialog.png" />
|
||||
|
||||
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch NBTExplorer" />
|
||||
<Property Id="WixShellExecTarget" Value="[#NBTExplorer.exe]" />
|
||||
<CustomAction Id="CA.LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
|
||||
|
||||
|
||||
|
||||
<Icon Id="I.MainIcon" SourceFile="Icon.ico" />
|
||||
<Property Id="ARPPRODUCTICON" Value="I.MainIcon" />
|
||||
|
||||
<Feature Id="F.MainApplication" Title="NBTExplorer" Level="1">
|
||||
<ComponentGroupRef Id="CG.StartMenu" />
|
||||
<ComponentGroupRef Id="CG.ProductComponents" />
|
||||
</Feature>
|
||||
</Product>
|
||||
|
||||
<Fragment>
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="ProgramMenuFolder">
|
||||
<Directory Id="D.StartFolder" Name="NBTExplorer" />
|
||||
</Directory>
|
||||
<Directory Id="ProgramFilesFolder">
|
||||
<Directory Id="INSTALLDIR" Name="NBTExplorer" />
|
||||
</Directory>
|
||||
</Directory>
|
||||
|
||||
<ComponentGroup Id="CG.StartMenu" Directory="D.StartFolder">
|
||||
<Component Id="C.NBTEShortcut" Guid="*">
|
||||
<Shortcut Id="S.NBTEShortcut"
|
||||
Name="NBTExplorer"
|
||||
Target="[INSTALLDIR]NBTExplorer.exe"
|
||||
WorkingDirectory="INSTALLDIR" />
|
||||
<RemoveFolder Id="RF.StartFolder" On="uninstall" />
|
||||
<RegistryValue Id="RV.NBTEShortcut" Root="HKCU" Key="Software\NBTExplorer" Name="installed" Type="integer" Value="1" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="C.Uninstall" Guid="*">
|
||||
<Shortcut Id="S.Uninstall"
|
||||
Name="Uninstall NBTExplorer"
|
||||
Target="[SystemFolder]msiexec.exe"
|
||||
Arguments="/x [ProductCode]"
|
||||
Description="Uninstalls the NBTExplorer Application" />
|
||||
<RemoveFolder Id="RF.Uninstall" On ="uninstall" />
|
||||
<RegistryValue Id="RV.Uninstall" Root="HKCU" Key="Software\NBTExplorer" Name="uninstall" Type="integer" Value="1" KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
|
||||
<ComponentGroup Id="CG.ProductComponents" Directory="INSTALLDIR">
|
||||
<Component Id="C.NBTExplorer.exe" Guid="*">
|
||||
<File Source="../Staging/NBTExplorer.exe" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="C.NBTExplorer.exe.config" Guid="*">
|
||||
<File Source="../Staging/NBTExplorer.exe.config" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="C.NBTExplorer.visualelementsmanifest.xml" Guid="*">
|
||||
<File Source="../Staging/Windows/NBTExplorer.visualelementsmanifest.xml" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="C.NBTUtil.exe" Guid="*">
|
||||
<File Source="../Staging/NBTUtil.exe" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="C.NBTUtil.exe.config" Guid="*">
|
||||
<File Source="../Staging/NBTUtil.exe.config" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="C.NBTModel.dll" Guid="*">
|
||||
<File Source="../Staging/NBTModel.dll" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="C.Substrate.dll" Guid="*">
|
||||
<File Source="../Staging/Substrate.dll" KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
177
NBTExplorer.sln
|
@ -1,54 +1,123 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NBTExplorer", "NBTExplorer.csproj", "{8A458245-8176-4599-95CD-3CA39F2435CE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NBTExplorerMac", "NBTExplorerMac.csproj", "{01F9A296-C477-4CBF-A0D0-41E697048257}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|x86 = Release|x86
|
||||
AppStore|Any CPU = AppStore|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.AppStore|Any CPU.ActiveCfg = AppStore|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.AppStore|Any CPU.Build.0 = AppStore|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{01F9A296-C477-4CBF-A0D0-41E697048257}.Release|x86.Build.0 = Release|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.AppStore|Any CPU.ActiveCfg = Debug|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.AppStore|Any CPU.Build.0 = Debug|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Debug|x86.Build.0 = Debug|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Release|x86.ActiveCfg = Release|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = NBTExplorerMac.csproj
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NBTExplorer", "NBTExplorer\NBTExplorer.csproj", "{8A458245-8176-4599-95CD-3CA39F2435CE}"
|
||||
EndProject
|
||||
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "NBTExplorer.Installer", "NBTExplorer.Installer\NBTExplorer.Installer.wixproj", "{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE} = {8A458245-8176-4599-95CD-3CA39F2435CE}
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC} = {20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF} = {BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NBTUtil", "NBTUtil\NBTUtil.csproj", "{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NBTModel", "NBTModel\NBTModel.csproj", "{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Substrate (NET2)", "..\Substrate\SubstrateCS\Substrate (NET2).csproj", "{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
AppStore|Any CPU = AppStore|Any CPU
|
||||
AppStore|Mixed Platforms = AppStore|Mixed Platforms
|
||||
AppStore|x86 = AppStore|x86
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.AppStore|Any CPU.ActiveCfg = Debug|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.AppStore|Any CPU.Build.0 = Debug|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.AppStore|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.AppStore|Mixed Platforms.Build.0 = Release|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.AppStore|x86.ActiveCfg = Release|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.AppStore|x86.Build.0 = Release|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Debug|x86.Build.0 = Debug|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Release|x86.ActiveCfg = Release|x86
|
||||
{8A458245-8176-4599-95CD-3CA39F2435CE}.Release|x86.Build.0 = Release|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.AppStore|Any CPU.ActiveCfg = Release|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.AppStore|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.AppStore|Mixed Platforms.Build.0 = Release|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.AppStore|x86.ActiveCfg = Release|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.AppStore|x86.Build.0 = Release|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.Debug|x86.Build.0 = Debug|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.Release|x86.ActiveCfg = Release|x86
|
||||
{A1566071-7CBB-4C54-AAE1-4B81B7715DB3}.Release|x86.Build.0 = Release|x86
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.AppStore|Any CPU.Build.0 = Release|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.AppStore|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.AppStore|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.AppStore|x86.ActiveCfg = Release|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{BD90EED5-97B9-47D5-AFEA-C2C0D0E59FCF}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.AppStore|Any CPU.Build.0 = Release|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.AppStore|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.AppStore|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.AppStore|x86.ActiveCfg = Release|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{20D7CBA3-5B6D-40B0-8D28-4C9A58E4FFBC}.Release|x86.Build.0 = Release|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.AppStore|Any CPU.Build.0 = Release|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.AppStore|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.AppStore|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.AppStore|x86.ActiveCfg = Release|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.AppStore|x86.Build.0 = Release|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{AFE30E14-3F2F-4461-9F7D-147AB4DCA4C3}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(MonoDevelopProperties) = preSolution
|
||||
StartupItem = NBTExplorerMac.csproj
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
106
NBTExplorer/Controllers/ExplorerBarController.cs
Normal file
|
@ -0,0 +1,106 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using NBTExplorer.Model;
|
||||
using NBTExplorer.Windows;
|
||||
|
||||
namespace NBTExplorer.Controllers
|
||||
{
|
||||
class ExplorerBarController
|
||||
{
|
||||
private ToolStrip _explorerStrip;
|
||||
private DataNode _rootNode;
|
||||
private IconRegistry _registry;
|
||||
private ImageList _iconList;
|
||||
|
||||
public ExplorerBarController (ToolStrip toolStrip, IconRegistry registry, ImageList iconList, DataNode rootNode)
|
||||
{
|
||||
_explorerStrip = toolStrip;
|
||||
_registry = registry;
|
||||
_iconList = iconList;
|
||||
_rootNode = rootNode;
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void Initialize ()
|
||||
{
|
||||
_explorerStrip.Items.Clear();
|
||||
|
||||
List<DataNode> ancestry = new List<DataNode>();
|
||||
DataNode node = _rootNode;
|
||||
|
||||
while (node != null) {
|
||||
ancestry.Add(node);
|
||||
node = node.Parent;
|
||||
}
|
||||
|
||||
ancestry.Reverse();
|
||||
|
||||
foreach (DataNode item in ancestry) {
|
||||
ToolStripSplitButton itemButton = new ToolStripSplitButton(item.NodePathName) {
|
||||
Tag = item,
|
||||
};
|
||||
itemButton.ButtonClick += (s, e) => {
|
||||
ToolStripSplitButton button = s as ToolStripSplitButton;
|
||||
if (button != null)
|
||||
SearchRoot = button.Tag as DataNode;
|
||||
};
|
||||
itemButton.DropDown.ImageList = _iconList;
|
||||
|
||||
if (_explorerStrip.Items.Count == 0)
|
||||
itemButton.ImageIndex = _registry.Lookup(item.GetType());
|
||||
|
||||
if (!item.IsExpanded)
|
||||
item.Expand();
|
||||
|
||||
foreach (DataNode subItem in item.Nodes) {
|
||||
if (!subItem.IsContainerType)
|
||||
continue;
|
||||
|
||||
ToolStripMenuItem menuItem = new ToolStripMenuItem(subItem.NodePathName) {
|
||||
ImageIndex = _registry.Lookup(subItem.GetType()),
|
||||
Tag = subItem,
|
||||
};
|
||||
menuItem.Click += (s, e) => {
|
||||
ToolStripMenuItem mItem = s as ToolStripMenuItem;
|
||||
if (mItem != null)
|
||||
SearchRoot = mItem.Tag as DataNode;
|
||||
};
|
||||
|
||||
if (ancestry.Contains(subItem))
|
||||
menuItem.Font = new Font(menuItem.Font, FontStyle.Bold);
|
||||
|
||||
itemButton.DropDownItems.Add(menuItem);
|
||||
}
|
||||
|
||||
_explorerStrip.Items.Add(itemButton);
|
||||
}
|
||||
}
|
||||
|
||||
public DataNode SearchRoot
|
||||
{
|
||||
get { return _rootNode; }
|
||||
set
|
||||
{
|
||||
if (_rootNode == value)
|
||||
return;
|
||||
|
||||
_rootNode = value;
|
||||
Initialize();
|
||||
|
||||
OnSearchRootChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public event EventHandler SearchRootChanged;
|
||||
|
||||
protected virtual void OnSearchRootChanged ()
|
||||
{
|
||||
var ev = SearchRootChanged;
|
||||
if (ev != null)
|
||||
ev(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
1169
NBTExplorer/Controllers/NodeTreeController.cs
Normal file
438
NBTExplorer/Controllers/RuleTreeController.cs
Normal file
|
@ -0,0 +1,438 @@
|
|||
using System.Windows.Forms;
|
||||
using NBTExplorer.Model.Search;
|
||||
using NBTExplorer.Windows;
|
||||
using NBTExplorer.Windows.Search;
|
||||
using Substrate.Nbt;
|
||||
|
||||
namespace NBTExplorer.Controllers
|
||||
{
|
||||
public class RuleTreeController
|
||||
{
|
||||
private TreeView _nodeTree;
|
||||
private IconRegistry _iconRegistry;
|
||||
|
||||
private RootRule _rootData;
|
||||
|
||||
public RuleTreeController (TreeView nodeTree)
|
||||
{
|
||||
_nodeTree = nodeTree;
|
||||
|
||||
InitializeIconRegistry();
|
||||
ShowVirtualRoot = true;
|
||||
|
||||
_rootData = new RootRule();
|
||||
|
||||
RefreshTree();
|
||||
}
|
||||
|
||||
private void InitializeIconRegistry ()
|
||||
{
|
||||
_iconRegistry = new IconRegistry();
|
||||
_iconRegistry.DefaultIcon = 15;
|
||||
|
||||
_iconRegistry.Register(typeof(RootRule), 18);
|
||||
_iconRegistry.Register(typeof(UnionRule), 21);
|
||||
_iconRegistry.Register(typeof(IntersectRule), 20);
|
||||
_iconRegistry.Register(typeof(WildcardRule), 19);
|
||||
_iconRegistry.Register(typeof(ByteTagRule), 0);
|
||||
_iconRegistry.Register(typeof(ShortTagRule), 1);
|
||||
_iconRegistry.Register(typeof(IntTagRule), 2);
|
||||
_iconRegistry.Register(typeof(LongTagRule), 3);
|
||||
_iconRegistry.Register(typeof(FloatTagRule), 4);
|
||||
_iconRegistry.Register(typeof(DoubleTagRule), 5);
|
||||
_iconRegistry.Register(typeof(StringTagRule), 7);
|
||||
}
|
||||
|
||||
public RootRule Root
|
||||
{
|
||||
get { return _rootData; }
|
||||
}
|
||||
|
||||
public TreeView Tree
|
||||
{
|
||||
get { return _nodeTree; }
|
||||
}
|
||||
|
||||
public bool ShowVirtualRoot { get; set; }
|
||||
|
||||
public string VirtualRootDisplay
|
||||
{
|
||||
get { return _rootData.NodeDisplay; }
|
||||
}
|
||||
|
||||
public void DeleteSelection ()
|
||||
{
|
||||
DeleteNode(SelectedNode);
|
||||
}
|
||||
|
||||
public void DeleteNode (TreeNode node)
|
||||
{
|
||||
if (node == null || !(node.Tag is SearchRule))
|
||||
return;
|
||||
|
||||
TreeNode parent = node.Parent;
|
||||
if (parent == null || !(parent.Tag is GroupRule))
|
||||
return;
|
||||
|
||||
GroupRule parentData = parent.Tag as GroupRule;
|
||||
SearchRule nodeData = node.Tag as SearchRule;
|
||||
|
||||
parentData.Rules.Remove(nodeData);
|
||||
parent.Nodes.Remove(node);
|
||||
}
|
||||
|
||||
private TreeNode SelectedNode
|
||||
{
|
||||
get { return _nodeTree.SelectedNode; }
|
||||
}
|
||||
|
||||
private TreeNode SelectedOrRootNode
|
||||
{
|
||||
get { return _nodeTree.SelectedNode ?? (_nodeTree.Nodes.Count > 0 ? _nodeTree.Nodes[0] : null); }
|
||||
}
|
||||
|
||||
private TreeNode CreateIntegralNode<T, K> (string typeName)
|
||||
where K : TagNode
|
||||
where T : IntegralTagRule<K>, new()
|
||||
{
|
||||
T rule = new T();
|
||||
|
||||
using (ValueRuleForm form = new ValueRuleForm(SearchRule.NumericOpStrings) {
|
||||
Text = "Edit " + typeName + " Tag Rule",
|
||||
}) {
|
||||
if (form.ShowDialog() == DialogResult.OK) {
|
||||
rule.Name = form.TagName;
|
||||
rule.Value = form.TagValueAsLong;
|
||||
rule.Operator = form.Operator;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
TreeNode node = CreateNode(rule);
|
||||
node.Text = rule.NodeDisplay;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
private void EditIntegralNode<T, K> (TreeNode node, T rule, string typeName)
|
||||
where K : TagNode
|
||||
where T : IntegralTagRule<K>
|
||||
{
|
||||
using (ValueRuleForm form = new ValueRuleForm(SearchRule.NumericOpStrings) {
|
||||
Text = "Edit " + typeName + " Tag Rule",
|
||||
TagName = rule.Name,
|
||||
TagValue = rule.Value.ToString(),
|
||||
Operator = rule.Operator,
|
||||
}) {
|
||||
if (form.ShowDialog() == DialogResult.OK) {
|
||||
rule.Name = form.TagName;
|
||||
rule.Value = form.TagValueAsLong;
|
||||
rule.Operator = form.Operator;
|
||||
}
|
||||
}
|
||||
|
||||
node.Text = rule.NodeDisplay;
|
||||
}
|
||||
|
||||
private TreeNode CreateFloatNode<T, K> (string typeName)
|
||||
where K : TagNode
|
||||
where T : FloatTagRule<K>, new()
|
||||
{
|
||||
T rule = new T();
|
||||
|
||||
using (ValueRuleForm form = new ValueRuleForm(SearchRule.NumericOpStrings) {
|
||||
Text = "Edit " + typeName + " Tag Rule",
|
||||
}) {
|
||||
if (form.ShowDialog() == DialogResult.OK) {
|
||||
rule.Name = form.TagName;
|
||||
rule.Value = form.TagValueAsDouble;
|
||||
rule.Operator = form.Operator;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
TreeNode node = CreateNode(rule);
|
||||
node.Text = rule.NodeDisplay;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
private void EditFloatNode<T, K> (TreeNode node, T rule, string typeName)
|
||||
where K : TagNode
|
||||
where T : FloatTagRule<K>
|
||||
{
|
||||
using (ValueRuleForm form = new ValueRuleForm(SearchRule.NumericOpStrings) {
|
||||
Text = "Edit " + typeName + " Tag Rule",
|
||||
TagName = rule.Name,
|
||||
TagValue = rule.Value.ToString(),
|
||||
Operator = rule.Operator,
|
||||
}) {
|
||||
if (form.ShowDialog() == DialogResult.OK) {
|
||||
rule.Name = form.TagName;
|
||||
rule.Value = form.TagValueAsDouble;
|
||||
rule.Operator = form.Operator;
|
||||
}
|
||||
}
|
||||
|
||||
node.Text = rule.NodeDisplay;
|
||||
}
|
||||
|
||||
private TreeNode CreateStringNode (string typeName)
|
||||
{
|
||||
StringTagRule rule = new StringTagRule();
|
||||
|
||||
using (StringRuleForm form = new StringRuleForm(SearchRule.StringOpStrings) {
|
||||
Text = "Edit " + typeName + " Tag Rule",
|
||||
}) {
|
||||
if (form.ShowDialog() == DialogResult.OK) {
|
||||
rule.Name = form.TagName;
|
||||
rule.Value = form.TagValue;
|
||||
rule.Operator = form.Operator;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
TreeNode node = CreateNode(rule);
|
||||
node.Text = rule.NodeDisplay;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
private void EditStringNode (TreeNode node, StringTagRule rule, string typeName)
|
||||
{
|
||||
using (StringRuleForm form = new StringRuleForm(SearchRule.StringOpStrings) {
|
||||
Text = "Edit " + typeName + " Tag Rule",
|
||||
TagName = rule.Name,
|
||||
TagValue = rule.Value,
|
||||
Operator = rule.Operator,
|
||||
}) {
|
||||
if (form.ShowDialog() == DialogResult.OK) {
|
||||
rule.Name = form.TagName;
|
||||
rule.Value = form.TagValue;
|
||||
rule.Operator = form.Operator;
|
||||
}
|
||||
}
|
||||
|
||||
node.Text = rule.NodeDisplay;
|
||||
}
|
||||
|
||||
private TreeNode CreateWildcardNode (string typeName)
|
||||
{
|
||||
WildcardRule rule = new WildcardRule();
|
||||
|
||||
using (WildcardRuleForm form = new WildcardRuleForm(SearchRule.WildcardOpStrings) {
|
||||
Text = "Edit " + typeName + " Rule",
|
||||
}) {
|
||||
if (form.ShowDialog() == DialogResult.OK) {
|
||||
rule.Name = form.TagName;
|
||||
rule.Value = form.TagValue;
|
||||
rule.Operator = form.Operator;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
TreeNode node = CreateNode(rule);
|
||||
node.Text = rule.NodeDisplay;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
private void EditWildcardNode (TreeNode node, WildcardRule rule, string typeName)
|
||||
{
|
||||
using (WildcardRuleForm form = new WildcardRuleForm(SearchRule.WildcardOpStrings) {
|
||||
Text = "Edit " + typeName + " Rule",
|
||||
TagName = rule.Name,
|
||||
TagValue = rule.Value,
|
||||
Operator = rule.Operator,
|
||||
}) {
|
||||
if (form.ShowDialog() == DialogResult.OK) {
|
||||
rule.Name = form.TagName;
|
||||
rule.Value = form.TagValue;
|
||||
rule.Operator = form.Operator;
|
||||
}
|
||||
}
|
||||
|
||||
node.Text = rule.NodeDisplay;
|
||||
}
|
||||
|
||||
public void CreateNode (TreeNode node, TagType type)
|
||||
{
|
||||
if (node == null || !(node.Tag is GroupRule))
|
||||
return;
|
||||
|
||||
GroupRule dataNode = node.Tag as GroupRule;
|
||||
TreeNode newNode = null;
|
||||
|
||||
switch (type) {
|
||||
case TagType.TAG_BYTE:
|
||||
newNode = CreateIntegralNode<ByteTagRule, TagNodeByte>("Byte");
|
||||
break;
|
||||
case TagType.TAG_SHORT:
|
||||
newNode = CreateIntegralNode<ShortTagRule, TagNodeShort>("Short");
|
||||
break;
|
||||
case TagType.TAG_INT:
|
||||
newNode = CreateIntegralNode<IntTagRule, TagNodeInt>("Int");
|
||||
break;
|
||||
case TagType.TAG_LONG:
|
||||
newNode = CreateIntegralNode<LongTagRule, TagNodeLong>("Long");
|
||||
break;
|
||||
case TagType.TAG_FLOAT:
|
||||
newNode = CreateFloatNode<FloatTagRule, TagNodeFloat>("Float");
|
||||
break;
|
||||
case TagType.TAG_DOUBLE:
|
||||
newNode = CreateFloatNode<DoubleTagRule, TagNodeDouble>("Double");
|
||||
break;
|
||||
case TagType.TAG_STRING:
|
||||
newNode = CreateStringNode("String");
|
||||
break;
|
||||
}
|
||||
|
||||
if (newNode != null) {
|
||||
node.Nodes.Add(newNode);
|
||||
dataNode.Rules.Add(newNode.Tag as SearchRule);
|
||||
|
||||
node.Expand();
|
||||
}
|
||||
}
|
||||
|
||||
public void EditNode (TreeNode node)
|
||||
{
|
||||
if (node == null || !(node.Tag is SearchRule))
|
||||
return;
|
||||
|
||||
SearchRule rule = node.Tag as SearchRule;
|
||||
|
||||
if (rule is ByteTagRule)
|
||||
EditIntegralNode<ByteTagRule, TagNodeByte>(node, rule as ByteTagRule, "Byte");
|
||||
else if (rule is ShortTagRule)
|
||||
EditIntegralNode<ShortTagRule, TagNodeShort>(node, rule as ShortTagRule, "Short");
|
||||
else if (rule is IntTagRule)
|
||||
EditIntegralNode<IntTagRule, TagNodeInt>(node, rule as IntTagRule, "Int");
|
||||
else if (rule is LongTagRule)
|
||||
EditIntegralNode<LongTagRule, TagNodeLong>(node, rule as LongTagRule, "Long");
|
||||
else if (rule is FloatTagRule)
|
||||
EditFloatNode<FloatTagRule, TagNodeFloat>(node, rule as FloatTagRule, "Float");
|
||||
else if (rule is DoubleTagRule)
|
||||
EditFloatNode<DoubleTagRule, TagNodeDouble>(node, rule as DoubleTagRule, "Double");
|
||||
else if (rule is StringTagRule)
|
||||
EditStringNode(node, rule as StringTagRule, "String");
|
||||
else if (rule is WildcardRule)
|
||||
EditWildcardNode(node, rule as WildcardRule, "Wildcard");
|
||||
}
|
||||
|
||||
public void EditSelection ()
|
||||
{
|
||||
if (_nodeTree.SelectedNode == null)
|
||||
return;
|
||||
|
||||
EditNode(_nodeTree.SelectedNode);
|
||||
}
|
||||
|
||||
public void CreateWildcardNode (TreeNode node)
|
||||
{
|
||||
if (node == null || !(node.Tag is GroupRule))
|
||||
return;
|
||||
|
||||
GroupRule dataNode = node.Tag as GroupRule;
|
||||
|
||||
TreeNode newNode = CreateWildcardNode("Wildcard");
|
||||
|
||||
if (newNode != null) {
|
||||
node.Nodes.Add(newNode);
|
||||
dataNode.Rules.Add(newNode.Tag as SearchRule);
|
||||
|
||||
node.Expand();
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateWildcardNode ()
|
||||
{
|
||||
CreateWildcardNode(SelectedOrRootNode);
|
||||
}
|
||||
|
||||
public void CreateUnionNode (TreeNode node)
|
||||
{
|
||||
if (node == null || !(node.Tag is GroupRule))
|
||||
return;
|
||||
|
||||
GroupRule dataNode = node.Tag as GroupRule;
|
||||
|
||||
TreeNode newNode = CreateNode(new UnionRule());
|
||||
node.Nodes.Add(newNode);
|
||||
dataNode.Rules.Add(newNode.Tag as SearchRule);
|
||||
|
||||
node.Expand();
|
||||
}
|
||||
|
||||
public void CreateUnionNode ()
|
||||
{
|
||||
CreateUnionNode(SelectedOrRootNode);
|
||||
}
|
||||
|
||||
public void CreateIntersectNode (TreeNode node)
|
||||
{
|
||||
if (node == null || !(node.Tag is GroupRule))
|
||||
return;
|
||||
|
||||
GroupRule dataNode = node.Tag as GroupRule;
|
||||
|
||||
TreeNode newNode = CreateNode(new IntersectRule());
|
||||
node.Nodes.Add(newNode);
|
||||
dataNode.Rules.Add(newNode.Tag as SearchRule);
|
||||
|
||||
node.Expand();
|
||||
}
|
||||
|
||||
public void CreateIntersectNode ()
|
||||
{
|
||||
CreateIntersectNode(SelectedOrRootNode);
|
||||
}
|
||||
|
||||
public void CreateNode (TagType type)
|
||||
{
|
||||
if (SelectedOrRootNode == null)
|
||||
return;
|
||||
|
||||
CreateNode(SelectedOrRootNode, type);
|
||||
}
|
||||
|
||||
private TreeNode CreateNode (SearchRule rule)
|
||||
{
|
||||
TreeNode frontNode = new TreeNode(rule.NodeDisplay);
|
||||
frontNode.ImageIndex = _iconRegistry.Lookup(rule.GetType());
|
||||
frontNode.SelectedImageIndex = frontNode.ImageIndex;
|
||||
frontNode.Tag = rule;
|
||||
|
||||
return frontNode;
|
||||
}
|
||||
|
||||
private void ExpandNode (TreeNode node, bool recurse)
|
||||
{
|
||||
GroupRule rule = node.Tag as GroupRule;
|
||||
if (rule == null)
|
||||
return;
|
||||
|
||||
foreach (var subRule in rule.Rules) {
|
||||
TreeNode subNode = CreateNode(subRule);
|
||||
node.Nodes.Add(subNode);
|
||||
|
||||
if (recurse)
|
||||
ExpandNode(subNode, recurse);
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshTree ()
|
||||
{
|
||||
_nodeTree.Nodes.Clear();
|
||||
_nodeTree.Nodes.Add(CreateNode(_rootData));
|
||||
|
||||
ExpandNode(_nodeTree.Nodes[0], true);
|
||||
|
||||
_nodeTree.ExpandAll();
|
||||
}
|
||||
}
|
||||
}
|
60
NBTExplorer/Interop.cs
Normal file
|
@ -0,0 +1,60 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace NBTExplorer
|
||||
{
|
||||
internal static class Interop
|
||||
{
|
||||
public static bool WinInteropAvailable
|
||||
{
|
||||
get { return IsWindows && Type.GetType("Mono.Runtime") == null; }
|
||||
}
|
||||
|
||||
public static bool IsWindows
|
||||
{
|
||||
get { return Environment.OSVersion.Platform == PlatformID.Win32NT; }
|
||||
}
|
||||
|
||||
public static bool IsWinXP
|
||||
{
|
||||
get
|
||||
{
|
||||
OperatingSystem OS = Environment.OSVersion;
|
||||
return (OS.Platform == PlatformID.Win32NT) &&
|
||||
((OS.Version.Major > 5) || ((OS.Version.Major == 5) && (OS.Version.Minor == 1)));
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsWinVista
|
||||
{
|
||||
get
|
||||
{
|
||||
OperatingSystem OS = Environment.OSVersion;
|
||||
return (OS.Platform == PlatformID.Win32NT) && (OS.Version.Major >= 6);
|
||||
}
|
||||
}
|
||||
|
||||
public static IntPtr SendMessage (IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam)
|
||||
{
|
||||
if (WinInteropAvailable)
|
||||
return NativeInterop.SendMessage(hWnd, msg, wParam, lParam);
|
||||
else
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
internal static class NativeInterop
|
||||
{
|
||||
public const int WM_PRINTCLIENT = 0x0318;
|
||||
public const int PRF_CLIENT = 0x00000004;
|
||||
|
||||
public const int TV_FIRST = 0x1100;
|
||||
public const int TVM_SETBKCOLOR = TV_FIRST + 29;
|
||||
public const int TVM_SETEXTENDEDSTYLE = TV_FIRST + 44;
|
||||
|
||||
public const int TVS_EX_DOUBLEBUFFER = 0x0004;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern IntPtr SendMessage (IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
|
||||
}
|
||||
}
|
|
@ -12,6 +12,21 @@
|
|||
<AssemblyName>NBTExplorer</AssemblyName>
|
||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
|
@ -38,7 +53,7 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;WINDOWS</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisLogFile>bin\Debug\NBTExplorer.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
|
||||
|
@ -55,7 +70,7 @@
|
|||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DefineConstants>TRACE;WINDOWS</DefineConstants>
|
||||
<Optimize>True</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
@ -69,25 +84,45 @@
|
|||
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject />
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Substrate">
|
||||
<HintPath>..\References\Substrate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Substrate">
|
||||
<HintPath>..\Substrate\SubstrateCS\bin\Release\NET2\Substrate.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FormRegistry.cs" />
|
||||
<Compile Include="NbtClipboardController.cs" />
|
||||
<Compile Include="Controllers\ExplorerBarController.cs" />
|
||||
<Compile Include="Controllers\NodeTreeController.cs" />
|
||||
<Compile Include="Controllers\RuleTreeController.cs" />
|
||||
<Compile Include="Interop.cs" />
|
||||
<Compile Include="Vendor\MultiSelectTreeView\MultiSelectTreeview.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Windows\CancelSearchForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Windows\CancelSearchForm.Designer.cs">
|
||||
<DependentUpon>CancelSearchForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\FindBlock.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Windows\FindBlock.Designer.cs">
|
||||
<DependentUpon>FindBlock.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\FindReplace.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Windows\FindReplace.Designer.cs">
|
||||
<DependentUpon>FindReplace.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\IconRegistry.cs" />
|
||||
<Compile Include="Windows\MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
|
@ -137,32 +172,6 @@
|
|||
<Compile Include="Windows\EditHex.Designer.cs">
|
||||
<DependentUpon>EditHex.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Model\CompoundTagContainer.cs" />
|
||||
<Compile Include="Model\CubicRegionDataNode.cs" />
|
||||
<Compile Include="Model\CubicRegionFile.cs" />
|
||||
<Compile Include="Model\DataNode.cs" />
|
||||
<Compile Include="Model\DataNodeCollection.cs" />
|
||||
<Compile Include="Model\DirectoryDataNode.cs" />
|
||||
<Compile Include="Model\FileTypeRegistry.cs" />
|
||||
<Compile Include="Model\ListTagContainer.cs" />
|
||||
<Compile Include="Model\NbtFileDataNode.cs" />
|
||||
<Compile Include="Model\NodeCapabilities.cs" />
|
||||
<Compile Include="Model\RegionChunkDataNode.cs" />
|
||||
<Compile Include="Model\RegionFileDataNode.cs" />
|
||||
<Compile Include="Model\TagByteArrayDataNode.cs" />
|
||||
<Compile Include="Model\TagByteDataNode.cs" />
|
||||
<Compile Include="Model\TagCompoundDataNode.cs" />
|
||||
<Compile Include="Model\TagContainerInterface.cs" />
|
||||
<Compile Include="Model\TagDataNode.cs" />
|
||||
<Compile Include="Model\TagDoubleDataNode.cs" />
|
||||
<Compile Include="Model\TagFloatDataNode.cs" />
|
||||
<Compile Include="Model\TagIntArrayDataNode.cs" />
|
||||
<Compile Include="Model\TagIntDataNode.cs" />
|
||||
<Compile Include="Model\TagListDataNode.cs" />
|
||||
<Compile Include="Model\TagLongDataNode.cs" />
|
||||
<Compile Include="Model\TagShortDataNode.cs" />
|
||||
<Compile Include="Model\TagStringDataNode.cs" />
|
||||
<Compile Include="NbtClipboardData.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
|
@ -171,7 +180,6 @@
|
|||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SearchWorker.cs" />
|
||||
<Compile Include="Model\TagKey.cs" />
|
||||
<Compile Include="Vendor\Be.Windows.Forms.HexBox\BuiltInContextMenu.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
@ -195,9 +203,37 @@
|
|||
<Compile Include="Windows\FormHandlers.cs" />
|
||||
<Compile Include="Windows\NbtClipboardControllerWin.cs" />
|
||||
<Compile Include="Windows\SearchStateWin.cs" />
|
||||
<Compile Include="Windows\Search\WildcardRuleForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Windows\Search\WildcardRuleForm.Designer.cs">
|
||||
<DependentUpon>WildcardRuleForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\Search\StringRuleForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Windows\Search\StringRuleForm.Designer.cs">
|
||||
<DependentUpon>StringRuleForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\Search\ValueRuleForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Windows\Search\ValueRuleForm.Designer.cs">
|
||||
<DependentUpon>ValueRuleForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Windows\ToolStripExplorerRenderer.cs" />
|
||||
<Compile Include="Windows\WatermarkTextBox.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Windows\CancelSearchForm.resx">
|
||||
<DependentUpon>CancelSearchForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\FindBlock.resx">
|
||||
<DependentUpon>FindBlock.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\FindReplace.resx">
|
||||
<DependentUpon>FindReplace.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\MainForm.resx">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
|
@ -236,6 +272,15 @@
|
|||
<EmbeddedResource Include="Vendor\Be.Windows.Forms.HexBox\HexBox.resx">
|
||||
<DependentUpon>HexBox.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\Search\WildcardRuleForm.resx">
|
||||
<DependentUpon>WildcardRuleForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\Search\StringRuleForm.resx">
|
||||
<DependentUpon>StringRuleForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Windows\Search\ValueRuleForm.resx">
|
||||
<DependentUpon>ValueRuleForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
|
@ -248,9 +293,27 @@
|
|||
</None>
|
||||
<None Include="Resources\arrow-090.png" />
|
||||
<None Include="Resources\arrow-270.png" />
|
||||
<Content Include="Windows\NBTExplorer.visualelementsmanifest.xml" />
|
||||
<Content Include="Vendor\Be.Windows.Forms.HexBox\HexBox.bmp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\NBTModel\NBTModel.csproj">
|
||||
<Project>{20d7cba3-5b6d-40b0-8d28-4c9a58e4ffbc}</Project>
|
||||
<Name>NBTModel</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
@ -259,4 +322,13 @@
|
|||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<Staging Include="$(OutputPath)\**\*.dll" />
|
||||
<Staging Include="$(OutputPath)\**\*.exe" />
|
||||
<Staging Include="$(OutputPath)\**\*.exe.config" />
|
||||
<Staging Include="$(ProjectDir)\**\*.visualelementsmanifest.xml" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(Staging)" DestinationFolder="..\Staging\%(RecursiveDir)" />
|
||||
</Target>
|
||||
</Project>
|
146
NBTExplorer/Program.cs
Normal file
|
@ -0,0 +1,146 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using NBTExplorer.Windows;
|
||||
|
||||
namespace NBTExplorer
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main (string[] args)
|
||||
{
|
||||
Application.ThreadException += AppThreadFailureHandler;
|
||||
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += AppDomainFailureHandler;
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm());
|
||||
}
|
||||
|
||||
public static void StaticInitFailure (Exception e)
|
||||
{
|
||||
Console.WriteLine("Static Initialization Failure:");
|
||||
|
||||
Exception original = e;
|
||||
while (e != null) {
|
||||
Console.WriteLine(e.Message);
|
||||
Console.WriteLine(e.StackTrace);
|
||||
e = e.InnerException;
|
||||
}
|
||||
|
||||
MessageBox.Show("Application failed during static initialization: " + original.Message);
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
private static void AppThreadFailureHandler (object sender, ThreadExceptionEventArgs e)
|
||||
{
|
||||
ProcessException(e.Exception);
|
||||
}
|
||||
|
||||
private static void AppDomainFailureHandler (object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
if (e.ExceptionObject is Exception)
|
||||
ProcessException(e.ExceptionObject as Exception);
|
||||
else if (e.IsTerminating) {
|
||||
MessageBox.Show("NBTExplorer encountered an unknown exception object: " + e.ExceptionObject.GetType().FullName,
|
||||
"NBTExplorer failed to run", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
|
||||
private static void ProcessException (Exception ex)
|
||||
{
|
||||
if (IsMissingSubstrate(ex)) {
|
||||
MessageBox.Show("NBTExplorer could not find required assembly \"Substrate.dll\".\n\nIf you obtained NBTExplorer from a ZIP distribution, make sure you've extracted NBTExplorer and all of its supporting files into another directory before running it.",
|
||||
"NBTExplorer failed to run", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsMissingNBTModel(ex)) {
|
||||
MessageBox.Show("NBTExplorer could not find required assembly \"NBTModel.dll\".\n\nIf you obtained NBTExplorer from a ZIP distribution, make sure you've extracted NBTExplorer and all of its supporting files into another directory before running it.",
|
||||
"NBTExplorer failed to run", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder errorText = new StringBuilder();
|
||||
errorText.AppendLine("NBTExplorer encountered the following exception while trying to run: " + ex.GetType().Name);
|
||||
errorText.AppendLine("Message: " + ex.Message);
|
||||
|
||||
Exception ix = ex;
|
||||
while (ix.InnerException != null) {
|
||||
ix = ix.InnerException;
|
||||
errorText.AppendLine();
|
||||
errorText.AppendLine("Caused by Inner Exception: " + ix.GetType().Name);
|
||||
errorText.AppendLine("Message: " + ix.Message);
|
||||
}
|
||||
|
||||
try {
|
||||
string logDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NBTExplorer");
|
||||
if (!Directory.Exists(logDir))
|
||||
Directory.CreateDirectory(logDir);
|
||||
|
||||
string logPath = Path.Combine(logDir, "error.log");
|
||||
using (var writer = new StreamWriter(logPath, true)) {
|
||||
writer.WriteLine("NBTExplorer Error Report");
|
||||
writer.WriteLine(DateTime.Now);
|
||||
writer.WriteLine("-------");
|
||||
writer.WriteLine(errorText);
|
||||
writer.WriteLine("-------");
|
||||
|
||||
ix = ex;
|
||||
while (ix != null) {
|
||||
writer.WriteLine(ex.StackTrace);
|
||||
writer.WriteLine("-------");
|
||||
ix = ix.InnerException;
|
||||
}
|
||||
|
||||
writer.WriteLine();
|
||||
}
|
||||
|
||||
errorText.AppendLine();
|
||||
errorText.AppendLine("Additional error detail has been written to:\n" + logPath);
|
||||
}
|
||||
catch { }
|
||||
|
||||
MessageBox.Show(errorText.ToString(), "NBTExplorer failed to run", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
private static bool IsMissingSubstrate (Exception ex)
|
||||
{
|
||||
if (ex is TypeInitializationException && ex.InnerException != null)
|
||||
ex = ex.InnerException;
|
||||
if (ex is FileNotFoundException) {
|
||||
FileNotFoundException fileEx = ex as FileNotFoundException;
|
||||
if (fileEx.FileName.Contains("Substrate"))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool IsMissingNBTModel (Exception ex)
|
||||
{
|
||||
if (ex is TypeInitializationException && ex.InnerException != null)
|
||||
ex = ex.InnerException;
|
||||
if (ex is FileNotFoundException) {
|
||||
FileNotFoundException fileEx = ex as FileNotFoundException;
|
||||
if (fileEx.FileName.Contains("NBTModel"))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("NBTExplorer")]
|
||||
[assembly: AssemblyCopyright("Copyright © Justin Aquadro 2011-2012")]
|
||||
[assembly: AssemblyCopyright("Copyright © Justin Aquadro 2011-2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.0.2.0")]
|
||||
[assembly: AssemblyFileVersion("2.0.2.0")]
|
||||
[assembly: AssemblyVersion("2.8.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.8.0.0")]
|
Before Width: | Height: | Size: 693 B After Width: | Height: | Size: 693 B |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
BIN
NBTExplorer/Resources/amp.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 618 B After Width: | Height: | Size: 618 B |
Before Width: | Height: | Size: 622 B After Width: | Height: | Size: 622 B |
BIN
NBTExplorer/Resources/arrow-315.png
Normal file
After Width: | Height: | Size: 601 B |
Before Width: | Height: | Size: 835 B After Width: | Height: | Size: 835 B |
BIN
NBTExplorer/Resources/asterisk-yellow.png
Normal file
After Width: | Height: | Size: 720 B |
Before Width: | Height: | Size: 733 B After Width: | Height: | Size: 733 B |
Before Width: | Height: | Size: 621 B After Width: | Height: | Size: 621 B |
Before Width: | Height: | Size: 630 B After Width: | Height: | Size: 630 B |
Before Width: | Height: | Size: 654 B After Width: | Height: | Size: 654 B |
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 508 B |
Before Width: | Height: | Size: 685 B After Width: | Height: | Size: 685 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 544 B |
Before Width: | Height: | Size: 677 B After Width: | Height: | Size: 677 B |
Before Width: | Height: | Size: 691 B After Width: | Height: | Size: 691 B |
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 507 B |
Before Width: | Height: | Size: 624 B After Width: | Height: | Size: 624 B |
Before Width: | Height: | Size: 612 B After Width: | Height: | Size: 612 B |
Before Width: | Height: | Size: 593 B After Width: | Height: | Size: 593 B |
Before Width: | Height: | Size: 566 B After Width: | Height: | Size: 566 B |
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 587 B |
Before Width: | Height: | Size: 556 B After Width: | Height: | Size: 556 B |