From 5c33f2adfeccf723b36b1e8360628c778fd7b448 Mon Sep 17 00:00:00 2001 From: Pear <61670316+Pear-231@users.noreply.github.com> Date: Sun, 8 Dec 2024 21:38:09 +0000 Subject: [PATCH 01/13] Change Notes: - Spelling extention --> extension. - Namespace fixes. - Using directives sorting and removing. --- AssetEditor/DependencyInjectionContainer.cs | 2 +- .../ViewModels/EditorShortcutViewModel.cs | 2 +- AssetEditor/ViewModels/MainViewModel.cs | 2 +- .../DependencyInjectionContainer.cs | 2 +- .../DevConfig/MountTool.cs | 3 +- .../MountAnimationCreatorViewModel.cs | 36 +++++++------- .../DependencyInjectionContainer.cs | 8 ++-- .../SuperView/SuperViewViewModel.cs | 5 +- Editors/Audio/Compiler/CompilerViewModel.cs | 2 +- Editors/Audio/DevConfig/AudioEditor_Wh3.cs | 2 +- .../Audio/DevConfig/AudioExplorer_Attila.cs | 2 +- Editors/Audio/DevConfig/AudioExplorer_Wh3.cs | 2 +- Editors/Audio/Storage/BnkLoader.cs | 2 +- Editors/Audio/Storage/DatLoader.cs | 7 ++- .../DependencyInjectionContainer.cs | 6 +-- .../KitbasherEditor/DevConfig/Kitbash_Karl.cs | 2 +- .../DevConfig/Kitbash_Karl_WH2.cs | 2 +- .../KitbasherEditor/DevConfig/Kitbash_Ox.cs | 2 +- .../KitbasherEditor/DevConfig/Kitbash_Rat.cs | 2 +- .../DevConfig/Kitbash_RomeShield.cs | 2 +- .../Animation/AnimMetaDataJsonGenerator.cs | 6 +-- .../Animation/AnimMetaDataReportGenerator.cs | 2 +- .../Reports/Files/FileListReportGenerator.cs | 48 +++++++++---------- .../Geometry/MaterialReportGenerator.cs | 2 +- .../Reports/Geometry/Rmv2ReportGenerator.cs | 2 +- .../ReferenceModel/BinAnimationViewModel.cs | 5 +- .../DependencyInjectionContainer.cs | 22 ++++----- .../Services/AnimPackUpdaterService.cs | 6 +-- .../Services/SkeletonAnimationLookUpHelper.cs | 3 +- .../AnimationBatchExportViewModel.cs | 9 ++-- .../DependencyInjectionContainer.cs | 9 ++-- .../DependencyInjectionContainer.cs | 2 +- .../DependencyInjectionContainer.cs | 6 +-- .../TextureEditor/DevConfig/Texture_Karl.cs | 2 +- ...{SceneExtentions.cs => SceneExtensions.cs} | 2 +- GameWorld/View3D/Components/SceneManager.cs | 12 ++--- .../Materials/Capabilities/TintCapability.cs | 3 +- .../Serialization/WsMaterialRepository.cs | 2 +- .../View3D/Services/ComplexMeshLoader.cs | 5 +- .../Services/TextureFileEditorService.cs | 8 ++-- .../UserInterface/ShaderTextureViewModel.cs | 2 +- Shared/GameFiles/WWise/HircItem.cs | 2 - .../DependencyInjectionContainer.cs | 6 --- .../Events/Global/OpenEditorCommand.cs | 7 ++- Shared/SharedCore/Misc/SaveUtility.cs | 4 +- .../SharedCore/PackFiles/FileSaveService.cs | 26 +++++----- .../SharedCore/PackFiles/Models/PackFile.cs | 6 +-- .../PackFiles/PackFileServiceUtility.cs | 18 +++---- .../SharedCore/ToolCreation/EditorDatabase.cs | 30 +++++------- .../ToolCreation/EditorInfoBuilder.cs | 9 ++-- .../PackFileTree/PackFileBrowserViewModel.cs | 1 + .../PackFileTree/PackFileTreeViewFactory.cs | 3 +- .../BaseDialogs/PackFileTree/SearchFilter.cs | 22 +++++---- .../PackFile/PackFileBrowserWindow.xaml.cs | 1 + .../PackFile/SavePackFileWindow.xaml.cs | 1 + .../StandardDialog/StandardDialogs.cs | 4 +- .../Common/Behaviors/MouseDoubleClick.cs | 8 +--- .../SharedUI/DependencyInjectionContainer.cs | 2 +- .../KitbashEditor_SaveTests.cs | 2 +- ...xtentions.cs => IRmvMaterialExtensions.cs} | 2 +- 60 files changed, 188 insertions(+), 217 deletions(-) rename GameWorld/View3D/Components/{SceneExtentions.cs => SceneExtensions.cs} (98%) rename Testing/GameWorld.Core.Test/TestUtility/{IRmvMaterialExtentions.cs => IRmvMaterialExtensions.cs} (97%) diff --git a/AssetEditor/DependencyInjectionContainer.cs b/AssetEditor/DependencyInjectionContainer.cs index e1ef055d9..533451b06 100644 --- a/AssetEditor/DependencyInjectionContainer.cs +++ b/AssetEditor/DependencyInjectionContainer.cs @@ -7,8 +7,8 @@ using Shared.Core.DependencyInjection; using Shared.Core.DevConfig; using Shared.Core.ErrorHandling.Exceptions; +using Shared.Core.Events.Global; using Shared.Core.ToolCreation; -using Shared.Ui.Events.UiCommands; namespace AssetEditor { diff --git a/AssetEditor/ViewModels/EditorShortcutViewModel.cs b/AssetEditor/ViewModels/EditorShortcutViewModel.cs index 73558c523..134c43947 100644 --- a/AssetEditor/ViewModels/EditorShortcutViewModel.cs +++ b/AssetEditor/ViewModels/EditorShortcutViewModel.cs @@ -1,7 +1,7 @@ using CommunityToolkit.Mvvm.Input; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.ToolCreation; -using Shared.Ui.Events.UiCommands; namespace AssetEditor.ViewModels { diff --git a/AssetEditor/ViewModels/MainViewModel.cs b/AssetEditor/ViewModels/MainViewModel.cs index 0489d11ad..f1dd0b1c9 100644 --- a/AssetEditor/ViewModels/MainViewModel.cs +++ b/AssetEditor/ViewModels/MainViewModel.cs @@ -12,8 +12,8 @@ using Shared.Core.ToolCreation; using Shared.Ui.BaseDialogs.PackFileBrowser; using Shared.Ui.BaseDialogs.PackFileBrowser.ContextMenu; +using Shared.Ui.BaseDialogs.PackFileTree; using Shared.Ui.Common; -using Shared.Ui.Events.UiCommands; namespace AssetEditor.ViewModels { diff --git a/Editors/AnimationEditor/DependencyInjectionContainer.cs b/Editors/AnimationEditor/DependencyInjectionContainer.cs index abeb8c120..82fc4d78a 100644 --- a/Editors/AnimationEditor/DependencyInjectionContainer.cs +++ b/Editors/AnimationEditor/DependencyInjectionContainer.cs @@ -1,8 +1,8 @@ using AnimationEditor.AnimationTransferTool; using AnimationEditor.CampaignAnimationCreator; using AnimationEditor.Common.BaseControl; -using AnimationEditor.MountAnimationCreator; using Editors.AnimationVisualEditors.AnimationKeyframeEditor; +using Editors.AnimationVisualEditors.MountAnimationCreator; using Editors.Shared.Core.Common.BaseControl; using Microsoft.Extensions.DependencyInjection; using Shared.Core.DependencyInjection; diff --git a/Editors/AnimationEditor/MountAnimationCreator/DevConfig/MountTool.cs b/Editors/AnimationEditor/MountAnimationCreator/DevConfig/MountTool.cs index 1a1b9cc8f..45102cd89 100644 --- a/Editors/AnimationEditor/MountAnimationCreator/DevConfig/MountTool.cs +++ b/Editors/AnimationEditor/MountAnimationCreator/DevConfig/MountTool.cs @@ -1,5 +1,4 @@ -using AnimationEditor.MountAnimationCreator; -using Editors.Shared.Core.Common.BaseControl; +using Editors.Shared.Core.Common.BaseControl; using Shared.Core.DevConfig; using Shared.Core.PackFiles; using Shared.Core.Settings; diff --git a/Editors/AnimationEditor/MountAnimationCreator/MountAnimationCreatorViewModel.cs b/Editors/AnimationEditor/MountAnimationCreator/MountAnimationCreatorViewModel.cs index bef882133..a2351d58c 100644 --- a/Editors/AnimationEditor/MountAnimationCreator/MountAnimationCreatorViewModel.cs +++ b/Editors/AnimationEditor/MountAnimationCreator/MountAnimationCreatorViewModel.cs @@ -3,36 +3,36 @@ using System.Collections.ObjectModel; using System.IO; using System.Linq; -using AnimationEditor.AnimationKeyframeEditor; using System.Windows.Forms; +using AnimationEditor.AnimationKeyframeEditor; +using AnimationEditor.MountAnimationCreator; using AnimationEditor.MountAnimationCreator.Services; using AnimationEditor.MountAnimationCreator.ViewModels; +using Editors.AnimationVisualEditors.MountAnimationCreator.Services; +using Editors.Shared.Core.Common; +using Editors.Shared.Core.Common.AnimationPlayer; +using Editors.Shared.Core.Common.BaseControl; +using Editors.Shared.Core.Common.ReferenceModel; using Editors.Shared.Core.Services; +using GameWorld.Core.Animation; +using GameWorld.Core.Components.Selection; +using GameWorld.Core.SceneNodes; using Microsoft.Xna.Framework; using Newtonsoft.Json; +using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.Misc; using Shared.Core.PackFiles; using Shared.GameFormats.AnimationPack; using Shared.Ui.Common; -using MessageBox = System.Windows.Forms.MessageBox; using Clipboard = System.Windows.Clipboard; -using Shared.Ui.Events.UiCommands; -using Shared.Core.Events; -using GameWorld.Core.Components.Selection; -using GameWorld.Core.Animation; -using GameWorld.Core.SceneNodes; -using Editors.Shared.Core.Common.BaseControl; -using Editors.Shared.Core.Common; -using Editors.Shared.Core.Common.AnimationPlayer; -using Editors.Shared.Core.Common.ReferenceModel; -using Editors.AnimationVisualEditors.MountAnimationCreator.Services; - +using MessageBox = System.Windows.Forms.MessageBox; -namespace AnimationEditor.MountAnimationCreator +namespace Editors.AnimationVisualEditors.MountAnimationCreator { public class MountAnimationCreatorViewModel : NotifyPropertyChangedImpl, IHostedEditor { - public Type EditorViewModelType => typeof(EditorView); + public Type EditorViewModelType => typeof(AnimationEditor.CampaignAnimationCreator.EditorView); private readonly SceneObjectViewModelBuilder _sceneObjectViewModelBuilder; private readonly SceneObjectEditor _sceneObjectBuilder; private readonly IFileSaveService _fileSaveService; @@ -45,7 +45,7 @@ public class MountAnimationCreatorViewModel : NotifyPropertyChangedImpl, IHosted SceneObject _mount; SceneObject _rider; SceneObject _newAnimation; - + List _mountVertexes = new(); Rmv2MeshNode _mountVertexOwner; @@ -75,8 +75,8 @@ public class MountAnimationCreatorViewModel : NotifyPropertyChangedImpl, IHosted public FilterCollection ActiveOutputFragment { get; set; } public FilterCollection ActiveFragmentSlot { get; set; } - public MountAnimationCreatorViewModel(IPackFileService pfs, - SkeletonAnimationLookUpHelper skeletonAnimationLookUpHelper, + public MountAnimationCreatorViewModel(IPackFileService pfs, + SkeletonAnimationLookUpHelper skeletonAnimationLookUpHelper, SelectionManager selectionManager, SceneObjectViewModelBuilder sceneObjectViewModelBuilder, AnimationPlayerViewModel animationPlayerViewModel, diff --git a/Editors/AnimationMeta/DependencyInjectionContainer.cs b/Editors/AnimationMeta/DependencyInjectionContainer.cs index 4f6de2d81..0420d8047 100644 --- a/Editors/AnimationMeta/DependencyInjectionContainer.cs +++ b/Editors/AnimationMeta/DependencyInjectionContainer.cs @@ -43,14 +43,14 @@ public override void RegisterTools(IEditorDatabase factory) { EditorInfoBuilder .Create(EditorEnums.SuperView_Editor) - .AddToToolbar("SuperView") + .AddToToolbar("Super View") .Build(factory); EditorInfoBuilder .Create (EditorEnums.Meta_Editor) - .AddExtention(".anm.meta", EditorPriorites.High) - .AddExtention(".meta", EditorPriorites.High) - .AddExtention(".snd.meta", EditorPriorites.High) + .AddExtension(".anm.meta", EditorPriorites.High) + .AddExtension(".meta", EditorPriorites.High) + .AddExtension(".snd.meta", EditorPriorites.High) .Build(factory); } } diff --git a/Editors/AnimationMeta/SuperView/SuperViewViewModel.cs b/Editors/AnimationMeta/SuperView/SuperViewViewModel.cs index 67f19556d..da61f6bc1 100644 --- a/Editors/AnimationMeta/SuperView/SuperViewViewModel.cs +++ b/Editors/AnimationMeta/SuperView/SuperViewViewModel.cs @@ -39,7 +39,8 @@ public SuperViewViewModel( IEditorHostParameters editorHostParameters) : base(editorHostParameters) { - DisplayName = "Super view"; + DisplayName = "Super View"; + _packFileService = packFileService; _skeletonAnimationLookUpHelper = skeletonAnimationLookUpHelper; _eventHub = eventHub; @@ -58,7 +59,7 @@ private void OnFileSaved(ScopedFileSavedEvent evnt) else if (evnt.FileOwner == MetaEditor) _sceneObjectBuilder.SetMetaFile(_asset.Data, newFile, _asset.Data.PersistMetaData); else - throw new Exception($"Unable to determine file owner when reciving a file save event in SuperView. Owner:{evnt.FileOwner}, File:{evnt.NewPath}"); + throw new Exception($"Unable to determine file owner when receiving a file save event in SuperView. Owner:{evnt.FileOwner}, File:{evnt.NewPath}"); } void Initialize() diff --git a/Editors/Audio/Compiler/CompilerViewModel.cs b/Editors/Audio/Compiler/CompilerViewModel.cs index 5ac8b81ac..bebd33820 100644 --- a/Editors/Audio/Compiler/CompilerViewModel.cs +++ b/Editors/Audio/Compiler/CompilerViewModel.cs @@ -26,7 +26,7 @@ public CompilerViewModel(IPackFileService pfs, CompilerService compilerService, _compilerService = compilerService; _packFileUiProvider = packFileUiProvider; var audioProjectFiles = PackFileServiceUtility.FindAllFilesInDirectory(pfs, "audioprojects") - .Where(x => x.Extention.ToLower() == ".json"); + .Where(x => x.Extension.ToLower() == ".json"); if (audioProjectFiles.Any()) ProjectFilePath.Value = pfs.GetFullPath(audioProjectFiles.First()); diff --git a/Editors/Audio/DevConfig/AudioEditor_Wh3.cs b/Editors/Audio/DevConfig/AudioEditor_Wh3.cs index 60c2ff8ed..ff567558d 100644 --- a/Editors/Audio/DevConfig/AudioEditor_Wh3.cs +++ b/Editors/Audio/DevConfig/AudioEditor_Wh3.cs @@ -1,8 +1,8 @@ using Shared.Core.DevConfig; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.Settings; using Shared.Core.ToolCreation; -using Shared.Ui.Events.UiCommands; namespace Editors.Audio.DevConfig { diff --git a/Editors/Audio/DevConfig/AudioExplorer_Attila.cs b/Editors/Audio/DevConfig/AudioExplorer_Attila.cs index 0570fd9ed..8d803e7c1 100644 --- a/Editors/Audio/DevConfig/AudioExplorer_Attila.cs +++ b/Editors/Audio/DevConfig/AudioExplorer_Attila.cs @@ -1,8 +1,8 @@ using Shared.Core.DevConfig; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.Settings; using Shared.Core.ToolCreation; -using Shared.Ui.Events.UiCommands; namespace Editors.Audio.DevConfig { diff --git a/Editors/Audio/DevConfig/AudioExplorer_Wh3.cs b/Editors/Audio/DevConfig/AudioExplorer_Wh3.cs index 329baf873..4e877f35a 100644 --- a/Editors/Audio/DevConfig/AudioExplorer_Wh3.cs +++ b/Editors/Audio/DevConfig/AudioExplorer_Wh3.cs @@ -1,8 +1,8 @@ using Shared.Core.DevConfig; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.Settings; using Shared.Core.ToolCreation; -using Shared.Ui.Events.UiCommands; namespace Editors.Audio.DevConfig { diff --git a/Editors/Audio/Storage/BnkLoader.cs b/Editors/Audio/Storage/BnkLoader.cs index 8246853ad..ba14b2d0f 100644 --- a/Editors/Audio/Storage/BnkLoader.cs +++ b/Editors/Audio/Storage/BnkLoader.cs @@ -46,7 +46,7 @@ public ParsedBnkFile LoadBnkFile(PackFile bnkFile, string bnkFileName, bool prin public LoadResult LoadBnkFiles(bool onlyEnglish = true) { - var bankFiles = PackFileServiceUtility.FindAllWithExtentionIncludePaths(_pfs, ".bnk"); + var bankFiles = PackFileServiceUtility.FindAllWithExtensionIncludePaths(_pfs, ".bnk"); var bankFilesAsDictionary = bankFiles.GroupBy(f => f.FileName).ToDictionary(g => g.Key, g => g.Last().Pack); var removeFilter = new List() { "media", "init.bnk", "animation_blood_data.bnk" }; if (onlyEnglish) diff --git a/Editors/Audio/Storage/DatLoader.cs b/Editors/Audio/Storage/DatLoader.cs index a95123020..a6227cf8c 100644 --- a/Editors/Audio/Storage/DatLoader.cs +++ b/Editors/Audio/Storage/DatLoader.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Text; using Editors.Audio.Utility; @@ -44,11 +43,11 @@ public Dictionary BuildNameHelper(SoundDatFile wh3Db) AddNames(wh3DbNameList); // Add all the bnk file names - var bnkFiles = PackFileServiceUtility.FindAllWithExtention(_pfs, ".bnk"); + var bnkFiles = PackFileServiceUtility.FindAllWithExtension(_pfs, ".bnk"); var bnkNames = bnkFiles.Select(x => x.Name.Replace(".bnk", "")).ToArray(); AddNames(bnkNames); - var wwiseIdFiles = PackFileServiceUtility.FindAllWithExtention(_pfs, ".wwiseids"); + var wwiseIdFiles = PackFileServiceUtility.FindAllWithExtension(_pfs, ".wwiseids"); foreach (var item in wwiseIdFiles) { var data = Encoding.UTF8.GetString(item.DataSource.ReadData()); @@ -65,7 +64,7 @@ SoundDatFile LoadDatFiles(IPackFileService pfs, out List failedFiles) var datDumpsFolderName = $"{DirectoryHelper.Temp}\\DatDumps"; DirectoryHelper.EnsureCreated(datDumpsFolderName); - var datFiles = PackFileServiceUtility.FindAllWithExtention(pfs, ".dat"); + var datFiles = PackFileServiceUtility.FindAllWithExtension(pfs, ".dat"); datFiles = PackFileUtil.FilterUnvantedFiles(pfs, datFiles, new[] { "bank_splits.dat", "campaign_music.dat", "battle_music.dat", "icudt61l.dat" }, out var removedFiles); var failedDatParsing = new List<(string, string)>(); diff --git a/Editors/KitbasherEditor/DependencyInjectionContainer.cs b/Editors/KitbasherEditor/DependencyInjectionContainer.cs index ee0986b24..b62ac36f8 100644 --- a/Editors/KitbasherEditor/DependencyInjectionContainer.cs +++ b/Editors/KitbasherEditor/DependencyInjectionContainer.cs @@ -105,9 +105,9 @@ public override void RegisterTools(IEditorDatabase factory) { EditorInfoBuilder .Create(EditorEnums.Kitbash_Editor) - .AddExtention(".rigid_model_v2", EditorPriorites.High) - //.AddExtention(".variantmeshdefinition", 0) - .AddExtention(".wsmodel", EditorPriorites.High) + .AddExtension(".rigid_model_v2", EditorPriorites.High) + //.AddExtension(".variantmeshdefinition", 0) + .AddExtension(".wsmodel", EditorPriorites.High) .Build(factory); } } diff --git a/Editors/KitbasherEditor/DevConfig/Kitbash_Karl.cs b/Editors/KitbasherEditor/DevConfig/Kitbash_Karl.cs index 0840e9878..5020de4d1 100644 --- a/Editors/KitbasherEditor/DevConfig/Kitbash_Karl.cs +++ b/Editors/KitbasherEditor/DevConfig/Kitbash_Karl.cs @@ -1,10 +1,10 @@ using Shared.Core.DevConfig; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.PackFiles; using Shared.Core.Settings; using Shared.Core.ToolCreation; using Shared.EmbeddedResources; -using Shared.Ui.Events.UiCommands; namespace Editors.KitbasherEditor.DevConfig { diff --git a/Editors/KitbasherEditor/DevConfig/Kitbash_Karl_WH2.cs b/Editors/KitbasherEditor/DevConfig/Kitbash_Karl_WH2.cs index 013dca271..792a30605 100644 --- a/Editors/KitbasherEditor/DevConfig/Kitbash_Karl_WH2.cs +++ b/Editors/KitbasherEditor/DevConfig/Kitbash_Karl_WH2.cs @@ -1,8 +1,8 @@ using Shared.Core.DevConfig; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.PackFiles; using Shared.Core.Settings; -using Shared.Ui.Events.UiCommands; namespace Editors.KitbasherEditor.DevConfig { diff --git a/Editors/KitbasherEditor/DevConfig/Kitbash_Ox.cs b/Editors/KitbasherEditor/DevConfig/Kitbash_Ox.cs index f5d0d9a3a..19d4ee340 100644 --- a/Editors/KitbasherEditor/DevConfig/Kitbash_Ox.cs +++ b/Editors/KitbasherEditor/DevConfig/Kitbash_Ox.cs @@ -1,9 +1,9 @@ using Shared.Core.DevConfig; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.PackFiles; using Shared.Core.Settings; using Shared.EmbeddedResources; -using Shared.Ui.Events.UiCommands; namespace Editors.KitbasherEditor.DevConfig { diff --git a/Editors/KitbasherEditor/DevConfig/Kitbash_Rat.cs b/Editors/KitbasherEditor/DevConfig/Kitbash_Rat.cs index d9773c933..15a805565 100644 --- a/Editors/KitbasherEditor/DevConfig/Kitbash_Rat.cs +++ b/Editors/KitbasherEditor/DevConfig/Kitbash_Rat.cs @@ -3,10 +3,10 @@ using Shared.Core.DependencyInjection; using Shared.Core.DevConfig; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.PackFiles; using Shared.Core.Settings; using Shared.EmbeddedResources; -using Shared.Ui.Events.UiCommands; namespace Editors.KitbasherEditor.DevConfig { diff --git a/Editors/KitbasherEditor/DevConfig/Kitbash_RomeShield.cs b/Editors/KitbasherEditor/DevConfig/Kitbash_RomeShield.cs index 78ace9e4e..e426527aa 100644 --- a/Editors/KitbasherEditor/DevConfig/Kitbash_RomeShield.cs +++ b/Editors/KitbasherEditor/DevConfig/Kitbash_RomeShield.cs @@ -1,9 +1,9 @@ using Shared.Core.DevConfig; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.PackFiles; using Shared.Core.Settings; using Shared.EmbeddedResources; -using Shared.Ui.Events.UiCommands; namespace Editors.KitbasherEditor.DevConfig { diff --git a/Editors/Reports/Animation/AnimMetaDataJsonGenerator.cs b/Editors/Reports/Animation/AnimMetaDataJsonGenerator.cs index aead9ce21..bb6d677a9 100644 --- a/Editors/Reports/Animation/AnimMetaDataJsonGenerator.cs +++ b/Editors/Reports/Animation/AnimMetaDataJsonGenerator.cs @@ -1,8 +1,6 @@ using System.Diagnostics; using System.Windows; -using CommonControls.BaseDialogs; using CommonControls.Editors.AnimationPack.Converters; -using Editors.Reports.DeepSearch; using Newtonsoft.Json; using Serilog; using Shared.Core.ErrorHandling; @@ -78,7 +76,7 @@ public void Create() } } - var allMeta = PackFileServiceUtility.FindAllWithExtentionIncludePaths(_pfs, ".meta"); + var allMeta = PackFileServiceUtility.FindAllWithExtensionIncludePaths(_pfs, ".meta"); foreach (var (fileName, packFile) in allMeta) { try @@ -97,7 +95,7 @@ public void Create() } } - var allAnimations = PackFileServiceUtility.FindAllWithExtentionIncludePaths(_pfs, ".anim"); + var allAnimations = PackFileServiceUtility.FindAllWithExtensionIncludePaths(_pfs, ".anim"); foreach (var (fileName, packFile) in allAnimations) { try diff --git a/Editors/Reports/Animation/AnimMetaDataReportGenerator.cs b/Editors/Reports/Animation/AnimMetaDataReportGenerator.cs index ea43fa728..ff686f0d7 100644 --- a/Editors/Reports/Animation/AnimMetaDataReportGenerator.cs +++ b/Editors/Reports/Animation/AnimMetaDataReportGenerator.cs @@ -59,7 +59,7 @@ public void Create() var output = new Dictionary(); - var fileList = PackFileServiceUtility.FindAllWithExtentionIncludePaths(_pfs, ".meta"); + var fileList = PackFileServiceUtility.FindAllWithExtensionIncludePaths(_pfs, ".meta"); var failedFiles = new List(); var metaTable = new List<(string Path, MetaDataFile File)>(); diff --git a/Editors/Reports/Files/FileListReportGenerator.cs b/Editors/Reports/Files/FileListReportGenerator.cs index edd9baa51..7e32304f9 100644 --- a/Editors/Reports/Files/FileListReportGenerator.cs +++ b/Editors/Reports/Files/FileListReportGenerator.cs @@ -3,7 +3,6 @@ using System.Text; using System.Text.RegularExpressions; using System.Windows; -using Editors.Reports.Animation; using Serilog; using Shared.Core.ErrorHandling; using Shared.Core.Events; @@ -24,8 +23,8 @@ public class FileListReportGenerator class FileItem { public string FileName { get; set; } - public string Extention { get; set; } = ""; - public string ExtentionLast { get; set; } = ""; + public string Extension { get; set; } = ""; + public string ExtensionLast { get; set; } = ""; public long Size { get; set; } public string PackFileName { get; set; } = ""; public string CheckSum { get; set; } @@ -89,12 +88,12 @@ public string Create() } bool IsDb(string fileName) => fileName.StartsWith(@"db\", StringComparison.InvariantCultureIgnoreCase); - string LastExtention(string fileName) => Path.GetExtension(fileName); + string LastExtension(string fileName) => Path.GetExtension(fileName); FileItem CreateFileItemFromFile(string fileName, PackFile file) { - var extention = Regex.Match(fileName, @"\..*").Value; - var extentionLast = LastExtention(fileName); + var extension = Regex.Match(fileName, @"\..*").Value; + var extensionLast = LastExtension(fileName); var size = file.DataSource.Size; var checkSum = _md5Instance.ComputeHash(file.DataSource.ReadData()); var isDb = IsDb(fileName); @@ -106,8 +105,8 @@ FileItem CreateFileItemFromFile(string fileName, PackFile file) return new FileItem() { FileName = fileName, - Extention = extention, - ExtentionLast = extentionLast, + Extension = extension, + ExtensionLast = extensionLast, Size = size, CheckSum = checkSumStr, IsDb = isDb, @@ -115,8 +114,6 @@ FileItem CreateFileItemFromFile(string fileName, PackFile file) }; } - - public void CompareFiles(string oldFilePath, string newFilePath) { var oldData = LoadFile(oldFilePath); @@ -204,17 +201,16 @@ Dictionary LoadFile(string path) return output; } - - int DetermineVersion(StreamReader fileReader) + private static int DetermineVersion(StreamReader fileReader) { var line = fileReader.ReadLine(); if (line.Contains("sep", StringComparison.InvariantCultureIgnoreCase)) { var header = fileReader.ReadLine(); - if (header.Contains("ExtentionLast", StringComparison.InvariantCultureIgnoreCase) && !header.Contains("IsDb", StringComparison.InvariantCultureIgnoreCase)) + if (header.Contains("ExtensionLast", StringComparison.InvariantCultureIgnoreCase) && !header.Contains("IsDb", StringComparison.InvariantCultureIgnoreCase)) return 1; - if (header.Contains("ExtentionLast", StringComparison.InvariantCultureIgnoreCase) && header.Contains("IsDb", StringComparison.InvariantCultureIgnoreCase)) + if (header.Contains("ExtensionLast", StringComparison.InvariantCultureIgnoreCase) && header.Contains("IsDb", StringComparison.InvariantCultureIgnoreCase)) return 2; return 0; @@ -231,8 +227,8 @@ FileItem LoadFromCsv(string line, int version) return new FileItem() { FileName = parts[0], - Extention = parts[1], - ExtentionLast = LastExtention(parts[0]), + Extension = parts[1], + ExtensionLast = LastExtension(parts[0]), Size = long.Parse(parts[2]), PackFileName = parts[3], CheckSum = parts[4], @@ -244,8 +240,8 @@ FileItem LoadFromCsv(string line, int version) return new FileItem() { FileName = parts[0], - Extention = parts[1], - ExtentionLast = parts[2], + Extension = parts[1], + ExtensionLast = parts[2], Size = long.Parse(parts[3]), PackFileName = parts[4], CheckSum = parts[5], @@ -257,8 +253,8 @@ FileItem LoadFromCsv(string line, int version) return new FileItem() { FileName = parts[0], - Extention = parts[1], - ExtentionLast = parts[2], + Extension = parts[1], + ExtensionLast = parts[2], Size = long.Parse(parts[3]), PackFileName = parts[4], CheckSum = parts[5], @@ -270,8 +266,8 @@ FileItem LoadFromCsv(string line, int version) return new FileItem() { FileName = parts[0], - Extention = parts[1], - ExtentionLast = parts[2], + Extension = parts[1], + ExtensionLast = parts[2], Size = long.Parse(parts[3]), PackFileName = parts[4], CheckSum = parts[5], @@ -282,15 +278,15 @@ FileItem LoadFromCsv(string line, int version) throw new Exception("Unknown version"); } - void WriteHeader(StreamWriter streamWriter) + static void WriteHeader(StreamWriter streamWriter) { streamWriter.WriteLine("sep=|"); - streamWriter.WriteLine("FileName|Extention|ExtentionLast|Size|PackFile|CheckSum|IsDb"); + streamWriter.WriteLine("FileName|Extension|ExtensionLast|Size|PackFile|CheckSum|IsDb"); } - void WriteItem(StreamWriter writer, FileItem fileItem) + static void WriteItem(StreamWriter writer, FileItem fileItem) { - writer.WriteLine($"{fileItem.FileName}|{fileItem.Extention}|{fileItem.ExtentionLast}|{fileItem.Size}|{fileItem.PackFileName}|{fileItem.CheckSum}|{fileItem.IsDb}"); + writer.WriteLine($"{fileItem.FileName}|{fileItem.Extension}|{fileItem.ExtensionLast}|{fileItem.Size}|{fileItem.PackFileName}|{fileItem.CheckSum}|{fileItem.IsDb}"); } } } diff --git a/Editors/Reports/Geometry/MaterialReportGenerator.cs b/Editors/Reports/Geometry/MaterialReportGenerator.cs index 76bbd810b..ec1f56931 100644 --- a/Editors/Reports/Geometry/MaterialReportGenerator.cs +++ b/Editors/Reports/Geometry/MaterialReportGenerator.cs @@ -29,7 +29,7 @@ public void Create() var shaderMap = new Dictionary>(); // Collect all files and sort them - var fileList = PackFileServiceUtility.FindAllWithExtention(_pfs, ".wsmodel"); + var fileList = PackFileServiceUtility.FindAllWithExtension(_pfs, ".wsmodel"); var notFoundFiles = new List(); var errorFiles = new List<(string, Exception)>(); foreach (var file in fileList) diff --git a/Editors/Reports/Geometry/Rmv2ReportGenerator.cs b/Editors/Reports/Geometry/Rmv2ReportGenerator.cs index f668808c6..9d75be627 100644 --- a/Editors/Reports/Geometry/Rmv2ReportGenerator.cs +++ b/Editors/Reports/Geometry/Rmv2ReportGenerator.cs @@ -35,7 +35,7 @@ public void Create(string outputDir = @"c:\temp\AssReports\rmv\") var gameName = _gameInformationFactory.GetGameById(_applicationSettingsService.CurrentSettings.CurrentGame).DisplayName; var gameDirectory = gameName; - var fileList = PackFileServiceUtility.FindAllWithExtention(_pfs, ".rigid_model_v2"); + var fileList = PackFileServiceUtility.FindAllWithExtension(_pfs, ".rigid_model_v2"); var failedMeshRecords = new List(); var versionInfoRecords = new List(); diff --git a/Editors/Shared/Editors.Shared.Core/Common/ReferenceModel/BinAnimationViewModel.cs b/Editors/Shared/Editors.Shared.Core/Common/ReferenceModel/BinAnimationViewModel.cs index 6f743730c..4a74e5272 100644 --- a/Editors/Shared/Editors.Shared.Core/Common/ReferenceModel/BinAnimationViewModel.cs +++ b/Editors/Shared/Editors.Shared.Core/Common/ReferenceModel/BinAnimationViewModel.cs @@ -4,11 +4,11 @@ using Editors.Shared.Core.Services; using GameWorld.Core.Animation; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.PackFiles; using Shared.Core.PackFiles.Models; using Shared.GameFormats.AnimationPack; using Shared.Ui.Common; -using Shared.Ui.Events.UiCommands; using static Editors.Shared.Core.Services.SkeletonAnimationLookUpHelper; namespace Editors.Shared.Core.Common.ReferenceModel @@ -46,9 +46,6 @@ public BinAnimationViewModel(SceneObjectEditor sceneObjectEditor, IPackFileServi OnSkeletonChange(_sceneObject.Skeleton); _sceneObject.SkeletonChanged += OnSkeletonChange; - - - } public void PreviewSelectedSlot() diff --git a/Editors/Shared/Editors.Shared.Core/DependencyInjectionContainer.cs b/Editors/Shared/Editors.Shared.Core/DependencyInjectionContainer.cs index 32ccd2e7d..785e58071 100644 --- a/Editors/Shared/Editors.Shared.Core/DependencyInjectionContainer.cs +++ b/Editors/Shared/Editors.Shared.Core/DependencyInjectionContainer.cs @@ -47,21 +47,21 @@ public override void RegisterTools(IEditorDatabase factory) { EditorInfoBuilder .Create, TextEditorView>(EditorEnums.XML_VariantMesh_Editor) - .AddExtention(".variantmeshdefinition", EditorPriorites.High) + .AddExtension(".variantmeshdefinition", EditorPriorites.High) .Build(factory); - EditorInfoBuilder .Create, TextEditorView>(EditorEnums.XML_Editor) - .AddExtention(".json", EditorPriorites.Default) - .AddExtention(".xml", EditorPriorites.Default) - .AddExtention(".txt", EditorPriorites.Default) - .AddExtention(".wsmodel", EditorPriorites.Default) - .AddExtention(".xml.material", EditorPriorites.Default) - .AddExtention(".anm.meta.xml", EditorPriorites.Default) - .AddExtention(".bmd.xml", EditorPriorites.Default) - .AddExtention(".csv", EditorPriorites.Default) - .AddExtention(".bnk.xml", EditorPriorites.Default) + .AddExtension(".json", EditorPriorites.Default) + .AddExtension(".xml", EditorPriorites.Default) + .AddExtension(".txt", EditorPriorites.Default) + .AddExtension(".wsmodel", EditorPriorites.Default) + .AddExtension(".xml.material", EditorPriorites.Default) + .AddExtension(".anm.meta.xml", EditorPriorites.Default) + .AddExtension(".bmd.xml", EditorPriorites.Default) + .AddExtension(".csv", EditorPriorites.Default) + .AddExtension(".bnk.xml", EditorPriorites.Default) + .AddExtension(".aproj", EditorPriorites.Default) .Build(factory); } } diff --git a/Editors/Shared/Editors.Shared.Core/Services/AnimPackUpdaterService.cs b/Editors/Shared/Editors.Shared.Core/Services/AnimPackUpdaterService.cs index 745d55b1c..72b4a9b04 100644 --- a/Editors/Shared/Editors.Shared.Core/Services/AnimPackUpdaterService.cs +++ b/Editors/Shared/Editors.Shared.Core/Services/AnimPackUpdaterService.cs @@ -34,7 +34,7 @@ public void Process(GameTypeEnum existingPackVersion = GameTypeEnum.Warhammer2, if (existingPackVersion != GameTypeEnum.Warhammer2) throw new Exception($"{outputFormat} selected as input, only Warhammer 2 is currently supported"); - var animPackFiles = PackFileServiceUtility.FindAllWithExtention(_pfs, ".animpack", packFileContainer); + var animPackFiles = PackFileServiceUtility.FindAllWithExtension(_pfs, ".animpack", packFileContainer); var animPacks = animPackFiles.Select(x => AnimationPackSerializer.Load(x, _pfs, GameTypeEnum.Warhammer2)).ToArray(); if (animPacks.Length == 0) @@ -72,8 +72,8 @@ public void Process(GameTypeEnum existingPackVersion = GameTypeEnum.Warhammer2, outputWh3AnimPack.AddFile(wh3Bin); } - var animPackPathWithoutExtentions = Path.GetFileNameWithoutExtension(animPack.FileName); - // var outputAnimPackName = AnimationPackSampleDataCreator.GenerateWh3AnimPackName(animPackPathWithoutExtentions + "_wh3"); + var animPackPathWithoutExtensions = Path.GetFileNameWithoutExtension(animPack.FileName); + // var outputAnimPackName = AnimationPackSampleDataCreator.GenerateWh3AnimPackName(animPackPathWithoutExtensions + "_wh3"); // SaveHelper.Save(_pfs, outputAnimPackName, null, AnimationPackSerializer.ConvertToBytes(outputWh3AnimPack), false); } } diff --git a/Editors/Shared/Editors.Shared.Core/Services/SkeletonAnimationLookUpHelper.cs b/Editors/Shared/Editors.Shared.Core/Services/SkeletonAnimationLookUpHelper.cs index 196214a52..009bcf655 100644 --- a/Editors/Shared/Editors.Shared.Core/Services/SkeletonAnimationLookUpHelper.cs +++ b/Editors/Shared/Editors.Shared.Core/Services/SkeletonAnimationLookUpHelper.cs @@ -2,7 +2,6 @@ using System.Diagnostics; using System.IO; using Serilog; -using Shared.Core.ByteParsing; using Shared.Core.ErrorHandling; using Shared.Core.Events; using Shared.Core.Events.Global; @@ -63,7 +62,7 @@ void LoadFromPackFileContainer(PackFileContainer packFileContainer) List skeletonFileNameList = []; Dictionary> animationList = []; - var allAnimations = PackFileServiceUtility.FindAllWithExtentionIncludePaths(_packFileService, ".anim", packFileContainer); + var allAnimations = PackFileServiceUtility.FindAllWithExtensionIncludePaths(_packFileService, ".anim", packFileContainer); // Split animations in to two categories. var allAnimsInSavedPackedFiles = new List<(string FullPath, PackedFileSource DataSource)>(); diff --git a/Editors/SimpleAnimationEditors/AnimationBatchExporter/AnimationBatchExportViewModel.cs b/Editors/SimpleAnimationEditors/AnimationBatchExporter/AnimationBatchExportViewModel.cs index 2662b65d9..80a34ab8f 100644 --- a/Editors/SimpleAnimationEditors/AnimationBatchExporter/AnimationBatchExportViewModel.cs +++ b/Editors/SimpleAnimationEditors/AnimationBatchExporter/AnimationBatchExportViewModel.cs @@ -12,7 +12,7 @@ using Shared.GameFormats.Animation; using Shared.Ui.Common; -namespace CommonControls.Editors.AnimationBatchExporter +namespace Editors.AnimationTextEditors.AnimationBatchExporter { public class AnimationBatchExportViewModel : IEditorInterface { @@ -27,7 +27,7 @@ public class AnimationBatchExportViewModel : IEditorInterface public string DisplayName { get; set; } = "Animation Batch Exporter"; - + public AnimationBatchExportViewModel(IPackFileService pfs, SkeletonAnimationLookUpHelper skeletonAnimationLookUpHelper) { @@ -66,7 +66,7 @@ public void Process() _logger.Here().Information($"Processing packfile container {packfile.Name}"); - var animFiles = PackFileServiceUtility.FindAllWithExtention(_pfs, ".anim", packfile.Container); + var animFiles = PackFileServiceUtility.FindAllWithExtension(_pfs, ".anim", packfile.Container); _logger.Here().Information($"Converting animations {animFiles.Count}"); var convertedAnimFiles = ConvertAnimFiles(animFiles, SelectedOutputFormat.Value, errorList); @@ -78,7 +78,7 @@ public void Process() _pfs.AddFilesToPack(_pfs.GetEditablePack(), filesToAdd); _logger.Here().Information($"Saving inv matix files"); - var invMatrixFileList = PackFileServiceUtility.FindAllWithExtention(_pfs, ".bone_inv_trans_mats", packfile.Container); + var invMatrixFileList = PackFileServiceUtility.FindAllWithExtension(_pfs, ".bone_inv_trans_mats", packfile.Container); foreach (var invMatrixFile in invMatrixFileList) _pfs.CopyFileFromOtherPackFile(packfile.Container, _pfs.GetFullPath(invMatrixFile), _pfs.GetEditablePack()); } @@ -119,7 +119,6 @@ public void Process() public void Close() { - } public class PackFileListItem diff --git a/Editors/SimpleAnimationEditors/DependencyInjectionContainer.cs b/Editors/SimpleAnimationEditors/DependencyInjectionContainer.cs index 849c0d041..6cb7f3d1a 100644 --- a/Editors/SimpleAnimationEditors/DependencyInjectionContainer.cs +++ b/Editors/SimpleAnimationEditors/DependencyInjectionContainer.cs @@ -3,6 +3,7 @@ using CommonControls.Editors.AnimationPack; using CommonControls.Editors.CampaignAnimBin; using CommonControls.Editors.TextEditor; +using Editors.AnimationTextEditors.AnimationBatchExporter; using Microsoft.Extensions.DependencyInjection; using Shared.Core.DependencyInjection; using Shared.Core.ToolCreation; @@ -28,23 +29,23 @@ public override void RegisterTools(IEditorDatabase database) { EditorInfoBuilder .Create(EditorEnums.AnimationPack_Editor) - .AddExtention(".animpack", EditorPriorites.High) + .AddExtension(".animpack", EditorPriorites.High) .Build(database); EditorInfoBuilder .Create, TextEditorView>(EditorEnums.XML_CampaginBin_Edtior) - .AddExtention(".bin", EditorPriorites.High) + .AddExtension(".bin", EditorPriorites.High) .ValidForFoldersContaining(@"animations\campaign\database") .Build(database); EditorInfoBuilder .Create, TextEditorView>(EditorEnums.XML_Anim_Editor) - .AddExtention(".anim", EditorPriorites.Default) + .AddExtension(".anim", EditorPriorites.Default) .Build(database); EditorInfoBuilder .Create, TextEditorView>(EditorEnums.XML_InvBoneEditor) - .AddExtention(".bone_inv_trans_mats", EditorPriorites.Default) + .AddExtension(".bone_inv_trans_mats", EditorPriorites.Default) .Build(database); diff --git a/Editors/SkeletonEditor/Editor.VisualSkeletonEditor/DependencyInjectionContainer.cs b/Editors/SkeletonEditor/Editor.VisualSkeletonEditor/DependencyInjectionContainer.cs index 0fb80d9ea..a086451e6 100644 --- a/Editors/SkeletonEditor/Editor.VisualSkeletonEditor/DependencyInjectionContainer.cs +++ b/Editors/SkeletonEditor/Editor.VisualSkeletonEditor/DependencyInjectionContainer.cs @@ -20,7 +20,7 @@ public override void RegisterTools(IEditorDatabase editorDatabase) { EditorInfoBuilder .Create(EditorEnums.VisualSkeletonEditor) - .AddExtention(".anim", EditorPriorites.High) + .AddExtension(".anim", EditorPriorites.High) .ValidForFoldersContaining(@"animations\skeletons") .ValidForFoldersContaining("tech") .AddToToolbar("Skeleton Tool", true) diff --git a/Editors/TextureEditor/DependencyInjectionContainer.cs b/Editors/TextureEditor/DependencyInjectionContainer.cs index 629598dea..bb1bf2330 100644 --- a/Editors/TextureEditor/DependencyInjectionContainer.cs +++ b/Editors/TextureEditor/DependencyInjectionContainer.cs @@ -23,9 +23,9 @@ public override void RegisterTools(IEditorDatabase factory) { EditorInfoBuilder .Create(EditorEnums.Texture_Editor) - .AddExtention(".dds", EditorPriorites.Default) - .AddExtention(".png", EditorPriorites.Default) - .AddExtention(".jpeg", EditorPriorites.Default) + .AddExtension(".dds", EditorPriorites.Default) + .AddExtension(".png", EditorPriorites.Default) + .AddExtension(".jpeg", EditorPriorites.Default) .Build(factory); } } diff --git a/Editors/TextureEditor/DevConfig/Texture_Karl.cs b/Editors/TextureEditor/DevConfig/Texture_Karl.cs index 7fdd177b8..9c1d46d00 100644 --- a/Editors/TextureEditor/DevConfig/Texture_Karl.cs +++ b/Editors/TextureEditor/DevConfig/Texture_Karl.cs @@ -1,9 +1,9 @@ using Shared.Core.DevConfig; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.PackFiles; using Shared.Core.Settings; using Shared.EmbeddedResources; -using Shared.Ui.Events.UiCommands; namespace Editors.TextureEditor.DevConfig { diff --git a/GameWorld/View3D/Components/SceneExtentions.cs b/GameWorld/View3D/Components/SceneExtensions.cs similarity index 98% rename from GameWorld/View3D/Components/SceneExtentions.cs rename to GameWorld/View3D/Components/SceneExtensions.cs index 7c5cb7b6c..840a8a4a0 100644 --- a/GameWorld/View3D/Components/SceneExtentions.cs +++ b/GameWorld/View3D/Components/SceneExtensions.cs @@ -3,7 +3,7 @@ namespace GameWorld.Core.Components { - public static class SceneExtentions + public static class SceneExtensions { public static IEnumerable Search(this T node, Func> childs, Func condition, GraphTraversal mode = GraphTraversal.DepthFirst) { diff --git a/GameWorld/View3D/Components/SceneManager.cs b/GameWorld/View3D/Components/SceneManager.cs index ab64c85f0..7df26bcea 100644 --- a/GameWorld/View3D/Components/SceneManager.cs +++ b/GameWorld/View3D/Components/SceneManager.cs @@ -1,14 +1,14 @@ -using GameWorld.Core.Components.Rendering; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using GameWorld.Core.Components.Rendering; using GameWorld.Core.SceneNodes; using GameWorld.Core.Utility; using Microsoft.Xna.Framework; using Serilog; using Shared.Core.ErrorHandling; using Shared.Core.Events; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace GameWorld.Core.Components { @@ -56,7 +56,7 @@ public T GetNodeByName(string name) where T : class, ISceneNode public IEnumerable GetEnumeratorConditional(Func condition) { - return RootNode.Search(i => i.Children, condition, SceneExtentions.GraphTraversal.BreadthFirst); + return RootNode.Search(i => i.Children, condition, SceneExtensions.GraphTraversal.BreadthFirst); } public void TriggerAddObjectEvent(ISceneNode parent, ISceneNode added) diff --git a/GameWorld/View3D/Rendering/Materials/Capabilities/TintCapability.cs b/GameWorld/View3D/Rendering/Materials/Capabilities/TintCapability.cs index bc27c5c02..255ad45e1 100644 --- a/GameWorld/View3D/Rendering/Materials/Capabilities/TintCapability.cs +++ b/GameWorld/View3D/Rendering/Materials/Capabilities/TintCapability.cs @@ -10,8 +10,7 @@ namespace GameWorld.Core.Rendering.Materials.Capabilities { - - public static class EffectExtentions + public static class EffectExtensions { public static EffectParameter GetParameter(this Effect effect, string parameterName) { diff --git a/GameWorld/View3D/Rendering/Materials/Serialization/WsMaterialRepository.cs b/GameWorld/View3D/Rendering/Materials/Serialization/WsMaterialRepository.cs index 00520760f..8202c89c4 100644 --- a/GameWorld/View3D/Rendering/Materials/Serialization/WsMaterialRepository.cs +++ b/GameWorld/View3D/Rendering/Materials/Serialization/WsMaterialRepository.cs @@ -65,7 +65,7 @@ Dictionary LoadAllExistingMaterials(IPackFileService packFileSer { var materialList = new Dictionary(); - var materialPacks = PackFileServiceUtility.FindAllWithExtentionIncludePaths(packFileService, ".material"); + var materialPacks = PackFileServiceUtility.FindAllWithExtensionIncludePaths(packFileService, ".material"); materialPacks = materialPacks.Where(x => x.Pack.Name.Contains(".xml.material")).ToList(); foreach (var (fileName, pack) in materialPacks) diff --git a/GameWorld/View3D/Services/ComplexMeshLoader.cs b/GameWorld/View3D/Services/ComplexMeshLoader.cs index 826d966fc..8ac113423 100644 --- a/GameWorld/View3D/Services/ComplexMeshLoader.cs +++ b/GameWorld/View3D/Services/ComplexMeshLoader.cs @@ -12,7 +12,6 @@ using Shared.GameFormats.WsModel; using static Shared.GameFormats.Vmd.VariantMeshDefinition; - namespace GameWorld.Core.Services { public class ComplexMeshLoader @@ -46,7 +45,7 @@ SceneNode Load(PackFile file, SceneNode parent, AnimationPlayer player, string a _logger.Here().Information($"Attempting to load file {file.Name}"); - switch (file.Extention) + switch (file.Extension) { case ".variantmeshdefinition": LoadVariantMesh(file, ref parent, player, attachmentPointName, onlyLoadRootNode); @@ -60,7 +59,7 @@ SceneNode Load(PackFile file, SceneNode parent, AnimationPlayer player, string a LoadWsModel(file, ref parent, player, attachmentPointName, onlyLoadRootNode); break; default: - throw new Exception("Unknown mesh extention"); + throw new Exception("Unknown mesh extension"); } return parent; diff --git a/GameWorld/View3D/Services/TextureFileEditorService.cs b/GameWorld/View3D/Services/TextureFileEditorService.cs index 56c596992..b953d0b13 100644 --- a/GameWorld/View3D/Services/TextureFileEditorService.cs +++ b/GameWorld/View3D/Services/TextureFileEditorService.cs @@ -392,20 +392,20 @@ private void ExportUvMap(string outputDirectory, Rmv2MeshNode mesh) graphics.DrawLine(blackPen, uv2.X, uv2.Y, uv0.X, uv0.Y); } - var imagePathWithoutExtention = outputDirectory + "\\Uv_map_" + mesh.Name; + var imagePathWithoutExtension = outputDirectory + "\\Uv_map_" + mesh.Name; for (var index = 0; index < 1024; index++) { - var name = index == 0 ? imagePathWithoutExtention : string.Format("{0} _{1}", imagePathWithoutExtention, index); + var name = index == 0 ? imagePathWithoutExtension : string.Format("{0} _{1}", imagePathWithoutExtension, index); name += ".png"; if (File.Exists(name)) continue; - imagePathWithoutExtention = name; + imagePathWithoutExtension = name; break; } DirectoryHelper.EnsureCreated(outputDirectory); - image.Save(imagePathWithoutExtention); + image.Save(imagePathWithoutExtension); } }*/ } diff --git a/GameWorld/View3D/Utility/UserInterface/ShaderTextureViewModel.cs b/GameWorld/View3D/Utility/UserInterface/ShaderTextureViewModel.cs index 50cd9f10a..6821556c3 100644 --- a/GameWorld/View3D/Utility/UserInterface/ShaderTextureViewModel.cs +++ b/GameWorld/View3D/Utility/UserInterface/ShaderTextureViewModel.cs @@ -9,9 +9,9 @@ using GameWorld.Core.Rendering.Materials.Capabilities.Utility; using GameWorld.Core.Services; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.PackFiles; using Shared.Core.Services; -using Shared.Ui.Events.UiCommands; namespace GameWorld.Core.Utility.UserInterface { diff --git a/Shared/GameFiles/WWise/HircItem.cs b/Shared/GameFiles/WWise/HircItem.cs index d038411b7..6b752338f 100644 --- a/Shared/GameFiles/WWise/HircItem.cs +++ b/Shared/GameFiles/WWise/HircItem.cs @@ -35,7 +35,6 @@ public void Parse(ByteChunk chunk) chunk.Index = computedIndex; HasError = false; } - catch (Exception e) { _logger.Here().Error($"Failed to parse object {Id} in {OwnerFile} at index {IndexInFile}- " + e.Message); @@ -49,7 +48,6 @@ protected MemoryStream WriteHeader() memStream.Write(ByteParsers.Byte.EncodeValue((byte)Type, out _)); memStream.Write(ByteParsers.UInt32.EncodeValue(Size, out _)); memStream.Write(ByteParsers.UInt32.EncodeValue(Id, out _)); - return memStream; } diff --git a/Shared/SharedCore/DependencyInjectionContainer.cs b/Shared/SharedCore/DependencyInjectionContainer.cs index 8e4b5567e..7d6c0e527 100644 --- a/Shared/SharedCore/DependencyInjectionContainer.cs +++ b/Shared/SharedCore/DependencyInjectionContainer.cs @@ -33,13 +33,7 @@ public override void Register(IServiceCollection services) services.AddScoped(); services.AddScoped(); services.AddTransient(); - services.AddSingleton(); - - - } } - } - diff --git a/Shared/SharedCore/Events/Global/OpenEditorCommand.cs b/Shared/SharedCore/Events/Global/OpenEditorCommand.cs index 7df759454..0eff5571e 100644 --- a/Shared/SharedCore/Events/Global/OpenEditorCommand.cs +++ b/Shared/SharedCore/Events/Global/OpenEditorCommand.cs @@ -1,9 +1,8 @@ -using Shared.Core.Events; -using Shared.Core.PackFiles; +using Shared.Core.PackFiles; using Shared.Core.PackFiles.Models; using Shared.Core.ToolCreation; -namespace Shared.Ui.Events.UiCommands +namespace Shared.Core.Events.Global { public class OpenEditorCommand : IUiCommand { @@ -36,7 +35,7 @@ public void ExecuteAsWindow(string fileName, int width, int heigh) window.ShowDialog(); } - public void ExecuteAsWindow(EditorEnums preferedEditor, int width, int heigh) + public void ExecuteAsWindow(EditorEnums preferedEditor, int width, int heigh) { var window = _editorCreator.CreateWindow(null, preferedEditor); window.Width = width; diff --git a/Shared/SharedCore/Misc/SaveUtility.cs b/Shared/SharedCore/Misc/SaveUtility.cs index c2056266d..14e2609e7 100644 --- a/Shared/SharedCore/Misc/SaveUtility.cs +++ b/Shared/SharedCore/Misc/SaveUtility.cs @@ -35,8 +35,8 @@ public static void CreateFileBackup(string originalFileName) { var dirName = Path.GetDirectoryName(originalFileName); var fileName = Path.GetFileNameWithoutExtension(originalFileName); - var extention = Path.GetExtension(originalFileName); - var uniqeFileName = IndexedFilename(Path.Combine(dirName, s_backupFolderPath, fileName), extention); + var extension = Path.GetExtension(originalFileName); + var uniqeFileName = IndexedFilename(Path.Combine(dirName, s_backupFolderPath, fileName), extension); Directory.CreateDirectory(Path.Combine(dirName, s_backupFolderPath)); File.Copy(originalFileName, uniqeFileName); diff --git a/Shared/SharedCore/PackFiles/FileSaveService.cs b/Shared/SharedCore/PackFiles/FileSaveService.cs index 7dcc9101e..aa8c53f1a 100644 --- a/Shared/SharedCore/PackFiles/FileSaveService.cs +++ b/Shared/SharedCore/PackFiles/FileSaveService.cs @@ -5,8 +5,8 @@ namespace Shared.Core.PackFiles { public interface IFileSaveService { - PackFile? Save(string fullPathWithExtention, byte[] content, bool prompOnConflict); - PackFile? SaveAs(string fullPathWithExtention, byte[] content); + PackFile? Save(string fullPathWithExtension, byte[] content, bool prompOnConflict); + PackFile? SaveAs(string fullPathWithExtension, byte[] content); } public class FileSaveService : IFileSaveService @@ -20,13 +20,13 @@ public FileSaveService(IPackFileService packFileService, IStandardDialogs packFi _packFileUiProvider = packFileUiProvider; } - public PackFile? SaveAs(string extention, byte[] content) + public PackFile? SaveAs(string extension, byte[] content) { var editablePack = _packFileService.GetEditablePack(); if (editablePack == null) throw new Exception($"Unable to save file. No Editable PackFile selected"); - var saveDialogResult = _packFileUiProvider.DisplaySaveDialog(_packFileService, [extention]); + var saveDialogResult = _packFileUiProvider.DisplaySaveDialog(_packFileService, [extension]); if (saveDialogResult.Result == false) return null; @@ -48,29 +48,29 @@ public FileSaveService(IPackFileService packFileService, IStandardDialogs packFi } - public PackFile? Save(string fullPathWithExtention, byte[] content, bool prompOnConflict) + public PackFile? Save(string fullPathWithExtension, byte[] content, bool prompOnConflict) { var editablePack = _packFileService.GetEditablePack(); if (editablePack == null) - throw new Exception($"Unable to save file {fullPathWithExtention}. No Editable PackFile selected"); + throw new Exception($"Unable to save file {fullPathWithExtension}. No Editable PackFile selected"); - var isExistingFile = _packFileService.FindFile(fullPathWithExtention, editablePack); + var isExistingFile = _packFileService.FindFile(fullPathWithExtension, editablePack); if (isExistingFile != null && prompOnConflict) { - var extention = Path.GetExtension(fullPathWithExtention); - var saveDialogResult = _packFileUiProvider.DisplaySaveDialog(_packFileService, [extention]); + var extension = Path.GetExtension(fullPathWithExtension); + var saveDialogResult = _packFileUiProvider.DisplaySaveDialog(_packFileService, [extension]); if (saveDialogResult.Result == false) return null; - fullPathWithExtention = saveDialogResult.SelectedFilePath!; - isExistingFile = _packFileService.FindFile(fullPathWithExtention, editablePack); + fullPathWithExtension = saveDialogResult.SelectedFilePath!; + isExistingFile = _packFileService.FindFile(fullPathWithExtension, editablePack); } if (isExistingFile == null) { - var fileName = Path.GetFileName(fullPathWithExtention); + var fileName = Path.GetFileName(fullPathWithExtension); var newPackFile = new PackFile(fileName, new MemorySource(content)); - var directoryPath = Path.GetDirectoryName(fullPathWithExtention); + var directoryPath = Path.GetDirectoryName(fullPathWithExtension); var item = new NewPackFileEntry(directoryPath!, newPackFile); _packFileService.AddFilesToPack(editablePack, [item]); return newPackFile; diff --git a/Shared/SharedCore/PackFiles/Models/PackFile.cs b/Shared/SharedCore/PackFiles/Models/PackFile.cs index 3fa306365..576387d47 100644 --- a/Shared/SharedCore/PackFiles/Models/PackFile.cs +++ b/Shared/SharedCore/PackFiles/Models/PackFile.cs @@ -1,6 +1,4 @@ -using Shared.Core.Misc; - -namespace Shared.Core.PackFiles.Models +namespace Shared.Core.PackFiles.Models { public class PackFile { @@ -16,7 +14,7 @@ public PackFile(string name, IDataSource dataSource) public string Name { get; set; } public override string ToString() => Name; - public string Extention { get => Path.GetExtension(Name); } + public string Extension { get => Path.GetExtension(Name); } public static PackFile CreateFromBytes(string fileName, byte[] bytes) => new(fileName, new MemorySource(bytes)); diff --git a/Shared/SharedCore/PackFiles/PackFileServiceUtility.cs b/Shared/SharedCore/PackFiles/PackFileServiceUtility.cs index 79d6bc123..2af0d42a5 100644 --- a/Shared/SharedCore/PackFiles/PackFileServiceUtility.cs +++ b/Shared/SharedCore/PackFiles/PackFileServiceUtility.cs @@ -52,7 +52,7 @@ public static List SearchForFile(IPackFileService pfs, string partOfFile public static List GetAllAnimPacks(IPackFileService pfs) { - var animPacks = FindAllWithExtention(pfs, @".animpack"); + var animPacks = FindAllWithExtension(pfs, @".animpack"); var itemsToRemove = animPacks.Where(x => pfs.GetFullPath(x).Contains("animation_culture_packs", StringComparison.InvariantCultureIgnoreCase)).ToList(); foreach (var item in itemsToRemove) animPacks.Remove(item); @@ -61,15 +61,15 @@ public static List GetAllAnimPacks(IPackFileService pfs) } - public static List FindAllWithExtention(IPackFileService pfs, string extention, PackFileContainer? packFileContainer = null) + public static List FindAllWithExtension(IPackFileService pfs, string extension, PackFileContainer? packFileContainer = null) { - return FindAllWithExtentionIncludePaths(pfs, extention, packFileContainer).Select(x => x.Item2).ToList(); + return FindAllWithExtensionIncludePaths(pfs, extension, packFileContainer).Select(x => x.Item2).ToList(); } - public static List<(string FileName, PackFile Pack)> FindAllWithExtentionIncludePaths(IPackFileService pfs, string extention, PackFileContainer? packFileContainer = null) + public static List<(string FileName, PackFile Pack)> FindAllWithExtensionIncludePaths(IPackFileService pfs, string extension, PackFileContainer? packFileContainer = null) { - extention = extention.ToLower(); + extension = extension.ToLower(); var output = new List>(); if (packFileContainer == null) { @@ -77,8 +77,8 @@ public static List FindAllWithExtention(IPackFileService pfs, string e { foreach (var file in pf.FileList) { - var fileExtention = Path.GetExtension(file.Key); - if (fileExtention == extention) + var fileExtension = Path.GetExtension(file.Key); + if (fileExtension == extension) output.Add(new ValueTuple(file.Key, file.Value)); } } @@ -87,8 +87,8 @@ public static List FindAllWithExtention(IPackFileService pfs, string e { foreach (var file in packFileContainer.FileList) { - var fileExtention = Path.GetExtension(file.Key); - if (fileExtention == extention) + var fileExtension = Path.GetExtension(file.Key); + if (fileExtension == extension) output.Add(new ValueTuple(file.Key, file.Value)); } } diff --git a/Shared/SharedCore/ToolCreation/EditorDatabase.cs b/Shared/SharedCore/ToolCreation/EditorDatabase.cs index c9b2efd19..a8e6987e0 100644 --- a/Shared/SharedCore/ToolCreation/EditorDatabase.cs +++ b/Shared/SharedCore/ToolCreation/EditorDatabase.cs @@ -6,10 +6,6 @@ namespace Shared.Core.ToolCreation { - - - - public interface IEditorDatabase { public void Register(EditorInfo editorInfo); @@ -112,31 +108,31 @@ IEditorInterface CreateEditorInternal(Type editorType) List GetAllPossibleEditors(string fullFileName) { - var extention = Regex.Match(fullFileName, @"\..*").Value; - if (extention.Contains("{") && extention.Contains("}")) + var extension = Regex.Match(fullFileName, @"\..*").Value; + if (extension.Contains("{") && extension.Contains("}")) { - var ext2 = Regex.Match(extention, @"\..*\.(.*)\.(.*)"); + var ext2 = Regex.Match(extension, @"\..*\.(.*)\.(.*)"); if (ext2.Success) { - extention = "." + ext2.Groups[1].Value + "." + ext2.Groups[2].Value; + extension = "." + ext2.Groups[1].Value + "." + ext2.Groups[2].Value; } } var output = new List<(EditorInfo info, int priority)>(); foreach (var toolLookUp in _editors) { - var hasValidExtention = false; + var hasValidExtension = false; var priority = -1; - foreach (var toolExtention in toolLookUp.Extensions) + foreach (var toolExtension in toolLookUp.Extensions) { - if (toolExtention.Extention == extention) + if (toolExtension.Extension == extension) { - if (toolExtention.Priority > priority) + if (toolExtension.Priority > priority) { - hasValidExtention = true; - priority = toolExtention.Priority; + hasValidExtension = true; + priority = toolExtension.Priority; } } } @@ -148,14 +144,14 @@ List GetAllPossibleEditors(string fullFileName) } else { - foreach (var toolExtention in toolLookUp.FolderRules) + foreach (var toolExtension in toolLookUp.FolderRules) { - if (fullFileName.Contains(toolExtention)) + if (fullFileName.Contains(toolExtension)) isValidForFolder = true; } } - if (hasValidExtention && isValidForFolder) + if (hasValidExtension && isValidForFolder) output.Add((toolLookUp, priority)); } diff --git a/Shared/SharedCore/ToolCreation/EditorInfoBuilder.cs b/Shared/SharedCore/ToolCreation/EditorInfoBuilder.cs index 3beeb2ee9..9bd5b85b9 100644 --- a/Shared/SharedCore/ToolCreation/EditorInfoBuilder.cs +++ b/Shared/SharedCore/ToolCreation/EditorInfoBuilder.cs @@ -2,7 +2,7 @@ { public class EditorInfo { - public record ExtentionInfo(string Extention, int Priority); + public record ExtensionInfo(string Extension, int Priority); public EditorInfo(EditorEnums editorEnum, Type view, Type viewModel) { @@ -10,7 +10,7 @@ public EditorInfo(EditorEnums editorEnum, Type view, Type viewModel) View = view; ViewModel = viewModel; } - public List Extensions { get; set; } = new List(); + public List Extensions { get; set; } = new List(); public List FolderRules { get; set; } = new List(); public string ToolbarName { get; set; } = ""; public bool AddToolbarButton { get; set; } = false; @@ -46,11 +46,10 @@ public EditorInfoBuilder AddToToolbar(string toolbarLabel, bool enabled = true) return this; } - public EditorInfoBuilder AddExtention(string extention, int priority) + public EditorInfoBuilder AddExtension(string extension, int priority) { // Ensure type is IFileEditor - - _instance.Extensions.Add(new EditorInfo.ExtentionInfo(extention.Trim().ToLower(), priority)); + _instance.Extensions.Add(new EditorInfo.ExtensionInfo(extension.Trim().ToLower(), priority)); return this; } diff --git a/Shared/SharedUI/BaseDialogs/PackFileTree/PackFileBrowserViewModel.cs b/Shared/SharedUI/BaseDialogs/PackFileTree/PackFileBrowserViewModel.cs index bd66eccf7..bc143815d 100644 --- a/Shared/SharedUI/BaseDialogs/PackFileTree/PackFileBrowserViewModel.cs +++ b/Shared/SharedUI/BaseDialogs/PackFileTree/PackFileBrowserViewModel.cs @@ -11,6 +11,7 @@ using Shared.Core.PackFiles; using Shared.Core.PackFiles.Models; using Shared.Ui.BaseDialogs.PackFileBrowser.ContextMenu; +using Shared.Ui.BaseDialogs.PackFileTree; using Shared.Ui.Common; namespace Shared.Ui.BaseDialogs.PackFileBrowser diff --git a/Shared/SharedUI/BaseDialogs/PackFileTree/PackFileTreeViewFactory.cs b/Shared/SharedUI/BaseDialogs/PackFileTree/PackFileTreeViewFactory.cs index 6745bd7d6..e195474a2 100644 --- a/Shared/SharedUI/BaseDialogs/PackFileTree/PackFileTreeViewFactory.cs +++ b/Shared/SharedUI/BaseDialogs/PackFileTree/PackFileTreeViewFactory.cs @@ -1,8 +1,9 @@ using Shared.Core.Events; using Shared.Core.PackFiles; +using Shared.Ui.BaseDialogs.PackFileBrowser; using Shared.Ui.BaseDialogs.PackFileBrowser.ContextMenu; -namespace Shared.Ui.BaseDialogs.PackFileBrowser +namespace Shared.Ui.BaseDialogs.PackFileTree { public class PackFileTreeViewFactory { diff --git a/Shared/SharedUI/BaseDialogs/PackFileTree/SearchFilter.cs b/Shared/SharedUI/BaseDialogs/PackFileTree/SearchFilter.cs index 4dc149410..f6f7335d0 100644 --- a/Shared/SharedUI/BaseDialogs/PackFileTree/SearchFilter.cs +++ b/Shared/SharedUI/BaseDialogs/PackFileTree/SearchFilter.cs @@ -4,8 +4,9 @@ using System.ComponentModel; using System.Text.RegularExpressions; using Shared.Core.Misc; +using Shared.Ui.BaseDialogs.PackFileBrowser; -namespace Shared.Ui.BaseDialogs.PackFileBrowser +namespace Shared.Ui.BaseDialogs.PackFileTree { public class SearchFilter : NotifyPropertyChangedImpl, IDataErrorInfo { @@ -26,6 +27,7 @@ public string FilterText } List _extentionFilter; + List _extensionFilter; public int AutoExapandResultsAfterLimitedCount { get; set; } = 25; public SearchFilter(ObservableCollection nodes) @@ -76,9 +78,9 @@ int CountVisibleNodes(TreeNode file) return count; } - public void SetExtentions(List extentions) + public void SetExtensions(List extensions) { - _extentionFilter = extentions; + _extensionFilter = extensions; Filter(FilterText); } @@ -92,21 +94,21 @@ bool HasChildWithFilterMatch(TreeNode file, Regex expression) if (file.GetNodeType() == NodeType.File) { - var hasValidExtention = true; - if (_extentionFilter != null) + var hasValidExtension = true; + if (_extensionFilter != null) { - hasValidExtention = false; - foreach (var extention in _extentionFilter) + hasValidExtension = false; + foreach (var extension in _extensionFilter) { - if (file.Name.Contains(extention)) + if (file.Name.Contains(extension)) { - hasValidExtention = true; + hasValidExtension = true; continue; } } } - if (hasValidExtention) + if (hasValidExtension) { if (expression.IsMatch(file.Name)) { diff --git a/Shared/SharedUI/BaseDialogs/StandardDialog/PackFile/PackFileBrowserWindow.xaml.cs b/Shared/SharedUI/BaseDialogs/StandardDialog/PackFile/PackFileBrowserWindow.xaml.cs index cfcceefda..b975e6205 100644 --- a/Shared/SharedUI/BaseDialogs/StandardDialog/PackFile/PackFileBrowserWindow.xaml.cs +++ b/Shared/SharedUI/BaseDialogs/StandardDialog/PackFile/PackFileBrowserWindow.xaml.cs @@ -5,6 +5,7 @@ using Shared.Core.PackFiles.Models; using Shared.Ui.BaseDialogs.PackFileBrowser; using Shared.Ui.BaseDialogs.PackFileBrowser.ContextMenu; +using Shared.Ui.BaseDialogs.PackFileTree; namespace CommonControls.PackFileBrowser { diff --git a/Shared/SharedUI/BaseDialogs/StandardDialog/PackFile/SavePackFileWindow.xaml.cs b/Shared/SharedUI/BaseDialogs/StandardDialog/PackFile/SavePackFileWindow.xaml.cs index bc414516d..940ed100c 100644 --- a/Shared/SharedUI/BaseDialogs/StandardDialog/PackFile/SavePackFileWindow.xaml.cs +++ b/Shared/SharedUI/BaseDialogs/StandardDialog/PackFile/SavePackFileWindow.xaml.cs @@ -5,6 +5,7 @@ using Shared.Core.PackFiles.Models; using Shared.Ui.BaseDialogs.PackFileBrowser; using Shared.Ui.BaseDialogs.PackFileBrowser.ContextMenu; +using Shared.Ui.BaseDialogs.PackFileTree; namespace CommonControls.PackFileBrowser { diff --git a/Shared/SharedUI/BaseDialogs/StandardDialog/StandardDialogs.cs b/Shared/SharedUI/BaseDialogs/StandardDialog/StandardDialogs.cs index e27fe6f59..8584d6375 100644 --- a/Shared/SharedUI/BaseDialogs/StandardDialog/StandardDialogs.cs +++ b/Shared/SharedUI/BaseDialogs/StandardDialog/StandardDialogs.cs @@ -8,7 +8,7 @@ using Shared.Core.ErrorHandling.Exceptions; using Shared.Core.PackFiles; using Shared.Core.Services; -using Shared.Ui.BaseDialogs.PackFileBrowser; +using Shared.Ui.BaseDialogs.PackFileTree; using Shared.Ui.Common.Exceptions; namespace Shared.Ui.BaseDialogs.StandardDialog @@ -29,7 +29,7 @@ public StandardDialogs(IPackFileService pfs, PackFileTreeViewFactory packFileBro public SaveDialogResult DisplaySaveDialog(IPackFileService remove, List extensions) { using var browser = new SavePackFileWindow(_pfs, _packFileBrowserBuilder); - browser.ViewModel.Filter.SetExtentions(extensions); + browser.ViewModel.Filter.SetExtensions(extensions); if (browser.ShowDialog() == true) return new SaveDialogResult(true, browser.SelectedFile, browser.FilePath); diff --git a/Shared/SharedUI/Common/Behaviors/MouseDoubleClick.cs b/Shared/SharedUI/Common/Behaviors/MouseDoubleClick.cs index be614ffcd..30bfa6a12 100644 --- a/Shared/SharedUI/Common/Behaviors/MouseDoubleClick.cs +++ b/Shared/SharedUI/Common/Behaviors/MouseDoubleClick.cs @@ -1,10 +1,5 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Windows; +using System.Windows; using System.Windows.Controls; -using System.Windows.Forms; using System.Windows.Input; namespace Shared.Ui.Common.Behaviors @@ -69,6 +64,5 @@ private static void OnMouseDoubleClick(object sender, RoutedEventArgs e) } } } - } } diff --git a/Shared/SharedUI/DependencyInjectionContainer.cs b/Shared/SharedUI/DependencyInjectionContainer.cs index 6421ebbd6..c2a7c7d77 100644 --- a/Shared/SharedUI/DependencyInjectionContainer.cs +++ b/Shared/SharedUI/DependencyInjectionContainer.cs @@ -2,9 +2,9 @@ using Shared.Core.DependencyInjection; using Shared.Core.Services; using Shared.Core.ToolCreation; -using Shared.Ui.BaseDialogs.PackFileBrowser; using Shared.Ui.BaseDialogs.PackFileBrowser.ContextMenu; using Shared.Ui.BaseDialogs.PackFileBrowser.ContextMenu.Commands; +using Shared.Ui.BaseDialogs.PackFileTree; using Shared.Ui.BaseDialogs.StandardDialog; using Shared.Ui.BaseDialogs.ToolSelector; diff --git a/Testing/E2EVerification/KitbashEditor_SaveTests.cs b/Testing/E2EVerification/KitbashEditor_SaveTests.cs index d1c1f4b5a..6f2b6908f 100644 --- a/Testing/E2EVerification/KitbashEditor_SaveTests.cs +++ b/Testing/E2EVerification/KitbashEditor_SaveTests.cs @@ -4,10 +4,10 @@ using GameWorld.Core.Services.SceneSaving.Lod; using Microsoft.Extensions.DependencyInjection; using Shared.Core.Events; +using Shared.Core.Events.Global; using Shared.Core.Settings; using Shared.GameFormats.RigidModel; using Shared.TestUtility; -using Shared.Ui.Events.UiCommands; namespace E2EVerification { diff --git a/Testing/GameWorld.Core.Test/TestUtility/IRmvMaterialExtentions.cs b/Testing/GameWorld.Core.Test/TestUtility/IRmvMaterialExtensions.cs similarity index 97% rename from Testing/GameWorld.Core.Test/TestUtility/IRmvMaterialExtentions.cs rename to Testing/GameWorld.Core.Test/TestUtility/IRmvMaterialExtensions.cs index e2ac2d477..d68b2e03e 100644 --- a/Testing/GameWorld.Core.Test/TestUtility/IRmvMaterialExtentions.cs +++ b/Testing/GameWorld.Core.Test/TestUtility/IRmvMaterialExtensions.cs @@ -4,7 +4,7 @@ namespace GameWorld.Core.Test.TestUtility { - public static class IRmvMaterialExtentions + public static class IRmvMaterialExtensions { public static IRmvMaterial AssignMaterials(this IRmvMaterial material, TextureType[] texturesToAssign) { From 8f3bef33e49e40857a1fdcd24eb87a078da12432 Mon Sep 17 00:00:00 2001 From: Pear <61670316+Pear-231@users.noreply.github.com> Date: Sun, 8 Dec 2024 21:41:38 +0000 Subject: [PATCH 02/13] Change Notes: - Fixed a bug where window maximisation ate the toolbar. --- AssetEditor/App.xaml.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AssetEditor/App.xaml.cs b/AssetEditor/App.xaml.cs index 2b7d30614..228b595fe 100644 --- a/AssetEditor/App.xaml.cs +++ b/AssetEditor/App.xaml.cs @@ -10,7 +10,6 @@ using Shared.Core.DependencyInjection; using Shared.Core.DevConfig; using Shared.Core.ErrorHandling; -using Shared.Core.ErrorHandling.Exceptions; using Shared.Core.PackFiles; using Shared.Core.Services; using Shared.Core.Settings; @@ -93,8 +92,12 @@ void ShowMainWindow() mainWindow.DataContext = _rootScope.ServiceProvider.GetRequiredService(); mainWindow.Show(); + // Ensure the window doesn't cover up the windows bar. + mainWindow.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight; + mainWindow.MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth; + if (applicationSettingsService.CurrentSettings.StartMaximised == true) - mainWindow.WindowState = WindowState.Maximized; + SystemCommands.MaximizeWindow(mainWindow); } void DispatcherUnhandledExceptionHandler(object sender, DispatcherUnhandledExceptionEventArgs args) From a3190a01da75103c7e2c471fac107189bade9dd1 Mon Sep 17 00:00:00 2001 From: Pear <61670316+Pear-231@users.noreply.github.com> Date: Sun, 8 Dec 2024 21:43:37 +0000 Subject: [PATCH 03/13] Change Notes: - Fixed a bug with ComboBoxItem colours. --- AssetEditor/Themes/ControlColours.xaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/AssetEditor/Themes/ControlColours.xaml b/AssetEditor/Themes/ControlColours.xaml index 01e819a2f..d4da9943a 100644 --- a/AssetEditor/Themes/ControlColours.xaml +++ b/AssetEditor/Themes/ControlColours.xaml @@ -53,17 +53,17 @@ - - - - - - - - - - - + + + + + + + + + + + From 8748c15ded018fb37bfc82f83ef737450a77a14b Mon Sep 17 00:00:00 2001 From: Pear <61670316+Pear-231@users.noreply.github.com> Date: Sun, 8 Dec 2024 21:45:41 +0000 Subject: [PATCH 04/13] Change Notes: - Added some Extended WPF Toolkit controls. - DataGrid and other control tweaks. --- AssetEditor/Themes/ControlColours.xaml | 12 +- AssetEditor/Themes/Controls.xaml | 869 ++++++++++++++++++++++++- 2 files changed, 863 insertions(+), 18 deletions(-) diff --git a/AssetEditor/Themes/ControlColours.xaml b/AssetEditor/Themes/ControlColours.xaml index d4da9943a..c52f49d34 100644 --- a/AssetEditor/Themes/ControlColours.xaml +++ b/AssetEditor/Themes/ControlColours.xaml @@ -255,15 +255,15 @@ - - - + + + - - - + + + diff --git a/AssetEditor/Themes/Controls.xaml b/AssetEditor/Themes/Controls.xaml index ad1acf5aa..2ba35aa93 100644 --- a/AssetEditor/Themes/Controls.xaml +++ b/AssetEditor/Themes/Controls.xaml @@ -4,13 +4,19 @@ xmlns:ap="clr-namespace:AssetEditor.Themes.Attached" xmlns:themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2" xmlns:windowstitlemenu="clr-namespace:AssetEditor.WindowsTitleMenu" - xmlns:extendedwpftoolkit="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"> + xmlns:sys="clr-namespace:System;assembly=netstandard" + xmlns:extendedwpftoolkit="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit" + xmlns:prim="clr-namespace:Xceed.Wpf.Toolkit.Primitives;assembly=Xceed.Wpf.Toolkit" + xmlns:chrome="clr-namespace:Xceed.Wpf.Toolkit.Chromes;assembly=Xceed.Wpf.Toolkit" + xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + M0,5 L4.5,.5 9,5 6,5 4.5,3.5 3,5 z + M0,0 L3,0 4.5,1.5 6,0 9,0 4.5,4.5 z + + + + + + + + + + + + + + + + + + + - +