├── Common ├── Controls │ ├── BitmapViewer.cs │ ├── BitmapViewerSideBySide.cs │ ├── Breadcrumb.cs │ ├── ComboBox.cs │ ├── DownloadDialog.cs │ ├── GitHubButton.cs │ ├── HexDiffer.cs │ ├── HexViewer.cs │ ├── Hyperlink.cs │ ├── ImageButton.cs │ ├── ImageCheckButton.cs │ ├── ImageRadioPanel.cs │ ├── ListBox.cs │ ├── MainDockPanel.cs │ ├── SelectFolderDialog.cs │ ├── StackPanel.cs │ ├── TextBoxDialog.cs │ ├── TextDiffer.cs │ ├── TextDifferBackgroundRenderer.cs │ ├── TextSearchBackgroundRenderer.cs │ ├── TextSearchPanel.cs │ ├── TextTabFoldingStrategy.cs │ ├── TextViewer.cs │ ├── TextViewerFolding.cs │ ├── TreeView.cs │ └── XmlViewer.cs ├── Extensions │ ├── Octokit.cs │ ├── Pfim.Dds.x.cs │ ├── System.Array.x.cs │ ├── System.Collections.Generic.IReadOnlyList.x.cs │ ├── System.Collections.IList.x.cs │ ├── System.DateTime.x.cs │ ├── System.Delegate.x.cs │ ├── System.IEnumerable.x.cs │ ├── System.IO.Stream.x.cs │ ├── System.Net.Http.HttpClient.x.cs │ ├── System.Object.x.cs │ ├── System.Reflection.FieldInfo.x.cs │ ├── System.Span.x.cs │ ├── System.String.x.cs │ ├── System.String.x.p.CompareNumeric.cs │ ├── System.Text.StringBuilder.x.cs │ ├── System.Threading.Tasks.Task.x.cs │ ├── System.Type.x.cs │ ├── System.Version.x.cs │ ├── System.WeakReference.cs │ ├── System.Windows.Controls.ColumnDefinitionCollection.x.cs │ ├── System.Windows.Controls.RowDefinitionCollection.x.cs │ ├── System.Windows.DependencyObject.x.cs │ └── System.Windows.Media.Imaging.BitmapSource.x.cs ├── NMS │ ├── Game │ │ ├── Game.Data.cs │ │ ├── Game.Data.p.instances.cs │ │ ├── Game.Files.Cache.cs │ │ ├── Game.Files.ComboBox.cs │ │ ├── Game.Files.View.cs │ │ ├── Game.Items.GroupListBox.cs │ │ ├── Game.Items.Products.cs │ │ ├── Game.Items.Substances.cs │ │ ├── Game.Items.Technologies.cs │ │ ├── Game.Items.cs │ │ ├── Game.Language.cs │ │ ├── Game.Location.Buttons.cs │ │ ├── Game.Location.Data.cs │ │ ├── Game.Location.Dialog.cs │ │ ├── Game.MODS.Files.cs │ │ ├── Game.PCBANKS.Files.cs │ │ ├── Game.Recipes.ListBox.cs │ │ ├── Game.Recipes.cs │ │ └── Game.Releases.cs │ ├── MBINC │ │ ├── MBINC.cs │ │ ├── MBINC.p.EBIN.cs │ │ ├── MBINC.p.cache.cs │ │ └── MBINC.p.types.cs │ └── PAK │ │ ├── Data │ │ ├── PAK.BIN.Data.cs │ │ ├── PAK.BNK.Data.cs │ │ ├── PAK.CS.Data.cs │ │ ├── PAK.CSV.Data.cs │ │ ├── PAK.DDS.Data.cs │ │ ├── PAK.JSON.Data.cs │ │ ├── PAK.LUA.Data.cs │ │ ├── PAK.MBIN.Data.cs │ │ ├── PAK.MBIN.Header.cs │ │ ├── PAK.SPV.Data.cs │ │ ├── PAK.TXT.Data.cs │ │ ├── PAK.VDF.Data.cs │ │ ├── PAK.WEM.Data.cs │ │ └── PAK.XML.Data.cs │ │ ├── Differ │ │ ├── PAK.BIN.Differ.cs │ │ ├── PAK.BNK.Differ.cs │ │ ├── PAK.CS.Differ.cs │ │ ├── PAK.CSV.Differ.cs │ │ ├── PAK.DDS.Differ.cs │ │ ├── PAK.Hex.Differ.cs │ │ ├── PAK.JSON.Differ.cs │ │ ├── PAK.LUA.Differ.cs │ │ ├── PAK.MBIN.Differ.cs │ │ ├── PAK.SPV.Differ.cs │ │ ├── PAK.TXT.Differ.cs │ │ ├── PAK.VDF.Differ.cs │ │ ├── PAK.WEM.Differ.cs │ │ └── PAK.XML.Differ.cs │ │ ├── PAK.File.Loader.cs │ │ ├── PAK.Files.cs │ │ ├── PAK.Item.Data.cs │ │ ├── PAK.Item.Info.cs │ │ ├── PAK.Item.Interfaces.cs │ │ ├── PAK.Item.Path.cs │ │ ├── PAK.Item.View.cs │ │ └── Viewer │ │ ├── PAK.BIN.Viewer.cs │ │ ├── PAK.BNK.Viewer.cs │ │ ├── PAK.CS.Viewer.cs │ │ ├── PAK.CSV.Viewer.cs │ │ ├── PAK.DDS.Viewer.cs │ │ ├── PAK.Hex.Viewer.cs │ │ ├── PAK.JSON.Viewer.cs │ │ ├── PAK.LUA.Viewer.cs │ │ ├── PAK.MBIN.EbinColorBackgroundRenderer.cs │ │ ├── PAK.MBIN.Viewer.cs │ │ ├── PAK.SPV.Viewer.cs │ │ ├── PAK.TXT.Viewer.cs │ │ ├── PAK.VDF.Viewer.cs │ │ ├── PAK.WEM.Viewer.cs │ │ └── PAK.XML.Viewer.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Resources │ ├── About.png │ ├── Avalon_csx.xshd │ ├── Avalon_ebin.xshd │ ├── Avalon_exml.xshd │ ├── BaseComputer.png │ ├── BinocsMod.png │ ├── Black.png │ ├── Build.png │ ├── CSharp.png │ ├── CaseSensitive.png │ ├── Center.png │ ├── CheckAll.png │ ├── Checker.png │ ├── Chromatic.png │ ├── Clear.png │ ├── CollapseAll.png │ ├── Compile.png │ ├── Configure.png │ ├── Copy.png │ ├── Cube.png │ ├── Diff.png │ ├── Egg.png │ ├── Error.png │ ├── ExpandAll.png │ ├── FSlash.png │ ├── FileCreate.png │ ├── FileDelete.png │ ├── FindInFile.png │ ├── First.png │ ├── FlagBrazil.png │ ├── FlagCanada.png │ ├── FlagChina.png │ ├── FlagFrance.png │ ├── FlagGermany.png │ ├── FlagItaly.png │ ├── FlagJapan.png │ ├── FlagMexico.png │ ├── FlagNetherlands.png │ ├── FlagPoland.png │ ├── FlagPortugal.png │ ├── FlagRussia.png │ ├── FlagSouthKorea.png │ ├── FlagSpain.png │ ├── FlagUSA.png │ ├── Folder.png │ ├── GOG.png │ ├── GamePass.png │ ├── GitHub.png │ ├── Gray.png │ ├── Grouping.png │ ├── Image.png │ ├── Last.png │ ├── Launch.png │ ├── MergeTabs.png │ ├── Mirror.png │ ├── NMS.ico │ ├── NMS.png │ ├── Next.png │ ├── PakItemBin.png │ ├── PakItemBnk.png │ ├── PakItemCs.png │ ├── PakItemCsv.png │ ├── PakItemDds.png │ ├── PakItemEbin.png │ ├── PakItemExml.png │ ├── PakItemHex.png │ ├── PakItemJson.png │ ├── PakItemLua.png │ ├── PakItemSpv.png │ ├── PakItemTxt.png │ ├── PakItemWem.png │ ├── PakItemXml.png │ ├── Paste.png │ ├── Prev.png │ ├── RecipesFood.png │ ├── RecipesRefiner.png │ ├── Redo.png │ ├── Regex.png │ ├── Rename.png │ ├── Run.png │ ├── Save.png │ ├── ScriptMod.png │ ├── ScriptPlugin.png │ ├── ScriptQuery.png │ ├── ScriptUtil.png │ ├── Search.png │ ├── Settings.png │ ├── Smiley_Green.png │ ├── Smiley_Red.png │ ├── Smiley_Yellow.png │ ├── SplitTabs.png │ ├── Steam.png │ ├── Stop.png │ ├── Stretch.png │ ├── Text.png │ ├── Tile.png │ ├── TypeArray.png │ ├── TypeEvent.png │ ├── TypeField.png │ ├── TypeProp.png │ ├── UncheckAll.png │ ├── Undo.png │ ├── Viewer.ico │ ├── Warning.png │ ├── WarpCell.png │ ├── White.png │ └── WholeWord.png ├── Themes │ └── Generic.xaml ├── Utility │ ├── BitmapBuilder.cs │ ├── Dialog.cs │ ├── DialogWrapper.cs │ ├── EndianBinaryReader.cs │ ├── EndianBinaryWriter.cs │ ├── FakeEnum.cs │ ├── FrameworkElementFactory.cs │ ├── GitHubReleases.cs │ ├── IO.Item.cs │ ├── IO.Path.cs │ ├── IO.Stream.cs │ ├── IPathNode.cs │ ├── IPersistState.cs │ ├── Log.cs │ ├── LogItem.cs │ ├── LogViewer.cs │ ├── PInvoke.cs │ ├── ReadWriteLock.cs │ ├── Resource.cs │ ├── ScopedCursor.cs │ └── Steam.File.Loader.cs ├── cmkNMSCommon.csproj ├── cmkNMSCommon.csproj.user ├── cmkNMSReleases.txt ├── libMBIN.dll └── spirv-cross.exe ├── Doc ├── About.png ├── Application.png ├── QuickStart │ └── Readme.md ├── Script │ └── Readme.md ├── Splash.png └── Tab │ ├── Application │ ├── Application.png │ ├── Download.png │ ├── LoadedTabs.png │ ├── Readme.md │ ├── SelectGameFolder.png │ ├── StartTabs.png │ ├── Statusbar.png │ └── Toolbar.png │ ├── Build │ ├── Build1.png │ ├── Build2.png │ └── Readme.md │ ├── Items │ ├── Products.png │ ├── Readme.md │ ├── Substances.png │ └── Technologies.png │ ├── Language │ ├── LanguageEN.png │ ├── LanguageKO.png │ └── Readme.md │ ├── MBINC │ ├── MBINC_ChildClass.png │ ├── MBINC_TopLevelClass.png │ └── Readme.md │ ├── PakConflicts │ ├── PakConflicts.png │ └── Readme.md │ ├── PakItems │ ├── PakItemDds.png │ ├── PakItemMbin.png │ ├── PakItemMbinColor.png │ ├── PakItemMbinDiff.png │ ├── PakItemMbinLanguage.png │ ├── PakItemMbinPath1.png │ ├── PakItemMbinPath2.png │ ├── PakItemSpv.png │ ├── PakItems.png │ └── Readme.md │ ├── Readme.md │ ├── Recipes │ ├── Readme.md │ ├── RecipesCooking.png │ └── RecipesRefiner.png │ ├── ScriptMod │ ├── Readme.md │ └── ScriptMod.png │ ├── ScriptQuery │ ├── Readme.md │ ├── ScriptQuery.png │ └── ScriptQueryCompile.png │ ├── ScriptUtil │ ├── Readme.md │ ├── ScriptQueryCompile.png │ └── ScriptUtil.png │ ├── SearchDds │ ├── Dds.png │ └── Readme.md │ ├── SearchPaths │ ├── Dds.png │ └── Readme.md │ └── SearchText │ ├── Mbin1.png │ ├── Mbin2.png │ └── Readme.md ├── LICENSE ├── Plugins └── Sample │ ├── Sample.cs │ ├── Sample.csproj │ └── Sample.sln ├── change.log └── readme.md /Common/Controls/BitmapViewerSideBySide.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Windows.Media; 22 | using System.Windows.Media.Imaging; 23 | using System.Windows.Shapes; 24 | 25 | //============================================================================= 26 | 27 | namespace cmk 28 | { 29 | public class BitmapViewerSideBySide 30 | : System.Windows.Controls.Grid 31 | { 32 | public BitmapViewerSideBySide() : base() 33 | { 34 | ColumnDefinitions.AddStar(); 35 | ColumnDefinitions.AddPixel(4); 36 | ColumnDefinitions.AddStar(); 37 | 38 | SetColumn(ViewerLeft, 0); 39 | SetColumn(Splitter, 1); 40 | SetColumn(ViewerRight, 2); 41 | 42 | Children.Add(ViewerLeft); 43 | Children.Add(Splitter); 44 | Children.Add(ViewerRight); 45 | } 46 | 47 | //........................................................... 48 | 49 | public readonly Rectangle Splitter = new() { Fill = Brushes.Black }; 50 | public readonly BitmapViewer ViewerLeft = new(); 51 | public readonly BitmapViewer ViewerRight = new(); 52 | 53 | //........................................................... 54 | 55 | public string LabelLeft { 56 | get { return ViewerLeft.LabelText; } 57 | set { ViewerLeft.LabelText = value; } 58 | } 59 | 60 | public string LabelRight { 61 | get { return ViewerRight.LabelText; } 62 | set { ViewerRight.LabelText = value; } 63 | } 64 | 65 | //........................................................... 66 | 67 | public BitmapSource SourceLeft { 68 | get { return ViewerLeft.Source; } 69 | set { ViewerLeft.Source = value; } 70 | } 71 | 72 | public BitmapSource SourceRight { 73 | get { return ViewerRight.Source; } 74 | set { ViewerRight.Source = value; } 75 | } 76 | } 77 | } 78 | 79 | //============================================================================= 80 | -------------------------------------------------------------------------------- /Common/Controls/ComboBox.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Windows; 22 | using System.Windows.Controls; 23 | using System.Windows.Data; 24 | 25 | //============================================================================= 26 | 27 | namespace cmk 28 | { 29 | public class ComboBox 30 | : System.Windows.Controls.ComboBox 31 | { 32 | public delegate void VisualChildrenChangedEventHandler( DependencyObject ADDED, DependencyObject REMOVED ); 33 | public event VisualChildrenChangedEventHandler VisualChildrenChanged; 34 | 35 | //........................................................... 36 | 37 | public ComboBox() : base() 38 | { 39 | Construct(true); 40 | } 41 | 42 | //........................................................... 43 | 44 | public ComboBox( bool IS_VIRTUALIZING ) : base() 45 | { 46 | Construct(IS_VIRTUALIZING); 47 | } 48 | 49 | //........................................................... 50 | 51 | public ListCollectionView ListCollectionView => 52 | CollectionViewSource.GetDefaultView(ItemsSource) as ListCollectionView 53 | ; 54 | 55 | //........................................................... 56 | 57 | protected void Construct( bool IS_VIRTUALIZING ) 58 | { 59 | Grid.SetIsSharedSizeScope(this, true); 60 | 61 | if( IS_VIRTUALIZING ) ItemsPanel = new() { 62 | VisualTree = new System.Windows.FrameworkElementFactory(typeof(VirtualizingStackPanel)) 63 | }; 64 | SetValue(VirtualizingStackPanel.IsVirtualizingProperty, IS_VIRTUALIZING); 65 | SetValue(VirtualizingStackPanel.IsVirtualizingWhenGroupingProperty, IS_VIRTUALIZING); 66 | SetValue(VirtualizingStackPanel.VirtualizationModeProperty, VirtualizationMode.Recycling); 67 | 68 | HorizontalContentAlignment = HorizontalAlignment.Stretch; 69 | VerticalAlignment = VerticalAlignment.Center; 70 | BorderThickness = new(0); 71 | Padding = new(2); 72 | Margin = new(2); 73 | IsEditable = false; 74 | IsReadOnly = true; 75 | 76 | ToolTipService.SetInitialShowDelay(this, 0); 77 | ToolTipService.SetShowDuration(this, 60000); 78 | } 79 | 80 | //........................................................... 81 | 82 | protected override void OnVisualChildrenChanged( DependencyObject ADDED, DependencyObject REMOVED ) 83 | { 84 | base.OnVisualChildrenChanged(ADDED, REMOVED); 85 | VisualChildrenChanged?.Invoke(ADDED, REMOVED); 86 | } 87 | } 88 | } 89 | 90 | //============================================================================= 91 | -------------------------------------------------------------------------------- /Common/Controls/GitHubButton.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | using System.Diagnostics; 23 | using System.Windows.Controls; 24 | 25 | //============================================================================= 26 | 27 | namespace cmk 28 | { 29 | public class GitHubButton 30 | : cmk.ImageButton 31 | { 32 | public GitHubButton( string USER, string REPOSITORY ) : base() 33 | { 34 | Uri = Resource.Uri("GitHub.png"); 35 | User = USER; 36 | Repository = REPOSITORY; 37 | 38 | ToolTipService.SetInitialShowDelay(this, 0); 39 | ToolTipService.SetShowDuration(this, 60000); 40 | } 41 | 42 | //........................................................... 43 | 44 | protected string m_user = ""; 45 | 46 | public string User { 47 | get { return m_user; } 48 | set { 49 | if( m_user == value ) return; 50 | m_user = value; 51 | ToolTip = Url; 52 | } 53 | } 54 | 55 | //........................................................... 56 | 57 | protected string m_repository = ""; 58 | 59 | public string Repository { 60 | get { return m_repository; } 61 | set { 62 | if( m_repository == value ) return; 63 | m_repository = value; 64 | ToolTip = Url; 65 | } 66 | } 67 | 68 | //........................................................... 69 | 70 | public string Url { 71 | get { return $"https://github.com/{User}/{Repository}"; } 72 | } 73 | 74 | //........................................................... 75 | 76 | protected override void OnClick() 77 | { 78 | base.OnClick(); 79 | try { 80 | var info = new ProcessStartInfo { 81 | FileName = Url, 82 | UseShellExecute = true, 83 | }; 84 | _ = Process.Start(info); 85 | } 86 | catch( Exception EX ) { Log.Default.AddFailure(EX); } 87 | } 88 | } 89 | } 90 | 91 | //============================================================================= 92 | -------------------------------------------------------------------------------- /Common/Controls/HexDiffer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.IO; 22 | using System.Windows.Media; 23 | using System.Windows.Shapes; 24 | 25 | //============================================================================= 26 | 27 | namespace cmk 28 | { 29 | public class HexDiffer 30 | : System.Windows.Controls.Grid 31 | { 32 | public HexDiffer( Stream LHS, Stream RHS ) : base() 33 | { 34 | ColumnDefinitions.AddStar(); 35 | ColumnDefinitions.AddPixel(4); 36 | ColumnDefinitions.AddStar(); 37 | 38 | SetColumn(ViewerLeft, 0); 39 | SetColumn(Splitter, 1); 40 | SetColumn(ViewerRight, 2); 41 | 42 | Children.Add(ViewerLeft); 43 | Children.Add(Splitter); 44 | Children.Add(ViewerRight); 45 | 46 | StreamLeft = LHS; 47 | StreamRight = RHS; 48 | } 49 | 50 | //........................................................... 51 | 52 | public readonly Rectangle Splitter = new() { Fill = Brushes.Black }; 53 | public readonly HexViewer ViewerLeft = new(null); 54 | public readonly HexViewer ViewerRight = new(null); 55 | 56 | //........................................................... 57 | 58 | public Stream StreamLeft { 59 | get { return ViewerLeft.Raw; } 60 | set { ViewerLeft.Raw = value; } 61 | } 62 | 63 | public Stream StreamRight { 64 | get { return ViewerRight.Raw; } 65 | set { ViewerRight.Raw = value; } 66 | } 67 | } 68 | } 69 | 70 | //============================================================================= 71 | -------------------------------------------------------------------------------- /Common/Controls/HexViewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.IO; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk 26 | { 27 | public class HexViewer // todo 28 | : cmk.TextViewer 29 | { 30 | public HexViewer( Stream RAW = null ) : base() 31 | { 32 | Raw = RAW; 33 | } 34 | 35 | //........................................................... 36 | 37 | public Stream Raw { 38 | get; 39 | set; 40 | } 41 | } 42 | } 43 | 44 | //============================================================================= 45 | -------------------------------------------------------------------------------- /Common/Controls/StackPanel.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Windows; 22 | using System.Windows.Controls; 23 | using System.Windows.Media; 24 | 25 | //============================================================================= 26 | 27 | namespace cmk 28 | { 29 | public class StackPanel 30 | : System.Windows.Controls.StackPanel 31 | { 32 | public delegate void VisualChildrenChangedEventHandler( DependencyObject ADDED, DependencyObject REMOVED ); 33 | public event VisualChildrenChangedEventHandler VisualChildrenChanged; 34 | 35 | //........................................................... 36 | 37 | public StackPanel() 38 | { 39 | Background = Brushes.LightGray; 40 | Grid.SetIsSharedSizeScope(this, true); 41 | } 42 | 43 | //........................................................... 44 | 45 | protected override void OnVisualChildrenChanged( DependencyObject ADDED, DependencyObject REMOVED ) 46 | { 47 | base.OnVisualChildrenChanged(ADDED, REMOVED); 48 | VisualChildrenChanged?.Invoke(ADDED, REMOVED); 49 | } 50 | } 51 | } 52 | 53 | //============================================================================= 54 | -------------------------------------------------------------------------------- /Common/Controls/TextBoxDialog.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Windows; 22 | using System.Windows.Controls; 23 | 24 | //============================================================================= 25 | 26 | namespace cmk 27 | { 28 | public class TextBoxDialog 29 | : System.Windows.Window 30 | { 31 | public TextBoxDialog() : base() 32 | { 33 | Title = "Edit Text"; 34 | 35 | WindowStartupLocation = WindowStartupLocation.CenterScreen; 36 | SizeToContent = SizeToContent.Width; 37 | Topmost = true; 38 | MinHeight = 105; 39 | MaxHeight = 105; 40 | MinWidth = 256; 41 | 42 | Grid.Children.Add(TextBox); 43 | Grid.Children.Add(OkButton); 44 | Grid.Children.Add(CancelButton); 45 | 46 | Content = Grid; 47 | 48 | OkButton.Click += OnOkClick; 49 | CancelButton.Click += OnCancelClick; 50 | 51 | Loaded += ( S, E ) => TextBox.Text = Text; 52 | } 53 | 54 | //........................................................... 55 | 56 | public readonly Grid Grid = new(); 57 | 58 | public readonly TextBox TextBox = new() { 59 | HorizontalAlignment = HorizontalAlignment.Stretch, 60 | VerticalAlignment = VerticalAlignment.Top, 61 | TextWrapping = TextWrapping.NoWrap, 62 | Margin = new(10, 10, 10, 0), 63 | }; 64 | 65 | public readonly Button OkButton = new() { 66 | HorizontalAlignment = HorizontalAlignment.Right, 67 | VerticalAlignment = VerticalAlignment.Bottom, 68 | Margin = new(0, 0, 90, 10), 69 | Width = 75, 70 | Content = "OK", 71 | }; 72 | public readonly Button CancelButton = new() { 73 | HorizontalAlignment = HorizontalAlignment.Right, 74 | VerticalAlignment = VerticalAlignment.Bottom, 75 | Margin = new(0, 0, 10, 10), 76 | Width = 75, 77 | Content = "Cancel", 78 | }; 79 | 80 | //........................................................... 81 | 82 | public string Text { get; set; } 83 | 84 | //........................................................... 85 | 86 | protected void OnOkClick( object SENDER, RoutedEventArgs ARGS ) 87 | { 88 | Text = TextBox.Text; 89 | DialogResult = true; 90 | Close(); 91 | } 92 | 93 | //........................................................... 94 | 95 | protected void OnCancelClick( object SENDER, RoutedEventArgs ARGS ) 96 | { 97 | DialogResult = false; 98 | Close(); 99 | } 100 | } 101 | } 102 | 103 | //============================================================================= 104 | -------------------------------------------------------------------------------- /Common/Controls/TextSearchBackgroundRenderer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text.RegularExpressions; 24 | using System.Windows.Media; 25 | using avalon = ICSharpCode.AvalonEdit; 26 | 27 | //============================================================================= 28 | 29 | namespace cmk 30 | { 31 | public class TextSearchBackgroundRenderer 32 | : avalon.Rendering.IBackgroundRenderer 33 | { 34 | public List Results { get; set; } 35 | public Brush MarkerBrush { get; set; } 36 | 37 | //........................................................... 38 | 39 | public avalon.Rendering.KnownLayer Layer { 40 | get { return avalon.Rendering.KnownLayer.Selection; } 41 | } 42 | 43 | //........................................................... 44 | 45 | public void Draw( avalon.Rendering.TextView VIEW, DrawingContext CONTEXT ) 46 | { 47 | var results = Results; 48 | if( VIEW == null || CONTEXT == null || results.IsNullOrEmpty() ) return; 49 | 50 | VIEW.EnsureVisualLines(); 51 | 52 | var visible_lines = VIEW.VisualLines; 53 | var offset_start = visible_lines.First().FirstDocumentLine.Offset; 54 | var offset_end = visible_lines.Last() .LastDocumentLine .EndOffset; 55 | 56 | var brush = MarkerBrush ?? Brushes.Yellow; 57 | 58 | foreach( var match in results ) { 59 | var match_end = match.Index + match.Length; 60 | if( match_end <= offset_start ) continue; 61 | if( match.Index > offset_end ) break; 62 | 63 | var segment = new avalon.Document.TextSegment{ 64 | StartOffset = match.Index, 65 | Length = match.Length, 66 | }; 67 | 68 | foreach( var rect in avalon.Rendering.BackgroundGeometryBuilder.GetRectsForSegment(VIEW, segment) ) { 69 | CONTEXT.DrawRectangle(brush, null, rect); 70 | } 71 | } 72 | } 73 | } 74 | } 75 | 76 | //============================================================================= 77 | -------------------------------------------------------------------------------- /Common/Controls/XmlViewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Windows; 22 | using avalon = ICSharpCode.AvalonEdit; 23 | 24 | //============================================================================= 25 | 26 | namespace cmk 27 | { 28 | public class XmlFoldingStrategyAdapter 29 | : cmk.ITextViewerFoldingStrategy 30 | { 31 | public static avalon.Folding.XmlFoldingStrategy XmlFoldingStrategy = new() { 32 | ShowAttributesWhenFolded = true 33 | }; 34 | 35 | //........................................................... 36 | 37 | public void UpdateFoldings( 38 | avalon.Folding.FoldingManager MANAGER, 39 | avalon.Document.TextDocument DOCUMENT 40 | ){ 41 | if( MANAGER != null && DOCUMENT != null ) { 42 | XmlFoldingStrategy.UpdateFoldings(MANAGER, DOCUMENT); 43 | } 44 | } 45 | } 46 | 47 | //========================================================================= 48 | 49 | public class XmlViewer 50 | : cmk.TextViewerFolding 51 | { 52 | public XmlViewer( string XML = "", string PAKFILENAME = "" ) 53 | : base(XML, PAKFILENAME, new XmlFoldingStrategyAdapter()) 54 | { 55 | LoadHighlighterExtension(".xml"); 56 | } 57 | 58 | //........................................................... 59 | 60 | protected override void OnLoaded( object SENDER, RoutedEventArgs ARGS ) 61 | { 62 | base.OnLoaded(SENDER, ARGS); 63 | FoldingsCollapseAll(); 64 | } 65 | } 66 | } 67 | 68 | //============================================================================= 69 | -------------------------------------------------------------------------------- /Common/Extensions/System.Array.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk 26 | { 27 | public static partial class Array_x 28 | { 29 | /// 30 | /// Use msvcrt memcmp to compare min length of LHS, RHS. 31 | /// If common length elements are equal then compare lengths. 32 | /// 33 | public static int MemCmp( byte[] LHS, byte[] RHS ) 34 | { 35 | if( ReferenceEquals(LHS, RHS) ) return 0; 36 | if( LHS == null ) return -1; 37 | if( RHS == null ) return 1; 38 | 39 | var length = Math.Min(LHS.Length, RHS.Length); 40 | var compare = PInvoke.memcmp(LHS, RHS, length); 41 | if( compare != 0 ) return compare; 42 | 43 | if( LHS.Length > length ) return 1; 44 | if( RHS.Length > length ) return -1; 45 | 46 | return 0; 47 | } 48 | } 49 | } 50 | 51 | //============================================================================= 52 | -------------------------------------------------------------------------------- /Common/Extensions/System.DateTime.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk 26 | { 27 | public static partial class _x_ 28 | { 29 | /// 30 | /// hh:mm:ss.fff 31 | /// 32 | public static string ToTimeStamp( this DateTime DATE_TIME ) 33 | { 34 | return DATE_TIME.ToString("hh:mm:ss.fff"); 35 | } 36 | } 37 | } 38 | 39 | //============================================================================= 40 | -------------------------------------------------------------------------------- /Common/Extensions/System.Delegate.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | using System.Threading.Tasks; 23 | using System.Windows; 24 | using System.Windows.Threading; 25 | 26 | //============================================================================= 27 | 28 | namespace cmk 29 | { 30 | public static partial class _x_ 31 | { 32 | /// 33 | /// Invoke DELEGATE using Application.Current?.Dispatcher. 34 | /// 35 | public static object DispatcherInvoke( 36 | this Delegate DELEGATE, params object[] ARGS 37 | ) 38 | => Application.Current?.Dispatcher.Invoke(DELEGATE, ARGS); 39 | 40 | //........................................................... 41 | 42 | /// 43 | /// BeginInvoke DELEGATE using Application.Current?.Dispatcher. 44 | /// 45 | public static DispatcherOperation DispatcherBeginInvoke( 46 | this Delegate DELEGATE, params object[] ARGS 47 | ) 48 | => Application.Current?.Dispatcher.BeginInvoke(DELEGATE, ARGS); 49 | 50 | //........................................................... 51 | 52 | /// 53 | /// DynamicInvoke each delegate in DELEGATE.GetInvocationList 54 | /// in parallel. 55 | /// 56 | public static void ParallelInvoke( 57 | this Delegate DELEGATE, params object[] ARGS 58 | ) { 59 | if( DELEGATE == null ) return; 60 | 61 | var list = DELEGATE.GetInvocationList(); 62 | 63 | if( list == null || ( 64 | list.Length == 1 && list[0] == DELEGATE 65 | ) ) { 66 | DELEGATE.DynamicInvoke(ARGS); 67 | } 68 | else { 69 | _ = Parallel.ForEach(list, SUB_DELEGATE => 70 | ParallelInvoke(SUB_DELEGATE, ARGS) 71 | ); 72 | } 73 | } 74 | } 75 | } 76 | 77 | //============================================================================= 78 | -------------------------------------------------------------------------------- /Common/Extensions/System.Net.Http.HttpClient.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | using System.IO; 23 | using System.Net.Http; 24 | using System.Threading; 25 | using System.Threading.Tasks; 26 | 27 | //============================================================================= 28 | 29 | namespace cmk 30 | { 31 | public static partial class _x_ 32 | { 33 | /// 34 | /// Use HTTP to request URI content and copy to TARGET. 35 | /// Report % progress (0-100) to PROGRESS_PERCENT. 36 | /// 37 | public static async Task RecvAsync( 38 | this HttpClient HTTP, 39 | Uri URI, 40 | Stream TARGET, 41 | IProgress PROGRESS_PERCENT = null, // 0 - 100 42 | CancellationToken CANCEL = default, 43 | int BUFFER_SIZE = 65536 44 | ){ 45 | if( HTTP == null ) throw new ArgumentNullException(nameof(HTTP)); 46 | if( URI == null ) throw new ArgumentNullException(nameof(URI)); 47 | if( TARGET == null ) throw new ArgumentNullException(nameof(TARGET)); 48 | 49 | if( !TARGET.CanWrite ) throw new ArgumentException("Can't write to target.", nameof(TARGET)); 50 | 51 | using( var response = await HTTP.GetAsync(URI, HttpCompletionOption.ResponseHeadersRead, CANCEL).ConfigureAwait(false) ) { 52 | if( !response.IsSuccessStatusCode ) throw new HttpRequestException( 53 | response.ReasonPhrase, null, response.StatusCode 54 | ); 55 | var length = response.Content.Headers.ContentLength.GetValueOrDefault(0); 56 | using( var source = await response.Content.ReadAsStreamAsync(CANCEL).ConfigureAwait(false) ) { 57 | if( PROGRESS_PERCENT == null || length < 1 ) { 58 | await source.CopyToAsync(TARGET, CANCEL).ConfigureAwait(false); 59 | return; 60 | } 61 | var progress = new Progress( 62 | // forward progress to PROGRESS_PERCENT. 63 | // convert CopyToAsync total-bytes-copied to a % (0 - 100). 64 | TOTAL => PROGRESS_PERCENT.Report((byte)(100 * TOTAL / length)) 65 | ); 66 | await source.CopyToAsync(TARGET, progress, CANCEL, BUFFER_SIZE).ConfigureAwait(false); 67 | PROGRESS_PERCENT.Report(100); 68 | } 69 | } 70 | } 71 | } 72 | } 73 | 74 | //============================================================================= 75 | -------------------------------------------------------------------------------- /Common/Extensions/System.Object.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk 26 | { 27 | public static partial class _x_ 28 | { 29 | [Obsolete] 30 | public static WeakReference GetWeakReference( this object OBJECT ) 31 | { 32 | return OBJECT == null ? null : new(OBJECT, trackResurrection: true); 33 | } 34 | 35 | //........................................................... 36 | 37 | public static WeakReference GetWeakReference( this TYPE_T OBJECT ) 38 | where TYPE_T : class 39 | { 40 | return OBJECT == null ? null : new(OBJECT, trackResurrection: true); 41 | } 42 | } 43 | } 44 | 45 | //============================================================================= 46 | -------------------------------------------------------------------------------- /Common/Extensions/System.Reflection.FieldInfo.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Reflection; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk 26 | { 27 | public static partial class _x_ 28 | { 29 | /// 30 | /// Build field name string, supports generic's, arrays, and libMBIN.NMSAttribute. 31 | /// 32 | public static string GenericName( this FieldInfo FIELD, bool FULL = false ) 33 | { 34 | var generic_name = ""; 35 | if( FULL ) generic_name = FIELD.FieldType.Namespace + "."; 36 | 37 | generic_name += RootName(FIELD.FieldType); 38 | 39 | var nms_attr = FIELD.GetCustomAttribute(); 40 | var nms_size = nms_attr?.Size ?? 0; 41 | var nms_enum = nms_attr?.EnumType; 42 | 43 | if( FIELD.FieldType.IsGenericType ) { 44 | generic_name += "<"; 45 | var generics = FIELD.FieldType.GetGenericArguments(); 46 | if( generics.Length > 0 ) { 47 | generic_name += GenericName(generics[0], false); 48 | for( int i = 1; i < generics.Length; ++i ) { 49 | generic_name += "," + GenericName(generics[i], false); 50 | } 51 | } 52 | generic_name += ">"; 53 | } 54 | if( FIELD.FieldType.IsArray ) { 55 | for( var i = 0; i < FIELD.FieldType.GetArrayRank(); ++i ) { 56 | generic_name += "["; 57 | if( nms_size > 0 ) generic_name += nms_size; 58 | if( nms_enum != null ) { 59 | if( nms_size < 1 ) generic_name += nms_enum.GetEnumValues().Length; 60 | generic_name += ":" + nms_enum.Name; 61 | } 62 | generic_name += "]"; 63 | } 64 | } 65 | else if( nms_size > 0 ) { 66 | generic_name += "(" + nms_size + ")"; 67 | } 68 | else if( nms_enum != null ) { 69 | generic_name += "(" + nms_enum.GetEnumValues().Length + ":" + nms_enum.Name + ")"; 70 | } 71 | 72 | return generic_name; 73 | } 74 | 75 | //........................................................... 76 | 77 | /// 78 | /// FIELD.FieldType.GenericName(false) + " " + FIELD.Name 79 | /// 80 | public static string TypeAndName( this FieldInfo FIELD ) 81 | { 82 | return FIELD.FieldType.GenericName(false) + " " + FIELD.Name; 83 | } 84 | } 85 | } 86 | 87 | //============================================================================= 88 | -------------------------------------------------------------------------------- /Common/Extensions/System.Span.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk 26 | { 27 | public static partial class _x_ 28 | { 29 | public static bool IsNullOrEmpty( this ReadOnlySpan SPAN ) 30 | { 31 | return (SPAN == null) || (SPAN.Length < 1); 32 | } 33 | } 34 | } 35 | 36 | //============================================================================= 37 | -------------------------------------------------------------------------------- /Common/Extensions/System.String.x.p.CompareNumeric.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk 26 | { 27 | public static partial class String 28 | { 29 | /// 30 | /// All embedded #'s are treated as positive and "01" > "1", 31 | /// i.e. in "blah-3blah" the '-' is a char, not part of the number. 32 | /// Does not handle decimals i.e. '.' is considered a char, not part of the number. 33 | /// 34 | public static int CompareNumeric( ReadOnlySpan LHS, ReadOnlySpan RHS, bool IGNORE_CASE = false ) 35 | { 36 | if( LHS == null ) return -1; 37 | if( RHS == null ) return 1; 38 | 39 | var ll = LHS.Length; 40 | var lr = RHS.Length; 41 | 42 | for( int il = 0, ir = 0; il < ll && ir < lr; ++il, ++ir ) { 43 | var is_dl = char.IsDigit(LHS[il]); 44 | var is_dr = char.IsDigit(RHS[ir]); 45 | if( is_dl && is_dr ) { 46 | // skip leading 0's 47 | while( il < ll && LHS[il] == '0' ) ++il; 48 | while( ir < lr && RHS[ir] == '0' ) ++ir; 49 | 50 | // find end of digit string 51 | var idl = il; while( idl < ll && char.IsDigit(LHS[idl]) ) ++idl; 52 | var idr = ir; while( idr < lr && char.IsDigit(RHS[idr]) ) ++idr; 53 | 54 | // if diff # of digits then compare lengths 55 | var ldl = idl - il; 56 | var ldr = idr - ir; 57 | if( ldl < ldr ) return -1; 58 | if( ldl > ldr ) return 1; 59 | 60 | // parse digit strings, they have same # of char 61 | if( ldl > 0 ) { 62 | var sl = LHS.Slice(il, ldl); 63 | var sr = RHS.Slice(ir, ldr); 64 | var c = sl.CompareTo(sr, StringComparison.Ordinal); 65 | if( c < 0 ) return -1; 66 | if( c > 0 ) return 1; 67 | } 68 | 69 | il = idl - 1; 70 | ir = idr - 1; 71 | } 72 | else { // not both digits 73 | var cl = is_dl ? LHS[il] : char.ToUpper(LHS[il]); 74 | var cr = is_dr ? RHS[ir] : char.ToUpper(RHS[ir]); 75 | if( cl < cr ) return -1; 76 | if( cl > cr ) return 1; 77 | if( !IGNORE_CASE ) { 78 | cl = LHS[il]; 79 | cr = RHS[ir]; 80 | if( cl < cr ) return -1; 81 | if( cl > cr ) return 1; 82 | } 83 | } 84 | } 85 | 86 | if( ll < lr ) return -1; 87 | if( ll > lr ) return 1; 88 | 89 | return 0; 90 | } 91 | } 92 | } 93 | 94 | //============================================================================= 95 | -------------------------------------------------------------------------------- /Common/Extensions/System.Threading.Tasks.Task.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Threading; 22 | using System.Threading.Tasks; 23 | using System.Windows.Threading; 24 | 25 | //============================================================================= 26 | 27 | namespace cmk 28 | { 29 | public static partial class _x_ 30 | { 31 | /// 32 | /// Wait for TASK to complete while still pumping messages for thread. 33 | /// 34 | public static void Pump( 35 | this Task TASK, 36 | CancellationToken CANCEL = default 37 | ){ 38 | // run TASK async, when TASK completes set nested.Continue = false 39 | var nested = new DispatcherFrame(); 40 | TASK.ContinueWith(_ => nested.Continue = false, TaskScheduler.Default); 41 | Dispatcher.PushFrame(nested); // pump until nested.Continue = false 42 | TASK.Wait(CANCEL); 43 | } 44 | 45 | //........................................................... 46 | 47 | /// 48 | /// Wait for TASK to complete while still pumping messages for thread. 49 | /// 50 | public static T Pump( 51 | this Task TASK, 52 | CancellationToken CANCEL = default 53 | ){ 54 | var nested = new DispatcherFrame(); 55 | TASK.ContinueWith(_ => nested.Continue = false, TaskScheduler.Default); 56 | Dispatcher.PushFrame(nested); 57 | return TASK.Result(CANCEL); 58 | } 59 | 60 | //........................................................... 61 | 62 | /// 63 | /// Wait for TASK to complete. 64 | /// 65 | public static T Result( this Task TASK, CancellationToken CANCEL = default ) 66 | { 67 | //TASK.Wait(CANCEL); 68 | return TASK.Result; 69 | } 70 | } 71 | } 72 | 73 | //============================================================================= 74 | -------------------------------------------------------------------------------- /Common/Extensions/System.Version.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk 26 | { 27 | public static partial class _x_ 28 | { 29 | /// 30 | /// All parts < 0. 31 | /// 32 | public static bool IsNull( this Version VERSION ) 33 | { 34 | return 35 | VERSION == null || ( 36 | VERSION.Major < 0 && 37 | VERSION.Minor < 0 && 38 | VERSION.Build < 0 && 39 | VERSION.Revision < 0 40 | ); 41 | } 42 | 43 | //........................................................... 44 | 45 | /// 46 | /// All parts <= 0. 47 | /// 48 | public static bool IsNullOrZero( this Version VERSION ) 49 | { 50 | return 51 | VERSION == null || ( 52 | VERSION.Major <= 0 && 53 | VERSION.Minor <= 0 && 54 | VERSION.Build <= 0 && 55 | VERSION.Revision <= 0 56 | ); 57 | } 58 | 59 | //........................................................... 60 | 61 | /// 62 | /// Convert any parts that are < 0 to 0. 63 | /// By default NET uses -1 to indicate part not used. 64 | /// 65 | public static Version Normalize( this Version VERSION ) 66 | { 67 | if( VERSION == null ) return new(); 68 | 69 | var major = VERSION.Major; 70 | var minor = VERSION.Minor; 71 | var build = VERSION.Build; 72 | var revision = VERSION.Revision; 73 | 74 | if( major < 1 ) major = 0; 75 | if( minor < 1 ) minor = 0; 76 | if( build < 1 ) build = 0; 77 | if( revision < 1 ) revision = 0; 78 | 79 | return new(major, minor, build, revision); 80 | } 81 | 82 | //........................................................... 83 | 84 | public static Version ClampLower( this Version VERSION, Version CLAMP ) 85 | { 86 | return (VERSION < CLAMP) ? CLAMP : VERSION; 87 | } 88 | 89 | //........................................................... 90 | 91 | public static Version ClampUpper( this Version VERSION, Version CLAMP ) 92 | { 93 | return (VERSION > CLAMP) ? CLAMP : VERSION; 94 | } 95 | 96 | //........................................................... 97 | 98 | public static Version Clamp( this Version VERSION, Version MIN, Version MAX ) 99 | { 100 | return ClampUpper(ClampLower(VERSION, MIN), MAX); 101 | } 102 | } 103 | } 104 | 105 | //============================================================================= 106 | -------------------------------------------------------------------------------- /Common/Extensions/System.WeakReference.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | using System.Runtime.CompilerServices; 23 | 24 | //============================================================================= 25 | 26 | namespace cmk 27 | { 28 | public static partial class _x_ 29 | { 30 | /// 31 | /// The object passed to IS_ALIVE will be non-null. 32 | /// 33 | [Obsolete] 34 | [MethodImpl(MethodImplOptions.NoInlining)] 35 | public static bool WaitForPendingFinalizers( 36 | this WeakReference WEAK, 37 | Predicate IS_ALIVE = null 38 | ){ 39 | if( WEAK == null ) return true; 40 | if( IS_ALIVE == null ) IS_ALIVE = OBJECT => true; 41 | 42 | for( var i = 0; WEAK.IsAlive && (i < 10); ++i ) { 43 | GC.Collect(); 44 | GC.WaitForPendingFinalizers(); 45 | var obj = WEAK.Target; 46 | if( obj == null || 47 | !IS_ALIVE(obj) 48 | ) return true; 49 | System.Threading.Thread.Sleep(8); 50 | } 51 | 52 | return !WEAK.IsAlive; 53 | } 54 | 55 | //........................................................... 56 | 57 | /// 58 | /// The object passed to IS_ALIVE will be non-null. 59 | /// 60 | [MethodImpl(MethodImplOptions.NoInlining)] 61 | public static bool WaitForPendingFinalizers( 62 | this WeakReference WEAK, 63 | Predicate IS_ALIVE = null 64 | ) 65 | where TYPE_T : class 66 | { 67 | if( WEAK == null ) return true; 68 | if( IS_ALIVE == null ) IS_ALIVE = OBJECT => true; 69 | 70 | for( var i = 0; i < 10; ++i ) { 71 | GC.Collect(); 72 | GC.WaitForPendingFinalizers(); 73 | TYPE_T obj = null; 74 | if( !WEAK.TryGetTarget(out obj) || 75 | !IS_ALIVE(obj) 76 | ) return true; 77 | System.Threading.Thread.Sleep(8); 78 | } 79 | 80 | return false; 81 | } 82 | } 83 | } 84 | 85 | //============================================================================= 86 | -------------------------------------------------------------------------------- /Common/Extensions/System.Windows.Controls.ColumnDefinitionCollection.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Windows; 22 | using System.Windows.Controls; 23 | 24 | //============================================================================= 25 | 26 | namespace cmk 27 | { 28 | public static partial class _x_ 29 | { 30 | /// 31 | /// Add auto-width column. 32 | /// 33 | public static void AddAuto( this ColumnDefinitionCollection COLUMNS ) 34 | { 35 | COLUMNS.Add(new() { Width = new(0, GridUnitType.Auto) }); 36 | } 37 | 38 | //........................................................... 39 | 40 | /// 41 | /// Add fill-width column. 42 | /// 43 | public static void AddStar( this ColumnDefinitionCollection COLUMNS, double VALUE = 1 ) 44 | { 45 | COLUMNS.Add(new() { Width = new(VALUE, GridUnitType.Star) }); 46 | } 47 | 48 | //........................................................... 49 | 50 | /// 51 | /// Add specific pixel-width column. 52 | /// 53 | public static void AddPixel( this ColumnDefinitionCollection COLUMNS, double VALUE ) 54 | { 55 | COLUMNS.Add(new() { Width = new(VALUE, GridUnitType.Pixel) }); 56 | } 57 | } 58 | } 59 | 60 | //============================================================================= 61 | -------------------------------------------------------------------------------- /Common/Extensions/System.Windows.Controls.RowDefinitionCollection.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Windows; 22 | using System.Windows.Controls; 23 | 24 | //============================================================================= 25 | 26 | namespace cmk 27 | { 28 | public static partial class _x_ 29 | { 30 | /// 31 | /// Add auto-height row. 32 | /// 33 | public static void AddAuto( this RowDefinitionCollection ROWS ) 34 | { 35 | ROWS.Add(new() { Height = new(0, GridUnitType.Auto) }); 36 | } 37 | 38 | //........................................................... 39 | 40 | /// 41 | /// Add fill-height row. 42 | /// 43 | public static void AddStar( this RowDefinitionCollection ROWS, double VALUE = 1 ) 44 | { 45 | ROWS.Add(new() { Height = new(VALUE, GridUnitType.Star) }); 46 | } 47 | 48 | //........................................................... 49 | 50 | /// 51 | /// Add specific pixel-height row. 52 | /// 53 | public static void AddPixel( this RowDefinitionCollection ROWS, double VALUE ) 54 | { 55 | ROWS.Add(new() { Height = new(VALUE, GridUnitType.Pixel) }); 56 | } 57 | } 58 | } 59 | 60 | //============================================================================= 61 | -------------------------------------------------------------------------------- /Common/Extensions/System.Windows.DependencyObject.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Collections.Generic; 22 | using System.Windows; 23 | using System.Windows.Media; 24 | 25 | //============================================================================= 26 | 27 | namespace cmk 28 | { 29 | public static partial class _x_ 30 | { 31 | /// 32 | /// Walk upstream through visual tree parents looking for PARENT_T. 33 | /// 34 | public static PARENT_T FindParent( this DependencyObject OBJECT ) 35 | where PARENT_T : System.Windows.DependencyObject 36 | { 37 | if( OBJECT == null ) return null; 38 | 39 | var parent = VisualTreeHelper.GetParent(OBJECT); 40 | if( parent == null ) return null; 41 | 42 | var cast_parent = parent as PARENT_T; 43 | if( cast_parent != null ) return cast_parent; 44 | 45 | return FindParent(parent); 46 | } 47 | 48 | //........................................................... 49 | 50 | /// 51 | /// Depth-first recursion through children to find first CHILD_T. 52 | /// Note: can't actually get child until visual tree available i.e. after root Window loaded. 53 | /// 54 | public static CHILD_T GetFirstChild( this DependencyObject OBJECT ) 55 | where CHILD_T : System.Windows.DependencyObject 56 | { 57 | if( OBJECT != null ) 58 | for( var i = 0; i < VisualTreeHelper.GetChildrenCount(OBJECT); ++i ) { 59 | var child = VisualTreeHelper.GetChild(OBJECT, i); 60 | var result = (child as CHILD_T) ?? GetFirstChild(child); 61 | if( result != null ) return result; 62 | } 63 | return null; 64 | } 65 | 66 | //........................................................... 67 | 68 | /// 69 | /// Depth-first recursion through children to find all CHILD_T. 70 | /// Note: can't actually get child until visual tree available i.e. after root Window loaded. 71 | /// 72 | public static IEnumerable GetChildren( this DependencyObject OBJECT ) 73 | where CHILD_T : System.Windows.DependencyObject 74 | { 75 | if( OBJECT != null ) 76 | for( var i = 0; i < VisualTreeHelper.GetChildrenCount(OBJECT); ++i ) { 77 | var child = VisualTreeHelper.GetChild(OBJECT, i); 78 | var result = (child as CHILD_T) ?? GetFirstChild(child); 79 | if( result != null ) yield return result; 80 | } 81 | } 82 | } 83 | } 84 | 85 | //============================================================================= 86 | -------------------------------------------------------------------------------- /Common/Extensions/System.Windows.Media.Imaging.BitmapSource.x.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | using System.Windows.Media; 23 | using System.Windows.Media.Imaging; 24 | 25 | //============================================================================= 26 | 27 | namespace cmk 28 | { 29 | public static partial class _x_ 30 | { 31 | // Only supports Bgr24 and Bgra32 formats. 32 | // A is not inverted, instead if A < ALPHA_MULT_THRESHOLD then multiply it by ALPHA_MULT. 33 | public static BitmapSource Invert( 34 | this BitmapSource SOURCE, 35 | byte ALPHA_MULT_THRESHOLD = 250, // 0 - 255 36 | double ALPHA_MULT = 1, // >= 0 37 | bool FREEZE = true 38 | ){ 39 | if( SOURCE == null ) return null; 40 | 41 | // only support the rgb formats we map to from pfim dds 42 | if( SOURCE.Format != PixelFormats.Bgr24 && 43 | SOURCE.Format != PixelFormats.Bgra32 44 | ) return null; 45 | 46 | var bpp = SOURCE.Format.BitsPerPixel / 8; // bytes per pixel (3 or 4) 47 | var stride = SOURCE.PixelWidth * bpp; 48 | var length = SOURCE.PixelHeight * stride; 49 | var data = new byte[length]; 50 | 51 | SOURCE.CopyPixels(data, stride, 0); 52 | 53 | for( var i = 0; i < length; i += bpp ) { 54 | data[i] = (byte)(255 - data[i]); // R 55 | data[i + 1] = (byte)(255 - data[i + 1]); // G 56 | data[i + 2] = (byte)(255 - data[i + 2]); // B 57 | if( bpp > 3 && data[i + 3] < ALPHA_MULT_THRESHOLD ) { // A 58 | data[i + 3] = (byte)Math.Clamp(data[i + 3] * ALPHA_MULT, 0, 255); 59 | } 60 | } 61 | 62 | try { 63 | var bmp = BitmapSource.Create( 64 | SOURCE.PixelWidth, SOURCE.PixelHeight, 65 | SOURCE.DpiX, SOURCE.DpiY, 66 | SOURCE.Format, null, 67 | data, stride 68 | ); 69 | if( FREEZE ) bmp?.Freeze(); 70 | return bmp; 71 | } 72 | catch( Exception EX ) { 73 | Log.Default.AddFailure(EX); 74 | return null; 75 | } 76 | } 77 | } 78 | } 79 | 80 | //============================================================================= 81 | -------------------------------------------------------------------------------- /Common/NMS/Game/Game.Items.Substances.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Collections.Generic; 22 | using System.Threading.Tasks; 23 | 24 | using libMBIN.NMS.GameComponents; 25 | using static cmk.NMS.Game.Items.Data; 26 | 27 | //============================================================================= 28 | 29 | namespace cmk.NMS.Game.Items.Substance 30 | { 31 | public class Collection 32 | : cmk.NMS.Game.Items.Collection 33 | { 34 | public Collection( NMS.Game.Files.Cache PAK_FILES ) 35 | : base(PAK_FILES, 200) // 4.00 - 91 36 | { 37 | } 38 | 39 | //........................................................... 40 | 41 | // "METADATA/REALITY/TABLES/NMS_REALITY_GCSUBSTANCETABLE.MXML" in default reality 42 | // "METADATA/REALITY/TABLES/NMS_REALITY_GCSUBSTANCETABLE.MBIN" actual mbin 43 | public override NMS.PAK.Item.Info FindItemInfo() 44 | { 45 | string path = Cache?.DefaultRealityMbin()?.SubstanceTable ?? 46 | "METADATA/REALITY/TABLES/NMS_REALITY_GCSUBSTANCETABLE.MBIN" 47 | ; 48 | path = NMS.PAK.Item.Path.NormalizeExtension(path); 49 | return Cache?.IPakItemCollection.FindInfo(path); 50 | } 51 | 52 | //........................................................... 53 | 54 | protected override void LoadMBIN() 55 | { 56 | var mbin = ItemInfo?.ExtractMbin(Log.Default); 57 | if( mbin == null ) return; 58 | 59 | var collection = Cache.IPakItemCollection; 60 | 61 | _ = Parallel.ForEach(mbin.Table, ITEM => { 62 | var icon = NMS.PAK.Item.Path.NormalizeExtension(ITEM.Icon.Filename) as string; 63 | var cat_name = ITEM.Category.SubstanceCategory.ToString() as string; 64 | 65 | var data = new Data(this, GcInventoryType.InventoryTypeEnum.Substance) { 66 | Id = (string)ITEM.ID, 67 | NameId = (string)ITEM.NameLower, 68 | DescriptionId = (string)ITEM.Description, 69 | CategoryName = cat_name.Expand(), 70 | IconInfo = collection.FindInfo(icon), 71 | Requirements = new Requirement[0] 72 | }; 73 | 74 | var dds = data.IconInfo?.ExtractData(); 75 | if( dds == null ) { 76 | Log.Default.AddWarning($"Unable to load {data.IconInfo?.Path} for {data.Id}"); 77 | } 78 | else { 79 | data.Icon32 = dds.GetBitmap(32); // recipe ingredient 80 | data.Icon48 = dds.GetBitmap(48); // recipe result 81 | data.Icon64 = dds.GetBitmap(64); // item list 82 | } 83 | 84 | lock( this ) this.Add(data); 85 | }); 86 | } 87 | } 88 | } 89 | 90 | //============================================================================= 91 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Data/PAK.BIN.Data.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.IO; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.BIN 26 | { 27 | /// 28 | /// Note: some .bin files are binary, some are text. 29 | /// todo: try to determine if binary and display binary w/ hex viewer. 30 | /// 31 | public class Data 32 | : cmk.NMS.PAK.TXT.Data 33 | { 34 | static Data() 35 | { 36 | var extension_info = new NMS.PAK.Item.Extension{ Data = typeof(Data) }; 37 | extension_info.Viewers.Insert(0, typeof(Viewer)); 38 | extension_info.Differs.Insert(0, typeof(Differ)); 39 | s_extensions[".BIN"] = extension_info; 40 | } 41 | 42 | public Data() : base() 43 | { 44 | } 45 | 46 | //........................................................... 47 | 48 | public Data( NMS.PAK.Item.Info INFO, Stream RAW, Log LOG = null ) 49 | : base(INFO, RAW, LOG) 50 | { 51 | CheckIfBinary(); 52 | } 53 | 54 | //........................................................... 55 | 56 | public Data( string PATH, Stream RAW, Log LOG = null ) 57 | : base(PATH, RAW, LOG) 58 | { 59 | CheckIfBinary(); 60 | } 61 | 62 | //........................................................... 63 | 64 | public bool IsBinary { get; protected set; } = false; 65 | 66 | protected void CheckIfBinary() 67 | { 68 | Raw.Position = 0; 69 | 70 | // some bin are xml, some are actual binary 71 | if( Raw.ReadByte() != '<' || 72 | Raw.ReadByte() != '!' || 73 | Raw.ReadByte() != '-' 74 | ) { 75 | IsBinary = true; 76 | Text = ""; 77 | } 78 | 79 | Raw.Position = 0; 80 | } 81 | 82 | //........................................................... 83 | 84 | protected override string RawToText( Log LOG = null ) 85 | { 86 | if( IsBinary ) return null; 87 | return base.RawToText(LOG); 88 | } 89 | 90 | //........................................................... 91 | 92 | protected override bool TextToRaw( string TEXT, Log LOG = null ) 93 | { 94 | if( IsBinary ) return false; 95 | return base.TextToRaw(TEXT, LOG); 96 | } 97 | } 98 | } 99 | 100 | //============================================================================= 101 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Data/PAK.BNK.Data.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.IO; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.BNK 26 | { 27 | public class Data 28 | : cmk.NMS.PAK.Item.Data 29 | { 30 | static Data() 31 | { 32 | var extension_info = new NMS.PAK.Item.Extension{ Data = typeof(Data) }; 33 | extension_info.Viewers.Insert(0, typeof(Viewer)); 34 | extension_info.Differs.Insert(0, typeof(Differ)); 35 | s_extensions[".BNK"] = extension_info; 36 | } 37 | 38 | public Data() : base() 39 | { 40 | } 41 | 42 | //........................................................... 43 | 44 | public Data( NMS.PAK.Item.Info INFO, Stream RAW, Log LOG = null ) 45 | : base(INFO, RAW, LOG) 46 | { 47 | } 48 | 49 | //........................................................... 50 | 51 | public Data( string PATH, Stream RAW, Log LOG = null ) 52 | : base(PATH, RAW, LOG) 53 | { 54 | } 55 | } 56 | } 57 | 58 | //============================================================================= 59 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Data/PAK.CS.Data.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.IO; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.CS 26 | { 27 | public class Data 28 | : cmk.NMS.PAK.TXT.Data 29 | { 30 | static Data() 31 | { 32 | var extension_info = new NMS.PAK.Item.Extension{ Data = typeof(Data) }; 33 | extension_info.Viewers.Insert(0, typeof(Viewer)); 34 | extension_info.Differs.Insert(0, typeof(Differ)); 35 | s_extensions[".CS"] = extension_info; 36 | } 37 | 38 | public Data() : base() 39 | { 40 | } 41 | 42 | //........................................................... 43 | 44 | public Data( NMS.PAK.Item.Info INFO, Stream RAW, Log LOG = null ) 45 | : base(INFO, RAW, LOG) 46 | { 47 | } 48 | 49 | //........................................................... 50 | 51 | public Data( string PATH, Stream RAW, Log LOG = null ) 52 | : base(PATH, RAW, LOG) 53 | { 54 | } 55 | } 56 | } 57 | 58 | //============================================================================= 59 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Data/PAK.CSV.Data.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.IO; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.CSV 26 | { 27 | public class Data 28 | : cmk.NMS.PAK.TXT.Data 29 | { 30 | static Data() 31 | { 32 | var extension_info = new NMS.PAK.Item.Extension{ Data = typeof(Data) }; 33 | extension_info.Viewers.Insert(0, typeof(Viewer)); 34 | extension_info.Differs.Insert(0, typeof(Differ)); 35 | s_extensions[".CSV"] = extension_info; 36 | } 37 | 38 | public Data() : base() 39 | { 40 | } 41 | 42 | //........................................................... 43 | 44 | public Data( NMS.PAK.Item.Info INFO, Stream RAW, Log LOG = null ) 45 | : base(INFO, RAW, LOG) 46 | { 47 | } 48 | 49 | //........................................................... 50 | 51 | public Data( string PATH, Stream RAW, Log LOG = null ) 52 | : base(PATH, RAW, LOG) 53 | { 54 | } 55 | } 56 | } 57 | 58 | //============================================================================= 59 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Data/PAK.JSON.Data.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.IO; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.JSON 26 | { 27 | public class Data 28 | : cmk.NMS.PAK.TXT.Data 29 | { 30 | static Data() 31 | { 32 | var extension_info = new NMS.PAK.Item.Extension{ Data = typeof(Data) }; 33 | extension_info.Viewers.Insert(0, typeof(Viewer)); 34 | extension_info.Differs.Insert(0, typeof(Differ)); 35 | s_extensions[".JSON"] = extension_info; 36 | } 37 | 38 | public Data() : base() 39 | { 40 | } 41 | 42 | //........................................................... 43 | 44 | public Data( NMS.PAK.Item.Info INFO, Stream RAW, Log LOG = null ) 45 | : base(INFO, RAW, LOG) 46 | { 47 | } 48 | 49 | //........................................................... 50 | 51 | public Data( string PATH, Stream RAW, Log LOG = null ) 52 | : base(PATH, RAW, LOG) 53 | { 54 | } 55 | } 56 | } 57 | 58 | //============================================================================= 59 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Data/PAK.LUA.Data.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.IO; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.LUA 26 | { 27 | public class Data 28 | : cmk.NMS.PAK.TXT.Data 29 | { 30 | static Data() 31 | { 32 | var extension_info = new NMS.PAK.Item.Extension{ Data = typeof(Data) }; 33 | extension_info.Viewers.Insert(0, typeof(Viewer)); 34 | extension_info.Differs.Insert(0, typeof(Differ)); 35 | s_extensions[".LUA"] = extension_info; 36 | } 37 | 38 | public Data() : base() 39 | { 40 | } 41 | 42 | //........................................................... 43 | 44 | public Data( NMS.PAK.Item.Info INFO, Stream RAW = null, Log LOG = null ) 45 | : base(INFO, RAW, LOG) 46 | { 47 | } 48 | 49 | //........................................................... 50 | 51 | public Data( string PATH, Stream RAW = null, Log LOG = null ) 52 | : base(PATH, RAW, LOG) 53 | { 54 | } 55 | } 56 | } 57 | 58 | //============================================================================= 59 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Data/PAK.VDF.Data.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.IO; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.VDF 26 | { 27 | /// 28 | /// Valve controller mappings. 29 | /// 30 | public class Data 31 | : cmk.NMS.PAK.TXT.Data 32 | { 33 | static Data() 34 | { 35 | var extension_info = new NMS.PAK.Item.Extension{ Data = typeof(Data) }; 36 | extension_info.Viewers.Insert(0, typeof(Viewer)); 37 | extension_info.Differs.Insert(0, typeof(Differ)); 38 | s_extensions[".VDF"] = extension_info; 39 | } 40 | 41 | public Data() : base() 42 | { 43 | } 44 | 45 | //........................................................... 46 | 47 | public Data( NMS.PAK.Item.Info INFO, Stream RAW, Log LOG = null ) 48 | : base(INFO, RAW, LOG) 49 | { 50 | } 51 | 52 | //........................................................... 53 | 54 | public Data( string PATH, Stream RAW, Log LOG = null ) 55 | : base(PATH, RAW, LOG) 56 | { 57 | } 58 | } 59 | } 60 | 61 | //============================================================================= 62 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Data/PAK.XML.Data.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.IO; 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.XML 26 | { 27 | public class Data 28 | : cmk.NMS.PAK.TXT.Data 29 | { 30 | static Data() 31 | { 32 | var extension_info = new NMS.PAK.Item.Extension{ Data = typeof(Data) }; 33 | extension_info.Viewers.Insert(0, typeof(Viewer)); 34 | extension_info.Differs.Insert(0, typeof(Differ)); 35 | s_extensions[".EXML"] = extension_info; 36 | s_extensions[".XML"] = extension_info; 37 | } 38 | 39 | public Data() : base() 40 | { 41 | } 42 | 43 | //........................................................... 44 | 45 | public Data( NMS.PAK.Item.Info INFO, Stream RAW = null, Log LOG = null ) 46 | : base(INFO, RAW, LOG) 47 | { 48 | } 49 | 50 | //........................................................... 51 | 52 | public Data( string PATH, Stream RAW = null, Log LOG = null ) 53 | : base(PATH, RAW, LOG) 54 | { 55 | } 56 | } 57 | } 58 | 59 | //============================================================================= 60 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.BIN.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.BIN 26 | { 27 | public class Differ 28 | : cmk.TextDiffer 29 | , Item.IDiffer 30 | { 31 | public Differ( Data LHS, Data RHS, Log LOG = null ) : base() 32 | { 33 | ViewerLeft .Data = LHS; 34 | ViewerRight.Data = RHS; 35 | SetDiffSource( 36 | LHS?.Text, RHS?.Text, 37 | LHS?.FilePath?.NameExt, RHS?.FilePath?.NameExt 38 | ); 39 | } 40 | 41 | //........................................................... 42 | 43 | public ImageButton DifferButton { get; } = new() { 44 | ToolTip = "Default", 45 | Uri = Resource.Uri("PakItemBin.png") 46 | }; 47 | } 48 | } 49 | 50 | //============================================================================= 51 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.BNK.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.BNK 26 | { 27 | public class Differ 28 | : Item.IDiffer 29 | { 30 | public Differ( Data LHS, Data RHS, Log LOG = null ) 31 | { 32 | //ViewerLeft .Data = LHS; 33 | //ViewerRight.Data = RHS; 34 | } 35 | 36 | //........................................................... 37 | 38 | public ImageButton DifferButton { get; } = new() { 39 | ToolTip = "Default", 40 | Uri = Resource.Uri("PakItemBnk.png") 41 | }; 42 | } 43 | } 44 | 45 | //============================================================================= 46 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.CS.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.CS 26 | { 27 | public class Differ 28 | : cmk.TextDiffer 29 | , Item.IDiffer 30 | { 31 | public Differ( Data LHS, Data RHS, Log LOG = null ) : base() 32 | { 33 | ViewerLeft .Data = LHS; 34 | ViewerRight.Data = RHS; 35 | SetDiffSource( 36 | LHS?.Text, RHS?.Text, 37 | LHS?.FilePath?.NameExt, RHS?.FilePath?.NameExt 38 | ); 39 | } 40 | 41 | //........................................................... 42 | 43 | public ImageButton DifferButton { get; } = new() { 44 | ToolTip = "Default", 45 | Uri = Resource.Uri("PakItemCs.png") 46 | }; 47 | } 48 | } 49 | 50 | //============================================================================= 51 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.CSV.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.CSV 26 | { 27 | public class Differ 28 | : cmk.TextDiffer 29 | , Item.IDiffer 30 | { 31 | public Differ( Data LHS, Data RHS, Log LOG = null ) : base() 32 | { 33 | ViewerLeft .Data = LHS; 34 | ViewerRight.Data = RHS; 35 | SetDiffSource( 36 | LHS?.Text, RHS?.Text, 37 | LHS?.FilePath?.NameExt, RHS?.FilePath?.NameExt 38 | ); 39 | } 40 | 41 | //........................................................... 42 | 43 | public ImageButton DifferButton { get; } = new() { 44 | ToolTip = "Default", 45 | Uri = Resource.Uri("PakItemCsv.png") 46 | }; 47 | } 48 | } 49 | 50 | //============================================================================= 51 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.DDS.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.DDS 26 | { 27 | public class Differ 28 | : cmk.BitmapViewerSideBySide 29 | , Item.IDiffer 30 | { 31 | public Differ( Data LHS, Data RHS, Log LOG = null ) : base() 32 | { 33 | LabelLeft = LHS?.Dds?.Description(); 34 | LabelRight = RHS?.Dds?.Description(); 35 | SourceLeft = LHS?.Dds?.GetBitmap(); 36 | SourceRight = RHS?.Dds?.GetBitmap(); 37 | } 38 | 39 | //........................................................... 40 | 41 | public ImageButton DifferButton { get; } = new() { 42 | ToolTip = "Default", 43 | Uri = Resource.Uri("PakItemDds.png") 44 | }; 45 | } 46 | } 47 | 48 | //============================================================================= 49 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.Hex.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.Hex 26 | { 27 | public class Differ 28 | : cmk.TextDiffer 29 | , Item.IDiffer 30 | { 31 | public Differ( Item.Data LHS, Item.Data RHS, Log LOG = null ) : base() 32 | { 33 | ViewerLeft .Data = LHS; 34 | ViewerRight.Data = RHS; 35 | SetDiffSource( 36 | LHS?.Raw?.ToString(), RHS?.Raw?.ToString(), 37 | LHS?.FilePath?.NameExt, RHS?.FilePath?.NameExt 38 | ); 39 | } 40 | 41 | //........................................................... 42 | 43 | public ImageButton DifferButton { get; } = new() { 44 | ToolTip = "Default", 45 | Uri = Resource.Uri("PakItemHex.png") 46 | }; 47 | } 48 | } 49 | 50 | //============================================================================= 51 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.JSON.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.JSON 26 | { 27 | public class Differ 28 | : cmk.TextDiffer 29 | , Item.IDiffer 30 | { 31 | public Differ( Data LHS, Data RHS, Log LOG = null ) : base() 32 | { 33 | ViewerLeft .Data = LHS; 34 | ViewerRight.Data = RHS; 35 | SetDiffSource( 36 | LHS?.Text, RHS?.Text, 37 | LHS?.FilePath?.NameExt, RHS?.FilePath?.NameExt 38 | ); 39 | } 40 | 41 | //........................................................... 42 | 43 | public ImageButton DifferButton { get; } = new() { 44 | ToolTip = "Default", 45 | Uri = Resource.Uri("PakItemJson.png") 46 | }; 47 | } 48 | } 49 | 50 | //============================================================================= 51 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.LUA.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.LUA 26 | { 27 | public class Differ 28 | : cmk.TextDiffer 29 | , Item.IDiffer 30 | { 31 | public Differ( Data LHS, Data RHS, Log LOG = null ) : base() 32 | { 33 | ViewerLeft .Data = LHS; 34 | ViewerRight.Data = RHS; 35 | SetDiffSource( 36 | LHS?.Text, RHS?.Text, 37 | LHS?.FilePath?.NameExt, RHS?.FilePath?.NameExt 38 | ); 39 | } 40 | 41 | //........................................................... 42 | 43 | public ImageButton DifferButton { get; } = new() { 44 | ToolTip = "Default", 45 | Uri = Resource.Uri("PakItemLua.png") 46 | }; 47 | } 48 | } 49 | 50 | //============================================================================= 51 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.MBIN.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.MBIN 26 | { 27 | public class ExmlDiffer 28 | : cmk.TextDiffer 29 | , Item.IDiffer 30 | { 31 | public ExmlDiffer( Data LHS, Data RHS, Log LOG = null ) : base() 32 | { 33 | ViewerLeft .Data = LHS; 34 | ViewerRight.Data = RHS; 35 | SetDiffSource( 36 | LHS?.RawEXML(LOG), RHS?.RawEXML(LOG), 37 | LHS?.FilePath?.NameExt, RHS?.FilePath?.NameExt 38 | ); 39 | } 40 | 41 | public ImageButton DifferButton { get; } = new() { 42 | ToolTip = "Default", 43 | Uri = Resource.Uri("PakItemExml.png") 44 | }; 45 | } 46 | 47 | //========================================================================= 48 | 49 | public class EbinDiffer 50 | : cmk.TextDiffer 51 | , Item.IDiffer 52 | { 53 | public EbinDiffer( Data LHS, Data RHS, Log LOG = null ) : base() 54 | { 55 | ViewerLeft .Data = LHS; 56 | ViewerRight.Data = RHS; 57 | SetDiffSource( 58 | LHS?.RawEBIN(LOG), RHS?.RawEBIN(LOG), 59 | LHS?.FilePath?.NameExt, RHS?.FilePath?.NameExt 60 | ); 61 | } 62 | 63 | public ImageButton DifferButton { get; } = new() { 64 | ToolTip = "Default", 65 | Uri = Resource.Uri("PakItemEbin.png") 66 | }; 67 | } 68 | } 69 | 70 | //============================================================================= 71 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.SPV.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.SPV 26 | { 27 | public class Differ 28 | : cmk.TextDiffer 29 | , Item.IDiffer 30 | { 31 | public Differ( Data LHS, Data RHS, Log LOG = null ) : base() 32 | { 33 | ViewerLeft .Data = LHS; 34 | ViewerRight.Data = RHS; 35 | SetDiffSource( 36 | LHS?.Text, RHS?.Text, 37 | LHS?.FilePath?.NameExt, RHS?.FilePath?.NameExt 38 | ); 39 | } 40 | 41 | //........................................................... 42 | 43 | public ImageButton DifferButton { get; } = new() { 44 | ToolTip = "Default", 45 | Uri = Resource.Uri("PakItemSpv.png") 46 | }; 47 | } 48 | } 49 | 50 | //============================================================================= 51 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.TXT.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.TXT 26 | { 27 | public class Differ 28 | : cmk.TextDiffer 29 | , Item.IDiffer 30 | { 31 | public Differ( Data LHS, Data RHS, Log LOG = null ) : base() 32 | { 33 | ViewerLeft .Data = LHS; 34 | ViewerRight.Data = RHS; 35 | SetDiffSource( 36 | LHS?.Text, RHS?.Text, 37 | LHS?.FilePath?.NameExt, RHS?.FilePath?.NameExt 38 | ); 39 | } 40 | 41 | //........................................................... 42 | 43 | public ImageButton DifferButton { get; } = new() { 44 | ToolTip = "Default", 45 | Uri = Resource.Uri("PakItemTxt.png") 46 | }; 47 | } 48 | } 49 | 50 | //============================================================================= 51 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.VDF.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.VDF 26 | { 27 | public class Differ 28 | : cmk.TextDiffer 29 | , Item.IDiffer 30 | { 31 | public Differ( Data LHS, Data RHS, Log LOG = null ) : base() 32 | { 33 | ViewerLeft .Data = LHS; 34 | ViewerRight.Data = RHS; 35 | SetDiffSource( 36 | LHS?.Text, RHS?.Text, 37 | LHS?.FilePath?.NameExt, RHS?.FilePath?.NameExt 38 | ); 39 | } 40 | 41 | //........................................................... 42 | 43 | public ImageButton DifferButton { get; } = new() { 44 | ToolTip = "Default", 45 | Uri = Resource.Uri("PakItemTxt.png") 46 | }; 47 | } 48 | } 49 | 50 | //============================================================================= 51 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.WEM.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.WEM 26 | { 27 | public class Differ 28 | : Item.IDiffer 29 | { 30 | public Differ( Data LHS, Data RHS, Log LOG = null ) 31 | { 32 | //ViewerLeft .Data = LHS; 33 | //ViewerRight.Data = RHS; 34 | } 35 | 36 | //........................................................... 37 | 38 | public ImageButton DifferButton { get; } = new() { 39 | ToolTip = "Default", 40 | Uri = Resource.Uri("PakItemWem.png") 41 | }; 42 | } 43 | } 44 | 45 | //============================================================================= 46 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Differ/PAK.XML.Differ.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.XML 26 | { 27 | public class Differ 28 | : cmk.TextDiffer 29 | , Item.IDiffer 30 | { 31 | public Differ( Data LHS, Data RHS, Log LOG = null ) : base() 32 | { 33 | ViewerLeft .Data = LHS; 34 | ViewerRight.Data = RHS; 35 | SetDiffSource( 36 | LHS?.Text, RHS?.Text, 37 | LHS?.FilePath?.NameExt, RHS?.FilePath?.NameExt 38 | ); 39 | } 40 | 41 | //........................................................... 42 | 43 | public ImageButton DifferButton { get; } = new() { 44 | ToolTip = "Default", 45 | Uri = Resource.Uri("PakItemXml.png") 46 | }; 47 | } 48 | } 49 | 50 | //============================================================================= 51 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.BIN.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.BIN 26 | { 27 | public class Viewer 28 | : cmk.TextViewer 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Data DATA, Log LOG = null ) : base() 34 | { 35 | LoadHighlighterExtension(".xml"); 36 | Data = DATA; 37 | } 38 | 39 | //........................................................... 40 | 41 | public ImageButton ViewerButton { get; } = new() { 42 | ToolTip = "Default", 43 | Uri = Resource.Uri("PakItemBin.png") 44 | }; 45 | 46 | //........................................................... 47 | 48 | protected NMS.PAK.BIN.Data m_data; 49 | 50 | public NMS.PAK.BIN.Data Data { 51 | get { return m_data; } 52 | set { 53 | if( m_data == value ) return; 54 | m_data = value; 55 | EditorText = m_data?.Text; 56 | SourceLabel.Text = m_data?.FilePath?.NameExt; 57 | Editor.CaretOffset = 0; 58 | } 59 | } 60 | } 61 | } 62 | 63 | //============================================================================= 64 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.BNK.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.BNK 26 | { 27 | public class Viewer 28 | : cmk.MainDockPanel 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Data DATA, Log LOG = null ) : base() 34 | { 35 | Data = DATA; 36 | } 37 | 38 | //........................................................... 39 | 40 | public ImageButton ViewerButton { get; } = new() { 41 | ToolTip = "Default", 42 | Uri = Resource.Uri("PakItemBnk.png") 43 | }; 44 | 45 | //........................................................... 46 | 47 | protected NMS.PAK.BNK.Data m_data; 48 | 49 | public NMS.PAK.BNK.Data Data { 50 | get { return m_data; } 51 | set { 52 | if( m_data == value ) return; 53 | m_data = value; 54 | } 55 | } 56 | } 57 | } 58 | 59 | //============================================================================= 60 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.CS.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.CS 26 | { 27 | public class Viewer 28 | : cmk.TextViewer 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Data DATA, Log LOG = null ) : base() 34 | { 35 | LoadHighlighterExtension(".csx"); 36 | Data = DATA; 37 | } 38 | 39 | //........................................................... 40 | 41 | public ImageButton ViewerButton { get; } = new() { 42 | ToolTip = "Default", 43 | Uri = Resource.Uri("PakItemCs.png") 44 | }; 45 | 46 | //........................................................... 47 | 48 | protected NMS.PAK.CS.Data m_data; 49 | 50 | public NMS.PAK.CS.Data Data { 51 | get { return m_data; } 52 | set { 53 | if( m_data == value ) return; 54 | m_data = value; 55 | EditorText = m_data?.Text; 56 | SourceLabel.Text = m_data?.FilePath?.NameExt; 57 | Editor.CaretOffset = 0; 58 | } 59 | } 60 | } 61 | } 62 | 63 | //============================================================================= 64 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.CSV.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.CSV 26 | { 27 | public class Viewer 28 | : cmk.TextViewer 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Data DATA, Log LOG = null ) : base() 34 | { 35 | LoadHighlighterExtension(".csv"); 36 | Data = DATA; 37 | } 38 | 39 | //........................................................... 40 | 41 | public ImageButton ViewerButton { get; } = new() { 42 | ToolTip = "Default", 43 | Uri = Resource.Uri("PakItemCsv.png") 44 | }; 45 | 46 | //........................................................... 47 | 48 | protected NMS.PAK.CSV.Data m_data; 49 | 50 | public NMS.PAK.CSV.Data Data { 51 | get { return m_data; } 52 | set { 53 | if( m_data == value ) return; 54 | m_data = value; 55 | EditorText = m_data?.Text; 56 | SourceLabel.Text = m_data?.FilePath?.NameExt; 57 | Editor.CaretOffset = 0; 58 | } 59 | } 60 | } 61 | } 62 | 63 | //============================================================================= 64 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.DDS.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.DDS 26 | { 27 | public class Viewer 28 | : cmk.BitmapViewer 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Data DATA, Log LOG = null ) : base() 34 | { 35 | Data = DATA; 36 | } 37 | 38 | //........................................................... 39 | 40 | public ImageButton ViewerButton { get; } = new() { 41 | ToolTip = "Default", 42 | Uri = Resource.Uri("PakItemDds.png") 43 | }; 44 | 45 | //........................................................... 46 | 47 | protected NMS.PAK.DDS.Data m_data; 48 | 49 | public NMS.PAK.DDS.Data Data { 50 | get { return m_data; } 51 | set { 52 | if( m_data == value ) return; 53 | m_data = value; 54 | LabelText = m_data?.Dds?.Description(); 55 | Source = m_data?.Dds?.GetBitmap(); 56 | } 57 | } 58 | } 59 | } 60 | 61 | //============================================================================= 62 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.Hex.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.Hex 26 | { 27 | public class Viewer 28 | : cmk.HexViewer 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Item.Data DATA, Log LOG = null ) : base() 34 | { 35 | Data = DATA; 36 | } 37 | 38 | //........................................................... 39 | 40 | public ImageButton ViewerButton { get; } = new() { 41 | ToolTip = "Hex", 42 | Uri = Resource.Uri("PakItemHex.png") 43 | }; 44 | 45 | //........................................................... 46 | 47 | protected NMS.PAK.Item.Data m_data; 48 | 49 | public NMS.PAK.Item.Data Data { 50 | get { return m_data; } 51 | set { 52 | if( m_data == value ) return; 53 | m_data = value; 54 | SourceLabel.Text = m_data?.FilePath?.NameExt; 55 | Raw = m_data?.Raw; 56 | } 57 | } 58 | } 59 | } 60 | 61 | //============================================================================= 62 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.JSON.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.JSON 26 | { 27 | public class Viewer 28 | : cmk.TextViewer 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Data DATA, Log LOG = null ) : base() 34 | { 35 | LoadHighlighterExtension(".json"); 36 | Data = DATA; 37 | } 38 | 39 | //........................................................... 40 | 41 | public ImageButton ViewerButton { get; } = new() { 42 | ToolTip = "Default", 43 | Uri = Resource.Uri("PakItemJson.png") 44 | }; 45 | 46 | //........................................................... 47 | 48 | protected NMS.PAK.JSON.Data m_data; 49 | 50 | public NMS.PAK.JSON.Data Data { 51 | get { return m_data; } 52 | set { 53 | if( m_data == value ) return; 54 | m_data = value; 55 | EditorText = m_data?.Text; 56 | SourceLabel.Text = m_data?.FilePath?.NameExt; 57 | Editor.CaretOffset = 0; 58 | } 59 | } 60 | } 61 | } 62 | 63 | //============================================================================= 64 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.LUA.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.LUA 26 | { 27 | public class Viewer 28 | : cmk.TextViewer 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Data DATA, Log LOG = null ) : base() 34 | { 35 | LoadHighlighterExtension(".lua"); 36 | Data = DATA; 37 | } 38 | 39 | //........................................................... 40 | 41 | public ImageButton ViewerButton { get; } = new() { 42 | ToolTip = "Default", 43 | Uri = Resource.Uri("PakItemLua.png") 44 | }; 45 | 46 | //........................................................... 47 | 48 | protected NMS.PAK.LUA.Data m_data; 49 | 50 | public NMS.PAK.LUA.Data Data { 51 | get { return m_data; } 52 | set { 53 | if( m_data == value ) return; 54 | m_data = value; 55 | EditorText = m_data?.Text; 56 | SourceLabel.Text = m_data?.FilePath?.NameExt; 57 | Editor.CaretOffset = 0; 58 | } 59 | } 60 | } 61 | } 62 | 63 | //============================================================================= 64 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.SPV.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.SPV 26 | { 27 | public class Viewer 28 | : cmk.TextViewer 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Data DATA, Log LOG = null ) : base() 34 | { 35 | LoadHighlighterExtension(".spv"); 36 | Data = DATA; 37 | } 38 | 39 | //........................................................... 40 | 41 | public ImageButton ViewerButton { get; } = new() { 42 | ToolTip = "Default", 43 | Uri = Resource.Uri("PakItemSpv.png") 44 | }; 45 | 46 | //........................................................... 47 | 48 | protected NMS.PAK.SPV.Data m_data; 49 | 50 | public NMS.PAK.SPV.Data Data { 51 | get { return m_data; } 52 | set { 53 | if( m_data == value ) return; 54 | m_data = value; 55 | EditorText = m_data?.Text; 56 | SourceLabel.Text = m_data?.FilePath?.NameExt; 57 | Editor.CaretOffset = 0; 58 | } 59 | } 60 | } 61 | } 62 | 63 | //============================================================================= 64 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.TXT.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.TXT 26 | { 27 | public class Viewer 28 | : cmk.TextViewer 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Data DATA, Log LOG = null ) : base() 34 | { 35 | Data = DATA; 36 | } 37 | 38 | //........................................................... 39 | 40 | public ImageButton ViewerButton { get; } = new() { 41 | ToolTip = "Default", 42 | Uri = Resource.Uri("PakItemTxt.png") 43 | }; 44 | 45 | //........................................................... 46 | 47 | protected NMS.PAK.TXT.Data m_data; 48 | 49 | public NMS.PAK.TXT.Data Data { 50 | get { return m_data; } 51 | set { 52 | if( m_data == value ) return; 53 | m_data = value; 54 | EditorText = m_data?.Text; 55 | SourceLabel.Text = m_data?.FilePath?.NameExt; 56 | Editor.CaretOffset = 0; 57 | } 58 | } 59 | } 60 | } 61 | 62 | //============================================================================= 63 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.VDF.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.VDF 26 | { 27 | public class Viewer 28 | : cmk.TextViewer 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Data DATA, Log LOG = null ) : base() 34 | { 35 | LoadHighlighterExtension(".json"); 36 | Data = DATA; 37 | } 38 | 39 | //........................................................... 40 | 41 | public ImageButton ViewerButton { get; } = new() { 42 | ToolTip = "Default", 43 | Uri = Resource.Uri("PakItemTxt.png") 44 | }; 45 | 46 | //........................................................... 47 | 48 | protected NMS.PAK.VDF.Data m_data; 49 | 50 | public NMS.PAK.VDF.Data Data { 51 | get { return m_data; } 52 | set { 53 | if( m_data == value ) return; 54 | m_data = value; 55 | EditorText = m_data?.Text; 56 | SourceLabel.Text = m_data?.FilePath?.NameExt; 57 | Editor.CaretOffset = 0; 58 | } 59 | } 60 | } 61 | } 62 | 63 | //============================================================================= 64 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.WEM.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.WEM 26 | { 27 | public class Viewer 28 | : cmk.MainDockPanel 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Data DATA, Log LOG = null ) : base() 34 | { 35 | Data = DATA; 36 | } 37 | 38 | //........................................................... 39 | 40 | public ImageButton ViewerButton { get; } = new() { 41 | ToolTip = "Default", 42 | Uri = Resource.Uri("PakItemWem.png") 43 | }; 44 | 45 | //........................................................... 46 | 47 | protected NMS.PAK.WEM.Data m_data; 48 | 49 | public NMS.PAK.WEM.Data Data { 50 | get { return m_data; } 51 | set { 52 | if( m_data == value ) return; 53 | m_data = value; 54 | } 55 | } 56 | } 57 | } 58 | 59 | //============================================================================= 60 | -------------------------------------------------------------------------------- /Common/NMS/PAK/Viewer/PAK.XML.Viewer.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | 23 | //============================================================================= 24 | 25 | namespace cmk.NMS.PAK.XML 26 | { 27 | public class Viewer 28 | : cmk.XmlViewer 29 | , Item.IViewer 30 | { 31 | public Viewer() : this(null) {} 32 | 33 | public Viewer( Data DATA, Log LOG = null ) : base() 34 | { 35 | Data = DATA; 36 | } 37 | 38 | //........................................................... 39 | 40 | public ImageButton ViewerButton { get; } = new() { 41 | ToolTip = "Default", 42 | Uri = Resource.Uri("PakItemXml.png") 43 | }; 44 | 45 | //........................................................... 46 | 47 | protected NMS.PAK.XML.Data m_data; 48 | 49 | public NMS.PAK.XML.Data Data { 50 | get { return m_data; } 51 | set { 52 | if( m_data == value ) return; 53 | m_data = value; 54 | EditorText = m_data?.Text; 55 | SourceLabel.Text = m_data?.FilePath?.NameExt; 56 | Editor.CaretOffset = 0; 57 | } 58 | } 59 | } 60 | } 61 | 62 | //============================================================================= 63 | -------------------------------------------------------------------------------- /Common/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | [assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] 4 | 5 | // In SDK-style projects such as this one, several assembly attributes that were historically 6 | // defined in this file are now automatically added during build and populated with 7 | // values defined in project properties. For details of which attributes are included 8 | // and how to customise this process see: https://aka.ms/assembly-info-properties 9 | 10 | 11 | // Setting ComVisible to false makes the types in this assembly not visible to COM 12 | // components. If you need to access a type in this assembly from COM, set the ComVisible 13 | // attribute to true on that type. 14 | 15 | [assembly: ComVisible(false)] 16 | 17 | // The following GUID is for the ID of the typelib if this project is exposed to COM. 18 | 19 | [assembly: Guid("52169c33-2a0a-49b6-a16a-5180a13e4dce")] 20 | -------------------------------------------------------------------------------- /Common/Resources/About.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/About.png -------------------------------------------------------------------------------- /Common/Resources/Avalon_ebin.xshd: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 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 | " 31 | " 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | ' 40 | ' 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | @" 49 | " 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | <null> 59 | 60 | 61 | 62 | True 63 | true 64 | False 65 | false 66 | 67 | 68 | 69 | [=:] 70 | 71 | 72 | 73 | [?,.;()\[\]{}+\-/%*<>^+~!|&]+ 74 | 75 | 76 | 77 | Gc 78 | \b 79 | 80 | 81 | 82 | Tk 83 | \b 84 | 85 | 86 | 87 | 88 | List< 89 | > 90 | 91 | 92 | 93 | 94 | \b[_0-9a-zA-Z]+(?=\[) 95 | 96 | 97 | 98 | 99 | (?<=\[)[0-9]+(?=[:\]]) 100 | 101 | 102 | 103 | 104 | \b[_a-zA-Z]+[_0-9a-zA-Z]+[a-zA-Z]+(?=:) 105 | 106 | 107 | 108 | 109 | (?<=:)[_a-zA-Z]+[_0-9a-zA-Z]+(?=\b) 110 | 111 | 112 | 113 | 114 | \b0[xX][0-9a-fA-F]+ # hex number 115 | | 116 | ( \b\d+(\.[0-9]+)? #number with optional floating point 117 | | \.[0-9]+ #or just starting with floating point 118 | ) 119 | ([eE][+-]?[0-9]+)? # optional exponent 120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /Common/Resources/Avalon_exml.xshd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <!-- 16 | --> 17 | 18 | 19 | 20 | <!\[CDATA\[ 21 | ]]> 22 | 23 | 24 | 25 | <!DOCTYPE 26 | > 27 | 28 | 29 | 30 | <\? 31 | \?> 32 | 33 | 34 | 35 | < 36 | > 37 | 38 | 40 | 41 | " 42 | "|(?=<) 43 | 44 | 45 | ' 46 | '|(?=<) 47 | 48 | [\d\w_\-\.]+(?=(\s*=)) 49 | = 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | & 59 | [\w\d\#]+ 60 | ; 61 | 62 | 63 | 64 | & 65 | [\w\d\#]* 66 | #missing ; 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Common/Resources/BaseComputer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/BaseComputer.png -------------------------------------------------------------------------------- /Common/Resources/BinocsMod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/BinocsMod.png -------------------------------------------------------------------------------- /Common/Resources/Black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Black.png -------------------------------------------------------------------------------- /Common/Resources/Build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Build.png -------------------------------------------------------------------------------- /Common/Resources/CSharp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/CSharp.png -------------------------------------------------------------------------------- /Common/Resources/CaseSensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/CaseSensitive.png -------------------------------------------------------------------------------- /Common/Resources/Center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Center.png -------------------------------------------------------------------------------- /Common/Resources/CheckAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/CheckAll.png -------------------------------------------------------------------------------- /Common/Resources/Checker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Checker.png -------------------------------------------------------------------------------- /Common/Resources/Chromatic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Chromatic.png -------------------------------------------------------------------------------- /Common/Resources/Clear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Clear.png -------------------------------------------------------------------------------- /Common/Resources/CollapseAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/CollapseAll.png -------------------------------------------------------------------------------- /Common/Resources/Compile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Compile.png -------------------------------------------------------------------------------- /Common/Resources/Configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Configure.png -------------------------------------------------------------------------------- /Common/Resources/Copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Copy.png -------------------------------------------------------------------------------- /Common/Resources/Cube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Cube.png -------------------------------------------------------------------------------- /Common/Resources/Diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Diff.png -------------------------------------------------------------------------------- /Common/Resources/Egg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Egg.png -------------------------------------------------------------------------------- /Common/Resources/Error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Error.png -------------------------------------------------------------------------------- /Common/Resources/ExpandAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/ExpandAll.png -------------------------------------------------------------------------------- /Common/Resources/FSlash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FSlash.png -------------------------------------------------------------------------------- /Common/Resources/FileCreate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FileCreate.png -------------------------------------------------------------------------------- /Common/Resources/FileDelete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FileDelete.png -------------------------------------------------------------------------------- /Common/Resources/FindInFile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FindInFile.png -------------------------------------------------------------------------------- /Common/Resources/First.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/First.png -------------------------------------------------------------------------------- /Common/Resources/FlagBrazil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagBrazil.png -------------------------------------------------------------------------------- /Common/Resources/FlagCanada.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagCanada.png -------------------------------------------------------------------------------- /Common/Resources/FlagChina.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagChina.png -------------------------------------------------------------------------------- /Common/Resources/FlagFrance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagFrance.png -------------------------------------------------------------------------------- /Common/Resources/FlagGermany.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagGermany.png -------------------------------------------------------------------------------- /Common/Resources/FlagItaly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagItaly.png -------------------------------------------------------------------------------- /Common/Resources/FlagJapan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagJapan.png -------------------------------------------------------------------------------- /Common/Resources/FlagMexico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagMexico.png -------------------------------------------------------------------------------- /Common/Resources/FlagNetherlands.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagNetherlands.png -------------------------------------------------------------------------------- /Common/Resources/FlagPoland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagPoland.png -------------------------------------------------------------------------------- /Common/Resources/FlagPortugal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagPortugal.png -------------------------------------------------------------------------------- /Common/Resources/FlagRussia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagRussia.png -------------------------------------------------------------------------------- /Common/Resources/FlagSouthKorea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagSouthKorea.png -------------------------------------------------------------------------------- /Common/Resources/FlagSpain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagSpain.png -------------------------------------------------------------------------------- /Common/Resources/FlagUSA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/FlagUSA.png -------------------------------------------------------------------------------- /Common/Resources/Folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Folder.png -------------------------------------------------------------------------------- /Common/Resources/GOG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/GOG.png -------------------------------------------------------------------------------- /Common/Resources/GamePass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/GamePass.png -------------------------------------------------------------------------------- /Common/Resources/GitHub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/GitHub.png -------------------------------------------------------------------------------- /Common/Resources/Gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Gray.png -------------------------------------------------------------------------------- /Common/Resources/Grouping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Grouping.png -------------------------------------------------------------------------------- /Common/Resources/Image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Image.png -------------------------------------------------------------------------------- /Common/Resources/Last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Last.png -------------------------------------------------------------------------------- /Common/Resources/Launch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Launch.png -------------------------------------------------------------------------------- /Common/Resources/MergeTabs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/MergeTabs.png -------------------------------------------------------------------------------- /Common/Resources/Mirror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Mirror.png -------------------------------------------------------------------------------- /Common/Resources/NMS.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/NMS.ico -------------------------------------------------------------------------------- /Common/Resources/NMS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/NMS.png -------------------------------------------------------------------------------- /Common/Resources/Next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Next.png -------------------------------------------------------------------------------- /Common/Resources/PakItemBin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemBin.png -------------------------------------------------------------------------------- /Common/Resources/PakItemBnk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemBnk.png -------------------------------------------------------------------------------- /Common/Resources/PakItemCs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemCs.png -------------------------------------------------------------------------------- /Common/Resources/PakItemCsv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemCsv.png -------------------------------------------------------------------------------- /Common/Resources/PakItemDds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemDds.png -------------------------------------------------------------------------------- /Common/Resources/PakItemEbin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemEbin.png -------------------------------------------------------------------------------- /Common/Resources/PakItemExml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemExml.png -------------------------------------------------------------------------------- /Common/Resources/PakItemHex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemHex.png -------------------------------------------------------------------------------- /Common/Resources/PakItemJson.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemJson.png -------------------------------------------------------------------------------- /Common/Resources/PakItemLua.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemLua.png -------------------------------------------------------------------------------- /Common/Resources/PakItemSpv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemSpv.png -------------------------------------------------------------------------------- /Common/Resources/PakItemTxt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemTxt.png -------------------------------------------------------------------------------- /Common/Resources/PakItemWem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemWem.png -------------------------------------------------------------------------------- /Common/Resources/PakItemXml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/PakItemXml.png -------------------------------------------------------------------------------- /Common/Resources/Paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Paste.png -------------------------------------------------------------------------------- /Common/Resources/Prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Prev.png -------------------------------------------------------------------------------- /Common/Resources/RecipesFood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/RecipesFood.png -------------------------------------------------------------------------------- /Common/Resources/RecipesRefiner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/RecipesRefiner.png -------------------------------------------------------------------------------- /Common/Resources/Redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Redo.png -------------------------------------------------------------------------------- /Common/Resources/Regex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Regex.png -------------------------------------------------------------------------------- /Common/Resources/Rename.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Rename.png -------------------------------------------------------------------------------- /Common/Resources/Run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Run.png -------------------------------------------------------------------------------- /Common/Resources/Save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Save.png -------------------------------------------------------------------------------- /Common/Resources/ScriptMod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/ScriptMod.png -------------------------------------------------------------------------------- /Common/Resources/ScriptPlugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/ScriptPlugin.png -------------------------------------------------------------------------------- /Common/Resources/ScriptQuery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/ScriptQuery.png -------------------------------------------------------------------------------- /Common/Resources/ScriptUtil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/ScriptUtil.png -------------------------------------------------------------------------------- /Common/Resources/Search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Search.png -------------------------------------------------------------------------------- /Common/Resources/Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Settings.png -------------------------------------------------------------------------------- /Common/Resources/Smiley_Green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Smiley_Green.png -------------------------------------------------------------------------------- /Common/Resources/Smiley_Red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Smiley_Red.png -------------------------------------------------------------------------------- /Common/Resources/Smiley_Yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Smiley_Yellow.png -------------------------------------------------------------------------------- /Common/Resources/SplitTabs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/SplitTabs.png -------------------------------------------------------------------------------- /Common/Resources/Steam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Steam.png -------------------------------------------------------------------------------- /Common/Resources/Stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Stop.png -------------------------------------------------------------------------------- /Common/Resources/Stretch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Stretch.png -------------------------------------------------------------------------------- /Common/Resources/Text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Text.png -------------------------------------------------------------------------------- /Common/Resources/Tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Tile.png -------------------------------------------------------------------------------- /Common/Resources/TypeArray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/TypeArray.png -------------------------------------------------------------------------------- /Common/Resources/TypeEvent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/TypeEvent.png -------------------------------------------------------------------------------- /Common/Resources/TypeField.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/TypeField.png -------------------------------------------------------------------------------- /Common/Resources/TypeProp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/TypeProp.png -------------------------------------------------------------------------------- /Common/Resources/UncheckAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/UncheckAll.png -------------------------------------------------------------------------------- /Common/Resources/Undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Undo.png -------------------------------------------------------------------------------- /Common/Resources/Viewer.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Viewer.ico -------------------------------------------------------------------------------- /Common/Resources/Warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/Warning.png -------------------------------------------------------------------------------- /Common/Resources/WarpCell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/WarpCell.png -------------------------------------------------------------------------------- /Common/Resources/White.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/White.png -------------------------------------------------------------------------------- /Common/Resources/WholeWord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/Resources/WholeWord.png -------------------------------------------------------------------------------- /Common/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /Common/Utility/GitHubReleases.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | using System.Collections.Generic; 23 | using System.Windows; 24 | 25 | //============================================================================= 26 | 27 | namespace cmk 28 | { 29 | /// 30 | /// Cache a list of releases for a specific GitHub repository. 31 | /// 32 | public class GitHubReleases 33 | { 34 | public GitHubReleases( 35 | string USER_AGENT_NAME, // GitHub user name for app 36 | string USER_AGENT_VERSION, // GitHub repository name for app 37 | string USER, // GitHub user name for query 38 | string REPOSITORY // GitHub repository name for query 39 | ){ 40 | UserAgentName = USER_AGENT_NAME; 41 | UserAgentVersion = USER_AGENT_VERSION; 42 | User = USER; 43 | Repository = REPOSITORY; 44 | } 45 | 46 | //........................................................... 47 | 48 | public string UserAgentName { get; } 49 | public string UserAgentVersion { get; } 50 | public string User { get; } 51 | public string Repository { get; } 52 | 53 | //........................................................... 54 | 55 | protected List m_releases; 56 | 57 | public List Releases { 58 | get { 59 | lock( this ) 60 | if( m_releases == null && !GitHub.Disabled ) { 61 | if( UserAgentName .IsNullOrEmpty() || 62 | UserAgentVersion.IsNullOrEmpty() || 63 | User .IsNullOrEmpty() || 64 | Repository .IsNullOrEmpty() 65 | ) { 66 | m_releases = new(); // invalid query info, don't try again 67 | } 68 | else try { 69 | var client = GitHub.CreateClient(UserAgentName, UserAgentVersion); 70 | var rate = client.Rate(); 71 | if( rate.Remaining > 0 ) { 72 | m_releases = client.Releases(User, Repository); 73 | } 74 | else Dialog.ShowMessageBoxOnMainWindow( // don't init m_releases, allow try again later 75 | $"Hit GitHub query rate limit {rate.Limit}/hr\nResets: {rate.Reset.LocalDateTime}.", 76 | "Version Check", 77 | MessageBoxButton.OK, 78 | MessageBoxImage.Error, 79 | MessageBoxResult.OK 80 | ); 81 | } 82 | catch( Exception EX ) { Log.Default.AddFailure(EX); } 83 | } 84 | return m_releases; 85 | } 86 | } 87 | } 88 | } 89 | 90 | //============================================================================= 91 | -------------------------------------------------------------------------------- /Common/Utility/IO.Stream.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | using System.IO; 23 | 24 | //============================================================================= 25 | 26 | namespace cmk.IO 27 | { 28 | public static class Stream 29 | { 30 | /// 31 | /// If CAPACITY < Int32.MaxValue return a new MemoryStream constructed 32 | /// with the specified CAPACITY, else return a FileStream to a temp 33 | /// DeleteOnClose file with the specified BUFFER_SIZE. 34 | /// CAPACITY should be treated as the maximum size this stream will get 35 | /// otherwise may get a MemoryStream only to throw when you write > Int32.MaxValue bytes to it. 36 | /// 37 | public static System.IO.Stream MemoryOrTempFile( long CAPACITY, int BUFFER_SIZE = 65536 ) 38 | { 39 | System.IO.Stream stream; 40 | if( CAPACITY < Int32.MaxValue ) { 41 | stream = new MemoryStream((int)CAPACITY); 42 | } 43 | else { 44 | if( BUFFER_SIZE < 4096 ) BUFFER_SIZE = 4096; 45 | var temp = System.IO.Path.GetTempFileName(); 46 | stream = new FileStream(temp, 47 | FileMode.Open, 48 | FileAccess.ReadWrite, 49 | FileShare.None, 50 | BUFFER_SIZE, 51 | FileOptions.DeleteOnClose 52 | ); 53 | } 54 | stream.Position = 0; 55 | return stream; 56 | } 57 | } 58 | } 59 | 60 | //============================================================================= 61 | -------------------------------------------------------------------------------- /Common/Utility/IPersistState.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | 22 | //============================================================================= 23 | 24 | namespace cmk 25 | { 26 | public interface IPersistState 27 | { 28 | void SaveState(); 29 | void LoadState(); 30 | } 31 | } 32 | 33 | //============================================================================= 34 | -------------------------------------------------------------------------------- /Common/Utility/PInvoke.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System.Runtime.InteropServices; 22 | using System.Security; 23 | 24 | //============================================================================= 25 | 26 | namespace cmk 27 | { 28 | [SuppressUnmanagedCodeSecurity] 29 | public static class PInvoke 30 | { 31 | [DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)] 32 | public static extern int memcmp( byte[] LHS, byte[] RHS, long LENGTH ); 33 | 34 | [DllImport("kernel32.dll")] 35 | [return: MarshalAs(UnmanagedType.Bool)] 36 | public static extern bool GetPhysicallyInstalledSystemMemory( out long KB ); 37 | } 38 | } 39 | 40 | //============================================================================= 41 | -------------------------------------------------------------------------------- /Common/Utility/ScopedCursor.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | /* 3 | cmk NMS Common 4 | Copyright (C) 2021 Chris Kushnir 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Affero General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Affero General Public License for more details. 15 | 16 | You should have received a copy of the GNU Affero General Public License 17 | along with this program. If not, see . 18 | */ 19 | //============================================================================= 20 | 21 | using System; 22 | using System.Windows; 23 | using System.Windows.Input; 24 | 25 | //============================================================================= 26 | 27 | namespace cmk 28 | { 29 | public class ScopedCursor 30 | : System.IDisposable 31 | { 32 | protected Cursor m_orig = null; 33 | protected bool m_is_disposed = true; 34 | 35 | public ScopedCursor( Cursor CURSOR ) // e.g. Cursors.Wait; 36 | { 37 | Application.Current.Dispatcher.Invoke(() => { 38 | m_orig = Mouse.OverrideCursor; 39 | Mouse.OverrideCursor = CURSOR; 40 | m_is_disposed = false; 41 | }); 42 | } 43 | 44 | ~ScopedCursor() => Dispose(false); 45 | 46 | public void Dispose() 47 | { 48 | Dispose(true); 49 | GC.SuppressFinalize(this); 50 | } 51 | 52 | protected void Dispose( bool DISPOSING ) 53 | { 54 | if( m_is_disposed ) return; 55 | m_is_disposed = true; 56 | Application.Current.Dispatcher.Invoke(() => { 57 | Mouse.OverrideCursor = m_orig; 58 | m_orig = null; 59 | }); 60 | } 61 | 62 | } 63 | } 64 | 65 | //============================================================================= 66 | -------------------------------------------------------------------------------- /Common/cmkNMSCommon.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | false 5 | <_LastSelectedProfileId>D:\dev\prj\cmk\Game\NoMansSky\Common\Properties\PublishProfiles\FolderProfile.pubxml 6 | 7 | 8 | 9 | Designer 10 | 11 | 12 | 13 | 14 | Designer 15 | 16 | 17 | -------------------------------------------------------------------------------- /Common/libMBIN.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/libMBIN.dll -------------------------------------------------------------------------------- /Common/spirv-cross.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Common/spirv-cross.exe -------------------------------------------------------------------------------- /Doc/About.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/About.png -------------------------------------------------------------------------------- /Doc/Application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Application.png -------------------------------------------------------------------------------- /Doc/Script/Readme.md: -------------------------------------------------------------------------------- 1 | # Script 2 | 3 | --- -------------------------------------------------------------------------------- /Doc/Splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Splash.png -------------------------------------------------------------------------------- /Doc/Tab/Application/Application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Application/Application.png -------------------------------------------------------------------------------- /Doc/Tab/Application/Download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Application/Download.png -------------------------------------------------------------------------------- /Doc/Tab/Application/LoadedTabs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Application/LoadedTabs.png -------------------------------------------------------------------------------- /Doc/Tab/Application/Readme.md: -------------------------------------------------------------------------------- 1 | # Application 2 | ![](Application.png) 3 | 4 | Contains the default Log window and global state toggle buttons. 5 | 6 | >Each log window has Clear and Save buttons in their toolbar.
7 | >The default save file name is based on the data the log represents. 8 | 9 | ## Log Entries 10 | 11 | ### Loading 12 | - **Loading Types from ... :** 13 | Each game instance gets it's own wrapper around the linked libMBIN.dll. 14 | This allows different game instances that use the same libMBIN.dll version, but may have different mbin's, 15 | to display the game instance specific mbins in the [libMBIN API tab](../MBINC/Readme.md). 16 | So even though it already did this at the application level, it needs to do it again per game instance. 17 | - **Loading item info from ... :** 18 | Load meta-data for each pak file in the PCBANKS and PCBANKS/MODS folders. 19 | - Load each pak header and manifest. 20 | Pak item Info objects are created for each manifest entry. 21 | The Info objects contain the item Path and meta-data required to extract the item Data. 22 | Each pak file wrapper maintains both a sorted list and a tree of manifest Info objects. 23 | - Load the header for each pak mbin item. Mainly used to get the top-level class for each mbin, so the mbin can be linked to the corresponding MBINC class. 24 | - **Building merged item info tree from ... :** 25 | The game pak files (PCBANKS) have their Info lists added to a merged Info tree. 26 | - **Linking MBIN paths to libMBIN classes:** 27 | Link the Path of each game pak mbin item to the top-level class in the game instance libMBIN wrapper. 28 | - **Loading cmk.NMS.Game.Language.Collection:** 29 | Each supported language has Id - value pairs stored in 5 or more mbin's. 30 | This loads all the mbin's for the current language, and adds all Id - value pairs to a dictionary. 31 | The dictionary is displayed in the [Language tab](../Language/Readme.md). 32 | It is also used to map Game.Item Id's to localized strings. 33 | - **Loading cmk.NMS.Game.Items.\*.Collection:** 34 | Load the corresponding mbin, create a wrapper for each item. 35 | The wrapper objects contain the Id's, localized strings, and bitmap versions of the icon. 36 | These collections are displayed in the [Substances, Products, Technologies tabs](../Items/Readme.md). 37 | - **Loading cmk.NMS.Game.Recipes.\*.Collection:** 38 | Load the recipes mbin and create wrappers for each item. 39 | The wrapper objects contain the Id's, localized strings, and bitmap versions of the icon. 40 | These collections are displayed in the [Refiner & Cooking Recipes tabs](../Recipes/Readme.md). 41 | - **Updated cmk.NMS.\*.Collection 'ENGLISH':** 42 | Whenever the current language is changed the Game.Items and Game.Recipes lists have their localized strings updated. 43 | It takes 1-2 seconds to load a different language. 44 | 45 | The above tasks are done in parallel. 46 | This means that having a processor that supports more concurrent threads will help keep the load time down. 47 | It also means the load may become I/O limited, especially if the game files are on a hard-disk instead of an SSD. 48 | 49 | ### Errors 50 | - As mentioned the Application tab log window is the tied to the default Log object. 51 | Whenever there is a message to be logged but the class|method wasn't explicitly provided a Log object the default Log object is used. 52 | As such, if something doesn't seem to be working in another tab it may be worth coming back to the Application tab to see if an error was logged. 53 | 54 | --- 55 | -------------------------------------------------------------------------------- /Doc/Tab/Application/SelectGameFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Application/SelectGameFolder.png -------------------------------------------------------------------------------- /Doc/Tab/Application/StartTabs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Application/StartTabs.png -------------------------------------------------------------------------------- /Doc/Tab/Application/Statusbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Application/Statusbar.png -------------------------------------------------------------------------------- /Doc/Tab/Application/Toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Application/Toolbar.png -------------------------------------------------------------------------------- /Doc/Tab/Build/Build1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Build/Build1.png -------------------------------------------------------------------------------- /Doc/Tab/Build/Build2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Build/Build2.png -------------------------------------------------------------------------------- /Doc/Tab/Items/Products.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Items/Products.png -------------------------------------------------------------------------------- /Doc/Tab/Items/Readme.md: -------------------------------------------------------------------------------- 1 | # Substances, Products, Technologies 2 | 3 | **Substances:** METADATA/REALITY/TABLES/NMS_REALITY_GCSUBSTANCETABLE.MBIN 4 | ![](Substances.png) 5 | 6 | **Products:** METADATA/REALITY/TABLES/NMS_REALITY_GCPRODUCTTABLE.MBIN 7 | ![](Products.png) 8 | 9 | **Technologies:** METADATA/REALITY/TABLES/NMS_REALITY_GCTECHNOLOGYTABLE.MBIN 10 | ![](Technologies.png) 11 | 12 | Each of the tabs displays the items from the corresponding mbin. The lists are grouped by category. 13 | The displayed names and descriptions use localized strings from the currently selected language. 14 | Double-clicking the icon will open the corresponding dds item in the PAK Items tab. 15 | 16 | The descriptions may have some of the carriage-return and newline characters compressed out for more compact display. 17 | Use the Language tab to get the description as it is exactly stored. 18 | 19 | The lists are drawn using virtualization - only the ui elements to be displayed are generated. 20 | If you scroll through a list with many items you will get periodic lag, this is a result of the .NET WPF control not the application code; 21 | the WPF control is having to repeatedly regenerate the ui elements to display as you scroll. 22 | It is possible to disable the list virtualization; however, it can then take 5+ seconds to generate all the ui elements for the list the first time the tab is selected, 23 | as well as when the filter is changed. 24 | 25 | The search filter uses simple case-insensitive substring searches. 26 | 27 | --- 28 | -------------------------------------------------------------------------------- /Doc/Tab/Items/Substances.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Items/Substances.png -------------------------------------------------------------------------------- /Doc/Tab/Items/Technologies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Items/Technologies.png -------------------------------------------------------------------------------- /Doc/Tab/Language/LanguageEN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Language/LanguageEN.png -------------------------------------------------------------------------------- /Doc/Tab/Language/LanguageKO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Language/LanguageKO.png -------------------------------------------------------------------------------- /Doc/Tab/Language/Readme.md: -------------------------------------------------------------------------------- 1 | # Language 2 | ![](LanguageEN.png) 3 | ![](LanguageKO.png) 4 | 5 | Selecting a language from the toolbar combobox will load all the corresponding language mbin items from the game pak files. 6 | The language Id - localized string value dictionary is used to lookup display names for the substances, products, technologies, and recipe lists in the other tabs. 7 | 8 | The search filter uses simple case-insensitive substring searches. 9 | 10 | --- 11 | -------------------------------------------------------------------------------- /Doc/Tab/MBINC/MBINC_ChildClass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/MBINC/MBINC_ChildClass.png -------------------------------------------------------------------------------- /Doc/Tab/MBINC/MBINC_TopLevelClass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/MBINC/MBINC_TopLevelClass.png -------------------------------------------------------------------------------- /Doc/Tab/MBINC/Readme.md: -------------------------------------------------------------------------------- 1 | # libMBIN API 2 | ![](MBINC_TopLevelClass.png) 3 | ![](MBINC_ChildClass.png) 4 | 5 | **First column:** All enums on top, enum values for selected enum on bottom.
6 | **Second column:** All classes on top, all fields on bottom.
7 | **Third column:** Fields for selected class, parent classes that have 1+ fields that use the selected class, mbin's with the selected class as the top-level object.
8 | 9 | Class names are bold if the class is a top-level class for 1+ mbin. 10 | This only applies when there is a selected game instance, 11 | as the class - mbin links are determined when a game instance is loaded. 12 | It's possible that different game instances will use the same libMBIN version, but have different mbins. 13 | To handle this each game instance gets it's own libMBIN wrapper copy whose classes are linked to the game instance mbins. 14 | 15 | Selection: 16 | - Selecting an enum will populate the enum value list, clear any selected field, and select the class that defines the enum. 17 | - Selecting a field will select the class that defines the field. 18 | - Selecting a class will clear any selected field. 19 | - In all cases the selected class tree will be updated. 20 | 21 | Double-clicking in the selected class tree: 22 | - Field: If the field uses a libMBIN class then select that class. 23 | - Parent: Select the class. 24 | - MBIN: View the selected item in the PAK Items tab. 25 | 26 | Classes and MBIN's: 27 | - 0 Parent, 0 MBIN: 28 | The class exists in a heirarchy that is only referenced by NMSTemplate fields. 29 | - 0 Parent, 1+ MBIN: 30 | The class is not explicitly used by any class field. 31 | The class is the top-level class for the MBIN's. 32 | - 1+ Parent, 0 MBIN: 33 | Each Parent has 1+ fields that use the selected class. 34 | The class is not a top-level class for any mbin's. 35 | - 1+ Parent, 1+ MBIN: 36 | Each Parent has 1+ fields that use the selected class. 37 | The class is the top-level class for the MBIN's. 38 | 39 | In all cases the Parent's only represent cases where the class is explicitly used as a field. 40 | It's possible a class is also used by a NMSTemplate, NMSTemplate[], and|or List\ field. 41 | To detect cases where a class is only used via NMSTemplate field, a deeper inspection of each mbin would be required; 42 | use a Query Script to find these mbin's. 43 | 44 | The lists can be filtered using the toolbar textbox. The search text can use Regex or *, ? wildcards.
45 | Enums can be further filtered based on number of values they have. 46 | 47 | --- 48 | -------------------------------------------------------------------------------- /Doc/Tab/PakConflicts/PakConflicts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/PakConflicts/PakConflicts.png -------------------------------------------------------------------------------- /Doc/Tab/PakConflicts/Readme.md: -------------------------------------------------------------------------------- 1 | # PAK Conflicts 2 | The conflicts tab is only displayed if conflicts are found. 3 | >The application will check for conflicts whenever it detects a *.pak change in the nms/GAMEDATA/PCBANKS/MODS/ folder. 4 | 5 | Conflicts occur when two or more mod pak files contain the same game pak item. 6 | 7 | ![](PakConflicts.png) 8 | 9 | In the above screenshot we can see that 4 mod pak files contain GCENVIRONMENTGLOBALS.GLOBAL.MBIN; 10 | the game will only load one, the changes in the other mod pak files will be ignored. 11 | 12 | The mods are prefixed with the MBINC version used to compile the mod mbin in conflict. 13 | The mods are listed in load-order, so the mbin from the last listed mod is the one that will be used by the game. 14 | 15 | Double-clicking on the mod name will open a diff view of the game version of the mbin (left) and the clicked mod version of the mbin (right). 16 | 17 | --- 18 | -------------------------------------------------------------------------------- /Doc/Tab/PakItems/PakItemDds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/PakItems/PakItemDds.png -------------------------------------------------------------------------------- /Doc/Tab/PakItems/PakItemMbin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/PakItems/PakItemMbin.png -------------------------------------------------------------------------------- /Doc/Tab/PakItems/PakItemMbinColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/PakItems/PakItemMbinColor.png -------------------------------------------------------------------------------- /Doc/Tab/PakItems/PakItemMbinDiff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/PakItems/PakItemMbinDiff.png -------------------------------------------------------------------------------- /Doc/Tab/PakItems/PakItemMbinLanguage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/PakItems/PakItemMbinLanguage.png -------------------------------------------------------------------------------- /Doc/Tab/PakItems/PakItemMbinPath1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/PakItems/PakItemMbinPath1.png -------------------------------------------------------------------------------- /Doc/Tab/PakItems/PakItemMbinPath2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/PakItems/PakItemMbinPath2.png -------------------------------------------------------------------------------- /Doc/Tab/PakItems/PakItemSpv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/PakItems/PakItemSpv.png -------------------------------------------------------------------------------- /Doc/Tab/PakItems/PakItems.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/PakItems/PakItems.png -------------------------------------------------------------------------------- /Doc/Tab/PakItems/Readme.md: -------------------------------------------------------------------------------- 1 | # PAK Items 2 | ![](PakItems.png) 3 | 4 | There are two PAK Items tabs, the last tab in the left set of tabs and the first tab in the right set of tabs. 5 | Both have the same functionality. 6 | To view a pak item first select the pak tree you wish to browse, by selecting an item from the pak combobox. 7 | The first entry (blank, default) represents the merged game pak item tree (all pak items from all game pak files), it is followed by the individual mod paks. 8 | 9 | Once a pak item tree is specified you can use the breadcrumb control to pick a pak item.
10 | Once several pak items have been viewed you can use the Previous | Next buttons on the toolbar to move through recently viewed items.
11 | You can use the Copy button to copy the path string from the breadcrumb control to the clipboard.
12 | You can use the Paste button to paste the path string from the clipboard to the breadcrumb control.
13 | You can use the Save button to save the current item to disk. 14 | You can save items even if they don't have a viewer. 15 | Some items can be saved in in multiple formats. 16 | 17 | --- 18 | 19 | ## .MBIN & .MBIN.PC 20 | ![](PakItemMbin.png) 21 | 22 | Mbin items are viewed using a custom text file format (ebin). 23 | Mbin items can be saved to disk as mbin binary, exml text, or ebin text files. 24 | 25 | The first line specifies the libMBIN version that was used to decompile the mbin. 26 | For game mbin's this is the version associated with the game instance release. 27 | For mod mbin's this is the version used to compile the mbin.
28 | The second line is the pak item path.
29 | The third line is the top-level libMBIN class name. This is the object that gets created when libMBIN deserializes the mbin binary data. 30 | 31 | ### Diff View 32 | Side-by-side, or diff, viewers are automatically used if the selected item is from a mod and there is a corresponding item in the game pak files. 33 | ![](PakItemMbinDiff.png) 34 | 35 | ### Color Swatch 36 | Ebin uses (...) to wrap colours, [...] to wrap vectors, and |...| to wrap quaternions.
37 | A custom background renderer draws swatches for color values (ignores alpha). 38 | ![](PakItemMbinColor.png) 39 | 40 | ### Language ID 41 | Double-click a language Id to put it in the toolbar along with the localized string (if found). 42 | Double-click a substance, product, or technology Id to put the language Id for the lower-case name in the toolbar along with the localized string (if found). 43 | You can also type a language Id string in the language Id textbox, but it is usually easier to use the Language tab. 44 | ![](PakItemMbinLanguage.png) 45 | 46 | ### Path 47 | Double-click a pak item path to view the item. 48 | The application will try to fix-up path errors e.g. strip leading slash, convert \ to /, make all upper-case, converts .PNG to .DDS, .EXML to .MBIN, ... . 49 | ![](PakItemMbinPath1.png)
50 | ![](PakItemMbinPath2.png)
51 | 52 | --- 53 | 54 | ## .DDS 55 | All images are stored in dds format. 56 | The dds viewer displays format information, and allows the user to select a background (checker, solid black, solid white), and scaling options (fit, tile, center). 57 | ![](PakItemDds.png) 58 | 59 | --- 60 | 61 | ## .SPV 62 | Spv items are compiled Vulkan GLSL shaders. 63 | The application uses spirv-cross.exe to decompile these to text for display. 64 | Spv items can be saved to disk as spv binary, or decompiled glsl text files. 65 | ![](PakItemSpv.png) 66 | 67 | --- 68 | -------------------------------------------------------------------------------- /Doc/Tab/Readme.md: -------------------------------------------------------------------------------- 1 | # Tabs 2 | ![](Tabs.png) 3 | 4 | There are two groups of tabs, roughly divided into research tabs and script | mod tabs. 5 | 6 | Where an action would open a pak item in the PAK Item tab e.g. double-clicking pak item path text, 7 | the item will generally be opened in the PAK Item tab in the 'other' set of tabs. 8 | For example, double-clicking a MBIN path in libMBIN API tab (left set of tabs) will open the mbin in the PAK Item tab viewer in the right set of tabs. 9 | Likewise, double-clicking a pak item path in a script (right set of tabs) will open the pak item in the PAK Item tab viewer in the left set of tabs. 10 | 11 | * [Application](Doc/Tab/Application/Readme.md) 12 | * [libMBIN API](Doc/Tab/MBINC/Readme.md) 13 | * [Language](Doc/Tab/Language/Readme.md) 14 | * [Substances, Products, Technologies](Doc/Tab/Items/Readme.md) 15 | * [Refiner & Cooking Recipes](Doc/Tab/Recipes/Readme.md) 16 | * [Search Paths](Doc/Tab/SearchPaths/Readme.md) 17 | * [Search DDS Paths](Doc/Tab/SearchDds/Readme.md) 18 | * [Search Text](Doc/Tab/SearchText/Readme.md) 19 | * [PAK Conflicts](Doc/Tab/PakConflicts/Readme.md) 20 | * [PAK Items](Doc/Tab/PakItems/Readme.md) 21 | * [Utility Scripts](Doc/Tab/ScriptUtil/Readme.md) 22 | * [Query Scripts](Doc/Tab/ScriptQuery/Readme.md) 23 | * [Mod Scripts](Doc/Tab/ScriptMod/Readme.md) 24 | * [Build](Doc/Tab/Build/Readme.md) 25 | -------------------------------------------------------------------------------- /Doc/Tab/Recipes/Readme.md: -------------------------------------------------------------------------------- 1 | # Refiner & Cooking Recipes 2 | ![](RecipesRefiner.png) 3 | ![](RecipesCooking.png) 4 | 5 | Recipes are sorted by: result, result amout, time to make, recipe id. 6 | Double-clicking the icon will open the corresponding dds item in the PAK Items tab. 7 | 8 | The lists are drawn using virtualization - only the ui elements to be displayed are generated. 9 | If you scroll through a list with many items you will get periodic lag, this is a result of the .NET WPF control not the application code; 10 | the WPF control is having to repeatedly regenerate the ui elements to display as you scroll. 11 | It is possible to disable the list virtualization; however, it can then take 5+ seconds to generate all the ui elements for the list the first time the tab is selected, 12 | as well as when the filter is changed. 13 | 14 | The search filter uses simple case-insensitive substring searches. 15 | 16 | --- 17 | -------------------------------------------------------------------------------- /Doc/Tab/Recipes/RecipesCooking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Recipes/RecipesCooking.png -------------------------------------------------------------------------------- /Doc/Tab/Recipes/RecipesRefiner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/Recipes/RecipesRefiner.png -------------------------------------------------------------------------------- /Doc/Tab/ScriptMod/ScriptMod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/ScriptMod/ScriptMod.png -------------------------------------------------------------------------------- /Doc/Tab/ScriptQuery/ScriptQuery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/ScriptQuery/ScriptQuery.png -------------------------------------------------------------------------------- /Doc/Tab/ScriptQuery/ScriptQueryCompile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/ScriptQuery/ScriptQueryCompile.png -------------------------------------------------------------------------------- /Doc/Tab/ScriptUtil/Readme.md: -------------------------------------------------------------------------------- 1 | # Utility Scripts 2 | ![](ScriptUtil.png) 3 | 4 | Use C# to query the currently loaded game instance, in particular from its pak files mbin items. 5 | 6 | The tab toolbar has buttons to: create a new script, clear all script logs, save all script edits to disk.
7 | The script toolbar has buttons to: delete, save, compile, execute, stop execute (only enabled while script running). 8 | 9 | --- 10 | 11 | ## New 12 | The New Script button will create a new .cs script file in the ./Scripts/Query/ folder. 13 | A file system watcher will detect the new file and add it to the listbox. 14 | 15 | When creating a new script a popup will prompt for the script file name.
16 | Double-clicking a script file name will open a popup to rename the script file. 17 | 18 | The class name is initially set to the file name with ' ', '_', and '-' removed. 19 | 20 | --- 21 | 22 | ## Edit 23 | Each query script file must have a class that derives from cmk.NMS.QueryScript and overrides its Execute method. 24 | New scripts are created from a template that meets these requirements.
25 | The script file may also contain other classes and methods. 26 | All types and methods used by a query script must be in a loaded Assembly, these are generally from: .NET library, a .NET exe | dll in the application folder, or a .NET dll in the ./Plugins folder. 27 | 28 | As you move the cursor over the script intellisense like feedback is provided in the script window statusbar. 29 | When you enter a '.' the app will display any available code-completion options in a popup e.g. methods, fields. 30 | 31 | > You can double-click a pak item path string to view the item in the PAK Items tab. 32 | 33 | There are three main properties a script will use: 34 | 35 | - [Game](../../../Common/NMS/Game/Game.Data.cs). This is the currently loaded game instance. It contains the following notable properties: 36 | - Location. Game path, NMS build date, Release information. 37 | - MBINC. libMBIN | MBINCompiler to be used based on Release information. 38 | Currently this will always be the link loaded libMBIN.dll. 39 | - PCBANKS. Collection of all game pak files. 40 | - MODS. Collection of all mod pak files. 41 | - Language. Dictionary of language Id - Value pairs for current language Identifier. 42 | - Substances, Products, Technologies. Lists of the various in-game items. 43 | - RefinerRecipes, CookingRecipes. Lists of the various in-game recipes. 44 | - [Log](../../../Common/Utility/Log.cs). List of log items for script. These items are displayed in the Log view, below the script editor. 45 | - Cancel. A token that is signalled when you click the Cancel button in the script toolbar while the script is being Executed. 46 | 47 | --- 48 | 49 | ## Compile 50 | ![](ScriptQueryCompile.png) 51 | 52 | The results of the compile, including any errors, will be displayed in the Log view below the script editor.
53 | In the above example we deleted the last 't' from the CreateText method name. 54 | The error tells us the script file name (Dump_Products), the line (19), column (30), and what is wrong (System.IO.File class does not contain a 'CreateTex' method). 55 | 56 | --- 57 | -------------------------------------------------------------------------------- /Doc/Tab/ScriptUtil/ScriptQueryCompile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/ScriptUtil/ScriptQueryCompile.png -------------------------------------------------------------------------------- /Doc/Tab/ScriptUtil/ScriptUtil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/ScriptUtil/ScriptUtil.png -------------------------------------------------------------------------------- /Doc/Tab/SearchDds/Dds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/SearchDds/Dds.png -------------------------------------------------------------------------------- /Doc/Tab/SearchDds/Readme.md: -------------------------------------------------------------------------------- 1 | # Search DDS Paths 2 | Search for dds images in the game pak files using wildcard | regex search of paths. 3 | 4 | ![](Dds.png) 5 | 6 | Specify the maximum number of results you want built.
7 | Specify the search pattern (*, ? wildcards).
8 | Click Search button to start search, Cancel button to abort search.
9 | If you cancel a search it will show the list of items built to that point. 10 | 11 | --- 12 | -------------------------------------------------------------------------------- /Doc/Tab/SearchPaths/Dds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/SearchPaths/Dds.png -------------------------------------------------------------------------------- /Doc/Tab/SearchPaths/Readme.md: -------------------------------------------------------------------------------- 1 | # Search Paths 2 | Search for pak items using wildcard search of paths. 3 | 4 | --- 5 | -------------------------------------------------------------------------------- /Doc/Tab/SearchText/Mbin1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/SearchText/Mbin1.png -------------------------------------------------------------------------------- /Doc/Tab/SearchText/Mbin2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmkushnir/NMSModBuilder/caa705c400215164b0388b6b1f9ac1bea660a072/Doc/Tab/SearchText/Mbin2.png -------------------------------------------------------------------------------- /Doc/Tab/SearchText/Readme.md: -------------------------------------------------------------------------------- 1 | # Search Text 2 | Search mbin's for a given search expression, language mbin's are excluded.
3 | Mbin's are extracted from their pak file, decompiled into a .NET object using libMBIN.dll, then converted to an ebin text string. The ebin text is searched using a regex expression built based on the button states and the text box text. 4 | 5 | First or uncached search:
6 | ![](Mbin1.png) 7 | 8 | Search after cache primed:
9 | ![](Mbin2.png) 10 | 11 | Use the combobox to select the source. The first entry (blank, default) represents the merged game pak item tree (all pak items from all game pak files), it is followed by the individual mod paks. 12 | 13 | Specify the search pattern (*, ? wildcards or regex expression, along w/ toolbar options for whole word and case-sensitivity).
14 | Click Search button to start search, Cancel button to abort search.
15 | If you cancel a search it will show the count of mbin's searched to that point. 16 | 17 | It takes ~2 min to search all 70K mbin's w/o caching, and about 1 sec w/ caching (after first search). Caching is enabled by default but requires ~36GB of memory to hold all cached mbin data. If your system has less than ~44 GB of physical memory you should specify the no_mbin_cache command-line option, in which case each search will take ~2 min. 18 | 19 | --- 20 | -------------------------------------------------------------------------------- /Plugins/Sample/Sample.cs: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | 3 | using System; 4 | using System.Windows; 5 | 6 | //============================================================================= 7 | 8 | namespace cmk.NMS.ModBuilder.Sample 9 | { 10 | public class Plugin 11 | : cmk.NMS.ModBuilder.Plugin 12 | { 13 | public Plugin() : base() 14 | { 15 | } 16 | 17 | //........................................................... 18 | 19 | public bool Load() 20 | { 21 | var app = Application.Current as cmk.NMS.ModBuilder.App; 22 | 23 | Log.Default.AddInformation("cmk.NMS.ModBuilder.Sample.Plugin.Load"); 24 | 25 | return true; 26 | } 27 | 28 | //........................................................... 29 | 30 | public void Unload() 31 | { 32 | 33 | } 34 | } 35 | } 36 | 37 | //============================================================================= 38 | -------------------------------------------------------------------------------- /Plugins/Sample/Sample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0-windows 5 | true 6 | x64 7 | 8 | 9 | 10 | 11 | ..\..\ModBuilder\bin\x64\Debug\net5.0-windows\cmkNMSCommon.dll 12 | 13 | 14 | ..\..\ModBuilder\bin\x64\Debug\net5.0-windows\cmkNMSModBuilder.dll 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Plugins/Sample/Sample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31624.102 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample", "Sample.csproj", "{6D77C104-1498-45BB-8E31-9F12BA10BCA0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {6D77C104-1498-45BB-8E31-9F12BA10BCA0}.Debug|x64.ActiveCfg = Debug|x64 15 | {6D77C104-1498-45BB-8E31-9F12BA10BCA0}.Debug|x64.Build.0 = Debug|x64 16 | {6D77C104-1498-45BB-8E31-9F12BA10BCA0}.Release|x64.ActiveCfg = Release|x64 17 | {6D77C104-1498-45BB-8E31-9F12BA10BCA0}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {2E1790C5-ED10-41B7-B729-57A615A3778C} 24 | EndGlobalSection 25 | EndGlobal 26 | --------------------------------------------------------------------------------