├── .gitignore ├── LICENSE ├── NdfDecompiler.dgml ├── README.md ├── icon.ico ├── moddingSuite.Test ├── BaseTests.cs ├── EdataManagerTest.cs ├── EssWriterTest.cs ├── Properties │ └── AssemblyInfo.cs ├── UnitTest1.cs ├── default.runsettings └── moddingSuite.Test.csproj ├── moddingSuite.sln ├── moddingSuite.sln_bak.sln ├── moddingSuite ├── App.xaml ├── App.xaml.cs ├── BL │ ├── Compressing │ │ └── Compressing.cs │ ├── DDS │ │ ├── DDS.cs │ │ ├── DDSHelper.cs │ │ ├── FourCC.cs │ │ └── PixelFormats.cs │ ├── Edata │ │ └── EdataWriter.cs │ ├── EdataManager.cs │ ├── Ess │ │ ├── EssReader.cs │ │ └── EssWriter.cs │ ├── ImageService │ │ ├── BlockDXT │ │ │ ├── AlphaBlockDXT5.cs │ │ │ ├── BlockDXT1.cs │ │ │ └── BlockDXT5.cs │ │ ├── Color16.cs │ │ ├── Color32.cs │ │ ├── ColorBlock.cs │ │ └── RawImage.cs │ ├── Mesh │ │ └── MeshReader.cs │ ├── Ndf │ │ ├── INdfReader.cs │ │ ├── INdfWriter.cs │ │ ├── NdfTextWriter.cs │ │ ├── NdfbinReader.cs │ │ └── NdfbinWriter.cs │ ├── SavManager.cs │ ├── Scenario │ │ ├── ScenarioExtensions.cs │ │ ├── ScenarioReader.cs │ │ └── ScenarioWriter.cs │ ├── SettingsManager.cs │ ├── TGV │ │ ├── TgvBitmapReader.cs │ │ ├── TgvDDSReader.cs │ │ ├── TgvDDSWriter.cs │ │ ├── TgvReader.cs │ │ └── TgvWriter.cs │ └── TradManager.cs ├── Model │ ├── Common │ │ ├── Md5Hash.cs │ │ └── MeshTriangularFace.cs │ ├── Edata │ │ ├── EdataContentFile.cs │ │ ├── EdataDir.cs │ │ ├── EdataEntity.cs │ │ ├── EdataFileType.cs │ │ ├── EdataHeader.cs │ │ └── EdataPackage.cs │ ├── Mesh │ │ ├── MeshContentFile.cs │ │ ├── MeshFile.cs │ │ ├── MeshHeader.cs │ │ ├── MeshHeaderEntry.cs │ │ ├── MeshHeaderEntryWithCount.cs │ │ └── MeshSubHeader.cs │ ├── Ndfbin │ │ ├── ChangeManager │ │ │ ├── ChangeEntryBase.cs │ │ │ ├── Enum.cs │ │ │ ├── FlatChangeEntry.cs │ │ │ ├── MapChangeEntry.cs │ │ │ ├── NdfChangeManager.cs │ │ │ └── ObjectReferenceChangeEntry.cs │ │ ├── ClassDiagram1.cd │ │ ├── CollectionItemValueHolder.cs │ │ ├── INdfScriptSerializable.cs │ │ ├── IValueHolder.cs │ │ ├── MapValueHolder.cs │ │ ├── NdfBinary.cs │ │ ├── NdfClass.cs │ │ ├── NdfFooter.cs │ │ ├── NdfFooterEntry.cs │ │ ├── NdfHeader.cs │ │ ├── NdfObject.cs │ │ ├── NdfProperty.cs │ │ ├── NdfPropertyValue.cs │ │ ├── NdfStringReference.cs │ │ ├── NdfTran.cs │ │ └── Types │ │ │ ├── AllTypes │ │ │ ├── NdfBlob.cs │ │ │ ├── NdfBoolean.cs │ │ │ ├── NdfCollection.cs │ │ │ ├── NdfColor128.cs │ │ │ ├── NdfColor32.cs │ │ │ ├── NdfDouble.cs │ │ │ ├── NdfEugFloat2.cs │ │ │ ├── NdfEugInt2.cs │ │ │ ├── NdfFileNameString.cs │ │ │ ├── NdfFlatValueWrapper.cs │ │ │ ├── NdfGuid.cs │ │ │ ├── NdfHash.cs │ │ │ ├── NdfInt16.cs │ │ │ ├── NdfInt32.cs │ │ │ ├── NdfInt8.cs │ │ │ ├── NdfLocalisationHash.cs │ │ │ ├── NdfLong.cs │ │ │ ├── NdfMap.cs │ │ │ ├── NdfMapList.cs │ │ │ ├── NdfNull.cs │ │ │ ├── NdfObjectReference.cs │ │ │ ├── NdfSingle.cs │ │ │ ├── NdfString.cs │ │ │ ├── NdfTime64.cs │ │ │ ├── NdfTrans.cs │ │ │ ├── NdfTrippleInt.cs │ │ │ ├── NdfUInt16.cs │ │ │ ├── NdfUInt32.cs │ │ │ ├── NdfUnkown.cs │ │ │ ├── NdfValueWrapper.cs │ │ │ ├── NdfVector.cs │ │ │ ├── NdfWideString.cs │ │ │ └── NdfZipBlob.cs │ │ │ ├── NdfType.cs │ │ │ └── NdfTypeManager.cs │ ├── Sav │ │ └── SavFile.cs │ ├── Scenario │ │ ├── Area classes.cd │ │ ├── Area.cs │ │ ├── AreaClipped.cs │ │ ├── AreaColletion.cs │ │ ├── AreaContent.cs │ │ ├── AreaFile.cs │ │ ├── AreaVertex.cs │ │ └── ScenarioFile.cs │ ├── Settings │ │ └── Settings.cs │ ├── Textures │ │ ├── TgvFile.cs │ │ └── TgvMipMap.cs │ └── Trad │ │ └── TradEntry.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Themes │ └── Generic.xaml ├── Util │ ├── Geometry.cs │ └── Utils.cs ├── View │ ├── Common │ │ ├── AboutView.xaml │ │ ├── AboutView.xaml.cs │ │ ├── MoviePlaybackView.xaml │ │ ├── MoviePlaybackView.xaml.cs │ │ ├── TradFileView.xaml │ │ ├── TradFileView.xaml.cs │ │ ├── UnhandledExceptionView.xaml │ │ └── UnhandledExceptionView.xaml.cs │ ├── DialogProvider │ │ ├── DialogProvider.cs │ │ ├── IViewMap.cs │ │ ├── ViewInstance.cs │ │ └── ViewMap.cs │ ├── Edata │ │ ├── EdataFileView.xaml │ │ ├── EdataFileView.xaml.cs │ │ ├── EdataManagerView.xaml │ │ └── EdataManagerView.xaml.cs │ ├── Extension │ │ ├── BindingProxy.cs │ │ ├── BoolToVisibilityCollapsedConverter.cs │ │ ├── ByteToKiloByteConverter.cs │ │ ├── Color32ValueConverter.cs │ │ ├── ColorToBrushConverter.cs │ │ ├── EdataFileTypeToImageConverter.cs │ │ ├── EditingControlDataTemplateSelector.cs │ │ ├── LeftMarginMultiplierConverter.cs │ │ ├── LocalisationHashValueConverter.cs │ │ ├── Masking.cs │ │ ├── TreeViewExtensions.cs │ │ └── TreeViewItemExtensions.cs │ ├── Images │ │ ├── 3d_printer-26.png │ │ ├── ASCube_16xLG.png │ │ ├── Add_Row-26.png │ │ ├── AppearanceEditorPart_6014.png │ │ ├── Binary_16xLG.png │ │ ├── BookmarkNext_2389.png │ │ ├── BookmarkPrevious_2391.png │ │ ├── Bracket_Curved_16xLG.png │ │ ├── Delete_Row-26.png │ │ ├── DisassemblyWindow_6536.png │ │ ├── ExcelWorksheetView_11748.png │ │ ├── Generic_Sorting2-26.png │ │ ├── InfoTooltip_16x.png │ │ ├── Open_6296.png │ │ ├── Recording_16xLG.png │ │ ├── Save_6530.png │ │ ├── UnloadedProject_8303.png │ │ ├── View_Details-26.png │ │ ├── about-26.png │ │ ├── about.jpg │ │ ├── add_file-26.png │ │ ├── add_property-26.png │ │ ├── copy-26.png │ │ ├── delete_property-26.png │ │ ├── donate.gif │ │ ├── empty_filter-26.png │ │ ├── error-32.png │ │ ├── exception.png │ │ ├── export-26.png │ │ ├── filled_filter-26.png │ │ ├── filter_16xLG.png │ │ ├── flag_16xLG.png │ │ ├── folder-26.png │ │ ├── folder_Closed_16xLG.png │ │ ├── folder_Closed_32xMD.png │ │ ├── folder_Open_16xLG.png │ │ ├── folder_Open_32xMD.png │ │ ├── geometry-26.png │ │ ├── google_code-26.png │ │ ├── google_web_search-26.png │ │ ├── gplv3-127x51.png │ │ ├── import-26.png │ │ ├── news-26.png │ │ ├── open_in_browser-26.png │ │ ├── package-16.png │ │ ├── picture-26.png │ │ ├── play-26.png │ │ ├── pushpin_16xLG.png │ │ ├── puzzle-26.png │ │ ├── python-26.png │ │ ├── question-26.png │ │ ├── refresh_shield-26.png │ │ ├── resource_16xLG.png │ │ ├── reuse-26.png │ │ ├── save-26.png │ │ ├── splash.jpg │ │ ├── splash.psd │ │ ├── splash_original.jpg │ │ ├── text-26.png │ │ ├── typography_Uppercase_T_16xLG.png │ │ └── zip-26.png │ ├── Mesh │ │ ├── MeshView.xaml │ │ └── MeshView.xaml.cs │ ├── Ndfbin │ │ ├── NdfbinView.xaml │ │ ├── NdfbinView.xaml.cs │ │ ├── Scenario │ │ │ ├── ScenarioView.xaml │ │ │ └── ScenarioView.xaml.cs │ │ ├── ValueEditing │ │ │ ├── BlobEditingTemplate.xaml │ │ │ ├── BlobEditingTemplate.xaml.cs │ │ │ ├── BooleanEditingTemplate.xaml │ │ │ ├── BooleanEditingTemplate.xaml.cs │ │ │ ├── ColorPickerEditingTemplate.xaml │ │ │ ├── ColorPickerEditingTemplate.xaml.cs │ │ │ ├── FloatEditingTemplate.xaml │ │ │ ├── FloatEditingTemplate.xaml.cs │ │ │ ├── FloatPairEditingTemplate.xaml │ │ │ ├── FloatPairEditingTemplate.xaml.cs │ │ │ ├── GuidEditingTemplate.xaml │ │ │ ├── GuidEditingTemplate.xaml.cs │ │ │ ├── Int32EditingTemplate.xaml │ │ │ ├── Int32EditingTemplate.xaml.cs │ │ │ ├── LocaleHashEditingTemplate.xaml │ │ │ ├── LocaleHashEditingTemplate.xaml.cs │ │ │ ├── MapEditingTemplate.xaml │ │ │ ├── MapEditingTemplate.xaml.cs │ │ │ ├── ObjectReferenceEditingTemplate.xaml │ │ │ ├── ObjectReferenceEditingTemplate.xaml.cs │ │ │ ├── StringTableEditingTemplate.xaml │ │ │ ├── StringTableEditingTemplate.xaml.cs │ │ │ ├── TransTableReferenceEditingTemplate.xaml │ │ │ ├── TransTableReferenceEditingTemplate.xaml.cs │ │ │ ├── UInt32EditingTemaplte.xaml │ │ │ ├── UInt32EditingTemaplte.xaml.cs │ │ │ ├── VectorEditingTemplate.xaml │ │ │ └── VectorEditingTemplate.xaml.cs │ │ └── Viewer │ │ │ ├── AddCollectionItemView.xaml │ │ │ ├── AddCollectionItemView.xaml.cs │ │ │ ├── ArmourDamageTableWindowView.xaml │ │ │ ├── ArmourDamageTableWindowView.xaml.cs │ │ │ ├── DamageTableView.xaml │ │ │ ├── InstanceView.xaml │ │ │ ├── InstanceView.xaml.cs │ │ │ ├── InstanceWindowView.xaml │ │ │ ├── InstanceWindowView.xaml.cs │ │ │ ├── ListEditorWindow.xaml │ │ │ ├── ListEditorWindow.xaml.cs │ │ │ ├── ListViewer.xaml │ │ │ ├── ListViewer.xaml.cs │ │ │ ├── ObjectCopyResultView.xaml │ │ │ ├── ObjectCopyResultView.xaml.cs │ │ │ ├── ReferenceSearchResultView.xaml │ │ │ └── ReferenceSearchResultView.xaml.cs │ ├── SettingsView.xaml │ ├── SettingsView.xaml.cs │ ├── SpinningWheel │ │ ├── Enums │ │ │ └── RotateDirection.cs │ │ └── SpinningWheel.cs │ └── VersionManager │ │ ├── VersionManagerView.xaml │ │ └── VersionManagerView.xaml.cs ├── ViewModel │ ├── About │ │ └── AboutViewModel.cs │ ├── Base │ │ ├── ActionCommand.cs │ │ ├── ObjectWrapperViewModel.cs │ │ └── ViewModelBase.cs │ ├── Edata │ │ ├── DirectoryViewModel.cs │ │ ├── EdataFileViewModel.cs │ │ ├── EdataManagerViewModel.cs │ │ ├── FileSystemItemViewModel.cs │ │ ├── FileSystemOverviewViewModelBase.cs │ │ ├── FileViewModel.cs │ │ ├── GameSpaceViewModel.cs │ │ └── WorkspaceViewModel.cs │ ├── Filter │ │ ├── FilterDiscriminator.cs │ │ └── PropertyFilterExpression.cs │ ├── Media │ │ └── MoviePlaybackViewModel.cs │ ├── Mesh │ │ └── MeshEditorViewModel.cs │ ├── Ndf │ │ ├── AddCollectionItemViewModel.cs │ │ ├── ArmourDamageViewModel.cs │ │ ├── ListEditorViewModel.cs │ │ ├── NdfClassViewModel.cs │ │ ├── NdfEditorMainViewModel.cs │ │ ├── NdfObjectViewModel.cs │ │ ├── NdfScriptableClassList.cs │ │ ├── ObjectCopyResultViewModel.cs │ │ └── ReferenceSearchResultViewModel.cs │ ├── Scenario │ │ └── ScenarioEditorViewModel.cs │ ├── Trad │ │ └── TradFileViewModel.cs │ ├── UnhandledException │ │ └── UnhandledExceptionViewModel.cs │ └── VersionManager │ │ ├── VersionFileViewModel.cs │ │ ├── VersionInfoViewModel.cs │ │ └── VersionManagerViewModel.cs ├── ZoneEditor │ ├── Creater.cs │ ├── Editor.Designer.cs │ ├── Editor.cs │ ├── Editor.resx │ ├── Form1.resx │ ├── Images │ │ ├── CV.png │ │ ├── FOB.png │ │ ├── N_Hamhung_Gamescon_v11.png │ │ ├── _2x2_port_wonsan.png │ │ ├── _2x3_anbyon.png │ │ ├── _2x3_boseong.png │ │ ├── _2x3_esashi.png │ │ ├── _2x3_hwaseong.png │ │ ├── _2x3_montagne_2.png │ │ ├── _2x3_tohoku.png │ │ ├── _3x2_boryeong.png │ │ ├── _3x2_haenam.png │ │ ├── _3x2_montagne_3.png │ │ ├── _3x2_sangju.png │ │ ├── _3x2_taean.png │ │ ├── _3x2_taebuko.png │ │ ├── _3x3_chongju.png │ │ ├── _3x3_gangjin.png │ │ ├── _3x3_montagne_1.png │ │ ├── _3x3_montagne_4.png │ │ ├── _3x3_pyeongtaek.png │ │ └── hopAndGlory.png │ ├── Marker.cs │ ├── Markers │ │ ├── CreaterMarker.cs │ │ ├── Marker.cs │ │ └── VertexMarker.cs │ ├── Outline.cs │ ├── PanAndZoom.cs │ ├── ScenarioItems │ │ ├── Icon.cs │ │ ├── IconType.cs │ │ ├── Possession.cs │ │ ├── Property.cs │ │ ├── PropertyPanels │ │ │ ├── IconProperty.Designer.cs │ │ │ ├── IconProperty.cs │ │ │ ├── IconProperty.resx │ │ │ ├── SpawnProperty.Designer.cs │ │ │ ├── SpawnProperty.cs │ │ │ ├── SpawnProperty.resx │ │ │ ├── ZoneProperty.Designer.cs │ │ │ ├── ZoneProperty.cs │ │ │ └── ZoneProperty.resx │ │ ├── ScenarioItem.cs │ │ ├── Spawn.cs │ │ ├── SpawnType.cs │ │ └── Zone.cs │ ├── ZoneEditor.Designer.cs │ ├── ZoneEditor.cs │ ├── ZoneEditor.resx │ └── ZoneEditorData.cs ├── icon.ico └── moddingSuite.csproj ├── ndfbin_reversing.txt └── tgvExporter ├── Program.cs ├── Properties └── AssemblyInfo.cs └── tgvExporter.csproj /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Ian Staples 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Wargame modding suite [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif "Shut up and take my money!")](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XP3SV7QWZ9UEG "Shut up and take my money!") 2 | ============ 3 | 4 | This software brings modding to R.U.S.E, Wargame: European Escalation, Wargame: Airland Battle and Wargame: Red Dragon. 5 | 6 | System Requirements 7 | ============ 8 | 9 | You need to have the .NET Desktop Runtime you can download it here: 10 | https://dotnet.microsoft.com/download/dotnet/5.0 11 | 12 | License 13 | ============ 14 | 15 | The Wargame modding suite is released under the MIT license. 16 | -------------------------------------------------------------------------------- /icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/icon.ico -------------------------------------------------------------------------------- /moddingSuite.Test/BaseTests.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace moddingSuite.Test 9 | { 10 | public abstract class BaseTests 11 | { 12 | public TestContext TestContext { get; set; } 13 | protected string RedDragonGameDataPath => TestContext.Properties["reddragonData"] as string; 14 | protected string AirLandGameDataPath => TestContext.Properties["airlandData"] as string; 15 | protected string AirLandUserDataPath => TestContext.Properties["airlandUserPath"] as string; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /moddingSuite.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("moddingSuite.Test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("moddingSuite.Test")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7c728793-9232-4ff4-bbf1-91f77d0ced45")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /moddingSuite.Test/default.runsettings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /moddingSuite.Test/moddingSuite.Test.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net472;net5.0-windows 4 | Library 5 | false 6 | $(MSBuildProjectDirectory)\default.runsettings 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /moddingSuite.sln_bak.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "moddingSuite", "moddingSuite\moddingSuite.csproj", "{ED8773BC-C0F3-45E2-A182-07A06260F1F7}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "moddingSuite.Test", "moddingSuite.Test\moddingSuite.Test.csproj", "{BC9ABC10-E5C5-4A7C-894B-6BDCC826E8E7}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{66C08E0F-9595-4099-B2BC-9D0BD7162BBA}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "moddingSuite.Infrastructure", "moddingSuite.Infrastructure\moddingSuite.Infrastructure.csproj", "{BFA27EFD-2A3B-4FF1-A78D-5F4769DD8D45}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {ED8773BC-C0F3-45E2-A182-07A06260F1F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {ED8773BC-C0F3-45E2-A182-07A06260F1F7}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {ED8773BC-C0F3-45E2-A182-07A06260F1F7}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {ED8773BC-C0F3-45E2-A182-07A06260F1F7}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {BC9ABC10-E5C5-4A7C-894B-6BDCC826E8E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {BC9ABC10-E5C5-4A7C-894B-6BDCC826E8E7}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {BC9ABC10-E5C5-4A7C-894B-6BDCC826E8E7}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {BC9ABC10-E5C5-4A7C-894B-6BDCC826E8E7}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {BFA27EFD-2A3B-4FF1-A78D-5F4769DD8D45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {BFA27EFD-2A3B-4FF1-A78D-5F4769DD8D45}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {BFA27EFD-2A3B-4FF1-A78D-5F4769DD8D45}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {BFA27EFD-2A3B-4FF1-A78D-5F4769DD8D45}.Release|Any CPU.Build.0 = Release|Any CPU 32 | EndGlobalSection 33 | GlobalSection(SolutionProperties) = preSolution 34 | HideSolutionNode = FALSE 35 | EndGlobalSection 36 | EndGlobal 37 | -------------------------------------------------------------------------------- /moddingSuite/BL/Compressing/Compressing.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Ionic.Zlib; 3 | 4 | namespace moddingSuite.BL.Compressing 5 | { 6 | public static class Compressor 7 | { 8 | public static byte[] Decomp(byte[] input) 9 | { 10 | using (var output = new MemoryStream()) 11 | { 12 | Decomp(input, output); 13 | return output.ToArray(); 14 | } 15 | } 16 | 17 | public static void Decomp(byte[] input, Stream outputStream) 18 | { 19 | using (var zipStream = new ZlibStream(outputStream, CompressionMode.Decompress)) 20 | { 21 | using (var inputStream = new MemoryStream(input)) 22 | { 23 | byte[] buffer = input.Length > 4096 ? new byte[4096] : new byte[input.Length]; 24 | 25 | int size; 26 | 27 | while ((size = inputStream.Read(buffer, 0, buffer.Length)) != 0) 28 | zipStream.Write(buffer, 0, size); 29 | } 30 | } 31 | } 32 | 33 | public static byte[] Comp(byte[] input) 34 | { 35 | using (var sourceStream = new MemoryStream(input)) 36 | { 37 | using (var compressed = new MemoryStream()) 38 | { 39 | using (var zipSteam = new ZlibStream(compressed, CompressionMode.Compress, CompressionLevel.Level9, true)) 40 | { 41 | zipSteam.FlushMode = FlushType.Full; 42 | 43 | //var buffer = new byte[1024]; 44 | //int len = sourceStream.Read(buffer, 0, buffer.Length); 45 | 46 | //while (len > 0) 47 | //{ 48 | // zipSteam.Write(buffer, 0, len); 49 | // len = sourceStream.Read(buffer, 0, buffer.Length); 50 | //} 51 | 52 | sourceStream.CopyTo(zipSteam); 53 | 54 | zipSteam.Flush(); 55 | 56 | return compressed.ToArray(); 57 | } 58 | } 59 | } 60 | } 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /moddingSuite/BL/ImageService/BlockDXT/BlockDXT5.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.BL.ImageService.BlockDXT 8 | { 9 | public struct BlockDXT5 10 | { 11 | AlphaBlockDXT5 alpha; 12 | BlockDXT1 color; 13 | 14 | public void decodeBlock(ref ColorBlock block) 15 | { 16 | if (block == null) 17 | throw new ArgumentNullException("block"); 18 | 19 | // Decode color. 20 | color.decodeBlock(block); 21 | 22 | // Decode alpha. 23 | alpha.decodeBlock(block); 24 | } 25 | 26 | /// Flip DXT5 block vertically. 27 | void flip4() 28 | { 29 | alpha.flip4(); 30 | color.flip4(); 31 | } 32 | 33 | /// Flip half DXT5 block vertically. 34 | void flip2() 35 | { 36 | alpha.flip2(); 37 | color.flip2(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /moddingSuite/BL/ImageService/Color16.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace moddingSuite.BL.ImageService 9 | { 10 | /// 11 | /// .NET is little endian -> bgr 12 | /// 13 | [StructLayout(LayoutKind.Explicit, Size = 2, Pack = 1)] 14 | public struct Color16 15 | { 16 | // Btifield: 5 17 | [FieldOffset(0)] 18 | private ushort b_i; 19 | 20 | public ushort b 21 | { 22 | get { return (ushort)((b_i >> 11) & 0x1F); } 23 | set { b_i = (ushort)((b_i & ~(0x1F << 11)) | (value & 0x3F) << 11); } 24 | } 25 | 26 | // Bitfield: 6 27 | [FieldOffset(0)] 28 | private ushort g_i; 29 | 30 | public ushort g 31 | { 32 | get { return (ushort)((g_i >> 5) & 0x7F); } 33 | set { g_i = (ushort)((g_i & ~(0x7F << 5)) | (value & 0x7F) << 5); } 34 | } 35 | 36 | // Bitfield: 5 37 | [FieldOffset(0)] 38 | private ushort r_i; 39 | 40 | public ushort r 41 | { 42 | get { return (ushort) (r_i & 0x1F); } 43 | set { r_i = (ushort) ((r_i & ~0x1F) | (value & 0x1F)); } 44 | } 45 | 46 | [FieldOffset(0)] 47 | public ushort u; 48 | 49 | //public Color16() { } 50 | public Color16(Color16 c) { r_i = 0; g_i = 0; b_i = 0; u = c.u; } 51 | public Color16(ushort U) { r_i = 0; g_i = 0; b_i = 0; u = U; } 52 | 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /moddingSuite/BL/ImageService/RawImage.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.Util; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Runtime.InteropServices; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace moddingSuite.BL.ImageService 10 | { 11 | public class RawImage 12 | { 13 | private Color32[] _data; 14 | 15 | public enum Format 16 | { 17 | Format_RGB, 18 | Format_ARGB, 19 | } 20 | 21 | public uint Width 22 | { 23 | get; 24 | set; 25 | } 26 | 27 | public uint Height 28 | { 29 | get; 30 | set; 31 | } 32 | 33 | public Color32[] Data 34 | { 35 | get { return _data; } 36 | } 37 | 38 | public Format ColFormat 39 | { 40 | get; 41 | set; 42 | } 43 | 44 | public RawImage(Color32[] data, uint width, uint height) 45 | { 46 | if (data == null) 47 | _data = new Color32[width * height * 4]; // sizeof(Color32) == 4 48 | else 49 | _data = data; 50 | 51 | Width = width; 52 | Height = height; 53 | } 54 | 55 | public RawImage(uint width, uint height) 56 | : this(null, width, height) 57 | { 58 | } 59 | 60 | public Color32[] Scanline(uint line) 61 | { 62 | Color32[] tmp = new Color32[Width]; 63 | Array.Copy(Data, line * Width, tmp, 0, Width); 64 | return tmp; 65 | } 66 | 67 | public Color32 Pixel(uint px) 68 | { 69 | return Data[px]; 70 | } 71 | 72 | public Color32 Pixel(uint x, uint y) 73 | { 74 | return Pixel(y * Width + x); 75 | } 76 | 77 | public byte[] GetRawData() 78 | { 79 | var ret = new List(); 80 | 81 | foreach (var col in Data) 82 | ret.AddRange(Utils.StructToBytes(col)); 83 | 84 | return ret.ToArray(); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /moddingSuite/BL/Ndf/INdfReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using moddingSuite.Model.Ndfbin; 7 | 8 | namespace moddingSuite.BL.Ndf 9 | { 10 | public interface INdfReader 11 | { 12 | NdfBinary Read(byte[] data); 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/BL/Ndf/INdfWriter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using moddingSuite.Model.Ndfbin; 8 | 9 | namespace moddingSuite.BL.Ndf 10 | { 11 | interface INdfWriter 12 | { 13 | void Write(Stream outStrea, NdfBinary ndf, bool compressed); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/BL/Ndf/NdfTextWriter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Linq; 4 | using System.Text; 5 | using moddingSuite.Model.Ndfbin; 6 | 7 | namespace moddingSuite.BL.Ndf 8 | { 9 | public class NdfTextWriter : INdfWriter 10 | { 11 | public const string InstanceNamePrefix = "public"; 12 | public static readonly Encoding NdfTextEncoding = Encoding.Unicode; 13 | 14 | public void Write(Stream outStrea, NdfBinary ndf, bool compressed) 15 | { 16 | throw new NotImplementedException(); 17 | } 18 | 19 | public byte[] CreateNdfScript(NdfBinary ndf) 20 | { 21 | using (var ms = new MemoryStream()) 22 | { 23 | byte[] buffer = NdfTextEncoding.GetBytes(string.Format("// Handwritten by enohka \n// For real\n\n\n")); 24 | 25 | ms.Write(buffer, 0, buffer.Length); 26 | 27 | foreach (NdfObject instance in ndf.Instances.Where(x => x.IsTopObject)) 28 | { 29 | buffer = instance.GetNdfText(); 30 | ms.Write(buffer, 0, buffer.Length); 31 | } 32 | 33 | return ms.ToArray(); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /moddingSuite/BL/SavManager.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.Model.Sav; 2 | using System; 3 | using System.IO; 4 | namespace moddingSuite.BL 5 | { 6 | /// 7 | /// 8 | ///struct savheader 9 | ///{ 10 | /// DWORD magic; 11 | /// DWORD null; 12 | /// blob checksum[16]; 13 | /// DWORD fileSize; 14 | /// DWORD contentSize; 15 | /// DWORD contentSize2; 16 | /// DWORD unknown1; 17 | /// DWORD unknown2; 18 | /// BYTE headerSize; 19 | /// BYTE two; 20 | /// blob padding[22]; 21 | ///}; 22 | /// 23 | public class SavManager 24 | { 25 | public const uint SavMagic = 0x30564153; 26 | 27 | public SavFile Read(byte[] data) 28 | { 29 | var ret = new SavFile(); 30 | 31 | byte[] buffer = new byte[4]; 32 | 33 | using (var ms = new MemoryStream(data)) 34 | { 35 | ms.Read(buffer, 0, buffer.Length); 36 | uint magic = BitConverter.ToUInt32(buffer, 0); 37 | 38 | if (magic != SavMagic) 39 | throw new InvalidDataException("Wrong sav magic"); 40 | 41 | ms.Seek(4, SeekOrigin.Current); 42 | 43 | buffer = new byte[16]; 44 | ms.Read(buffer, 0, buffer.Length); 45 | Array.Copy(buffer, ret.Checksum, 16); 46 | 47 | buffer = new byte[4]; 48 | ms.Read(buffer, 0, buffer.Length); 49 | ret.FileSize = BitConverter.ToUInt32(buffer, 0); 50 | 51 | if (data.Length != ret.FileSize) 52 | throw new InvalidDataException("Header doesn't match to filesize"); 53 | 54 | ms.Read(buffer, 0, buffer.Length); 55 | ret.ContentSize1 = BitConverter.ToUInt32(buffer, 0); 56 | 57 | ms.Read(buffer, 0, buffer.Length); 58 | ret.ContentSize2 = BitConverter.ToUInt32(buffer, 0); 59 | 60 | buffer = new byte[8]; 61 | ms.Read(buffer, 0, buffer.Length); 62 | 63 | ret.SaveDate = BitConverter.ToUInt64(buffer, 0); 64 | 65 | } 66 | 67 | return ret; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /moddingSuite/BL/Scenario/ScenarioExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace moddingSuite.BL.Scenario 9 | { 10 | public static class ScenarioExtensions 11 | { 12 | public const int AreaMagic = 1095062081; 13 | 14 | public static void AssertAreaMagic(this Stream s) 15 | { 16 | var buffer = new byte[4]; 17 | 18 | s.Read(buffer, 0, buffer.Length); 19 | 20 | if (BitConverter.ToInt32(buffer, 0) != AreaMagic) 21 | throw new InvalidDataException("AREA expected"); 22 | } 23 | 24 | public static void WriteAreaMagic(this Stream s) 25 | { 26 | var buffer = BitConverter.GetBytes(AreaMagic); 27 | s.Write(buffer, 0, buffer.Length); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /moddingSuite/Model/Common/Md5Hash.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Common 8 | { 9 | public struct Md5Hash 10 | { 11 | public byte B_1; 12 | public byte B_2; 13 | public byte B_3; 14 | public byte B_4; 15 | public byte B_5; 16 | public byte B_6; 17 | public byte B_7; 18 | public byte B_8; 19 | public byte B_9; 20 | public byte B_10; 21 | public byte B_11; 22 | public byte B_12; 23 | public byte B_13; 24 | public byte B_14; 25 | public byte B_15; 26 | public byte B_16; 27 | 28 | public static Md5Hash GetHash(byte[] arr) 29 | { 30 | Md5Hash h = new Md5Hash(); 31 | 32 | h.B_1 = arr[0]; 33 | h.B_2 = arr[1]; 34 | h.B_3 = arr[2]; 35 | h.B_4 = arr[3]; 36 | h.B_5 = arr[4]; 37 | h.B_6 = arr[5]; 38 | h.B_7 = arr[6]; 39 | h.B_8 = arr[7]; 40 | h.B_9 = arr[8]; 41 | h.B_10 = arr[9]; 42 | h.B_11 = arr[10]; 43 | h.B_12 = arr[11]; 44 | h.B_13 = arr[12]; 45 | h.B_14 = arr[13]; 46 | h.B_15 = arr[14]; 47 | h.B_16 = arr[15]; 48 | 49 | return h; 50 | } 51 | 52 | public static byte[] GetBytes(Md5Hash hash) 53 | { 54 | List l = new List(); 55 | 56 | l.Add(hash.B_1); 57 | l.Add(hash.B_2); 58 | l.Add(hash.B_3); 59 | l.Add(hash.B_4); 60 | l.Add(hash.B_5); 61 | l.Add(hash.B_6); 62 | l.Add(hash.B_7); 63 | l.Add(hash.B_8); 64 | l.Add(hash.B_9); 65 | l.Add(hash.B_10); 66 | l.Add(hash.B_11); 67 | l.Add(hash.B_12); 68 | l.Add(hash.B_13); 69 | l.Add(hash.B_14); 70 | l.Add(hash.B_15); 71 | l.Add(hash.B_16); 72 | 73 | return l.ToArray(); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /moddingSuite/Model/Common/MeshTriangularFace.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Media.Media3D; 2 | 3 | namespace moddingSuite.Model.Common 4 | { 5 | public struct MeshTriangularFace 6 | { 7 | public int Point1; 8 | public int Point2; 9 | public int Point3; 10 | 11 | public MeshTriangularFace(int p1, int p2, int p3) 12 | { 13 | Point1 = p1; 14 | Point2 = p2; 15 | Point3 = p3; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Edata/EdataDir.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace moddingSuite.Model.Edata 4 | { 5 | /// 6 | /// struct dictGroupEntry { 7 | /// DWORD groupId; 8 | /// DWORD entrySize; 9 | /// zstring name; 10 | /// }; 11 | /// 12 | public class EdataDir : EdataEntity 13 | { 14 | private readonly List _children = new List(); 15 | private readonly List _files = new List(); 16 | private EdataDir _parent; 17 | private int _subTreeSize; 18 | 19 | public EdataDir() 20 | : base(string.Empty) 21 | { 22 | } 23 | 24 | public EdataDir(string name, EdataDir parent = null) 25 | : base(name) 26 | { 27 | Parent = parent; 28 | if (parent != null) 29 | parent.Children.Add(this); 30 | } 31 | 32 | public int SubTreeSize 33 | { 34 | get { return _subTreeSize; } 35 | set 36 | { 37 | _subTreeSize = value; 38 | OnPropertyChanged("GroupId"); 39 | } 40 | } 41 | 42 | public EdataDir Parent 43 | { 44 | get { return _parent; } 45 | set 46 | { 47 | _parent = value; 48 | OnPropertyChanged("Parent"); 49 | } 50 | } 51 | 52 | public List Children 53 | { 54 | get { return _children; } 55 | } 56 | 57 | public List Files 58 | { 59 | get { return _files; } 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Edata/EdataEntity.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using moddingSuite.ViewModel.Base; 3 | 4 | namespace moddingSuite.Model.Edata 5 | { 6 | public abstract class EdataEntity : ViewModelBase 7 | { 8 | private int _fileEntrySize; 9 | private string _name; 10 | 11 | public EdataEntity(string name) 12 | { 13 | Name = name; 14 | } 15 | 16 | 17 | public string Name 18 | { 19 | get { return _name; } 20 | set 21 | { 22 | _name = value; 23 | OnPropertyChanged("Name"); 24 | } 25 | } 26 | 27 | public int FileEntrySize 28 | { 29 | get { return _fileEntrySize; } 30 | set 31 | { 32 | _fileEntrySize = value; 33 | OnPropertyChanged("FileEntrySize"); 34 | } 35 | } 36 | 37 | public override string ToString() 38 | { 39 | return Name.ToString(CultureInfo.CurrentCulture); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Edata/EdataFileType.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace moddingSuite.Model.Edata 3 | { 4 | public enum EdataFileType 5 | { 6 | Ndfbin, 7 | Dictionary, 8 | Video, 9 | Image, 10 | Package, 11 | Save, 12 | Mesh, 13 | Scenario, 14 | 15 | Unknown 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /moddingSuite/Model/Edata/EdataHeader.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.BL; 2 | using moddingSuite.Model.Common; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace moddingSuite.Model.Edata 6 | { 7 | /// 8 | /// Thanks to Wargame:EE DAT Unpacker by Giovanni Condello 9 | /// Restructured header 10 | /// struct edataHeader 11 | /// { 12 | /// DWORD magic; 13 | /// DWORD version; 14 | /// 15 | /// blob checksum_v1[16]; 16 | /// blob skip[1]; 17 | /// 18 | /// DWORD dictionaryOffset; // ASM seems to say it must be 1037: CMP DWORD PTR DS:[ESI+0x19],0x40D (Compare value at offset 25 is 1037) 19 | 20 | /// DWORD dictionaryLength; 21 | /// DWORD filesOffset; 22 | /// DWORD filesLength; 23 | /// 24 | /// DWORD unkown2; // always 0 25 | /// 26 | /// DWORD padding; // always 8192 27 | /// 28 | /// blob checksum_v2[16]; 29 | /// }; 30 | /// 31 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 32 | public struct EdataHeader 33 | { 34 | public uint Magic; 35 | public uint Version; 36 | 37 | public Md5Hash Checksum_V1; 38 | public readonly byte Skip_1; 39 | 40 | public uint DictOffset; 41 | public uint DictLength; 42 | public uint FileOffset; 43 | public uint FileLength; 44 | 45 | public readonly uint Unkown_1; 46 | public uint Padding; 47 | 48 | public Md5Hash Checksum_V2; 49 | } 50 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Edata/EdataPackage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using moddingSuite.BL; 8 | 9 | namespace moddingSuite.Model.Edata 10 | { 11 | public class EdataPackage : EdataManager 12 | { 13 | private EdataDir _root; 14 | private Dictionary _loadedFiles = new Dictionary(); 15 | 16 | public EdataPackage(string path) 17 | : base(path) 18 | { 19 | 20 | } 21 | 22 | public EdataDir Root 23 | { 24 | get { return _root; } 25 | set 26 | { 27 | _root = value; 28 | OnPropertyChanged("Root"); 29 | } 30 | } 31 | 32 | public Dictionary LoadedFiles 33 | { 34 | get { return _loadedFiles; } 35 | } 36 | 37 | public byte[] GetRawData(EdataContentFile ofFile, bool cacheResult = true) 38 | { 39 | byte[] rawData; 40 | 41 | if (LoadedFiles.ContainsKey(ofFile)) 42 | { 43 | rawData = LoadedFiles[ofFile]; 44 | ofFile.Checksum = MD5.Create().ComputeHash(rawData); 45 | } 46 | else 47 | { 48 | rawData = base.GetRawData(ofFile); 49 | if (cacheResult) 50 | LoadedFiles.Add(ofFile, rawData); 51 | } 52 | 53 | return rawData; 54 | } 55 | 56 | public override void ReplaceFile(EdataContentFile oldFile, byte[] newContent) 57 | { 58 | if (LoadedFiles.ContainsKey(oldFile)) 59 | LoadedFiles[oldFile] = newContent; 60 | else 61 | LoadedFiles.Add(oldFile, newContent); 62 | } 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /moddingSuite/Model/Mesh/MeshContentFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Media.Media3D; 7 | 8 | namespace moddingSuite.Model.Mesh 9 | { 10 | public class MeshContentFile 11 | { 12 | public uint FileEntrySize { get; set; } 13 | public Point3D MinBoundingBox { get; set; } 14 | public Point3D MaxBoundingBox { get; set; } 15 | public uint Flags { get; set; } 16 | public ushort MultiMaterialMeshIndex { get; set; } 17 | public ushort HierarchicalAseModelSkeletonIndex { get; set; } 18 | 19 | public string Name { get; set; } 20 | public string Path { get; set; } 21 | 22 | public MeshContentFile() 23 | { 24 | 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /moddingSuite/Model/Mesh/MeshFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using moddingSuite.Model.Ndfbin; 8 | 9 | namespace moddingSuite.Model.Mesh 10 | { 11 | public class MeshFile 12 | { 13 | public MeshHeader Header { get; set; } 14 | public MeshSubHeader SubHeader { get; set; } 15 | 16 | public ObservableCollection MultiMaterialMeshFiles { get; set; } 17 | public NdfBinary TextureBindings { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /moddingSuite/Model/Mesh/MeshHeader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Mesh 8 | { 9 | /// 10 | /// typedef struct meshFileHeader_s 11 | /// { 12 | /// DWORD magic; 13 | /// DWORD platform; 14 | /// DWORD version; 15 | /// DWORD fileSize; 16 | /// blob checksum[16]; 17 | /// DWORD headerOffset; 18 | /// DWORD headerSize; 19 | /// DWORD dataOffset; 20 | /// DWORD dataSize; 21 | /// } meshFileHeader; 22 | /// 23 | public class MeshHeader 24 | { 25 | public uint Platform { get; set; } 26 | public uint Version { get; set; } 27 | public uint FileSize { get; set; } 28 | public byte[] Checksum { get; set; } 29 | public uint HeaderOffset { get; set; } 30 | public uint HeaderSize { get; set; } 31 | public uint ContentOffset { get; set; } 32 | public uint ContentSize { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /moddingSuite/Model/Mesh/MeshHeaderEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Mesh 8 | { 9 | public class MeshHeaderEntry 10 | { 11 | public uint Offset { get; set; } 12 | public uint Size { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /moddingSuite/Model/Mesh/MeshHeaderEntryWithCount.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Mesh 8 | { 9 | public class MeshHeaderEntryWithCount : MeshHeaderEntry 10 | { 11 | public uint Count { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /moddingSuite/Model/Mesh/MeshSubHeader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Mesh 8 | { 9 | public class MeshSubHeader 10 | { 11 | public uint MeshCount { get; set; } 12 | 13 | public MeshHeaderEntryWithCount Dictionary { get; set; } 14 | public MeshHeaderEntryWithCount VertexTypeNames { get; set; } 15 | public MeshHeaderEntryWithCount MeshMaterial { get; set; } 16 | public MeshHeaderEntryWithCount KeyedMeshSubPart { get; set; } 17 | public MeshHeaderEntryWithCount KeyedMeshSubPartVectors { get; set; } 18 | public MeshHeaderEntryWithCount MultiMaterialMeshes { get; set; } 19 | public MeshHeaderEntryWithCount SingleMaterialMeshes { get; set; } 20 | public MeshHeaderEntryWithCount Index1DBufferHeaders { get; set; } 21 | public MeshHeaderEntry Index1DBufferStreams { get; set; } 22 | public MeshHeaderEntryWithCount Vertex1DBufferHeaders { get; set; } 23 | public MeshHeaderEntry Vertex1DBufferStreams { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/ChangeManager/ChangeEntryBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using moddingSuite.ViewModel.Base; 7 | 8 | namespace moddingSuite.Model.Ndfbin.ChangeManager 9 | { 10 | public abstract class ChangeEntryBase : ViewModelBase 11 | { 12 | private NdfPropertyValue _affectedPropertyValue; 13 | 14 | public ChangeEntryBase(NdfPropertyValue affectedPropertyValue) 15 | { 16 | AffectedPropertyValue = affectedPropertyValue; 17 | } 18 | 19 | public NdfPropertyValue AffectedPropertyValue 20 | { 21 | get { return _affectedPropertyValue; } 22 | set 23 | { 24 | _affectedPropertyValue = value; 25 | OnPropertyChanged("AffectedPropertyValue"); 26 | } 27 | } 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/ChangeManager/Enum.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Ndfbin.ChangeManager 8 | { 9 | public enum ChangeType 10 | { 11 | Flat, 12 | List, 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/ChangeManager/FlatChangeEntry.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.Model.Ndfbin.Types; 2 | using moddingSuite.Model.Ndfbin.Types.AllTypes; 3 | using moddingSuite.ViewModel.Base; 4 | 5 | namespace moddingSuite.Model.Ndfbin.ChangeManager 6 | { 7 | public class FlatChangeEntry : ChangeEntryBase 8 | { 9 | private NdfValueWrapper _newValue; 10 | 11 | public FlatChangeEntry(NdfPropertyValue affectedPropertyValue, NdfValueWrapper newValue) 12 | : base(affectedPropertyValue) 13 | { 14 | NewValue = newValue; 15 | } 16 | 17 | public NdfValueWrapper NewValue 18 | { 19 | get { return _newValue; } 20 | set 21 | { 22 | _newValue = value; 23 | OnPropertyChanged(() => NewValue); 24 | } 25 | } 26 | 27 | } 28 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/ChangeManager/MapChangeEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Ndfbin.ChangeManager 8 | { 9 | public class MapChangeEntry : ChangeEntryBase 10 | { 11 | private MapValueHolder _newKey; 12 | private MapValueHolder _newValue; 13 | 14 | public MapChangeEntry(NdfPropertyValue affectedPropertyValue, MapValueHolder newKey, MapValueHolder newValue) 15 | : base(affectedPropertyValue) 16 | { 17 | NewKey = newKey; 18 | NewValue = newValue; 19 | 20 | } 21 | 22 | public MapValueHolder NewKey 23 | { 24 | get { return _newKey; } 25 | set 26 | { 27 | _newKey = value; 28 | OnPropertyChanged("NewKey"); 29 | } 30 | } 31 | 32 | public MapValueHolder NewValue 33 | { 34 | get { return _newValue; } 35 | set 36 | { 37 | _newValue = value; 38 | OnPropertyChanged("NewValue"); 39 | } 40 | } 41 | 42 | 43 | int min(int l, int r) 44 | { 45 | return l < r ? l : r; 46 | } 47 | 48 | float min(float l, float r) 49 | { 50 | return l < r ? l : r; 51 | } 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/ChangeManager/NdfChangeManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.ObjectModel; 3 | using System.ComponentModel; 4 | using System.Windows.Data; 5 | using System.Windows.Input; 6 | using moddingSuite.ViewModel.Base; 7 | 8 | namespace moddingSuite.Model.Ndfbin.ChangeManager 9 | { 10 | public class NdfChangeManager 11 | { 12 | private readonly ObservableCollection _changes = new ObservableCollection(); 13 | 14 | public NdfChangeManager() 15 | { 16 | } 17 | 18 | public ObservableCollection Changes 19 | { 20 | get { return _changes; } 21 | } 22 | 23 | public bool HasChanges 24 | { 25 | get { return Changes.Count > 0; } 26 | } 27 | 28 | public void AddChange(ChangeEntryBase change) 29 | { 30 | Changes.Add(change); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/ChangeManager/ObjectReferenceChangeEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Ndfbin.ChangeManager 8 | { 9 | public class ObjectReferenceChangeEntry : ChangeEntryBase 10 | { 11 | private uint _classId; 12 | private uint _instanceId; 13 | 14 | public ObjectReferenceChangeEntry(NdfPropertyValue affectedPropertyValue, uint classId, uint instanceId) 15 | : base(affectedPropertyValue) 16 | { 17 | ClassId = classId; 18 | InstanceId = instanceId; 19 | } 20 | 21 | public uint ClassId 22 | { 23 | get { return _classId; } 24 | set 25 | { 26 | _classId = value; 27 | OnPropertyChanged("ClassId"); 28 | } 29 | } 30 | 31 | public uint InstanceId 32 | { 33 | get { return _instanceId; } 34 | set 35 | { 36 | _instanceId = value; 37 | OnPropertyChanged("InstanceId"); 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/CollectionItemValueHolder.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.Model.Ndfbin.Types.AllTypes; 2 | using moddingSuite.ViewModel.Base; 3 | 4 | namespace moddingSuite.Model.Ndfbin 5 | { 6 | public class CollectionItemValueHolder : ViewModelBase, IValueHolder 7 | { 8 | private NdfValueWrapper _value; 9 | 10 | public CollectionItemValueHolder(NdfValueWrapper value, NdfBinary manager) 11 | { 12 | Value = value; 13 | Manager = manager; 14 | } 15 | 16 | public virtual NdfBinary Manager 17 | { 18 | get; 19 | private set; 20 | } 21 | 22 | public virtual NdfValueWrapper Value 23 | { 24 | get { return _value; } 25 | set 26 | { 27 | _value = value; 28 | OnPropertyChanged("Value"); 29 | } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/INdfScriptSerializable.cs: -------------------------------------------------------------------------------- 1 | namespace moddingSuite.Model.Ndfbin 2 | { 3 | public interface INdfScriptSerializable 4 | { 5 | byte[] GetNdfText(); 6 | } 7 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/IValueHolder.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.Model.Ndfbin.Types.AllTypes; 2 | 3 | namespace moddingSuite.Model.Ndfbin 4 | { 5 | public interface IValueHolder 6 | { 7 | NdfValueWrapper Value { get; set; } 8 | 9 | NdfBinary Manager { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/MapValueHolder.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.Model.Ndfbin.Types.AllTypes; 2 | 3 | namespace moddingSuite.Model.Ndfbin 4 | { 5 | public class MapValueHolder : CollectionItemValueHolder 6 | { 7 | public MapValueHolder(NdfValueWrapper value, NdfBinary manager) 8 | : base(value, manager) 9 | { 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/NdfClass.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using System.Globalization; 3 | using moddingSuite.ViewModel.Base; 4 | 5 | namespace moddingSuite.Model.Ndfbin 6 | { 7 | public class NdfClass : ViewModelBase 8 | { 9 | private uint _id; 10 | 11 | private string _name; 12 | private readonly ObservableCollection _instances = new ObservableCollection(); 13 | private readonly ObservableCollection _properties = new ObservableCollection(); 14 | 15 | public uint Id 16 | { 17 | get { return _id; } 18 | set 19 | { 20 | _id = value; 21 | OnPropertyChanged(() => Id); 22 | } 23 | } 24 | 25 | public string Name 26 | { 27 | get { return _name; } 28 | set 29 | { 30 | _name = value; 31 | OnPropertyChanged(() => Name); 32 | } 33 | } 34 | 35 | public ObservableCollection Properties 36 | { 37 | get { return _properties; } 38 | } 39 | 40 | public ObservableCollection Instances 41 | { 42 | get { return _instances; } 43 | } 44 | 45 | public NdfBinary Manager { get; protected set; } 46 | 47 | public NdfClass(NdfBinary mgr, uint id) 48 | { 49 | Manager = mgr; 50 | Id = id; 51 | } 52 | 53 | public override string ToString() 54 | { 55 | return Name.ToString(CultureInfo.InvariantCulture); 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/NdfFooter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Text; 5 | using moddingSuite.ViewModel.Base; 6 | 7 | namespace moddingSuite.Model.Ndfbin 8 | { 9 | /// 10 | /// typedef struct ndfbinFooterPart { 11 | /// char partName[4]; 12 | /// DWORD junk1; 13 | /// DWORD offset; 14 | /// DWORD junk2; 15 | /// DWORD length; 16 | /// DWORD junk3; 17 | /// } footerPart; 18 | /// 19 | /// struct ndfbinFooter { 20 | /// char header[4]; 21 | /// DWORD entryCount; 22 | /// footerPart entries[entryCount]; 23 | /// }; 24 | /// 25 | public class NdfFooter : ViewModelBase 26 | { 27 | private readonly ObservableCollection _entries = new ObservableCollection(); 28 | 29 | private ulong _offset; 30 | 31 | public ObservableCollection Entries 32 | { 33 | get { return _entries; } 34 | } 35 | 36 | public ulong Offset 37 | { 38 | get { return _offset; } 39 | set 40 | { 41 | _offset = value; 42 | OnPropertyChanged(() => Offset); 43 | } 44 | } 45 | 46 | public void AddEntry(string name, long offset, long size) 47 | { 48 | Entries.Add(new NdfFooterEntry { Name = name.ToUpper(), Offset = offset, Size = size }); 49 | } 50 | 51 | public byte[] GetBytes() 52 | { 53 | var data = new List(); 54 | 55 | var seperator = new byte[4]; 56 | 57 | data.AddRange(Encoding.ASCII.GetBytes("TOC0")); 58 | data.AddRange(BitConverter.GetBytes(Entries.Count)); 59 | 60 | foreach (NdfFooterEntry entry in Entries) 61 | { 62 | data.AddRange(Encoding.ASCII.GetBytes(entry.Name)); 63 | data.AddRange(seperator); 64 | data.AddRange(BitConverter.GetBytes(entry.Offset)); 65 | data.AddRange(BitConverter.GetBytes(entry.Size)); 66 | } 67 | 68 | return data.ToArray(); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/NdfFooterEntry.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.ViewModel.Base; 2 | 3 | namespace moddingSuite.Model.Ndfbin 4 | { 5 | public class NdfFooterEntry : ViewModelBase 6 | { 7 | private string _name; 8 | private long _offset; 9 | private long _size; 10 | 11 | public string Name 12 | { 13 | get { return _name; } 14 | set 15 | { 16 | _name = value; 17 | OnPropertyChanged(() => Name); 18 | } 19 | } 20 | 21 | public long Offset 22 | { 23 | get { return _offset; } 24 | set 25 | { 26 | _offset = value; 27 | OnPropertyChanged(() => Offset); 28 | } 29 | } 30 | 31 | public long Size 32 | { 33 | get { return _size; } 34 | set 35 | { 36 | _size = value; 37 | OnPropertyChanged(() => Size); 38 | } 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/NdfHeader.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.ViewModel.Base; 2 | using System; 3 | 4 | namespace moddingSuite.Model.Ndfbin 5 | { 6 | /// 7 | ///struct cndfHeader { 8 | /// 9 | /// blob headerMagic[12]; // EUG0 00 00 00 00 CNDF 10 | /// DWORD IsCompressed; // 128 == true; 0 == false; 11 | /// QWORD Footeroffset; // With full header 12 | /// QWORD HeaderSize; // value == 40 13 | /// QWORD FullFileSizeUncomp; // full filesize with header (When Compressed its the uncompressed size) 14 | /// 15 | ///}; 16 | /// 17 | public class NdfHeader : ViewModelBase 18 | { 19 | private bool _isCompressedBody; 20 | 21 | public bool IsCompressedBody 22 | { 23 | get { return _isCompressedBody; } 24 | set 25 | { 26 | _isCompressedBody = value; 27 | OnPropertyChanged(() => IsCompressedBody); 28 | } 29 | } 30 | public ulong FooterOffset { get; set; } 31 | public ulong HeaderSize { get; set; } 32 | public ulong FullFileSizeUncomp { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/NdfProperty.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using moddingSuite.ViewModel.Base; 3 | 4 | namespace moddingSuite.Model.Ndfbin 5 | { 6 | public class NdfProperty : ViewModelBase 7 | { 8 | private int _id; 9 | private string _name; 10 | private NdfClass _class; 11 | 12 | public int Id 13 | { 14 | get { return _id; } 15 | set 16 | { 17 | _id = value; 18 | OnPropertyChanged(() => Id); 19 | } 20 | } 21 | 22 | public string Name 23 | { 24 | get { return _name; } 25 | set 26 | { 27 | _name = value; 28 | OnPropertyChanged(() => Name); 29 | } 30 | } 31 | 32 | public NdfClass Class 33 | { 34 | get { return _class; } 35 | set 36 | { 37 | _class = value; 38 | OnPropertyChanged(() => Class); 39 | } 40 | } 41 | 42 | public NdfProperty(int id) 43 | { 44 | Id = id; 45 | } 46 | 47 | public override string ToString() 48 | { 49 | return Name.ToString(CultureInfo.InvariantCulture); 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/NdfStringReference.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using moddingSuite.ViewModel.Base; 3 | 4 | namespace moddingSuite.Model.Ndfbin 5 | { 6 | public class NdfStringReference : ViewModelBase 7 | { 8 | private int _id; 9 | private string _value; 10 | 11 | public int Id 12 | { 13 | get { return _id; } 14 | set 15 | { 16 | _id = value; 17 | OnPropertyChanged(() => Id); 18 | } 19 | } 20 | 21 | public string Value 22 | { 23 | get { return _value; } 24 | set 25 | { 26 | _value = value; 27 | OnPropertyChanged(() => Value); 28 | } 29 | } 30 | 31 | public override string ToString() 32 | { 33 | return Value.ToString(CultureInfo.InvariantCulture); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/NdfTran.cs: -------------------------------------------------------------------------------- 1 | namespace moddingSuite.Model.Ndfbin 2 | { 3 | public class NdfTranReference : NdfStringReference 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfBoolean.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using moddingSuite.BL; 3 | using moddingSuite.BL.Ndf; 4 | 5 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 6 | { 7 | public class NdfBoolean : NdfFlatValueWrapper 8 | { 9 | public NdfBoolean(bool value) 10 | : base(NdfType.Boolean, value) 11 | { 12 | } 13 | 14 | public override byte[] GetBytes() 15 | { 16 | return BitConverter.GetBytes(Convert.ToBoolean(Value)); 17 | } 18 | 19 | public override byte[] GetNdfText() 20 | { 21 | return NdfTextWriter.NdfTextEncoding.GetBytes(Value.ToString()); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfColor128.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using moddingSuite.Util; 3 | 4 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 5 | { 6 | public class NdfColor128 : NdfFlatValueWrapper 7 | { 8 | public NdfColor128(byte[] value) : base(NdfType.Color128, value) 9 | { 10 | } 11 | 12 | public new byte[] Value 13 | { 14 | get { return (byte[]) base.Value; } 15 | set 16 | { 17 | base.Value = value; 18 | OnPropertyChanged(() => Value); 19 | } 20 | } 21 | 22 | public override byte[] GetBytes() 23 | { 24 | return Value; 25 | } 26 | 27 | public override string ToString() 28 | { 29 | return string.Format("Vec4: {0}", Utils.ByteArrayToBigEndianHexByteString(Value)); 30 | } 31 | 32 | 33 | public override byte[] GetNdfText() 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfColor32.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 5 | { 6 | public class NdfColor32 : NdfFlatValueWrapper 7 | { 8 | public NdfColor32(Color value) 9 | : base(NdfType.Color32, value) 10 | { 11 | } 12 | 13 | public override byte[] GetBytes() 14 | { 15 | var col = (Color) Value; 16 | 17 | var colorArray = new[] { col.R, col.G, col.B, col.A}; 18 | 19 | return colorArray; 20 | } 21 | 22 | public override byte[] GetNdfText() 23 | { 24 | throw new NotImplementedException(); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfDouble.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using moddingSuite.BL; 3 | using moddingSuite.BL.Ndf; 4 | 5 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 6 | { 7 | public class NdfDouble : NdfFlatValueWrapper 8 | { 9 | public NdfDouble(double value) 10 | : base(NdfType.Float64, value) 11 | { 12 | } 13 | 14 | public new double Value 15 | { 16 | get { return (double)base.Value; } 17 | set 18 | { 19 | base.Value = value; 20 | OnPropertyChanged("Value"); 21 | } 22 | } 23 | 24 | public override byte[] GetBytes() 25 | { 26 | return BitConverter.GetBytes(Convert.ToDouble(Value)); 27 | } 28 | 29 | public override string ToString() 30 | { 31 | return string.Format("{0:0.###################################}", Value); 32 | } 33 | 34 | public override byte[] GetNdfText() 35 | { 36 | return NdfTextWriter.NdfTextEncoding.GetBytes(Value.ToString()); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfEugFloat2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 8 | { 9 | public class NdfEugFloat2 : NdfFlatValueWrapper 10 | { 11 | private float _value2; 12 | 13 | public NdfEugFloat2(float value1, float value2) 14 | : base(NdfType.EugFloat2, value1) 15 | { 16 | Value2 = value2; 17 | } 18 | 19 | public float Value2 20 | { 21 | get { return _value2; } 22 | set 23 | { 24 | _value2 = value; 25 | OnPropertyChanged("Value2"); 26 | } 27 | } 28 | 29 | public override byte[] GetBytes() 30 | { 31 | var value = new List(); 32 | value.AddRange(BitConverter.GetBytes(Convert.ToSingle(Value))); 33 | value.AddRange(BitConverter.GetBytes(Convert.ToSingle(Value2))); 34 | return value.ToArray(); 35 | } 36 | 37 | public override byte[] GetNdfText() 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | 42 | public override string ToString() 43 | { 44 | return string.Format("Float pair: {0} : {1}", Value, Value2); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfEugInt2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 8 | { 9 | public class NdfEugInt2 : NdfFlatValueWrapper 10 | { 11 | private int _value2; 12 | 13 | public NdfEugInt2(int value1, int value2) 14 | : base(NdfType.EugInt2, value1) 15 | { 16 | Value2 = value2; 17 | } 18 | 19 | public int Value2 20 | { 21 | get { return _value2; } 22 | set 23 | { 24 | _value2 = value; 25 | OnPropertyChanged("Value2"); 26 | } 27 | } 28 | 29 | public override byte[] GetBytes() 30 | { 31 | var value = new List(); 32 | value.AddRange(BitConverter.GetBytes(Convert.ToInt32(Value))); 33 | value.AddRange(BitConverter.GetBytes(Convert.ToInt32(Value2))); 34 | return value.ToArray(); 35 | } 36 | 37 | public override byte[] GetNdfText() 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | 42 | public override string ToString() 43 | { 44 | return string.Format("Int pair: {0} : {1}", Value, Value2); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfFileNameString.cs: -------------------------------------------------------------------------------- 1 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 2 | { 3 | public class NdfFileNameString : NdfString 4 | { 5 | public NdfFileNameString(NdfStringReference value) : base(value) 6 | { 7 | Type = NdfType.TableStringFile; 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfFlatValueWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 4 | { 5 | public abstract class NdfFlatValueWrapper : NdfValueWrapper 6 | { 7 | private object _value; 8 | 9 | protected NdfFlatValueWrapper(NdfType type, object value) 10 | : base(type) 11 | { 12 | Value = value; 13 | } 14 | 15 | public object Value 16 | { 17 | get { return _value; } 18 | set 19 | { 20 | _value = value; 21 | OnPropertyChanged("Value"); 22 | } 23 | } 24 | 25 | public override string ToString() 26 | { 27 | return Value.ToString(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfGuid.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 4 | { 5 | public class NdfGuid : NdfFlatValueWrapper 6 | { 7 | public NdfGuid(Guid value) 8 | : base(NdfType.Guid, value) 9 | { 10 | } 11 | 12 | public override byte[] GetBytes() 13 | { 14 | return Guid.Parse(Value.ToString()).ToByteArray(); 15 | } 16 | 17 | public override byte[] GetNdfText() 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfHash.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using moddingSuite.Util; 7 | 8 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 9 | { 10 | public class NdfHash : NdfFlatValueWrapper 11 | { 12 | public NdfHash(byte[] value) 13 | : base(NdfType.Hash, value) 14 | { 15 | } 16 | 17 | public override byte[] GetBytes() 18 | { 19 | return Value; 20 | } 21 | 22 | public new byte[] Value 23 | { 24 | get { return (byte[])base.Value; } 25 | set 26 | { 27 | base.Value = value; 28 | OnPropertyChanged(() => Value); 29 | } 30 | } 31 | 32 | public override byte[] GetNdfText() 33 | { 34 | throw new NotImplementedException(); 35 | } 36 | 37 | public override string ToString() 38 | { 39 | return Utils.ByteArrayToBigEndianHexByteString(Value); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfInt16.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using moddingSuite.BL; 7 | using moddingSuite.BL.Ndf; 8 | 9 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 10 | { 11 | public class NdfInt16 : NdfFlatValueWrapper 12 | { 13 | public NdfInt16(short value) 14 | : base(NdfType.Int16, value) 15 | { 16 | 17 | } 18 | 19 | 20 | public override byte[] GetBytes() 21 | { 22 | return BitConverter.GetBytes(Convert.ToInt16(Value)); 23 | } 24 | 25 | public override byte[] GetNdfText() 26 | { 27 | return NdfTextWriter.NdfTextEncoding.GetBytes(Value.ToString()); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfInt32.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using moddingSuite.BL; 3 | using moddingSuite.BL.Ndf; 4 | 5 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 6 | { 7 | public class NdfInt32 : NdfFlatValueWrapper 8 | { 9 | public NdfInt32(int value) 10 | : base(NdfType.Int32, value) 11 | { 12 | } 13 | 14 | public override byte[] GetBytes() 15 | { 16 | return BitConverter.GetBytes(Convert.ToInt32(Value)); 17 | } 18 | 19 | public override byte[] GetNdfText() 20 | { 21 | return NdfTextWriter.NdfTextEncoding.GetBytes(Value.ToString()); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfInt8.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using moddingSuite.BL; 3 | using moddingSuite.BL.Ndf; 4 | 5 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 6 | { 7 | public class NdfInt8 : NdfFlatValueWrapper 8 | { 9 | public NdfInt8(byte value) 10 | : base(NdfType.Int8, value) 11 | { 12 | } 13 | 14 | public override byte[] GetBytes() 15 | { 16 | return new byte[1] { (byte)Value }; 17 | } 18 | 19 | public override byte[] GetNdfText() 20 | { 21 | return NdfTextWriter.NdfTextEncoding.GetBytes(Value.ToString()); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfLocalisationHash.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using moddingSuite.Util; 3 | 4 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 5 | { 6 | public class NdfLocalisationHash : NdfFlatValueWrapper 7 | { 8 | public NdfLocalisationHash(byte[] value) 9 | : base(NdfType.LocalisationHash, value) 10 | { 11 | } 12 | 13 | public new byte[] Value 14 | { 15 | get { return (byte[]) base.Value; } 16 | set 17 | { 18 | base.Value = value; 19 | OnPropertyChanged(() => Value); 20 | } 21 | } 22 | 23 | public override byte[] GetBytes() 24 | { 25 | return Value; 26 | } 27 | 28 | public override string ToString() 29 | { 30 | return Utils.ByteArrayToBigEndianHexByteString(Value); 31 | } 32 | 33 | public override byte[] GetNdfText() 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfLong.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using moddingSuite.BL.Ndf; 7 | 8 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 9 | { 10 | class NdfLong : NdfFlatValueWrapper 11 | { 12 | public NdfLong(long value) 13 | : base(NdfType.Long, value) 14 | { 15 | } 16 | 17 | public override byte[] GetBytes() 18 | { 19 | return BitConverter.GetBytes(Convert.ToInt64(Value)); 20 | } 21 | 22 | public override byte[] GetNdfText() 23 | { 24 | return NdfTextWriter.NdfTextEncoding.GetBytes(Value.ToString()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfMapList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 5 | { 6 | public class NdfMapList : NdfCollection 7 | { 8 | public NdfMapList() 9 | { 10 | Type = NdfType.MapList; 11 | } 12 | 13 | public override byte[] GetBytes() 14 | { 15 | var data = new List(); 16 | 17 | data.AddRange(BitConverter.GetBytes(InnerList.Count)); 18 | 19 | foreach (CollectionItemValueHolder valueHolder in InnerList) 20 | { 21 | byte[] valueDat = valueHolder.Value.GetBytes(); 22 | 23 | //if (valueHolder.Value.Type == NdfType.ObjectReference || valueHolder.Value.Type == NdfType.TransTableReference) 24 | // data.AddRange(BitConverter.GetBytes((uint)NdfType.Reference)); 25 | 26 | //data.AddRange(BitConverter.GetBytes((uint)valueHolder.Value.Type)); 27 | data.AddRange(valueDat); 28 | } 29 | 30 | return data.ToArray(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfNull.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 4 | { 5 | public class NdfNull : NdfValueWrapper 6 | { 7 | public NdfNull() 8 | : base(NdfType.Unset) 9 | { 10 | } 11 | 12 | public override string ToString() 13 | { 14 | return "null"; 15 | } 16 | 17 | public override byte[] GetBytes() 18 | { 19 | throw new InvalidOperationException("Null is not to be saved"); 20 | } 21 | 22 | public override byte[] GetNdfText() 23 | { 24 | throw new NotImplementedException(); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfSingle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using moddingSuite.BL; 3 | using moddingSuite.BL.Ndf; 4 | 5 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 6 | { 7 | public class NdfSingle : NdfFlatValueWrapper 8 | { 9 | public NdfSingle(float value) 10 | : base(NdfType.Float32, value) 11 | { 12 | } 13 | 14 | public new float Value 15 | { 16 | get { return (float)base.Value; } 17 | set 18 | { 19 | base.Value = value; 20 | OnPropertyChanged("Value"); 21 | } 22 | } 23 | 24 | public override byte[] GetBytes() 25 | { 26 | return BitConverter.GetBytes(Convert.ToSingle(Value)); 27 | } 28 | 29 | public override string ToString() 30 | { 31 | return string.Format("{0:0.####################}", Value); 32 | } 33 | 34 | public override byte[] GetNdfText() 35 | { 36 | return NdfTextWriter.NdfTextEncoding.GetBytes(Value.ToString()); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfString.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using moddingSuite.BL; 3 | using moddingSuite.BL.Ndf; 4 | 5 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 6 | { 7 | public class NdfString : NdfFlatValueWrapper 8 | { 9 | public NdfString(NdfStringReference value) 10 | : base(NdfType.TableString, value) 11 | { 12 | } 13 | 14 | public override byte[] GetBytes() 15 | { 16 | return BitConverter.GetBytes(((NdfStringReference)Value).Id); 17 | } 18 | 19 | public override byte[] GetNdfText() 20 | { 21 | return NdfTextWriter.NdfTextEncoding.GetBytes(string.Format("\"{0}\"", ((NdfStringReference)Value).Value)); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfTime64.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 8 | { 9 | public class NdfTime64 : NdfFlatValueWrapper 10 | { 11 | public NdfTime64(DateTime value) 12 | : base(NdfType.Time64, value) 13 | { 14 | } 15 | 16 | public override byte[] GetBytes() 17 | { 18 | var unixdt = new DateTime(1970, 1, 1); 19 | var msdt = (DateTime)Value; 20 | 21 | ulong res = (ulong)msdt.Subtract(unixdt).TotalSeconds; 22 | 23 | return BitConverter.GetBytes(res); 24 | } 25 | 26 | public override byte[] GetNdfText() 27 | { 28 | throw new NotImplementedException(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfTrans.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using moddingSuite.BL; 3 | using moddingSuite.BL.Ndf; 4 | 5 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 6 | { 7 | public class NdfTrans : NdfFlatValueWrapper 8 | { 9 | public NdfTrans(NdfTranReference value) 10 | : base(NdfType.TransTableReference, value) 11 | { 12 | } 13 | 14 | public override byte[] GetBytes() 15 | { 16 | return BitConverter.GetBytes(((NdfTranReference)Value).Id); 17 | } 18 | 19 | 20 | public override byte[] GetNdfText() 21 | { 22 | return NdfTextWriter.NdfTextEncoding.GetBytes(string.Format("\"{0}\"", ((NdfStringReference)Value).Value)); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfTrippleInt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 8 | { 9 | public class NdfTrippleInt : NdfFlatValueWrapper 10 | { 11 | private int _value2; 12 | private int _value3; 13 | 14 | public NdfTrippleInt(int value1, int value2, int value3) 15 | : base(NdfType.TrippleInt, value1) 16 | { 17 | Value2 = value2; 18 | Value3 = value3; 19 | } 20 | 21 | public int Value2 22 | { 23 | get { return _value2; } 24 | set 25 | { 26 | _value2 = value; 27 | OnPropertyChanged("Value2"); 28 | } 29 | } 30 | 31 | public int Value3 32 | { 33 | get { return _value3; } 34 | set 35 | { 36 | _value3 = value; 37 | OnPropertyChanged("Value3"); 38 | } 39 | } 40 | 41 | public override byte[] GetBytes() 42 | { 43 | var value = new List(); 44 | value.AddRange(BitConverter.GetBytes(Convert.ToInt32(Value))); 45 | value.AddRange(BitConverter.GetBytes(Convert.ToInt32(Value2))); 46 | value.AddRange(BitConverter.GetBytes(Convert.ToInt32(Value3))); 47 | return value.ToArray(); 48 | } 49 | 50 | public override byte[] GetNdfText() 51 | { 52 | throw new NotImplementedException(); 53 | } 54 | 55 | public override string ToString() 56 | { 57 | return string.Format("Int tripplet: {0} : {1} : {2}", Value, Value2, Value3); 58 | } 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfUInt16.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using moddingSuite.BL; 3 | using moddingSuite.BL.Ndf; 4 | 5 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 6 | { 7 | public class NdfUInt16 : NdfFlatValueWrapper 8 | { 9 | public NdfUInt16(ushort value) 10 | : base(NdfType.UInt16, value) 11 | { 12 | } 13 | 14 | public override byte[] GetBytes() 15 | { 16 | return BitConverter.GetBytes(Convert.ToUInt16(Value)); 17 | } 18 | 19 | public override byte[] GetNdfText() 20 | { 21 | return NdfTextWriter.NdfTextEncoding.GetBytes(Value.ToString()); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfUInt32.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using moddingSuite.BL; 3 | using moddingSuite.BL.Ndf; 4 | 5 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 6 | { 7 | public class NdfUInt32 : NdfFlatValueWrapper 8 | { 9 | public NdfUInt32(uint value) 10 | : base(NdfType.UInt32, value) 11 | { 12 | } 13 | 14 | public override byte[] GetBytes() 15 | { 16 | return BitConverter.GetBytes(Convert.ToUInt32(Value)); 17 | } 18 | 19 | public override byte[] GetNdfText() 20 | { 21 | return NdfTextWriter.NdfTextEncoding.GetBytes(Value.ToString()); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfUnkown.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using moddingSuite.Util; 3 | 4 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 5 | { 6 | public class NdfUnkown : NdfFlatValueWrapper 7 | { 8 | public NdfUnkown(byte[] value) 9 | : base(NdfType.Unknown, value) 10 | { 11 | } 12 | 13 | public override byte[] GetBytes() 14 | { 15 | throw new InvalidOperationException("Cant serialize ndfunknown."); 16 | } 17 | 18 | public override byte[] GetNdfText() 19 | { 20 | throw new NotImplementedException(); 21 | } 22 | 23 | public override string ToString() 24 | { 25 | return string.Format("{0}", Utils.ByteArrayToBigEndianHexByteString((byte[]) Value)); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfValueWrapper.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.ViewModel.Base; 2 | 3 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 4 | { 5 | public abstract class NdfValueWrapper : ViewModelBase, INdfScriptSerializable 6 | { 7 | private NdfType _type; 8 | private NdfPropertyValue _parentProperty; 9 | protected NdfValueWrapper(NdfType type) 10 | { 11 | Type = type; 12 | } 13 | 14 | public NdfType Type 15 | { 16 | get { return _type; } 17 | protected set 18 | { 19 | _type = value; 20 | OnPropertyChanged("Type"); 21 | } 22 | } 23 | public NdfPropertyValue ParentProperty 24 | { 25 | get { return _parentProperty; } 26 | set 27 | { 28 | _parentProperty = value; 29 | } 30 | } 31 | #region INdfScriptSerializable Members 32 | 33 | public abstract byte[] GetNdfText(); 34 | 35 | #endregion 36 | 37 | public abstract byte[] GetBytes(); 38 | } 39 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfVector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Media.Media3D; 4 | using moddingSuite.BL; 5 | using moddingSuite.BL.Ndf; 6 | 7 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 8 | { 9 | public class NdfVector : NdfFlatValueWrapper 10 | { 11 | public NdfVector(Point3D value) 12 | : base(NdfType.Vector, value) 13 | { 14 | } 15 | 16 | public override byte[] GetBytes() 17 | { 18 | var pt = (Point3D) Value; 19 | 20 | var vector = new List(); 21 | 22 | vector.AddRange(BitConverter.GetBytes((Single) pt.X)); 23 | vector.AddRange(BitConverter.GetBytes((Single) pt.Y)); 24 | vector.AddRange(BitConverter.GetBytes((Single) pt.Z)); 25 | 26 | return vector.ToArray(); 27 | } 28 | 29 | public override byte[] GetNdfText() 30 | { 31 | return NdfTextWriter.NdfTextEncoding.GetBytes(Value.ToString()); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfWideString.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 6 | { 7 | public class NdfWideString : NdfFlatValueWrapper 8 | { 9 | public NdfWideString(string value) 10 | : base(NdfType.WideString, value) 11 | { 12 | } 13 | 14 | public override byte[] GetBytes() 15 | { 16 | var data = new List(); 17 | 18 | var val = (string) Value; 19 | 20 | byte[] valBytes = Encoding.Unicode.GetBytes(val); 21 | 22 | data.AddRange(BitConverter.GetBytes(valBytes.Length)); 23 | data.AddRange(valBytes); 24 | 25 | return data.ToArray(); 26 | } 27 | 28 | public override byte[] GetNdfText() 29 | { 30 | throw new NotImplementedException(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/AllTypes/NdfZipBlob.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Ndfbin.Types.AllTypes 8 | { 9 | public class NdfZipBlob : NdfFlatValueWrapper 10 | { 11 | public NdfZipBlob(byte[] value) 12 | : base(NdfType.ZipBlob, value) 13 | { 14 | } 15 | 16 | public override byte[] GetBytes() 17 | { 18 | var val = new List(); 19 | 20 | val.AddRange(BitConverter.GetBytes((uint)((byte[])Value).Length)); 21 | val.Add(1); 22 | val.AddRange((byte[])Value); 23 | 24 | return val.ToArray(); 25 | } 26 | 27 | public override byte[] GetNdfText() 28 | { 29 | throw new NotImplementedException(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /moddingSuite/Model/Ndfbin/Types/NdfType.cs: -------------------------------------------------------------------------------- 1 | namespace moddingSuite.Model.Ndfbin.Types 2 | { 3 | public enum NdfType : uint 4 | { 5 | Boolean = 0x00000000, 6 | Int8 = 0x00000001, 7 | 8 | Int16 = 0x00000018, 9 | UInt16 = 0x00000019, 10 | 11 | 12 | 13 | Int32 = 0x00000002, 14 | UInt32 = 0x00000003, 15 | Float32 = 0x00000005, 16 | Float64 = 0x00000006, 17 | //Float64_2 = 33, 18 | Long = 0x00000013, 19 | Time64 = 0x00000004, 20 | 21 | EugInt2 = 0x0000001F, 22 | EugFloat2 = 0x00000021, 23 | 24 | Guid = 26, 25 | Vector = 0x0000000b, 26 | Color128 = 0x0000000c, 27 | Color32 = 0x0000000d, 28 | TrippleInt = 0x0000000e, 29 | 30 | TableString = 0x00000007, 31 | TableStringFile = 0x0000001C, 32 | WideString = 0x00000008, 33 | 34 | LocalisationHash = 29, 35 | 36 | Hash = 0x00000025, 37 | 38 | Reference = 0x00000009, 39 | ObjectReference = 0xBBBBBBBB, 40 | TransTableReference = 0xAAAAAAAA, 41 | 42 | Map = 0x00000022, 43 | 44 | Blob = 0x00000014, 45 | ZipBlob = 0x0000001E, 46 | 47 | List = 0x00000011, 48 | MapList = 0x00000012, 49 | 50 | Unknown = 0xFFFFFFFF, 51 | Unset = 0xEEEEEEEE 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /moddingSuite/Model/Sav/SavFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Sav 8 | { 9 | public class SavFile 10 | { 11 | private byte[] _checksum = new byte[16]; 12 | 13 | public byte[] Checksum 14 | { 15 | get { return _checksum; } 16 | set { _checksum = value; } 17 | } 18 | 19 | public uint FileSize { get; set; } 20 | 21 | public uint ContentSize1 { get; set; } 22 | public uint ContentSize2 { get; set; } 23 | 24 | public ulong SaveDate {get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /moddingSuite/Model/Scenario/Area.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Media.Media3D; 7 | using moddingSuite.Model.Common; 8 | 9 | namespace moddingSuite.Model.Scenario 10 | { 11 | public class Area 12 | { 13 | private AreaContent _content; 14 | private Point3D _attachmentPoint; 15 | private string _name; 16 | private int _id; 17 | 18 | public string Name 19 | { 20 | get { return _name; } 21 | set { _name = value; } 22 | } 23 | 24 | public int Id 25 | { 26 | get { return _id; } 27 | set { _id = value; } 28 | } 29 | 30 | public Point3D AttachmentPoint 31 | { 32 | get { return _attachmentPoint; } 33 | set { _attachmentPoint = value; } 34 | } 35 | 36 | public AreaContent Content 37 | { 38 | get { return _content; } 39 | set { _content = value; } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /moddingSuite/Model/Scenario/AreaClipped.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Scenario 8 | { 9 | public class AreaClipped 10 | { 11 | private int _startTriangle; 12 | private int _triangleCount; 13 | 14 | private int _startVertex; 15 | private int _vertexCount; 16 | 17 | public int StartTriangle 18 | { 19 | get { return _startTriangle; } 20 | set { _startTriangle = value; } 21 | } 22 | 23 | public int TriangleCount 24 | { 25 | get { return _triangleCount; } 26 | set { _triangleCount = value; } 27 | } 28 | 29 | public int VertexCount 30 | { 31 | get { return _vertexCount; } 32 | set { _vertexCount = value; } 33 | } 34 | 35 | public int StartVertex 36 | { 37 | get { return _startVertex; } 38 | set { _startVertex = value; } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /moddingSuite/Model/Scenario/AreaColletion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Scenario 8 | { 9 | public class AreaColletion : List 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /moddingSuite/Model/Scenario/AreaContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using moddingSuite.Model.Common; 7 | 8 | namespace moddingSuite.Model.Scenario 9 | { 10 | public class AreaContent 11 | { 12 | private List _clippedAreas = new List(); 13 | private AreaClipped _borderTriangle = new AreaClipped(); 14 | private AreaClipped _borderVertex = new AreaClipped(); 15 | 16 | private List _vertices = new List(); 17 | private List _triangles = new List(); 18 | 19 | public List ClippedAreas 20 | { 21 | get { return _clippedAreas; } 22 | set { _clippedAreas = value; } 23 | } 24 | 25 | public AreaClipped BorderTriangle 26 | { 27 | get { return _borderTriangle; } 28 | set { _borderTriangle = value; } 29 | } 30 | 31 | public AreaClipped BorderVertex 32 | { 33 | get { return _borderVertex; } 34 | set { _borderVertex = value; } 35 | } 36 | 37 | public List Vertices 38 | { 39 | get { return _vertices; } 40 | set { _vertices = value; } 41 | } 42 | 43 | public List Triangles 44 | { 45 | get { return _triangles; } 46 | set { _triangles = value; } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /moddingSuite/Model/Scenario/AreaFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Scenario 8 | { 9 | public class AreaFile 10 | { 11 | private List _areaManagers = new List(); 12 | 13 | public List AreaManagers 14 | { 15 | get { return _areaManagers; } 16 | set { _areaManagers = value; } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /moddingSuite/Model/Scenario/AreaVertex.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.Model.Scenario 8 | { 9 | public class AreaVertex 10 | { 11 | public float X; 12 | public float Y; 13 | public float Z; 14 | public float W; 15 | public float Center; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /moddingSuite/Model/Scenario/ScenarioFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using moddingSuite.Model.Ndfbin; 7 | using moddingSuite.ViewModel.Base; 8 | 9 | namespace moddingSuite.Model.Scenario 10 | { 11 | public class ScenarioFile : ViewModelBase 12 | { 13 | private int _version; 14 | private byte[] _checksum; 15 | private NdfBinary _ndfBinary; 16 | private List _contentFiles = new List(); 17 | private AreaFile _zoneData; 18 | public long lastPartStartByte; 19 | public byte[] Checksum 20 | { 21 | get { return _checksum; } 22 | set { _checksum = value; OnPropertyChanged("Checksum"); } 23 | } 24 | 25 | public NdfBinary NdfBinary 26 | { 27 | get { return _ndfBinary; } 28 | set { _ndfBinary = value; OnPropertyChanged("Checksum"); } 29 | } 30 | 31 | public int Version 32 | { 33 | get { return _version; } 34 | set { _version = value; OnPropertyChanged("Version"); } 35 | } 36 | 37 | public List ContentFiles 38 | { 39 | get { return _contentFiles; } 40 | set { _contentFiles = value; } 41 | } 42 | 43 | public AreaFile ZoneData 44 | { 45 | get { return _zoneData; } 46 | set { _zoneData = value; OnPropertyChanged("ZoneData"); } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /moddingSuite/Model/Textures/TgvMipMap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using moddingSuite.ViewModel.Base; 7 | 8 | namespace moddingSuite.Model.Textures 9 | { 10 | public class TgvMipMap : ViewModelBase 11 | { 12 | private uint _offset; 13 | private uint _size; 14 | private int _mipWidth; 15 | private byte[] _content; 16 | 17 | public TgvMipMap() 18 | { 19 | } 20 | 21 | public TgvMipMap(uint offset, uint size, ushort mipWidth) 22 | { 23 | Offset = offset; 24 | Size = size; 25 | MipWidth = mipWidth; 26 | } 27 | 28 | public uint Offset 29 | { 30 | get { return _offset; } 31 | set { _offset = value; OnPropertyChanged(() => Offset); } 32 | } 33 | 34 | public uint Size 35 | { 36 | get { return _size; } 37 | set { _size = value; OnPropertyChanged(() => Size); } 38 | } 39 | 40 | public int MipWidth 41 | { 42 | get { return _mipWidth; } 43 | set { _mipWidth = value; OnPropertyChanged(() => MipWidth); } 44 | } 45 | 46 | public byte[] Content 47 | { 48 | get { return _content; } 49 | set { _content = value; OnPropertyChanged(() => Content);} 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /moddingSuite/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace moddingSuite.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /moddingSuite/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /moddingSuite/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 22 | 23 | -------------------------------------------------------------------------------- /moddingSuite/View/Common/AboutView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | using System.Windows.Input; 3 | 4 | namespace moddingSuite.View.Common 5 | { 6 | /// 7 | /// Interaction logic for AboutView.xaml 8 | /// 9 | public partial class AboutView : Window 10 | { 11 | public AboutView() 12 | { 13 | InitializeComponent(); 14 | } 15 | 16 | private void ButtonClick1(object sender, RoutedEventArgs e) 17 | { 18 | Close(); 19 | } 20 | 21 | private void ImageMouseUp1(object sender, MouseButtonEventArgs e) 22 | { 23 | System.Diagnostics.Process.Start("http://www.gnu.org/licenses/gpl-3.0.en.html"); 24 | } 25 | 26 | private void UIElement_OnMouseUp(object sender, MouseButtonEventArgs e) 27 | { 28 | System.Diagnostics.Process.Start("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XP3SV7QWZ9UEG"); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /moddingSuite/View/Common/MoviePlaybackView.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /moddingSuite/View/Common/MoviePlaybackView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace moddingSuite.View.Common 4 | { 5 | /// 6 | /// Interaction logic for movie_playback.xaml 7 | /// 8 | public partial class MoviePlaybackView : Window 9 | { 10 | public MoviePlaybackView() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Common/TradFileView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace moddingSuite.View.Common 4 | { 5 | /// 6 | /// Interaction logic for TradFileView.xaml 7 | /// 8 | public partial class TradFileView : Window 9 | { 10 | public TradFileView() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Common/UnhandledExceptionView.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 15 | 16 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/Scenario/ScenarioView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | 15 | namespace moddingSuite.View.Scenario 16 | { 17 | /// 18 | /// Interaction logic for ScenarioView.xaml 19 | /// 20 | public partial class ScenarioView : Window 21 | { 22 | public ScenarioView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/BlobEditingTemplate.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/BlobEditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.ValueEditing 4 | { 5 | /// 6 | /// Interaction logic for BooleanEditingTemplate.xaml 7 | /// 8 | public partial class BlobEditingTemplate : UserControl 9 | { 10 | public BlobEditingTemplate() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/BooleanEditingTemplate.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/BooleanEditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.ValueEditing 4 | { 5 | /// 6 | /// Interaction logic for BooleanEditingTemplate.xaml 7 | /// 8 | public partial class BooleanEditingTemplate : UserControl 9 | { 10 | public BooleanEditingTemplate() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/ColorPickerEditingTemplate.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/ColorPickerEditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.ValueEditing 4 | { 5 | /// 6 | /// Interaction logic for ColorPickerEditingTemplate.xaml 7 | /// 8 | public partial class ColorPickerEditingTemplate : UserControl 9 | { 10 | public ColorPickerEditingTemplate() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/FloatEditingTemplate.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/FloatEditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.ValueEditing 4 | { 5 | /// 6 | /// Interaction logic for FloatEditingTemplate.xaml 7 | /// 8 | public partial class FloatEditingTemplate : UserControl 9 | { 10 | public FloatEditingTemplate() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/FloatPairEditingTemplate.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/FloatPairEditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace moddingSuite.View.Ndfbin.ValueEditing 17 | { 18 | /// 19 | /// Interaction logic for FloatPairEditingTemplate.xaml 20 | /// 21 | public partial class FloatPairEditingTemplate : UserControl 22 | { 23 | public FloatPairEditingTemplate() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/GuidEditingTemplate.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/GuidEditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.ValueEditing 4 | { 5 | /// 6 | /// Interaction logic for GuidEditingTemplate.xaml 7 | /// 8 | public partial class GuidEditingTemplate : UserControl 9 | { 10 | public GuidEditingTemplate() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/Int32EditingTemplate.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/Int32EditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.ValueEditing 4 | { 5 | /// 6 | /// Interaction logic for Int32EditingTemplate.xaml 7 | /// 8 | public partial class Int32EditingTemplate : UserControl 9 | { 10 | public Int32EditingTemplate() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/LocaleHashEditingTemplate.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/LocaleHashEditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.ValueEditing 4 | { 5 | /// 6 | /// Interaction logic for LocaleHashEditingTemplate.xaml 7 | /// 8 | public partial class LocaleHashEditingTemplate : UserControl 9 | { 10 | public LocaleHashEditingTemplate() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/MapEditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.ValueEditing 4 | { 5 | /// 6 | /// Interaction logic for MapEditingTemplate.xaml 7 | /// 8 | public partial class MapEditingTemplate : UserControl 9 | { 10 | public MapEditingTemplate() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/ObjectReferenceEditingTemplate.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/ObjectReferenceEditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.ValueEditing 4 | { 5 | /// 6 | /// Interaction logic for ObjectReferenceEditingTemplate.xaml 7 | /// 8 | public partial class ObjectReferenceEditingTemplate : UserControl 9 | { 10 | public ObjectReferenceEditingTemplate() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/StringTableEditingTemplate.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/StringTableEditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.ValueEditing 4 | { 5 | /// 6 | /// Interaction logic for StringTableEditingTemplate.xaml 7 | /// 8 | public partial class StringTableEditingTemplate : UserControl 9 | { 10 | public StringTableEditingTemplate() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/TransTableReferenceEditingTemplate.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/TransTableReferenceEditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.ValueEditing 4 | { 5 | /// 6 | /// Interaction logic for TransTableReferenceEditingTemplate.xaml 7 | /// 8 | public partial class TransTableReferenceEditingTemplate : UserControl 9 | { 10 | public TransTableReferenceEditingTemplate() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/UInt32EditingTemaplte.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/UInt32EditingTemaplte.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.ValueEditing 4 | { 5 | /// 6 | /// Interaction logic for UInt32EditingTemaplte.xaml 7 | /// 8 | public partial class UInt32EditingTemaplte : UserControl 9 | { 10 | public UInt32EditingTemaplte() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/VectorEditingTemplate.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/ValueEditing/VectorEditingTemplate.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace moddingSuite.View.Ndfbin.ValueEditing 17 | { 18 | /// 19 | /// Interaction logic for VectorEditingTemplate.xaml 20 | /// 21 | public partial class VectorEditingTemplate : UserControl 22 | { 23 | public VectorEditingTemplate() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/Viewer/AddCollectionItemView.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 26 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/Viewer/InstanceWindowView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace moddingSuite.View.Ndfbin.Viewer 4 | { 5 | /// 6 | /// Interaction logic for InstancesWindowView.xaml 7 | /// 8 | public partial class InstanceWindowView : Window 9 | { 10 | public InstanceWindowView() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/Viewer/ListEditorWindow.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/Viewer/ListEditorWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace moddingSuite.View.Ndfbin.Viewer 4 | { 5 | /// 6 | /// Interaction logic for ListEditorWindow.xaml 7 | /// 8 | public partial class ListEditorWindow : Window 9 | { 10 | public ListEditorWindow() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/Viewer/ListViewer.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/Viewer/ListViewer.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Controls; 2 | 3 | namespace moddingSuite.View.Ndfbin.Viewer 4 | { 5 | /// 6 | /// Interaction logic for ListViewer.xaml 7 | /// 8 | public partial class ListViewer : UserControl 9 | { 10 | public ListViewer() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/Viewer/ObjectCopyResultView.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/Viewer/ObjectCopyResultView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | 15 | namespace moddingSuite.View.Ndfbin.Viewer 16 | { 17 | /// 18 | /// Interaction logic for ObjectCopyResultView.xaml 19 | /// 20 | public partial class ObjectCopyResultView : Window 21 | { 22 | public ObjectCopyResultView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/Viewer/ReferenceSearchResultView.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /moddingSuite/View/Ndfbin/Viewer/ReferenceSearchResultView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | 15 | namespace moddingSuite.View.Ndfbin.Viewer 16 | { 17 | /// 18 | /// Interaction logic for ReferenceSearchResultViewModel.xaml 19 | /// 20 | public partial class ReferenceSearchResultView : Window 21 | { 22 | public ReferenceSearchResultView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /moddingSuite/View/SpinningWheel/Enums/RotateDirection.cs: -------------------------------------------------------------------------------- 1 | namespace moddingSuite.View.Enums 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | 8 | public enum RotateDirection 9 | { 10 | CW = 0, 11 | CCW = 1 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /moddingSuite/View/VersionManager/VersionManagerView.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /moddingSuite/View/VersionManager/VersionManagerView.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Shapes; 14 | 15 | namespace moddingSuite.View.VersionManager 16 | { 17 | /// 18 | /// Interaction logic for VersionManagerView.xaml 19 | /// 20 | public partial class VersionManagerView : Window 21 | { 22 | public VersionManagerView() 23 | { 24 | InitializeComponent(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/About/AboutViewModel.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.ViewModel.Base; 2 | 3 | namespace moddingSuite.ViewModel.About 4 | { 5 | public class AboutViewModel : ViewModelBase 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Base/ActionCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Windows.Input; 4 | 5 | namespace moddingSuite.ViewModel.Base 6 | { 7 | public class ActionCommand : ICommand 8 | { 9 | private readonly Action _executeHandler; 10 | private readonly Func _canExecuteHandler; 11 | 12 | public ActionCommand(Action execute, Func canExecute = null) 13 | { 14 | if (execute == null) 15 | throw new ArgumentNullException("execute"); 16 | _executeHandler = execute; 17 | _canExecuteHandler = canExecute; 18 | } 19 | 20 | public event EventHandler CanExecuteChanged 21 | { 22 | add { CommandManager.RequerySuggested += value; } 23 | remove { CommandManager.RequerySuggested -= value; } 24 | } 25 | public void Execute(object parameter) 26 | { 27 | _executeHandler(parameter); 28 | } 29 | 30 | [DebuggerStepThrough] 31 | public bool CanExecute(object parameter) 32 | { 33 | return _canExecuteHandler == null || _canExecuteHandler(); 34 | 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Base/ObjectWrapperViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace moddingSuite.ViewModel.Base 4 | { 5 | public abstract class ObjectWrapperViewModel : ViewModelBase 6 | where T : ViewModelBase 7 | { 8 | private ViewModelBase _parentVm; 9 | 10 | protected ObjectWrapperViewModel(T obj, ViewModelBase parentVm) 11 | { 12 | if (obj == null) 13 | throw new ArgumentException("obj"); 14 | //if (parentVm == null) 15 | // throw new ArgumentException("parentVm"); 16 | 17 | Object = obj; 18 | ParentVm = parentVm; 19 | } 20 | 21 | public T Object { get; protected set; } 22 | 23 | public ViewModelBase ParentVm 24 | { 25 | get { return _parentVm; } 26 | set { _parentVm = value; OnPropertyChanged("ParentVm"); } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Base/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Linq.Expressions; 4 | using System.Runtime.CompilerServices; 5 | using System.Xml.Serialization; 6 | 7 | namespace moddingSuite.ViewModel.Base 8 | { 9 | public class ViewModelBase : INotifyPropertyChanged 10 | { 11 | private bool _isUiBusy = false; 12 | 13 | public event PropertyChangedEventHandler PropertyChanged; 14 | 15 | public void OnPropertyChanged(params Expression>[] props) 16 | { 17 | foreach (var prop in props) 18 | { 19 | var body = prop.Body as MemberExpression; 20 | if (PropertyChanged != null && body != null) 21 | PropertyChanged(this, new PropertyChangedEventArgs(body.Member.Name)); 22 | } 23 | } 24 | 25 | public void OnPropertyChanged([CallerMemberName] string prop = "") 26 | { 27 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop)); 28 | } 29 | 30 | [XmlIgnore] 31 | public bool IsUIBusy 32 | { 33 | get 34 | { 35 | return _isUiBusy; 36 | } 37 | set 38 | { 39 | _isUiBusy = value; 40 | OnPropertyChanged(() => IsUIBusy); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Edata/DirectoryViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Diagnostics; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Input; 10 | using moddingSuite.ViewModel.Base; 11 | 12 | namespace moddingSuite.ViewModel.Edata 13 | { 14 | public class DirectoryViewModel : FileSystemItemViewModel 15 | { 16 | private ObservableCollection _items = new ObservableCollection(); 17 | private DirectoryInfo _directoryInfo; 18 | 19 | public DirectoryViewModel(DirectoryInfo info) 20 | { 21 | _directoryInfo = info; 22 | OpenInFileExplorerCommand = new ActionCommand(OpenInFileExplorerExecute); 23 | } 24 | 25 | private void OpenInFileExplorerExecute(object obj) 26 | { 27 | Process.Start(this.Info.FullName); 28 | } 29 | 30 | public ObservableCollection Items 31 | { 32 | get 33 | { 34 | return _items; 35 | } 36 | set 37 | { 38 | _items = value; 39 | OnPropertyChanged(); 40 | } 41 | } 42 | 43 | public DirectoryInfo Info 44 | { 45 | get 46 | { 47 | return _directoryInfo; 48 | } 49 | set 50 | { 51 | _directoryInfo = value; 52 | } 53 | } 54 | 55 | public ICommand OpenInFileExplorerCommand 56 | { 57 | get; set; 58 | } 59 | 60 | public override string Name 61 | { 62 | get 63 | { 64 | return Info.Name; 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Edata/FileSystemItemViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using moddingSuite.ViewModel.Base; 8 | 9 | namespace moddingSuite.ViewModel.Edata 10 | { 11 | public abstract class FileSystemItemViewModel : ViewModelBase 12 | { 13 | public abstract string Name { get; } 14 | 15 | public void Invalidate() 16 | { 17 | OnPropertyChanged(nameof(Name)); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Edata/FileSystemOverviewViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using moddingSuite.ViewModel.Base; 9 | 10 | namespace moddingSuite.ViewModel.Edata 11 | { 12 | public abstract class FileSystemOverviewViewModelBase : ViewModelBase 13 | { 14 | private string _rootPath; 15 | private readonly ObservableCollection _root = new ObservableCollection(); 16 | 17 | public string RootPath 18 | { 19 | get { return _rootPath; } 20 | set 21 | { 22 | _rootPath = value; 23 | OnPropertyChanged(); 24 | } 25 | } 26 | 27 | public ObservableCollection Root 28 | { 29 | get { return _root; } 30 | } 31 | 32 | protected DirectoryViewModel ParseRoot() 33 | { 34 | return ParseDirectory(new DirectoryInfo(RootPath)); 35 | } 36 | 37 | protected DirectoryViewModel ParseDirectory(DirectoryInfo info) 38 | { 39 | var dirVm = new DirectoryViewModel(info); 40 | 41 | foreach (var directoryInfo in dirVm.Info.EnumerateDirectories()) 42 | { 43 | dirVm.Items.Add(ParseDirectory(directoryInfo)); 44 | } 45 | 46 | foreach (var fileInfo in dirVm.Info.EnumerateFiles()) 47 | { 48 | dirVm.Items.Add(new FileViewModel(fileInfo)); 49 | } 50 | 51 | return dirVm; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Edata/FileViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace moddingSuite.ViewModel.Edata 9 | { 10 | public class FileViewModel : FileSystemItemViewModel 11 | { 12 | private FileInfo _fileInfo; 13 | 14 | public FileViewModel(FileInfo info) 15 | { 16 | _fileInfo = info; 17 | } 18 | 19 | public FileInfo Info 20 | { 21 | get { return _fileInfo; } 22 | set 23 | { 24 | _fileInfo = value; 25 | } 26 | } 27 | 28 | public override string Name 29 | { 30 | get 31 | { 32 | return Info.Name; 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Edata/GameSpaceViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using moddingSuite.BL; 8 | using moddingSuite.Model.Settings; 9 | using moddingSuite.ViewModel.Base; 10 | 11 | namespace moddingSuite.ViewModel.Edata 12 | { 13 | public class GameSpaceViewModel : FileSystemOverviewViewModelBase 14 | { 15 | public GameSpaceViewModel(Settings settings) 16 | { 17 | RootPath = settings.WargamePath; 18 | 19 | if (Directory.Exists(RootPath)) 20 | Root.Add(ParseRoot()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Filter/FilterDiscriminator.cs: -------------------------------------------------------------------------------- 1 | namespace moddingSuite.ViewModel.Filter 2 | { 3 | public enum FilterDiscriminator 4 | { 5 | Equals, 6 | Smaller, 7 | Greater, 8 | Contains 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Filter/PropertyFilterExpression.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.ViewModel.Base; 2 | 3 | namespace moddingSuite.ViewModel.Filter 4 | { 5 | public class PropertyFilterExpression : ViewModelBase 6 | { 7 | private string _propertyName; 8 | private string _value; 9 | 10 | private FilterDiscriminator _discriminator = FilterDiscriminator.Equals; 11 | 12 | public string PropertyName 13 | { 14 | get { return _propertyName; } 15 | set { _propertyName = value; OnPropertyChanged(() => PropertyName); } 16 | } 17 | 18 | public string Value 19 | { 20 | get { return _value; } 21 | set { _value = value; OnPropertyChanged(() => Value); } 22 | } 23 | 24 | public FilterDiscriminator Discriminator 25 | { 26 | get { return _discriminator; } 27 | set { _discriminator = value; OnPropertyChanged(() => Discriminator); } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Media/MoviePlaybackViewModel.cs: -------------------------------------------------------------------------------- 1 | using moddingSuite.ViewModel.Base; 2 | 3 | namespace moddingSuite.ViewModel.Media 4 | { 5 | public class MoviePlaybackViewModel : ViewModelBase 6 | { 7 | private string _file; 8 | 9 | public MoviePlaybackViewModel(string file) 10 | { 11 | _file = file; 12 | } 13 | 14 | public string File 15 | { 16 | get { return _file; } 17 | set 18 | { 19 | _file = value; 20 | OnPropertyChanged(() => File); 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Ndf/NdfScriptableClassList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace moddingSuite.ViewModel.Ndf 5 | { 6 | public class NdfScriptableClassList 7 | { 8 | private readonly IList Classes; 9 | 10 | public NdfScriptableClassList(IList classes) 11 | { 12 | Classes = classes; 13 | } 14 | 15 | /// 16 | /// Easy class lookup by name for scripts. 17 | /// 18 | /// 19 | public NdfClassViewModel this[string name] => Classes.FirstOrDefault(cls => cls.Name == name); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Ndf/ObjectCopyResultViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Input; 8 | using moddingSuite.Model.Ndfbin; 9 | using moddingSuite.View.DialogProvider; 10 | using moddingSuite.ViewModel.Base; 11 | 12 | namespace moddingSuite.ViewModel.Ndf 13 | { 14 | public class ObjectCopyResultViewModel : ViewModelBase 15 | { 16 | public ObservableCollection NewInstances { get; set; } 17 | 18 | public ICommand DetailsCommand { get; set; } 19 | 20 | public NdfEditorMainViewModel Editor { get; set; } 21 | 22 | public ObjectCopyResultViewModel(List results, NdfEditorMainViewModel editor) 23 | { 24 | NewInstances = new ObservableCollection(results); 25 | 26 | Editor = editor; 27 | 28 | DetailsCommand = new ActionCommand(DetailsExecute); 29 | } 30 | 31 | private void DetailsExecute(object obj) 32 | { 33 | var instance = obj as NdfObject; 34 | 35 | if (instance == null) 36 | return; 37 | 38 | var vm = new NdfClassViewModel(instance.Class, this); 39 | 40 | NdfObjectViewModel inst = vm.Instances.SingleOrDefault(x => x.Id == instance.Id); 41 | 42 | if (inst == null) 43 | return; 44 | 45 | vm.InstancesCollectionView.MoveCurrentTo(inst); 46 | 47 | DialogProvider.ProvideView(vm, Editor); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/Ndf/ReferenceSearchResultViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | using System.Linq; 4 | using System.Windows.Input; 5 | using moddingSuite.Model.Ndfbin; 6 | using moddingSuite.View.DialogProvider; 7 | using moddingSuite.ViewModel.Base; 8 | 9 | namespace moddingSuite.ViewModel.Ndf 10 | { 11 | public class ReferenceSearchResultViewModel : ViewModelBase 12 | { 13 | public ObservableCollection Results { get; set; } 14 | 15 | public ICommand DetailsCommand { get; set; } 16 | 17 | public NdfEditorMainViewModel Editor { get; set; } 18 | 19 | public ReferenceSearchResultViewModel(List results, NdfEditorMainViewModel editor) 20 | { 21 | Results = new ObservableCollection(results); 22 | 23 | Editor = editor; 24 | 25 | DetailsCommand = new ActionCommand(DetailsExecute); 26 | } 27 | 28 | private void DetailsExecute(object obj) 29 | { 30 | var propVal = obj as NdfPropertyValue; 31 | 32 | if (propVal == null) 33 | return; 34 | 35 | var vm = new NdfClassViewModel(propVal.Instance.Class, this); 36 | 37 | NdfObjectViewModel inst = vm.Instances.SingleOrDefault(x => x.Id == propVal.Instance.Id); 38 | 39 | if (inst == null) 40 | return; 41 | 42 | vm.InstancesCollectionView.MoveCurrentTo(inst); 43 | 44 | DialogProvider.ProvideView(vm, Editor); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/UnhandledException/UnhandledExceptionViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Input; 7 | using moddingSuite.ViewModel.Base; 8 | 9 | namespace moddingSuite.ViewModel.UnhandledException 10 | { 11 | public class UnhandledExceptionViewModel : ViewModelBase 12 | { 13 | private string _title; 14 | private string _errorText; 15 | 16 | public string Title 17 | { 18 | get { return _title; } 19 | set 20 | { 21 | _title = value; 22 | OnPropertyChanged("Title"); 23 | } 24 | } 25 | 26 | public string ErrorText 27 | { 28 | get { return _errorText; } 29 | set 30 | { 31 | _errorText = value; 32 | OnPropertyChanged("ErrorText"); 33 | } 34 | } 35 | 36 | public ICommand SendErrorCommand { get; set; } 37 | 38 | public UnhandledExceptionViewModel(Exception exception) 39 | { 40 | Title = "An unhandled exception occured"; 41 | 42 | SendErrorCommand = new ActionCommand(SendErrorExecute); 43 | 44 | var sb = new StringBuilder(); 45 | 46 | var excep = exception; 47 | 48 | while (excep != null) 49 | { 50 | sb.Append(exception); 51 | excep = excep.InnerException; 52 | } 53 | 54 | ErrorText = sb.ToString(); 55 | } 56 | 57 | private void SendErrorExecute(object obj) 58 | { 59 | throw new NotImplementedException(); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /moddingSuite/ViewModel/VersionManager/VersionFileViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using moddingSuite.ViewModel.Base; 8 | 9 | namespace moddingSuite.ViewModel.VersionManager 10 | { 11 | public class VersionFileViewModel : ViewModelBase 12 | { 13 | private string _path; 14 | private FileInfo _fileInfo; 15 | 16 | public string Path 17 | { 18 | get { return _path; } 19 | set { _path = value; OnPropertyChanged(() => Path);} 20 | } 21 | 22 | public FileInfo FileInfo 23 | { 24 | get { return _fileInfo; } 25 | set { _fileInfo = value; OnPropertyChanged(() => FileInfo);} 26 | } 27 | 28 | public VersionFileViewModel(FileInfo i) 29 | { 30 | FileInfo = i; 31 | Path = i.FullName; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Creater.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Forms; 8 | 9 | namespace Editor 10 | { 11 | class Creater:Control 12 | { 13 | Point position; 14 | public Creater() 15 | { 16 | this.Paint += new PaintEventHandler(paint); 17 | this.Location = new System.Drawing.Point(30, 30); 18 | this.Name = "pictureBox1"; 19 | this.Size = new System.Drawing.Size(5, 5); 20 | //this.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; 21 | this.TabIndex = 1; 22 | this.TabStop = false; 23 | 24 | //this.MouseDown += new MouseEventHandler(OnMouseDown); 25 | //this.MouseUp += new MouseEventHandler(OnMouseUp); 26 | //dragEventHandler = new MouseEventHandler(OnDrag); 27 | 28 | 29 | } 30 | private void paint(object obj, PaintEventArgs e) 31 | { 32 | e.Graphics.FillRectangle(Brushes.Red, new Rectangle(0, 0, 5, 5)); 33 | } 34 | public void setPosition(Point point) 35 | { 36 | 37 | position = point; 38 | UpdateCreater(); 39 | /*p.Offset(-Size.Width / 2, -Size.Height / 2); 40 | var k = new Point((int)(p.X * Form1.zoom), (int)(p.Y * Form1.zoom)); 41 | p.Offset((int)(Form1.imgx), (int)(Form1.imgy));*/ 42 | 43 | //this.Location = p; 44 | } 45 | public Point getPosition() 46 | { 47 | var loc = Location; 48 | loc.Offset(Size.Width / 2, Size.Height / 2); 49 | return PanAndZoom.fromLocalToGlobal(loc); 50 | } 51 | 52 | internal void UpdateCreater() 53 | { 54 | 55 | var loc = PanAndZoom.fromGlobalToLocal(position); 56 | loc.Offset(-Size.Width / 2, -Size.Height / 2); 57 | Location = loc; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/CV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/CV.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/FOB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/FOB.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/N_Hamhung_Gamescon_v11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/N_Hamhung_Gamescon_v11.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_2x2_port_wonsan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_2x2_port_wonsan.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_2x3_anbyon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_2x3_anbyon.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_2x3_boseong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_2x3_boseong.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_2x3_esashi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_2x3_esashi.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_2x3_hwaseong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_2x3_hwaseong.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_2x3_montagne_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_2x3_montagne_2.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_2x3_tohoku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_2x3_tohoku.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_3x2_boryeong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_3x2_boryeong.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_3x2_haenam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_3x2_haenam.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_3x2_montagne_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_3x2_montagne_3.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_3x2_sangju.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_3x2_sangju.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_3x2_taean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_3x2_taean.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_3x2_taebuko.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_3x2_taebuko.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_3x3_chongju.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_3x3_chongju.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_3x3_gangjin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_3x3_gangjin.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_3x3_montagne_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_3x3_montagne_1.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_3x3_montagne_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_3x3_montagne_4.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/_3x3_pyeongtaek.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/_3x3_pyeongtaek.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Images/hopAndGlory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/ZoneEditor/Images/hopAndGlory.png -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Markers/CreaterMarker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Forms; 8 | 9 | namespace moddingSuite.ZoneEditor.Markers 10 | { 11 | class CreaterMarker:Marker 12 | { 13 | public CreaterMarker() 14 | : base() 15 | { 16 | this.Size = new System.Drawing.Size(5, 5); 17 | Console.WriteLine("creater create"); 18 | } 19 | public override void paint(object obj, PaintEventArgs e) 20 | { 21 | Console.WriteLine("paint creater"); 22 | e.Graphics.FillRectangle(Brushes.Red, new Rectangle(0, 0, 5, 5)); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/Markers/Marker.cs: -------------------------------------------------------------------------------- 1 | using ZoneEditor; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Drawing; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using System.Windows.Forms; 9 | 10 | namespace moddingSuite.ZoneEditor.Markers 11 | { 12 | abstract class Marker:Control 13 | { 14 | protected Point position; 15 | public Marker() 16 | { 17 | this.Paint += new PaintEventHandler(paint); 18 | this.Location = new System.Drawing.Point(30, 30); 19 | this.Name = "pictureBox1"; 20 | //this.Size = new System.Drawing.Size(10, 10); 21 | //this.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; 22 | this.TabIndex = 1; 23 | this.TabStop = false; 24 | 25 | //this.MouseDown += new MouseEventHandler(OnMouseDown); 26 | //this.MouseUp += new MouseEventHandler(OnMouseUp); 27 | //dragEventHandler = new MouseEventHandler(OnDrag); 28 | 29 | 30 | } 31 | public abstract void paint(object obj, PaintEventArgs e); 32 | 33 | 34 | public void setPosition(Point point) 35 | { 36 | 37 | position = point; 38 | UpdateMarker(); 39 | } 40 | public Point getPosition() 41 | { 42 | 43 | var loc = Location; 44 | loc.Offset(Size.Width / 2 + 1, Size.Height / 2 + 1); 45 | return PanAndZoom.fromLocalToGlobal(loc); 46 | } 47 | internal void UpdateMarker() 48 | { 49 | var loc = PanAndZoom.fromGlobalToLocal(position); 50 | loc.Offset(-Size.Width / 2, -Size.Height / 2); 51 | Location = loc; 52 | 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/ScenarioItems/IconType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.ZoneEditor.ScenarioItems 8 | { 9 | public enum IconType 10 | { 11 | CV=0, 12 | FOB=1 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/ScenarioItems/Possession.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.ZoneEditor.ScenarioItems 8 | { 9 | public enum Possession: int 10 | { 11 | Redfor=0, 12 | Bluefor=1, 13 | Neutral=2 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/ScenarioItems/Property.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.ZoneEditor.ScenarioItems 8 | { 9 | public class Property 10 | { 11 | public string Name{ get; set; } 12 | public object Value{ get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/ScenarioItems/PropertyPanels/IconProperty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace moddingSuite.ZoneEditor.ScenarioItems.PropertyPanels 12 | { 13 | public partial class IconProperty : UserControl 14 | { 15 | 16 | 17 | Icon icon; 18 | public IconProperty(Icon s) 19 | { 20 | icon = s; 21 | InitializeComponent(); 22 | } 23 | public void update() 24 | { 25 | comboBox1.SelectedIndex = (int)icon.type; 26 | textBox1.Text = string.Format("{0}", icon.priority); 27 | } 28 | private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) 29 | { 30 | icon.type = (IconType)comboBox1.SelectedIndex; 31 | } 32 | 33 | private void textBox1_TextChanged(object sender, EventArgs e) 34 | { 35 | int temp; 36 | if (int.TryParse(textBox1.Text, out temp)) 37 | { 38 | icon.priority = temp; 39 | } 40 | textBox1.Text = string.Format("{0}", icon.priority); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/ScenarioItems/PropertyPanels/SpawnProperty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace moddingSuite.ZoneEditor.ScenarioItems.PropertyPanels 12 | { 13 | public partial class SpawnProperty : UserControl 14 | { 15 | Spawn spawn; 16 | public SpawnProperty(Spawn s) 17 | { 18 | spawn = s; 19 | InitializeComponent(); 20 | } 21 | public void update() 22 | { 23 | comboBox1.SelectedIndex = (int)spawn.type; 24 | //textBox1.Text = string.Format("{0}", zone.value); 25 | } 26 | private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) 27 | { 28 | spawn.type = (SpawnType)comboBox1.SelectedIndex; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/ScenarioItems/PropertyPanels/ZoneProperty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace moddingSuite.ZoneEditor.ScenarioItems.PropertyPanels 12 | { 13 | public partial class ZoneProperty : UserControl 14 | { 15 | Zone zone; 16 | public ZoneProperty(Zone z) 17 | { 18 | InitializeComponent(); 19 | zone = z; 20 | 21 | } 22 | public void update() 23 | { 24 | comboBox1.SelectedIndex = (int)zone.possession; 25 | textBox1.Text = string.Format("{0}", zone.value); 26 | } 27 | private void label1_Click(object sender, EventArgs e) 28 | { 29 | 30 | } 31 | 32 | private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) 33 | { 34 | zone.possession = (Possession)comboBox1.SelectedIndex; 35 | } 36 | 37 | private void textBox1_TextChanged(object sender, EventArgs e) 38 | { 39 | int temp; 40 | if(int.TryParse(textBox1.Text, out temp)){ 41 | zone.value=temp; 42 | } 43 | textBox1.Text = string.Format("{0}", zone.value); 44 | 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /moddingSuite/ZoneEditor/ScenarioItems/SpawnType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace moddingSuite.ZoneEditor.ScenarioItems 8 | { 9 | public enum SpawnType 10 | { 11 | Land=0, 12 | Air=1, 13 | Sea=2 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /moddingSuite/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/is-consulting/moddingSuite/7f1274b614fb907d420cb6ee85c18900018589fd/moddingSuite/icon.ico -------------------------------------------------------------------------------- /tgvExporter/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("tgvExporter")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("tgvExporter")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2e10ba38-10c0-4292-bf0d-97a8b8fcc9b6")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /tgvExporter/tgvExporter.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net472;net5.0-windows 4 | Exe 5 | false 6 | 7 | 8 | 9 | 10 | --------------------------------------------------------------------------------