diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/ASX.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/ASX.xml new file mode 100644 index 00000000..0ac3da22 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/ASX.xml @@ -0,0 +1,25 @@ + + + + + + + + *.asx + + + + <?xml + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/CompactDisc.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/CompactDisc.xml new file mode 100644 index 00000000..cec5f77b --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/CompactDisc.xml @@ -0,0 +1,27 @@ + + + + + + + + *.cda + + + + RIFF + + CDDA + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/HTML.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/HTML.xml new file mode 100644 index 00000000..9ff3b3d7 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/HTML.xml @@ -0,0 +1,25 @@ + + + + + + + + *.html + + + + <?xml + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/Notepad++.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/Notepad++.xml new file mode 100644 index 00000000..cc448559 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/Notepad++.xml @@ -0,0 +1,25 @@ + + + + + + + + session.xml + + + + <?xml + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/PLS.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/PLS.xml new file mode 100644 index 00000000..61279f97 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/PLS.xml @@ -0,0 +1,25 @@ + + + + + + + + *.pls + + + + [playlist + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/SMIL.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/SMIL.xml new file mode 100644 index 00000000..b0f7bf23 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/AudioWorkstation/Associations/Playlist/SMIL.xml @@ -0,0 +1,28 @@ + + + + + + + + *.wpl + *.zpl + *.smil + + + + <?xml + <?zpl + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/FileSystem/Associations/ARC.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/FileSystem/Associations/ARC.xml new file mode 100644 index 00000000..39fc3946 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/FileSystem/Associations/ARC.xml @@ -0,0 +1,25 @@ + + + + + + + + *.arc + + + + 1A + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/FileSystem/Associations/ARJ.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/FileSystem/Associations/ARJ.xml new file mode 100644 index 00000000..c0837eca --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/FileSystem/Associations/ARJ.xml @@ -0,0 +1,25 @@ + + + + + + + + *.arj + + + + 60EA + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/FileSystem/Associations/WinRAR.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/FileSystem/Associations/WinRAR.xml new file mode 100644 index 00000000..b2e124bf --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/FileSystem/Associations/WinRAR.xml @@ -0,0 +1,25 @@ + + + + + + + + *.rar + + + + Rar! + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/FileSystem/Associations/YamazakiZipper.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/FileSystem/Associations/YamazakiZipper.xml new file mode 100644 index 00000000..feba5222 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/FileSystem/Associations/YamazakiZipper.xml @@ -0,0 +1,25 @@ + + + + + + + + *.yz1 + + + + yz010600 + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/AlienNationsGD.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/AlienNationsGD.xml new file mode 100644 index 00000000..338360e0 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/AlienNationsGD.xml @@ -0,0 +1,20 @@ + + + + + + + + *.gd + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/CompressedHunks.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/CompressedHunks.xml new file mode 100644 index 00000000..cf38c8f4 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/CompressedHunks.xml @@ -0,0 +1,25 @@ + + + + + + + + *.chd + + + + MComprHD + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/DoomWAD.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/DoomWAD.xml new file mode 100644 index 00000000..22f1062c --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/DoomWAD.xml @@ -0,0 +1,28 @@ + + + + + + + + *.gd + + + + IWAD + + + PWAD + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/DreamfallPAK.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/DreamfallPAK.xml new file mode 100644 index 00000000..7f03d522 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/DreamfallPAK.xml @@ -0,0 +1,25 @@ + + + + + + + + *.pak + + + + tlj_pack0001 + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/Homeworld.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/Homeworld.xml new file mode 100644 index 00000000..4738d94e --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/Homeworld.xml @@ -0,0 +1,29 @@ + + + + + + + + *.vce + *.wxd + + + + VCE0 + + + WXD1 + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/JackOrlandoPAK.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/JackOrlandoPAK.xml new file mode 100644 index 00000000..9667b092 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/JackOrlandoPAK.xml @@ -0,0 +1,27 @@ + + + + + + + + *.pak + *.phk + *.ph2 + + + + PAK\0 + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/MementoMoriRES.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/MementoMoriRES.xml new file mode 100644 index 00000000..f7cee7e4 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/MementoMoriRES.xml @@ -0,0 +1,25 @@ + + + + + + + + *.res + + + + C\0e\0n\0t\0a\0u\0r\0i\0 \0P\0r\0o\0d\0u\0c\0t\0i\0o\0n\0 \0R\0e\0s\0o\0u\0r\0c\0e\0 \0F\0i\0l\0e\0 \03\0.\01\00\0\xa\0\xa\0 + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/PlayStation/PKG.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/PlayStation/PKG.xml new file mode 100644 index 00000000..37c87ca7 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/PlayStation/PKG.xml @@ -0,0 +1,26 @@ + + + + + + + + *.pkg + + + + 7F + PKG + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/PrincessWaltzARC.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/PrincessWaltzARC.xml new file mode 100644 index 00000000..04c424ef --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/FileSystem/PrincessWaltzARC.xml @@ -0,0 +1,20 @@ + + + + + + + + *.arc + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/UnrealPackage/UnrealPackage.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/UnrealPackage/UnrealPackage.xml new file mode 100644 index 00000000..c6d19597 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/UnrealPackage/UnrealPackage.xml @@ -0,0 +1,27 @@ + + + + + + + + *.u + *.utx + *.upk + + + + C1832A9E + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/UnrealPackage/UnrealUMOD.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/UnrealPackage/UnrealUMOD.xml new file mode 100644 index 00000000..0cd4abe5 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GameDeveloper/Associations/UnrealPackage/UnrealUMOD.xml @@ -0,0 +1,25 @@ + + + + + + + + *.umod + + + + A3C5E39F + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GraphicDesigner/Associations/Palette/Adobe/ACOColorPalette.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GraphicDesigner/Associations/Palette/Adobe/ACOColorPalette.xml new file mode 100644 index 00000000..06d440c0 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GraphicDesigner/Associations/Palette/Adobe/ACOColorPalette.xml @@ -0,0 +1,25 @@ + + + + + + + + *.aco + + + + GIMP Palette + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GraphicDesigner/Associations/Palette/Adobe/AdobeSwatchExchange.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GraphicDesigner/Associations/Palette/Adobe/AdobeSwatchExchange.xml new file mode 100644 index 00000000..6a019525 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GraphicDesigner/Associations/Palette/Adobe/AdobeSwatchExchange.xml @@ -0,0 +1,25 @@ + + + + + + + + *.ase + + + + ASEF + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GraphicDesigner/Associations/Palette/GIMPColorPalette.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GraphicDesigner/Associations/Palette/GIMPColorPalette.xml new file mode 100644 index 00000000..d96e084b --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GraphicDesigner/Associations/Palette/GIMPColorPalette.xml @@ -0,0 +1,25 @@ + + + + + + + + *.gpl + + + + GIMP Palette + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GraphicDesigner/Associations/Palette/JASCPaintShopPro.xml b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GraphicDesigner/Associations/Palette/JASCPaintShopPro.xml new file mode 100644 index 00000000..a2bd91e6 --- /dev/null +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/Extensions/GraphicDesigner/Associations/Palette/JASCPaintShopPro.xml @@ -0,0 +1,25 @@ + + + + + + + + *.pal + + + + JASC-PAL + + + + + + + + + + + + + \ No newline at end of file diff --git a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj index 28e19d7a..0b66991d 100644 --- a/CSharp/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj +++ b/CSharp/Content/UniversalEditor.Content.PlatformIndependent/UniversalEditor.Content.PlatformIndependent.csproj @@ -52,9 +52,29 @@ + + + + + + + + + + + + + + + + + + + + @@ -80,6 +100,12 @@ + + + + + + diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARC/ARCDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARC/ARCDataFormat.cs index 3fd8b65b..fbc76b0f 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARC/ARCDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARC/ARCDataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.FileSystem.ARC { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("SEA ARC archive", /* new byte?[][] { new byte?[] { 0x1A } }, */ new string[] { "*.arc" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARJ/ARJDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARJ/ARJDataFormat.cs index 5530ce07..7e597f3c 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARJ/ARJDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARJ/ARJDataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.FileSystem.ARJ { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Archive by Robert Jung", new byte?[][] { new byte?[] { 0x60, 0xEA } }, new string[] { "*.arj" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/AlienNations/GD/GDDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/AlienNations/GD/GDDataFormat.cs index b4b0e500..e1fc97cd 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/AlienNations/GD/GDDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/AlienNations/GD/GDDataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.FileSystem.AlienNations.GD { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Alien Nations GD archive", new string[] { "*.gd" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/CHD/CHDDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/CHD/CHDDataFormat.cs index 470dd77c..96dce585 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/CHD/CHDDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/CHD/CHDDataFormat.cs @@ -14,7 +14,6 @@ namespace UniversalEditor.DataFormats.FileSystem.CHD { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Compressed Hunks of Data", new byte?[][] { new byte?[] { (byte)'M', (byte)'C', (byte)'o', (byte)'m', (byte)'p', (byte)'r', (byte)'H', (byte)'D' } }, new string[] { "*.chd" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Dreamfall/PAKDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Dreamfall/PAKDataFormat.cs index 69b8d3e4..57889237 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Dreamfall/PAKDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Dreamfall/PAKDataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.FileSystem.Dreamfall { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Dreamfall PAK archive", new byte?[][] { new byte?[] { (byte)'t', (byte)'l', (byte)'j', (byte)'_', (byte)'p', (byte)'a', (byte)'c', (byte)'k', (byte)'0', (byte)'0', (byte)'0', (byte)'1' } }, new string[] { "*.pak" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Homeworld/HomeworldDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Homeworld/HomeworldDataFormat.cs index b33994e1..00198801 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Homeworld/HomeworldDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Homeworld/HomeworldDataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.FileSystem.Homeworld { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Homeworld VCE/WXD archive", new byte?[][] { new byte?[] { (byte)'V', (byte)'C', (byte)'E', (byte)'0' }, new byte?[] { (byte)'W', (byte)'X', (byte)'D', (byte)'1' } }, new string[] { "*.wxd", "*.vce" }); _dfr.ExportOptions.Add(new CustomOptionChoice("Version", "Format &version:", true, new CustomOptionFieldChoice("Version \"VCE0\"", (uint)0), new CustomOptionFieldChoice("Version \"WXD1\"", (uint)1) diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/JackOrlando/JackOrlandoDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/JackOrlando/JackOrlandoDataFormat.cs index 57016865..8ca04617 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/JackOrlando/JackOrlandoDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/JackOrlando/JackOrlandoDataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.FileSystem.JackOrlando { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Jack Orlando archive", new byte?[][] { new byte?[] { (byte)'P', (byte)'A', (byte)'K', (byte)0 } }, new string[] { "*.pak", "*.phk", "*.ph2" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/MementoMori/RESDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/MementoMori/RESDataFormat.cs index be8e3dd3..eaf42068 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/MementoMori/RESDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/MementoMori/RESDataFormat.cs @@ -15,16 +15,6 @@ namespace UniversalEditor.DataFormats.FileSystem.MementoMori { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Centauri Production / Memento Mori RES archive", new byte?[][] - { - new byte?[] { (byte)'C', 0, (byte)'e', 0, (byte)'n', 0, (byte)'t', 0, (byte)'a', 0, - (byte)'u', 0, (byte)'r', 0, (byte)'i', 0, (byte)' ', 0, (byte)'P', 0, (byte)'r', 0, - (byte)'o', 0, (byte)'d', 0, (byte)'u', 0, (byte)'c', 0, (byte)'t', 0, (byte)'i', 0, - (byte)'o', 0, (byte)'n', 0, (byte)' ', 0, (byte)'R', 0, (byte)'e', 0, (byte)'s', 0, - (byte)'o', 0, (byte)'u', 0, (byte)'r', 0, (byte)'c', 0, (byte)'e', 0, (byte)' ', 0, - (byte)'F', 0, (byte)'i', 0, (byte)'l', 0, (byte)'e', 0, (byte)' ', 0, (byte)'3', 0, - (byte)'.', 0, (byte)'1', 0, (byte)'0', 0, 0x0A, 0, 0x0A, 0 } - }, new string[] { "*.res" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PKG/PKGDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PKG/PKGDataFormat.cs index 915e0e3d..d1213eac 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PKG/PKGDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PKG/PKGDataFormat.cs @@ -13,7 +13,6 @@ namespace UniversalEditor.DataFormats.FileSystem.PKG { if (_dfr == null) _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("PlayStation Network package", new byte?[][] { new byte?[] { (byte)0x7F, (byte)'P', (byte)'K', (byte)'G' } }, new string[] { "*.pkg" }); _dfr.ExportOptions.Add(new CustomOptionText("GameName", "Game &name:")); return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PrincessWaltz/ARC/ARCDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PrincessWaltz/ARC/ARCDataFormat.cs index 11b97912..52688de8 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PrincessWaltz/ARC/ARCDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PrincessWaltz/ARC/ARCDataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.FileSystem.PrincessWaltz.ARC { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Princess Waltz ARC", new string[] { "*.arc" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/WAD/WADDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/WAD/WADDataFormat.cs index f63863cb..8ee85dc6 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/WAD/WADDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/WAD/WADDataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.FileSystem.WAD { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("DOOM WAD archive", new byte?[][] { new byte?[] { (byte)'I', (byte)'W', (byte)'A', (byte)'D' } }, new string[] { "*.wad" }); _dfr.ExportOptions.Add(new CustomOptionBoolean("UserContent", "This archive contains public content (PWAD) rather than internal content (IWAD)")); } return _dfr; diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/WinRAR/RARDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/WinRAR/RARDataFormat.cs index 2bc25d21..0d3e5c6a 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/WinRAR/RARDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/WinRAR/RARDataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.FileSystem.WinRAR { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Eugene Roshal WinRAR archive", new byte?[][] { new byte?[] { (byte)'R', (byte)'a', (byte)'r', (byte)'!' } }, new string[] { "*.rar" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/YZ1/YZ1DataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/YZ1/YZ1DataFormat.cs index 82d1aa34..f5fa292b 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/YZ1/YZ1DataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/YZ1/YZ1DataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.FileSystem.YZ1 { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Yamazaki ZIPPER/DeepFreezer archive", new byte?[][] { new byte?[] { (byte)'y', (byte)'z', (byte)'0', (byte)'1', (byte)'0', (byte)'6', (byte)'0', (byte)'0' } }, new string[] { "*.yz1" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/Adobe/ACODataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/Adobe/ACODataFormat.cs index d80d2cac..eb42cfb5 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/Adobe/ACODataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/Adobe/ACODataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.Multimedia.Palette.Adobe { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(PaletteObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Adobe color palette", new string[] { "*.aco" }); _dfr.Sources.Add("http://www.nomodes.com/aco.html"); _dfr.ExportOptions.Add(new CustomOptionNumber("Version", "&Version:", 1, 1, ushort.MaxValue)); } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/Adobe/ASEDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/Adobe/ASEDataFormat.cs index 34d31bd6..79602625 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/Adobe/ASEDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/Adobe/ASEDataFormat.cs @@ -18,7 +18,6 @@ namespace UniversalEditor.DataFormats.Multimedia.Palette.Adobe { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(PaletteObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Adobe Swatch Exchange color palette", new byte?[][] { new byte?[] { (byte)'A', (byte)'S', (byte)'E', (byte)'F' } }, new string[] { "*.ase" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/GIMP/GPLDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/GIMP/GPLDataFormat.cs index f742ac56..68e28e17 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/GIMP/GPLDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/GIMP/GPLDataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.Multimedia.Palette.GIMP { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(PaletteObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("GIMP color palette", new byte?[][] { new byte?[] { (byte)'G', (byte)'I', (byte)'M', (byte)'P', (byte)' ', (byte)'P', (byte)'a', (byte)'l', (byte)'e', (byte)'t', (byte)'t', (byte)'e' } }, new string[] { "*.gpl" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/PaintShop/PaintShopPaletteDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/PaintShop/PaintShopPaletteDataFormat.cs index bc381c17..49436717 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/PaintShop/PaintShopPaletteDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/PaintShop/PaintShopPaletteDataFormat.cs @@ -15,7 +15,6 @@ namespace UniversalEditor.DataFormats.Multimedia.Palette.PaintShop { _dfr = base.MakeReferenceInternal(); _dfr.Capabilities.Add(typeof(PaletteObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("JASC Paint Shop color palette", new byte?[][] { new byte?[] { (byte)'J', (byte)'A', (byte)'S', (byte)'C', (byte)'-', (byte)'P', (byte)'A', (byte)'L' } }, new string[] { "*.pal" }); } return _dfr; } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/ASXDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/ASXDataFormat.cs index 6525d62a..c235d0cb 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/ASXDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/ASXDataFormat.cs @@ -11,8 +11,6 @@ namespace UniversalEditor.DataFormats.Multimedia.Playlist { DataFormatReference dfr = base.MakeReferenceInternal(); dfr.Clear(); - - dfr.Filters.Add("Advanced Stream Redirector", new string[] { "*.asx" }); dfr.Capabilities.Add(typeof(PlaylistObjectModel), DataFormatCapabilities.All); dfr.ContentTypes.Add("video/x-ms-asf"); return dfr; diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/CDDA/CDDADataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/CDDA/CDDADataFormat.cs index 0c4e11cb..c4926c3a 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/CDDA/CDDADataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/CDDA/CDDADataFormat.cs @@ -16,8 +16,6 @@ namespace UniversalEditor.DataFormats.Multimedia.Playlist.CDDA { DataFormatReference dfr = base.MakeReferenceInternal(); dfr.Clear(); - - dfr.Filters.Add("Compact Disc Digital Audio", new byte?[][] { new byte?[] { new byte?(82), new byte?(73), new byte?(70), new byte?(70), null, null, null, null, new byte?(67), new byte?(68), new byte?(68), new byte?(65) } }, new string[] { "*.cda" }); dfr.Capabilities.Add(typeof(PlaylistObjectModel), DataFormatCapabilities.All); return dfr; } @@ -28,7 +26,7 @@ namespace UniversalEditor.DataFormats.Multimedia.Playlist.CDDA PlaylistObjectModel pom = objectModels.Pop() as PlaylistObjectModel; RIFFDataChunk fmtChunk = new RIFFDataChunk(); fmtChunk.ID = "fmt "; - Accessors.MemoryAccessor ms = new Accessors.MemoryAccessor(); + Accessors.MemoryAccessor ms = new Accessors.MemoryAccessor(); IO.Writer bw = new IO.Writer(ms); ushort CDAFileVersion = 1; ushort CDATrackNumber = 1; @@ -66,7 +64,7 @@ namespace UniversalEditor.DataFormats.Multimedia.Playlist.CDDA CDATrackLengthRBFMinute, CDATrackLengthRBFUnused }); - ms.Close(); + ms.Close(); fmtChunk.Data = ms.ToArray(); rom.Chunks.Add(fmtChunk); diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/HTMLPlaylistDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/HTMLPlaylistDataFormat.cs index 123f3f15..f23e644c 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/HTMLPlaylistDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/HTMLPlaylistDataFormat.cs @@ -11,8 +11,6 @@ namespace UniversalEditor.DataFormats.Multimedia.Playlist { DataFormatReference dfr = base.MakeReferenceInternal(); dfr.Clear(); - - dfr.Filters.Add("HTML playlist", new byte?[][] { new byte?[] { new byte?(60), new byte?(63), new byte?(120), new byte?(109), new byte?(108) } }, new string[] { "*.html" }); dfr.Capabilities.Add(typeof(MarkupObjectModel), DataFormatCapabilities.Bootstrap); dfr.Capabilities.Add(typeof(PlaylistObjectModel), DataFormatCapabilities.All); return dfr; @@ -38,15 +36,15 @@ namespace UniversalEditor.DataFormats.Multimedia.Playlist PlaylistObjectModel pom = objectModels.Pop() as PlaylistObjectModel; } - protected override void BeforeSaveInternal(Stack objectModels) - { - base.BeforeSaveInternal(objectModels); + protected override void BeforeSaveInternal(Stack objectModels) + { + base.BeforeSaveInternal(objectModels); - PlaylistObjectModel pom = (objectModels.Pop() as PlaylistObjectModel); - if (pom == null) throw new ObjectModelNotSupportedException(); + PlaylistObjectModel pom = (objectModels.Pop() as PlaylistObjectModel); + if (pom == null) throw new ObjectModelNotSupportedException(); - MarkupObjectModel mom = new MarkupObjectModel(); - objectModels.Push(mom); - } + MarkupObjectModel mom = new MarkupObjectModel(); + objectModels.Push(mom); + } } } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/NotepadPlusPlaylistDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/NotepadPlusPlaylistDataFormat.cs index f6f669bd..5953f73e 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/NotepadPlusPlaylistDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/NotepadPlusPlaylistDataFormat.cs @@ -10,7 +10,6 @@ namespace UniversalEditor.DataFormats.Multimedia.Playlist protected override DataFormatReference MakeReferenceInternal() { DataFormatReference dfr = base.MakeReferenceInternal(); - dfr.Filters.Add("Notepad++ session", new byte?[][] { new byte?[] { new byte?(60), new byte?(63), new byte?(120), new byte?(109), new byte?(108) } }, new string[] { "session.xml" }); dfr.Capabilities.Add(typeof(MarkupObjectModel), DataFormatCapabilities.Bootstrap); dfr.Capabilities.Add(typeof(PlaylistObjectModel), DataFormatCapabilities.All); return dfr; diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/PLSDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/PLSDataFormat.cs index 32321390..e07f6406 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/PLSDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/PLSDataFormat.cs @@ -11,7 +11,6 @@ namespace UniversalEditor.DataFormats.Multimedia.Playlist protected override DataFormatReference MakeReferenceInternal() { DataFormatReference dfr = new DataFormatReference(GetType()); - dfr.Filters.Add("PLS playlist", new byte?[][] { new byte?[] { (byte)'[', (byte)'p', (byte)'l', (byte)'a', (byte)'y', (byte)'l', (byte)'i', (byte)'s', (byte)'t' } }, new string[] { "*.pls" }); dfr.Capabilities.Add(typeof(PlaylistObjectModel), DataFormatCapabilities.All); dfr.ContentTypes.Add("audio/x-scpls"); return dfr; diff --git a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/SMILDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/SMILDataFormat.cs index c77c6776..54e52266 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/SMILDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Playlist/SMILDataFormat.cs @@ -14,7 +14,6 @@ namespace UniversalEditor.DataFormats.Multimedia.Playlist { DataFormatReference dfr = base.MakeReferenceInternal(); dfr.Clear(); - dfr.Filters.Add("SMIL/Windows Media/Zune playlist", new byte?[][] { new byte?[] { new byte?(60), new byte?(63), new byte?(119), new byte?(112), new byte?(108) }, new byte?[] { new byte?(60), new byte?(63), new byte?(122), new byte?(112), new byte?(108) }, new byte?[] { new byte?(60), new byte?(63), new byte?(120), new byte?(109), new byte?(108) } }, new string[] { "*.wpl", "*.zpl", "*.smil" }); dfr.Capabilities.Add(typeof(MarkupObjectModel), DataFormatCapabilities.Bootstrap); dfr.Capabilities.Add(typeof(PlaylistObjectModel), DataFormatCapabilities.All); dfr.ContentTypes.AddRange("application/smil+xml", "application/vnd.ms-wpl"); diff --git a/CSharp/Plugins/UniversalEditor.Plugins.UnrealEngine/DataFormats/UnrealEngine/Installer/UMODDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.UnrealEngine/DataFormats/UnrealEngine/Installer/UMODDataFormat.cs index b4b47c7c..4a0cbac3 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.UnrealEngine/DataFormats/UnrealEngine/Installer/UMODDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.UnrealEngine/DataFormats/UnrealEngine/Installer/UMODDataFormat.cs @@ -9,177 +9,175 @@ using UniversalEditor.Plugins.UnrealEngine; namespace UniversalEditor.DataFormats.UnrealEngine.Installer { - public class UMODDataFormat : DataFormat - { - private static DataFormatReference _dfr = null; - protected override DataFormatReference MakeReferenceInternal() - { - if (_dfr == null) - { - _dfr = base.MakeReferenceInternal(); - _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Unreal Tournament UMOD installer", new byte?[][] { new byte?[] { 0xA3, 0xC5, 0xE3, 0x9F } }, new string[] { "*.umod" }); - _dfr.Filters[0].MagicByteOffsets = new int[] { -20 }; + public class UMODDataFormat : DataFormat + { + private static DataFormatReference _dfr = null; + protected override DataFormatReference MakeReferenceInternal() + { + if (_dfr == null) + { + _dfr = base.MakeReferenceInternal(); + _dfr.Capabilities.Add(typeof(FileSystemObjectModel), DataFormatCapabilities.All); _dfr.Sources.Add("http://wiki.beyondunreal.com/Legacy:UMOD/File_Format"); - } - return _dfr; - } + } + return _dfr; + } - protected override void LoadInternal(ref ObjectModel objectModel) - { - Reader br = base.Accessor.Reader; - FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); + protected override void LoadInternal(ref ObjectModel objectModel) + { + Reader br = base.Accessor.Reader; + FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - // The UMOD file "header" is 20 bytes long. The header is stored in the last 20 bytes of - // the file (hence the quotes around the term "header"). - br.Accessor.Seek(-20, SeekOrigin.End); + // The UMOD file "header" is 20 bytes long. The header is stored in the last 20 bytes of + // the file (hence the quotes around the term "header"). + br.Accessor.Seek(-20, SeekOrigin.End); - // Magic number. Used to verify this file as a UMOD installer. Always 0x9FE3C5A3. - uint magic = br.ReadUInt32(); - if (magic != 0x9FE3C5A3) throw new InvalidDataFormatException("Footer does not begin with 0x9FE3C5A3"); + // Magic number. Used to verify this file as a UMOD installer. Always 0x9FE3C5A3. + uint magic = br.ReadUInt32(); + if (magic != 0x9FE3C5A3) throw new InvalidDataFormatException("Footer does not begin with 0x9FE3C5A3"); - // Byte offset of file directory in the UMOD file. (See below.) - uint fileDirectoryOffset = br.ReadUInt32(); + // Byte offset of file directory in the UMOD file. (See below.) + uint fileDirectoryOffset = br.ReadUInt32(); - // Total byte size of the UMOD file. - uint fileSize = br.ReadUInt32(); + // Total byte size of the UMOD file. + uint fileSize = br.ReadUInt32(); - // UMOD file version. - uint formatVersion = br.ReadUInt32(); + // UMOD file version. + uint formatVersion = br.ReadUInt32(); - // CRC32 checksum over the file content. - uint checksum = br.ReadUInt32(); + // CRC32 checksum over the file content. + uint checksum = br.ReadUInt32(); - // The file directory describes the files stored in the first part of the UMOD file. Its - // byte offset in the UMOD file is given in the file "header" (see above). - br.Accessor.Seek(fileDirectoryOffset, SeekOrigin.Begin); + // The file directory describes the files stored in the first part of the UMOD file. Its + // byte offset in the UMOD file is given in the file "header" (see above). + br.Accessor.Seek(fileDirectoryOffset, SeekOrigin.Begin); - // The directory consists of an index-type file count (the index data type is described - // below), followed by variable-size records, each describing one file in the UMOD - // installer. - int fileCount = br.ReadINDEX(); + // The directory consists of an index-type file count (the index data type is described + // below), followed by variable-size records, each describing one file in the UMOD + // installer. + int fileCount = br.ReadINDEX(); - for (int i = 0; i < fileCount; i++) - { - // Length of file name (including trailing null byte). - int fileNameLength = br.ReadINDEX(); + for (int i = 0; i < fileCount; i++) + { + // Length of file name (including trailing null byte). + int fileNameLength = br.ReadINDEX(); - // File name, with trailing null byte. - string fileName = br.ReadNullTerminatedString(); + // File name, with trailing null byte. + string fileName = br.ReadNullTerminatedString(); - // Byte offset of file in UMOD file. - uint offset = br.ReadUInt32(); - // Byte length of file. - uint length = br.ReadUInt32(); + // Byte offset of file in UMOD file. + uint offset = br.ReadUInt32(); + // Byte length of file. + uint length = br.ReadUInt32(); - // Bit field describing file flags. + // Bit field describing file flags. - // Mychaeel: Feel free to investigate and contribute information about the file flags. - // (I know that they have to be set to 0x03 for Manifest.ini and Manifest.int to - // prevent those files from being copied to the user's System directory, and set to - // 0x00 for all other files.) - UMODFileFlags flags = (UMODFileFlags)br.ReadUInt32(); + // Mychaeel: Feel free to investigate and contribute information about the file flags. + // (I know that they have to be set to 0x03 for Manifest.ini and Manifest.int to + // prevent those files from being copied to the user's System directory, and set to + // 0x00 for all other files.) + UMODFileFlags flags = (UMODFileFlags)br.ReadUInt32(); - File file = new File(); - file.Name = fileName; - file.Size = length; - file.Properties.Add("offset", offset); - file.Properties.Add("length", length); - fsom.Files.Add(file); - } - } + File file = new File(); + file.Name = fileName; + file.Size = length; + file.Properties.Add("offset", offset); + file.Properties.Add("length", length); + fsom.Files.Add(file); + } + } - protected override void SaveInternal(ObjectModel objectModel) - { - FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - Writer bw = null; + protected override void SaveInternal(ObjectModel objectModel) + { + FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); + Writer bw = null; - #region File data - MemoryAccessor msData = new MemoryAccessor(); - bw = new Writer(msData); - foreach (File file in fsom.Files) - { - bw.WriteBytes(file.GetDataAsByteArray()); - } - bw.Close(); + #region File data + MemoryAccessor msData = new MemoryAccessor(); + bw = new Writer(msData); + foreach (File file in fsom.Files) + { + bw.WriteBytes(file.GetDataAsByteArray()); + } + bw.Close(); - byte[] data = msData.ToArray(); - #endregion - #region File records - uint fileOffset = 0; + byte[] data = msData.ToArray(); + #endregion + #region File records + uint fileOffset = 0; MemoryAccessor msDirectory = new MemoryAccessor(); - bw = new Writer(msDirectory); - // The directory consists of an index-type file count (the index data type is described - // below), followed by variable-size records, each describing one file in the UMOD - // installer. - bw.WriteINDEX(fsom.Files.Count); - foreach (File file in fsom.Files) - { - // Length of file name (including trailing null byte). - bw.WriteINDEX(file.Name.Length); + bw = new Writer(msDirectory); + // The directory consists of an index-type file count (the index data type is described + // below), followed by variable-size records, each describing one file in the UMOD + // installer. + bw.WriteINDEX(fsom.Files.Count); + foreach (File file in fsom.Files) + { + // Length of file name (including trailing null byte). + bw.WriteINDEX(file.Name.Length); - // File name, with trailing null byte. - bw.WriteNullTerminatedString(file.Name); + // File name, with trailing null byte. + bw.WriteNullTerminatedString(file.Name); - // Byte offset of file in UMOD file. - bw.WriteUInt32(fileOffset); - // Byte length of file. - bw.WriteUInt32((uint)file.Size); + // Byte offset of file in UMOD file. + bw.WriteUInt32(fileOffset); + // Byte length of file. + bw.WriteUInt32((uint)file.Size); - // Bit field describing file flags. + // Bit field describing file flags. - // Mychaeel: Feel free to investigate and contribute information about the file flags. - // (I know that they have to be set to 0x03 for Manifest.ini and Manifest.int to - // prevent those files from being copied to the user's System directory, and set to - // 0x00 for all other files.) - UMODFileFlags flags = UMODFileFlags.None; - bw.WriteUInt32((uint)flags); - fileOffset += (uint)file.Size; - } - bw.Close(); + // Mychaeel: Feel free to investigate and contribute information about the file flags. + // (I know that they have to be set to 0x03 for Manifest.ini and Manifest.int to + // prevent those files from being copied to the user's System directory, and set to + // 0x00 for all other files.) + UMODFileFlags flags = UMODFileFlags.None; + bw.WriteUInt32((uint)flags); + fileOffset += (uint)file.Size; + } + bw.Close(); - byte[] directoryData = msDirectory.ToArray(); - #endregion - #region Header data - // The UMOD file "header" is 20 bytes long. The header is stored in the last 20 bytes of - // the file (hence the quotes around the term "header"). - MemoryAccessor msHeader = new MemoryAccessor(); - bw = new Writer(msHeader); + byte[] directoryData = msDirectory.ToArray(); + #endregion + #region Header data + // The UMOD file "header" is 20 bytes long. The header is stored in the last 20 bytes of + // the file (hence the quotes around the term "header"). + MemoryAccessor msHeader = new MemoryAccessor(); + bw = new Writer(msHeader); - // Magic number. Used to verify this file as a UMOD installer. Always 0x9FE3C5A3. - bw.WriteUInt32((uint)0x9FE3C5A3); + // Magic number. Used to verify this file as a UMOD installer. Always 0x9FE3C5A3. + bw.WriteUInt32((uint)0x9FE3C5A3); - // Byte offset of file directory in the UMOD file. (See below.) - uint fileDirectoryOffset = (uint)data.Length; - bw.WriteUInt32(fileDirectoryOffset); + // Byte offset of file directory in the UMOD file. (See below.) + uint fileDirectoryOffset = (uint)data.Length; + bw.WriteUInt32(fileDirectoryOffset); - // Total byte size of the UMOD file. - uint fileSize = 20; - bw.WriteUInt32(fileSize); + // Total byte size of the UMOD file. + uint fileSize = 20; + bw.WriteUInt32(fileSize); - // UMOD file version. - uint formatVersion = 0; - bw.WriteUInt32(formatVersion); + // UMOD file version. + uint formatVersion = 0; + bw.WriteUInt32(formatVersion); - // CRC32 checksum over the file content. - uint checksum = 0; - bw.WriteUInt32(checksum); + // CRC32 checksum over the file content. + uint checksum = 0; + bw.WriteUInt32(checksum); - bw.Flush(); - bw.Close(); + bw.Flush(); + bw.Close(); - byte[] headerData = msHeader.ToArray(); - #endregion + byte[] headerData = msHeader.ToArray(); + #endregion - bw = base.Accessor.Writer; + bw = base.Accessor.Writer; - bw.WriteBytes(data); - bw.WriteBytes(directoryData); - bw.WriteBytes(headerData); - bw.Flush(); - } - } + bw.WriteBytes(data); + bw.WriteBytes(directoryData); + bw.WriteBytes(headerData); + bw.Flush(); + } + } } diff --git a/CSharp/Plugins/UniversalEditor.Plugins.UnrealEngine/DataFormats/UnrealEngine/Package/UnrealPackageDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.UnrealEngine/DataFormats/UnrealEngine/Package/UnrealPackageDataFormat.cs index 7e105dbf..244b2944 100644 --- a/CSharp/Plugins/UniversalEditor.Plugins.UnrealEngine/DataFormats/UnrealEngine/Package/UnrealPackageDataFormat.cs +++ b/CSharp/Plugins/UniversalEditor.Plugins.UnrealEngine/DataFormats/UnrealEngine/Package/UnrealPackageDataFormat.cs @@ -8,224 +8,223 @@ using UniversalEditor.Plugins.UnrealEngine; namespace UniversalEditor.DataFormats.UnrealEngine.Package { - public class UnrealPackageDataFormat : DataFormat - { - private static DataFormatReference _dfr = null; - protected override DataFormatReference MakeReferenceInternal() - { - if (_dfr == null) - { - _dfr = base.MakeReferenceInternal(); - _dfr.Capabilities.Add(typeof(UnrealPackageObjectModel), DataFormatCapabilities.All); - _dfr.Filters.Add("Unreal Engine package", new byte?[][] { new byte?[] { 0xC1, 0x83, 0x2A, 0x9E } }, new string[] { "*.u", "*.utx", "*.upk" }); - _dfr.ExportOptions.Add(new CustomOptionText("PackageName", "Package &name:")); - _dfr.ExportOptions.Add(new CustomOptionNumber("PackageVersion", "Package &version:", 0, UInt16.MinValue, UInt16.MaxValue)); + public class UnrealPackageDataFormat : DataFormat + { + private static DataFormatReference _dfr = null; + protected override DataFormatReference MakeReferenceInternal() + { + if (_dfr == null) + { + _dfr = base.MakeReferenceInternal(); + _dfr.Capabilities.Add(typeof(UnrealPackageObjectModel), DataFormatCapabilities.All); + _dfr.ExportOptions.Add(new CustomOptionText("PackageName", "Package &name:")); + _dfr.ExportOptions.Add(new CustomOptionNumber("PackageVersion", "Package &version:", 0, UInt16.MinValue, UInt16.MaxValue)); _dfr.Sources.Add("http://wiki.beyondunreal.com/Legacy:Package_File_Format"); - } - return _dfr; - } + } + return _dfr; + } - private ushort mvarPackageVersion = 0; - /// - /// Version of the file-format; Unreal1 uses mostly 61-63, UT 67-69; However, note that - /// quite a few packages are in use with UT that have Unreal1 versions. - /// - public ushort PackageVersion { get { return mvarPackageVersion; } set { mvarPackageVersion = value; } } - - private string mvarPackageName = String.Empty; - public string PackageName { get { return mvarPackageName; } set { mvarPackageName = value; } } + private ushort mvarPackageVersion = 0; + /// + /// Version of the file-format; Unreal1 uses mostly 61-63, UT 67-69; However, note that + /// quite a few packages are in use with UT that have Unreal1 versions. + /// + public ushort PackageVersion { get { return mvarPackageVersion; } set { mvarPackageVersion = value; } } + + private string mvarPackageName = String.Empty; + public string PackageName { get { return mvarPackageName; } set { mvarPackageName = value; } } - protected override void LoadInternal(ref ObjectModel objectModel) - { - Reader br = base.Accessor.Reader; - - UnrealPackageObjectModel upk = (objectModel as UnrealPackageObjectModel); - #region Header + protected override void LoadInternal(ref ObjectModel objectModel) + { + Reader br = base.Accessor.Reader; + + UnrealPackageObjectModel upk = (objectModel as UnrealPackageObjectModel); + #region Header - // Always "0x9E2A83C1"; use this to verify that you indeed try to read an Unreal-Package - uint signature = br.ReadUInt32(); - if (signature != 0x9E2A83C1) throw new InvalidDataFormatException("File does not begin with 0x9E2A83C1"); + // Always "0x9E2A83C1"; use this to verify that you indeed try to read an Unreal-Package + uint signature = br.ReadUInt32(); + if (signature != 0x9E2A83C1) throw new InvalidDataFormatException("File does not begin with 0x9E2A83C1"); - mvarPackageVersion = br.ReadUInt16(); - upk.LicenseeNumber = br.ReadUInt16(); - upk.PackageFlags = (PackageFlags)br.ReadUInt32(); // 1949392 + mvarPackageVersion = br.ReadUInt16(); + upk.LicenseeNumber = br.ReadUInt16(); + upk.PackageFlags = (PackageFlags)br.ReadUInt32(); // 1949392 - if (mvarPackageVersion >= 512) - { - uint valueLength = br.ReadUInt32(); - mvarPackageName = br.ReadFixedLengthString(valueLength); - mvarPackageName = mvarPackageName.TrimNull(); + if (mvarPackageVersion >= 512) + { + uint valueLength = br.ReadUInt32(); + mvarPackageName = br.ReadFixedLengthString(valueLength); + mvarPackageName = mvarPackageName.TrimNull(); - uint unknown1 = br.ReadUInt32(); - uint unknown2 = br.ReadUInt32(); - } + uint unknown1 = br.ReadUInt32(); + uint unknown2 = br.ReadUInt32(); + } - // Number of entries in name-table - uint nameTableEntryCount = br.ReadUInt32(); - // Offset of name-table within the file - uint nameTableOffset = br.ReadUInt32(); + // Number of entries in name-table + uint nameTableEntryCount = br.ReadUInt32(); + // Offset of name-table within the file + uint nameTableOffset = br.ReadUInt32(); - // Number of entries in export-table - uint exportTableEntryCount = br.ReadUInt32(); - // Offset of export-table within the file - uint exportTableOffset = br.ReadUInt32(); + // Number of entries in export-table + uint exportTableEntryCount = br.ReadUInt32(); + // Offset of export-table within the file + uint exportTableOffset = br.ReadUInt32(); - // Number of entries in import-table - uint importTableEntryCount = br.ReadUInt32(); - // Offset of import-table within the file - uint importTableOffset = br.ReadUInt32(); + // Number of entries in import-table + uint importTableEntryCount = br.ReadUInt32(); + // Offset of import-table within the file + uint importTableOffset = br.ReadUInt32(); - // After the ImportOffset, the header differs between the versions. The only interesting - // fact, though, is that for fileformat versions => 68, a GUID has been introduced. It can - // be found right after the ImportOffset: - if (mvarPackageVersion < 68) - { - // number of values in the Heritage Table - uint heritageTableEntryCount = br.ReadUInt32(); - // offset of the Heritage Table from the beginning of the file - uint heritageTableOffset = br.ReadUInt32(); + // After the ImportOffset, the header differs between the versions. The only interesting + // fact, though, is that for fileformat versions => 68, a GUID has been introduced. It can + // be found right after the ImportOffset: + if (mvarPackageVersion < 68) + { + // number of values in the Heritage Table + uint heritageTableEntryCount = br.ReadUInt32(); + // offset of the Heritage Table from the beginning of the file + uint heritageTableOffset = br.ReadUInt32(); - long pos = br.Accessor.Position; - br.Accessor.Position = heritageTableOffset; + long pos = br.Accessor.Position; + br.Accessor.Position = heritageTableOffset; - for (uint i = 0; i < heritageTableEntryCount; i++) - { - upk.PackageGUIDs.Add(br.ReadGuid()); - } + for (uint i = 0; i < heritageTableEntryCount; i++) + { + upk.PackageGUIDs.Add(br.ReadGuid()); + } - br.Accessor.Position = pos; - } - else if (mvarPackageVersion >= 68) - { - upk.PackageGUIDs.Add(br.ReadGuid()); + br.Accessor.Position = pos; + } + else if (mvarPackageVersion >= 68) + { + upk.PackageGUIDs.Add(br.ReadGuid()); - if (mvarPackageVersion < 512) - { - uint generationCount = br.ReadUInt32(); - for (uint i = 0; i < generationCount; i++) - { - Generation generation = new Generation(); - generation.ExportCount = br.ReadUInt32(); - generation.NameCount = br.ReadUInt32(); - upk.Generations.Add(generation); - } - } - } + if (mvarPackageVersion < 512) + { + uint generationCount = br.ReadUInt32(); + for (uint i = 0; i < generationCount; i++) + { + Generation generation = new Generation(); + generation.ExportCount = br.ReadUInt32(); + generation.NameCount = br.ReadUInt32(); + upk.Generations.Add(generation); + } + } + } - #endregion + #endregion - #region Name table - { - // The Unreal-Engine introduces two new variable-types. The first one is a rather simple - // string type, called NAME from now on. The second one is a bit more tricky, these - // CompactIndices, or INDEX later on, compresses ordinary DWORDs downto one to five BYTEs. + #region Name table + { + // The Unreal-Engine introduces two new variable-types. The first one is a rather simple + // string type, called NAME from now on. The second one is a bit more tricky, these + // CompactIndices, or INDEX later on, compresses ordinary DWORDs downto one to five BYTEs. - // The first and most simple one of the three tables is the name-table. The name-table can - // be considered an index of all unique names used for objects and references within the - // file. Later on, you'll often find indexes into this table instead of a string - // containing the object-name. - br.Accessor.Position = nameTableOffset; - for (uint i = 0; i < nameTableEntryCount; i++) - { - string name = br.ReadNAME(mvarPackageVersion); - if (mvarPackageVersion >= 512) - { - uint unknown = br.ReadUInt32(); - } - NameTableEntryFlags flags = (NameTableEntryFlags)br.ReadInt32(); - upk.NameTableEntries.Add(name, flags); - } - } - #endregion + // The first and most simple one of the three tables is the name-table. The name-table can + // be considered an index of all unique names used for objects and references within the + // file. Later on, you'll often find indexes into this table instead of a string + // containing the object-name. + br.Accessor.Position = nameTableOffset; + for (uint i = 0; i < nameTableEntryCount; i++) + { + string name = br.ReadNAME(mvarPackageVersion); + if (mvarPackageVersion >= 512) + { + uint unknown = br.ReadUInt32(); + } + NameTableEntryFlags flags = (NameTableEntryFlags)br.ReadInt32(); + upk.NameTableEntries.Add(name, flags); + } + } + #endregion - #region Export table - { - // The export-table is an index for all objects within the package. Every object in - // the body of the file has a corresponding entry in this table, with information like - // offset within the file etc. - br.Accessor.Position = exportTableOffset; - for (uint i = 0; i < exportTableEntryCount; i++) - { - ExportTableEntry entry = new ExportTableEntry(); + #region Export table + { + // The export-table is an index for all objects within the package. Every object in + // the body of the file has a corresponding entry in this table, with information like + // offset within the file etc. + br.Accessor.Position = exportTableOffset; + for (uint i = 0; i < exportTableEntryCount; i++) + { + ExportTableEntry entry = new ExportTableEntry(); - // Class of the object, i.e. "Texture" or "Palette" etc; stored as a - // ObjectReference - int classIndex = br.ReadINDEX(); - if (classIndex != 0) entry.ObjectClass = new ObjectReference(classIndex, upk); + // Class of the object, i.e. "Texture" or "Palette" etc; stored as a + // ObjectReference + int classIndex = br.ReadINDEX(); + if (classIndex != 0) entry.ObjectClass = new ObjectReference(classIndex, upk); - // Object Parent; again a ObjectReference - int objectParentIndex = br.ReadINDEX(); - if (objectParentIndex != 0) entry.ObjectParent = new ObjectReference(objectParentIndex, upk); + // Object Parent; again a ObjectReference + int objectParentIndex = br.ReadINDEX(); + if (objectParentIndex != 0) entry.ObjectParent = new ObjectReference(objectParentIndex, upk); - // Internal package/group of the object, i.e. ‘Floor’ for floor-textures; - // ObjectReference - int groupIndex = br.ReadInt32(); - if (groupIndex != 0) entry.Group = new ObjectReference(groupIndex, upk); + // Internal package/group of the object, i.e. ‘Floor’ for floor-textures; + // ObjectReference + int groupIndex = br.ReadInt32(); + if (groupIndex != 0) entry.Group = new ObjectReference(groupIndex, upk); - // The name of the object; an index into the name-table - int objectNameIndex = br.ReadINDEX(); - if (objectNameIndex >= 0 && objectNameIndex < upk.NameTableEntries.Count) - { - entry.Name = upk.NameTableEntries[objectNameIndex]; - } + // The name of the object; an index into the name-table + int objectNameIndex = br.ReadINDEX(); + if (objectNameIndex >= 0 && objectNameIndex < upk.NameTableEntries.Count) + { + entry.Name = upk.NameTableEntries[objectNameIndex]; + } - // Flags for the object; described in the appendix - entry.Flags = (ObjectFlags)br.ReadInt32(); + // Flags for the object; described in the appendix + entry.Flags = (ObjectFlags)br.ReadInt32(); - // Total size of the object - entry.Size = br.ReadINDEX(); + // Total size of the object + entry.Size = br.ReadINDEX(); entry.DataRequest += entry_DataRequest; - if (entry.Size != 0) - { - // Offset of the object; this field only exists if the SerialSize is larger 0 - entry.Offset = br.ReadINDEX(); - } - upk.ExportTableEntries.Add(entry); - } - } - #endregion + if (entry.Size != 0) + { + // Offset of the object; this field only exists if the SerialSize is larger 0 + entry.Offset = br.ReadINDEX(); + } + upk.ExportTableEntries.Add(entry); + } + } + #endregion - #region Import table - { - br.Accessor.Position = importTableOffset; - for (uint i = 0; i < importTableEntryCount; i++) - { - // The third table holds references to objects in external packages. For example, a - // texture might have a DetailTexture (which makes for the nice structure if have a - // very close look at a texture). Now, these DetailTextures are all stored in a - // single package (as they are used by many different textures in different package - // files). The property of the texture object only needs to store an index into the - // import-table then as the entry in the import-table already points to the - // DetailTexture in the other package. - ImportTableEntry entry = new ImportTableEntry(); + #region Import table + { + br.Accessor.Position = importTableOffset; + for (uint i = 0; i < importTableEntryCount; i++) + { + // The third table holds references to objects in external packages. For example, a + // texture might have a DetailTexture (which makes for the nice structure if have a + // very close look at a texture). Now, these DetailTextures are all stored in a + // single package (as they are used by many different textures in different package + // files). The property of the texture object only needs to store an index into the + // import-table then as the entry in the import-table already points to the + // DetailTexture in the other package. + ImportTableEntry entry = new ImportTableEntry(); - int classPackageIndex = br.ReadINDEX(); - if (classPackageIndex >= 0 && classPackageIndex < upk.NameTableEntries.Count) - { - entry.PackageName = upk.NameTableEntries[classPackageIndex]; - } + int classPackageIndex = br.ReadINDEX(); + if (classPackageIndex >= 0 && classPackageIndex < upk.NameTableEntries.Count) + { + entry.PackageName = upk.NameTableEntries[classPackageIndex]; + } - int classNameIndex = br.ReadINDEX(); - if (classNameIndex >= 0 && classNameIndex < upk.NameTableEntries.Count) - { - entry.ClassName = upk.NameTableEntries[classNameIndex]; - } + int classNameIndex = br.ReadINDEX(); + if (classNameIndex >= 0 && classNameIndex < upk.NameTableEntries.Count) + { + entry.ClassName = upk.NameTableEntries[classNameIndex]; + } - int packageReference = br.ReadInt32(); - entry.Package = new ObjectReference(packageReference, upk); + int packageReference = br.ReadInt32(); + entry.Package = new ObjectReference(packageReference, upk); - int objectNameIndex = br.ReadINDEX(); - if (objectNameIndex >= 0 && objectNameIndex < upk.NameTableEntries.Count) - { - entry.ObjectName = upk.NameTableEntries[objectNameIndex]; - } - upk.ImportTableEntries.Add(entry); - } - } - #endregion - } + int objectNameIndex = br.ReadINDEX(); + if (objectNameIndex >= 0 && objectNameIndex < upk.NameTableEntries.Count) + { + entry.ObjectName = upk.NameTableEntries[objectNameIndex]; + } + upk.ImportTableEntries.Add(entry); + } + } + #endregion + } private void entry_DataRequest(object sender, ObjectModels.FileSystem.DataRequestEventArgs e) { @@ -234,203 +233,203 @@ namespace UniversalEditor.DataFormats.UnrealEngine.Package e.Data = base.Accessor.Reader.ReadBytes(entry.Size); } - protected override void SaveInternal(ObjectModel objectModel) - { - Writer bw = base.Accessor.Writer; - - UnrealPackageObjectModel upk = (objectModel as UnrealPackageObjectModel); - #region Header + protected override void SaveInternal(ObjectModel objectModel) + { + Writer bw = base.Accessor.Writer; + + UnrealPackageObjectModel upk = (objectModel as UnrealPackageObjectModel); + #region Header - // Always "0x9E2A83C1"; use this to verify that you indeed try to read an Unreal-Package - bw.WriteUInt32((uint)0x9E2A83C1); - - bw.WriteUInt16(mvarPackageVersion); - bw.WriteUInt16(upk.LicenseeNumber); - bw.WriteUInt32((uint)upk.PackageFlags); // 1949392 + // Always "0x9E2A83C1"; use this to verify that you indeed try to read an Unreal-Package + bw.WriteUInt32((uint)0x9E2A83C1); + + bw.WriteUInt16(mvarPackageVersion); + bw.WriteUInt16(upk.LicenseeNumber); + bw.WriteUInt32((uint)upk.PackageFlags); // 1949392 - if (mvarPackageVersion >= 512) - { - bw.WriteUInt32((uint)mvarPackageName.Length); - bw.WriteFixedLengthString(mvarPackageName); - - uint unknown1 = 0; - bw.WriteUInt32(unknown1); - - uint unknown2 = 0; - bw.WriteUInt32(unknown2); - } + if (mvarPackageVersion >= 512) + { + bw.WriteUInt32((uint)mvarPackageName.Length); + bw.WriteFixedLengthString(mvarPackageName); + + uint unknown1 = 0; + bw.WriteUInt32(unknown1); + + uint unknown2 = 0; + bw.WriteUInt32(unknown2); + } - // Number of entries in name-table - bw.WriteUInt32((uint)upk.NameTableEntries.Count); - // Offset of name-table within the file - uint nameTableOffset = 0; - bw.WriteUInt32(nameTableOffset); + // Number of entries in name-table + bw.WriteUInt32((uint)upk.NameTableEntries.Count); + // Offset of name-table within the file + uint nameTableOffset = 0; + bw.WriteUInt32(nameTableOffset); - // Number of entries in export-table - bw.WriteUInt32((uint)upk.ExportTableEntries.Count); - // Offset of export-table within the file - uint exportTableOffset = 0; - bw.WriteUInt32(exportTableOffset); + // Number of entries in export-table + bw.WriteUInt32((uint)upk.ExportTableEntries.Count); + // Offset of export-table within the file + uint exportTableOffset = 0; + bw.WriteUInt32(exportTableOffset); - // Number of entries in import-table - bw.WriteUInt32((uint)upk.ImportTableEntries.Count); - // Offset of import-table within the file - uint importTableOffset = 0; - bw.WriteUInt32(importTableOffset); + // Number of entries in import-table + bw.WriteUInt32((uint)upk.ImportTableEntries.Count); + // Offset of import-table within the file + uint importTableOffset = 0; + bw.WriteUInt32(importTableOffset); - // After the ImportOffset, the header differs between the versions. The only interesting - // fact, though, is that for fileformat versions => 68, a GUID has been introduced. It can - // be found right after the ImportOffset: - if (mvarPackageVersion < 68) - { - // number of values in the Heritage Table - bw.WriteUInt32((uint)upk.PackageGUIDs.Count); - // offset of the Heritage Table from the beginning of the file - uint heritageTableOffset = 0; - bw.WriteUInt32(heritageTableOffset); + // After the ImportOffset, the header differs between the versions. The only interesting + // fact, though, is that for fileformat versions => 68, a GUID has been introduced. It can + // be found right after the ImportOffset: + if (mvarPackageVersion < 68) + { + // number of values in the Heritage Table + bw.WriteUInt32((uint)upk.PackageGUIDs.Count); + // offset of the Heritage Table from the beginning of the file + uint heritageTableOffset = 0; + bw.WriteUInt32(heritageTableOffset); - // TODO: navigate to the heritageTableOffset to write the data - for (uint i = 0; i < (uint)upk.PackageGUIDs.Count; i++) - { - bw.WriteGuid(upk.PackageGUIDs[(int)i]); - } - } - else if (mvarPackageVersion >= 68) - { - if (upk.PackageGUIDs.Count > 0) - { - bw.WriteGuid(upk.PackageGUIDs[0]); - } - else - { - Guid guid = Guid.NewGuid(); - upk.PackageGUIDs.Add(guid); - bw.WriteGuid(guid); - } - - if (mvarPackageVersion < 512) - { - bw.WriteUInt32((uint)upk.Generations.Count); - for (uint i = 0; i < upk.Generations.Count; i++) - { - Generation generation = upk.Generations[(int)i]; - bw.WriteUInt32(generation.ExportCount); - bw.WriteUInt32(generation.NameCount); - } - } - } + // TODO: navigate to the heritageTableOffset to write the data + for (uint i = 0; i < (uint)upk.PackageGUIDs.Count; i++) + { + bw.WriteGuid(upk.PackageGUIDs[(int)i]); + } + } + else if (mvarPackageVersion >= 68) + { + if (upk.PackageGUIDs.Count > 0) + { + bw.WriteGuid(upk.PackageGUIDs[0]); + } + else + { + Guid guid = Guid.NewGuid(); + upk.PackageGUIDs.Add(guid); + bw.WriteGuid(guid); + } + + if (mvarPackageVersion < 512) + { + bw.WriteUInt32((uint)upk.Generations.Count); + for (uint i = 0; i < upk.Generations.Count; i++) + { + Generation generation = upk.Generations[(int)i]; + bw.WriteUInt32(generation.ExportCount); + bw.WriteUInt32(generation.NameCount); + } + } + } - #endregion + #endregion - #region Name table - { - // The Unreal-Engine introduces two new variable-types. The first one is a rather simple - // string type, called NAME from now on. The second one is a bit more tricky, these - // CompactIndices, or INDEX later on, compresses ordinary DWORDs downto one to five BYTEs. + #region Name table + { + // The Unreal-Engine introduces two new variable-types. The first one is a rather simple + // string type, called NAME from now on. The second one is a bit more tricky, these + // CompactIndices, or INDEX later on, compresses ordinary DWORDs downto one to five BYTEs. - // The first and most simple one of the three tables is the name-table. The name-table can - // be considered an index of all unique names used for objects and references within the - // file. Later on, you'll often find indexes into this table instead of a string - // containing the object-name. - - // TODO: navigate to the name table offset - // br.BaseStream.Position = nameTableOffset; - for (uint i = 0; i < upk.NameTableEntries.Count; i++) - { - bw.WriteNAME(upk.NameTableEntries[(int)i].Name, mvarPackageVersion); - if (mvarPackageVersion >= 512) - { - uint unknown = 0; - bw.WriteUInt32(unknown); - } - bw.WriteInt32((int)upk.NameTableEntries[(int)i].Flags); - } - } - #endregion + // The first and most simple one of the three tables is the name-table. The name-table can + // be considered an index of all unique names used for objects and references within the + // file. Later on, you'll often find indexes into this table instead of a string + // containing the object-name. + + // TODO: navigate to the name table offset + // br.BaseStream.Position = nameTableOffset; + for (uint i = 0; i < upk.NameTableEntries.Count; i++) + { + bw.WriteNAME(upk.NameTableEntries[(int)i].Name, mvarPackageVersion); + if (mvarPackageVersion >= 512) + { + uint unknown = 0; + bw.WriteUInt32(unknown); + } + bw.WriteInt32((int)upk.NameTableEntries[(int)i].Flags); + } + } + #endregion - #region Export table - { - // The export-table is an index for all objects within the package. Every object in - // the body of the file has a corresponding entry in this table, with information like - // offset within the file etc. - // br.BaseStream.Position = exportTableOffset; - // TODO: navigate to export table offset - - for (uint i = 0; i < upk.ExportTableEntries.Count; i++) - { - ExportTableEntry entry = upk.ExportTableEntries[(int)i]; + #region Export table + { + // The export-table is an index for all objects within the package. Every object in + // the body of the file has a corresponding entry in this table, with information like + // offset within the file etc. + // br.BaseStream.Position = exportTableOffset; + // TODO: navigate to export table offset + + for (uint i = 0; i < upk.ExportTableEntries.Count; i++) + { + ExportTableEntry entry = upk.ExportTableEntries[(int)i]; - // Class of the object, i.e. "Texture" or "Palette" etc; stored as a - // ObjectReference - if (entry.ObjectClass != null) - { - bw.WriteINDEX(entry.ObjectClass.IndexValue); - } - else - { - bw.WriteINDEX(0); - } + // Class of the object, i.e. "Texture" or "Palette" etc; stored as a + // ObjectReference + if (entry.ObjectClass != null) + { + bw.WriteINDEX(entry.ObjectClass.IndexValue); + } + else + { + bw.WriteINDEX(0); + } - // Object Parent; again a ObjectReference - if (entry.ObjectParent != null) - { - bw.WriteINDEX(entry.ObjectParent.IndexValue); - } - else - { - bw.WriteINDEX(0); - } + // Object Parent; again a ObjectReference + if (entry.ObjectParent != null) + { + bw.WriteINDEX(entry.ObjectParent.IndexValue); + } + else + { + bw.WriteINDEX(0); + } - // Internal package/group of the object, i.e. ‘Floor’ for floor-textures; - // ObjectReference - if (entry.Group != null) - { - bw.WriteInt32(entry.Group.IndexValue); - } - else - { - bw.WriteInt32((int)0); - } - - // The name of the object; an index into the name-table - bw.WriteINDEX(upk.NameTableEntries.IndexOf(entry.Name)); - - // Flags for the object; described in the appendix - bw.WriteInt32((int)entry.Flags); + // Internal package/group of the object, i.e. ‘Floor’ for floor-textures; + // ObjectReference + if (entry.Group != null) + { + bw.WriteInt32(entry.Group.IndexValue); + } + else + { + bw.WriteInt32((int)0); + } + + // The name of the object; an index into the name-table + bw.WriteINDEX(upk.NameTableEntries.IndexOf(entry.Name)); + + // Flags for the object; described in the appendix + bw.WriteInt32((int)entry.Flags); - // Total size of the object - bw.WriteINDEX(entry.Size); + // Total size of the object + bw.WriteINDEX(entry.Size); - if (entry.Size != 0) - { - // Offset of the object; this field only exists if the SerialSize is larger 0 - bw.WriteINDEX(entry.Offset); - } - } - } - #endregion + if (entry.Size != 0) + { + // Offset of the object; this field only exists if the SerialSize is larger 0 + bw.WriteINDEX(entry.Offset); + } + } + } + #endregion - #region Import table - { - for (uint i = 0; i < upk.ImportTableEntries.Count; i++) - { - // The third table holds references to objects in external packages. For example, a - // texture might have a DetailTexture (which makes for the nice structure if have a - // very close look at a texture). Now, these DetailTextures are all stored in a - // single package (as they are used by many different textures in different package - // files). The property of the texture object only needs to store an index into the - // import-table then as the entry in the import-table already points to the - // DetailTexture in the other package. - ImportTableEntry entry = upk.ImportTableEntries[(int)i]; + #region Import table + { + for (uint i = 0; i < upk.ImportTableEntries.Count; i++) + { + // The third table holds references to objects in external packages. For example, a + // texture might have a DetailTexture (which makes for the nice structure if have a + // very close look at a texture). Now, these DetailTextures are all stored in a + // single package (as they are used by many different textures in different package + // files). The property of the texture object only needs to store an index into the + // import-table then as the entry in the import-table already points to the + // DetailTexture in the other package. + ImportTableEntry entry = upk.ImportTableEntries[(int)i]; - bw.WriteINDEX(upk.NameTableEntries.IndexOf(entry.PackageName)); - bw.WriteINDEX(upk.NameTableEntries.IndexOf(entry.ClassName)); - bw.WriteInt32(entry.Package.IndexValue); - bw.WriteINDEX(upk.NameTableEntries.IndexOf(entry.ObjectName)); - } - } - #endregion - bw.Flush(); - } - } + bw.WriteINDEX(upk.NameTableEntries.IndexOf(entry.PackageName)); + bw.WriteINDEX(upk.NameTableEntries.IndexOf(entry.ClassName)); + bw.WriteInt32(entry.Package.IndexValue); + bw.WriteINDEX(upk.NameTableEntries.IndexOf(entry.ObjectName)); + } + } + #endregion + bw.Flush(); + } + } }