├── .gitattributes ├── .gitignore ├── CONTRIBUTION.md ├── DLLs ├── 7z.dll ├── 7z64.dll ├── Datamodel.NET.dll ├── HLLib.x64.dll ├── HLLib.x86.dll ├── SevenZipSharp.dll └── TargaImage.dll ├── LICENSE.md ├── LibModMaker ├── CCommentReader.cs ├── FGDLib │ └── TokenReader.cs ├── FGDReader.cs ├── ForgeGameData.cs ├── HLLib.cs ├── KeyValues.cs ├── KeyValuesInnerParser.cs ├── KeyValvesParser.cs ├── LICENSE.md ├── Lang.cs ├── LibModMaker.csproj ├── Lights.cs ├── Localization.cs ├── LooseFiles.cs ├── Package.cs ├── Properties │ └── AssemblyInfo.cs ├── SoundManifest.cs ├── SoundScriptKeyValues.cs ├── SourceFileSystem.cs ├── SourceGame.cs ├── SourceMod.cs ├── Steam.cs ├── TGA.cs ├── VTFConverter.cs ├── ValveCommentStream.cs ├── WeaponManifest.cs ├── WeaponScript.cs ├── iFileSystem.cs └── test.xls ├── ModMaker.sln ├── ModMaker ├── 7z.dll ├── 7z64.dll ├── App.config ├── Controls │ ├── FGD │ │ ├── FGD_ChoicesControl.Designer.cs │ │ ├── FGD_ChoicesControl.cs │ │ ├── FGD_ChoicesControl.resx │ │ ├── FGD_FlagControl.Designer.cs │ │ ├── FGD_FlagControl.cs │ │ ├── FGD_FlagControl.resx │ │ ├── FGD_IOControl.Designer.cs │ │ ├── FGD_IOControl.cs │ │ ├── FGD_IOControl.resx │ │ ├── FGD_PropertyControl.Designer.cs │ │ ├── FGD_PropertyControl.cs │ │ ├── FGD_PropertyControl.resx │ │ ├── FGD_WidgetControl.Designer.cs │ │ ├── FGD_WidgetControl.cs │ │ └── FGD_WidgetControl.resx │ ├── KeyBindControl.Designer.cs │ ├── KeyBindControl.cs │ ├── KeyBindControl.resx │ ├── ModView.Designer.cs │ ├── ModView.cs │ ├── ModView.resx │ ├── TextureDataControl.Designer.cs │ ├── TextureDataControl.cs │ ├── TextureDataControl.resx │ ├── TextureDataEditorControl.Designer.cs │ ├── TextureDataEditorControl.cs │ ├── WeaponControl.Designer.cs │ ├── WeaponControl.cs │ ├── WeaponControl.resx │ ├── WeaponSoundPickerControl.Designer.cs │ ├── WeaponSoundPickerControl.cs │ └── WeaponSoundPickerControl.resx ├── Forms │ ├── AboutForm.Designer.cs │ ├── AboutForm.cs │ ├── AboutForm.resx │ ├── AdvancedStartupForm.Designer.cs │ ├── AdvancedStartupForm.cs │ ├── ChaptersForm.Designer.cs │ ├── ChaptersForm.cs │ ├── ChaptersForm.resx │ ├── ConsoleProcessMonitorForm.Designer.cs │ ├── ConsoleProcessMonitorForm.cs │ ├── ConsoleProcessMonitorForm.resx │ ├── FGDChoicesForm.Designer.cs │ ├── FGDChoicesForm.cs │ ├── FGDForm.Designer.cs │ ├── FGDForm.cs │ ├── FGDForm.resx │ ├── FolderDialog.Designer.cs │ ├── FolderDialog.cs │ ├── GameInfoForm.Designer.cs │ ├── GameInfoForm.cs │ ├── InstallerForm.Designer.cs │ ├── InstallerForm.cs │ ├── InstallerForm.resx │ ├── KeyBindingForm.Designer.cs │ ├── KeyBindingForm.cs │ ├── KeyBindingForm.resx │ ├── LightsForm.Designer.cs │ ├── LightsForm.cs │ ├── LightsForm.resx │ ├── LocalForm.Designer.cs │ ├── LocalForm.cs │ ├── LocalForm.resx │ ├── MainForm.Designer.cs │ ├── MainForm.cs │ ├── MainForm.resx │ ├── NewEntityForm.Designer.cs │ ├── NewEntityForm.cs │ ├── NewEntityForm.resx │ ├── NewModForm.Designer.cs │ ├── NewModForm.cs │ ├── NewModForm.resx │ ├── NewModProgressForm.Designer.cs │ ├── NewModProgressForm.cs │ ├── NewModProgressForm.resx │ ├── OptionsForm.Designer.cs │ ├── OptionsForm.cs │ ├── OptionsForm.resx │ ├── ParticleToolForm.Designer.cs │ ├── ParticleToolForm.cs │ ├── ParticleToolForm.resx │ ├── ResEditorForm.Designer.cs │ ├── ResEditorForm.cs │ ├── ResEditorForm.resx │ ├── SMDtoQCForm.Designer.cs │ ├── SMDtoQCForm.cs │ ├── SMDtoQCForm.resx │ ├── SteamInfoForm.Designer.cs │ ├── SteamInfoForm.cs │ ├── TextureDataform.Designer.cs │ ├── TextureDataform.cs │ ├── WeaponsForm.Designer.cs │ ├── WeaponsForm.cs │ ├── WeaponsForm.resx │ ├── ZipForm.Designer.cs │ ├── ZipForm.cs │ └── ZipForm.resx ├── Logic │ ├── CPP_generators │ │ ├── CPlusPlus.cs │ │ ├── EntityScriptGenerator.cs │ │ ├── VGUI_ScriptGenerator.cs │ │ └── WeaponScriptGenerator.cs │ ├── Compiler.cs │ ├── InstallScriptGenerator.cs │ ├── MakeModWizard.cs │ ├── ModAwareCompiler.cs │ ├── Obj.cs │ ├── ObjToSMD.cs │ ├── PanelRectangle.cs │ └── ShortCutIcon.cs ├── ModMaker.csproj ├── Options │ ├── Cleansweep.txt │ ├── FileType.txt │ ├── apps.txt │ ├── mods.txt │ ├── tools.txt │ └── vgui_controls.txt ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── Chapter2014.ico │ ├── Clean2014.ico │ ├── Folder_Closed.png │ ├── Folder_Open.png │ ├── FormRunHS.png │ ├── Hard_Drive.ico │ ├── Keys2014.ico │ ├── Light2014.ico │ ├── Localization2014.ico │ ├── ModMaker128.png │ ├── ModMaker2014.ico │ ├── Refresh.png │ ├── Sound2014.ico │ ├── Weapon2014.ico │ ├── computer.ico │ ├── modern-install-full.ico │ └── orange-install.ico └── Tools │ ├── ChapterTool.cs │ ├── CleanupTool.cs │ ├── CompilerTool.cs │ ├── FGD_Tool.cs │ ├── FacePoserTool.cs │ ├── HammerTool.cs │ ├── HitBoxFix.cs │ ├── InstallScriptTool.cs │ ├── KeyBindingsTool.cs │ ├── LightTool.cs │ ├── LocalizationTool.cs │ ├── MapBuilderTool.cs │ ├── ModelViewerTool.cs │ ├── ParticleTool.cs │ ├── SDKInstallTool.cs │ ├── SMD2QC_Tool.cs │ ├── ScriptSoundsTool.cs │ ├── ShaderEditorTool.cs │ ├── SourceSDKSetupTool.cs │ ├── SourceSDKTool.cs │ ├── VGUI_RES_EditTool.cs │ ├── VPKPackerTool.cs │ ├── WeaponsTool.cs │ ├── ZipPatchTool.cs │ └── iTool.cs ├── ModMakerTests ├── ModMakerTests.csproj ├── Properties │ └── AssemblyInfo.cs ├── Samples │ ├── Background01.vmf │ ├── Chapters_Ref.txt │ ├── Cleansweep.txt │ ├── GameConfig.txt │ ├── GameInfo.txt │ ├── GameLogo.res │ ├── apps.txt │ ├── base.fgd │ ├── ex_player_sounds.txt │ ├── halflife2.fgd │ ├── lights.rad │ ├── test.rad │ └── titles.txt └── UnitTest1.cs ├── README.md └── warHammer ├── App.config ├── Launcher.cs ├── Program.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings └── warHammer.csproj /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /CONTRIBUTION.md: -------------------------------------------------------------------------------- 1 | How you can Contribute to Mod Maker (MM) 2 | ======================================== 3 | 4 | * 1) Promote MM in any place that Source modders visit or wherever you hear of anyone working on a task Mod Maker can do for them. 5 | * 2) Report Issues at , in English, with the steps you took to produce them and (if possible) a copy of your system info ( Help->System Info ) 6 | * 3) Write documentation, in English, for MM in the wiki 7 | * 4) Record video tutorials for installing MM or using one of it's features, upload them to Youtube and link to them from the wiki. 8 | * 5) Request new features by raising an Issue, In English, labelled as "enhancement", describing your feature and how you would like to access it from MM. 9 | * 6) Make replacement Icons for the tools in MM. 10 | * 7) Make a coding style document (I know such things exist and are supported by Visual Studio, i've just never had time to look into it). 11 | * 8) Add features by branching the repo, making the changes and sending a pull request. 12 | * 9) Fix bugs by branching the repo, making the changes and sending a pull request. 13 | 14 | ### 1. Features we would like to have: 15 | * 1) Bug free (see Known Issues below). 16 | * 2) Streamlined support for creating content-only mods. 17 | * 3) Support for creating Alien Swarm mods. 18 | * 4) Installers that can install Steam and the Source SDK if they are not found. 19 | * 5) A "Modern" (Windows 8+) User Interface (and Windows Store presense) 20 | * 6) Linux support, in both the Library and UI. 21 | * 7) An installer for MM itself. 22 | * 8) Generate mod installers that create shortcuts to allow SDK2013 mods to use the Steam Overlay. 23 | * 9) A QC script editor and compiler front-end with syntax highlighting. 24 | * 10) An asyncronous UI for the map compiler tools, so MM can tell Hammer to launch the UI, rather than get locked up waiting for the commandline compile tools to finish. 25 | 26 | ### 2. Known Issues: 27 | * 1) MM doesn't run on all systems. Steam and Source are pretty complicated systems and there are a wide variety of versions and configurations in use by modders in the wild. MM *tries* to cope with every eventuality, but does not always succeed. If MM does not work on your system please work with us (by raising an Issue), so that MM can work for you. 28 | * 2) The Source file system compoment is quite new (at the time of writing) and may not 100% see the file system the way that HL2.exe does when the game runs. 29 | * 3) Asynchronous progress bars for the download, zip and unzip processes rarely run smoothly, jumping from 0 to 100%. 30 | * 4) Not all tools/features that could benefit from the Source file system make use of it (see 2) and have crappy mannual workarounds instead. These should be modernized to use the Source file system component. 31 | * 5) The weapon editor tool is fiddly, cranky and could use some finessing. 32 | 33 | ### 3.Rules of Conduct 34 | Be curtious and polite in all communications, keeping in-mind that: 35 | A) No one is getting paid for this. 36 | B) English, while popular, is not universal. The person you are communicating with may not be a native English speaker and is already struggling to understand English documentaion and tools, which can be frustraiting. 37 | C) Avoid sarcasm and humor. They do not translate well into writing. 38 | 39 | Do not spam. When promoting MM, avoid making more than 3 references to MM per person or site per day. When raising Issues, please limit yourself to 5 Issues per day. When raising an issue do a search to see if something like your issue has been raised before. When making pull requests, please limit yourself to one feature per pull request and to 5 open pull requests at a time. 40 | 41 | Give meaningful descriptions of the changes and additions you have made, in English, on your Git commits and pull requests, referencing related Issues where appropriate. This will aid the project administrator and speed integration of your changes into the master branch. 42 | 43 | Coders should use meaningful English names for classes, methods and variables in their code. English comments in the standard format for each class and function about WHY they do what they do will be appreciated. Coders should keep to the coding conventions (naming, tab, and bracket usage etc.) already used in the project. This will aid and speed the project administrators review of your changes, prior to merging into the master branch. 44 | 45 | Do not reference paid or commercial libraries in the code, we want to be able to keep MM free to distribute and use. -------------------------------------------------------------------------------- /DLLs/7z.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/DLLs/7z.dll -------------------------------------------------------------------------------- /DLLs/7z64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/DLLs/7z64.dll -------------------------------------------------------------------------------- /DLLs/Datamodel.NET.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/DLLs/Datamodel.NET.dll -------------------------------------------------------------------------------- /DLLs/HLLib.x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/DLLs/HLLib.x64.dll -------------------------------------------------------------------------------- /DLLs/HLLib.x86.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/DLLs/HLLib.x86.dll -------------------------------------------------------------------------------- /DLLs/SevenZipSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/DLLs/SevenZipSharp.dll -------------------------------------------------------------------------------- /DLLs/TargaImage.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/DLLs/TargaImage.dll -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MOD MAKER PUBLIC LICENSE 2 | ======================== 3 | 4 | Version 1.0 July 2018 5 | 6 | ### 1. Disclaimers 7 | Application, assets and supporting libraries are supplied as-is without out any garuntees or waranties. Use of this software is at your own risk. 8 | 9 | This app contains links to sites not under the contributors control. The contributors are not responsible for anything on the linked site(s). 10 | 11 | ### 2. No Paid Distribution 12 | No Commercial or paid for Redistribution of the assemblies, assets or source code. Eg don't sell it in a store or charge for CDs containing this software. 13 | You may distribute these assemblies, assets or source code as long as it is free to the reciever. 14 | 15 | ### 3. Share your Wisdom 16 | If you distribute a modified version of this app or library you must publish the modified source code of the released version. 17 | 18 | ### 4. LibModMaker is LGPL3 license 19 | The LibModMaker project and assembly is covered by the more in-deapth and liberal LGPL3 license, see the LICENSE.md included with that project for details. -------------------------------------------------------------------------------- /LibModMaker/CCommentReader.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace LibModMaker 4 | { 5 | 6 | /// 7 | /// Read lines from a texct file stripping out the empty lines and C style comments 8 | /// 9 | /// 10 | public class CCommentReader : StreamReader 11 | { 12 | 13 | public CCommentReader(string FilePath) : base(FilePath) 14 | { 15 | } 16 | 17 | public override string ReadLine() 18 | { 19 | string Result = base.ReadLine(); 20 | 21 | if (Result == null) 22 | return null; 23 | 24 | Result = Result.Trim(); 25 | 26 | if (Result.Length == 0) 27 | { 28 | return ReadLine(); 29 | } 30 | 31 | if (!Result.Contains("//")) 32 | { 33 | return Result; 34 | } 35 | 36 | Result = Result.Substring(0, Result.IndexOf("//")); 37 | Result = Result.Trim(); 38 | 39 | if (Result.Length == 0) 40 | { 41 | return ReadLine(); 42 | } 43 | 44 | return Result; 45 | } 46 | } //end class 47 | 48 | } -------------------------------------------------------------------------------- /LibModMaker/FGDReader.cs: -------------------------------------------------------------------------------- 1 | namespace LibModMaker 2 | { 3 | 4 | /// 5 | /// Read lines from and FGD file stripping out comments 6 | /// 7 | public class FGDReader : CCommentReader 8 | { 9 | 10 | private const char Quote = '"'; 11 | 12 | private const char Plus = '+'; 13 | 14 | private System.Text.StringBuilder Buffer = new System.Text.StringBuilder(); 15 | internal FGDReader(string FilePath) : base(FilePath) 16 | { 17 | } 18 | 19 | public override string ReadLine() 20 | { 21 | string Result = ReadBuffer(); 22 | 23 | if (Result == null) return null; 24 | 25 | Result = Result.Trim(); 26 | 27 | if (Result.Length == 0) return ReadLine(); 28 | 29 | if (!Result.EndsWith(Plus.ToString())) return Result; 30 | 31 | string Peek = ReadBuffer(); 32 | 33 | Peek = Peek.Trim(); 34 | 35 | if (Peek.StartsWith(Quote.ToString())) 36 | { 37 | Result = Result.TrimEnd(Plus).TrimEnd().TrimEnd(Quote) + Peek.Substring(1); 38 | } else { 39 | Result = Result.TrimEnd(Plus).TrimEnd(); 40 | } 41 | 42 | if (Result.Length == 0) 43 | { 44 | Result = Peek; 45 | } else { 46 | Buffer.Append(Peek); 47 | } 48 | 49 | return Result; 50 | } 51 | 52 | protected string ReadBuffer() 53 | { 54 | if (Buffer.Length == 0) 55 | { 56 | return base.ReadLine(); 57 | } 58 | 59 | string result = Buffer.ToString(); 60 | 61 | Buffer.Length = 0; 62 | 63 | return result; 64 | } 65 | } //end class 66 | 67 | } -------------------------------------------------------------------------------- /LibModMaker/KeyValvesParser.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace LibModMaker 4 | { 5 | 6 | /// 7 | /// Helper class for parsing KeyValues files (see KeyValues.cs) 8 | /// 9 | internal class KeyValvesParser 10 | { 11 | protected KeyValuesInnerParser InnerParser = new KeyValuesInnerParser(); 12 | 13 | protected KeyValues Context = null; 14 | 15 | public virtual KeyValues Parse(TextReader Source) 16 | { 17 | InnerParser = new KeyValuesInnerParser(); 18 | InnerParser.ReadKey += InnerParser_ReadKey; 19 | InnerParser.SetCondition += InnerParser_SetCondition; 20 | InnerParser.SetEnd += InnerParser_SetEnd; 21 | InnerParser.SetLastKeyCondition += InnerParser_SetLastKeyCondition; 22 | InnerParser.SetStart += InnerParser_SetStart; 23 | 24 | InnerParser.Parse(Source); 25 | 26 | if (Context == null) 27 | return null; 28 | 29 | KeyValues Result = Context; 30 | 31 | Context = null; 32 | 33 | while (Result.Parent != null) 34 | { 35 | Result = Result.Parent; 36 | } 37 | 38 | return Result; 39 | } 40 | 41 | private void InnerParser_ReadKey(object sender, KeyValuesInnerParser.KeyEventArgs e) 42 | { 43 | KeyValues Key = new KeyValues(e.Key, KeyValues.UnQuote(e.Value), Context); 44 | } 45 | 46 | private void InnerParser_SetCondition(object Sender, KeyValuesInnerParser.SetStartEventArgs e) 47 | { 48 | Context.Condition = e.Key; 49 | } 50 | private void InnerParser_SetLastKeyCondition(object Sender, KeyValuesInnerParser.SetStartEventArgs e) 51 | { 52 | if (Context.Keys.Count == 0) 53 | { 54 | Context.Condition = e.Key; 55 | } 56 | else 57 | { 58 | Context.Keys[Context.Keys.Count - 1].Condition = e.Key; 59 | } 60 | } 61 | 62 | private void InnerParser_SetEnd(object sender, System.EventArgs e) 63 | { 64 | if (Context == null || Context.Parent == null) 65 | return; 66 | 67 | Context = Context.Parent; 68 | } 69 | 70 | private void InnerParser_SetStart(object sender, KeyValuesInnerParser.SetStartEventArgs e) 71 | { 72 | KeyValues Key = new KeyValues(e.Key, Context); 73 | 74 | Context = Key; 75 | } 76 | } //end class 77 | 78 | } -------------------------------------------------------------------------------- /LibModMaker/Lang.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Xml; 5 | using System.IO; 6 | 7 | namespace LibModMaker 8 | { 9 | /// 10 | /// Class to aid localising text at runtime, by loading translation terms from a spreadsheet 11 | /// 12 | public static class Lang 13 | { 14 | /// 15 | /// A dictionary of english terms and their translated equivilents 16 | /// 17 | private static Dictionary Terms; 18 | 19 | /// 20 | /// Load terms and their translations from a spreadsheet 21 | /// 22 | /// path to an exell 2003 format XML docuemnt (see example format at the end of this document) 23 | /// true on success, false on failure 24 | public static bool LoadTerms(string filePath) 25 | { 26 | if (!File.Exists(filePath)) return false; 27 | 28 | var x = new XmlDocument(); 29 | 30 | try 31 | { 32 | x.Load(filePath); 33 | 34 | var Rows = x.GetElementsByTagName("Row"); 35 | Terms = new Dictionary(); 36 | 37 | foreach (XmlNode Row in Rows) 38 | { 39 | if (Row.ChildNodes.Count < 2) continue; 40 | 41 | //ChildNodes of a Row are expected to be Cells and have their own Data child node 42 | string termText = Row.ChildNodes[0].ChildNodes[0].InnerText; 43 | string valueText = Row.ChildNodes[1].ChildNodes[0].InnerText; 44 | 45 | Terms.Add(termText, valueText); 46 | } 47 | } 48 | catch (Exception oops) 49 | { 50 | Debug.WriteLine("Lang.LoadTerms " + filePath); 51 | Debug.WriteLine(oops.GetType().Name); 52 | Debug.WriteLine(oops.Message); 53 | Debug.WriteLine(oops.StackTrace); 54 | 55 | return false; 56 | } 57 | 58 | return true; 59 | } 60 | 61 | /// 62 | /// Translate a given term into the loaded language 63 | /// 64 | /// term to translate 65 | /// text to use if no translation is available, defaults to the empty string 66 | /// the text corrisponding to the given term from the loaded translations 67 | public static string Term(String Term, string Default = "") 68 | { 69 | if (string.IsNullOrEmpty(Term)) return string.Empty; 70 | if (Terms == null) return Default; 71 | if (Terms.ContainsKey(Term)) return Terms[Term]; 72 | 73 | return Default; 74 | } 75 | 76 | /// 77 | /// Translate then format the given term and arguments 78 | /// 79 | /// A term that transaltes to a composite format string 80 | /// An object array that contains zero or more objects to translate and format. 81 | /// A copy of the translated format in which the format items have been translated and replaced by the string representation of the corresponding objects in args. 82 | public static string Format(string FormatTerm, params object[] args) 83 | { 84 | if (string.IsNullOrEmpty(FormatTerm)) return ""; 85 | 86 | //replace any string argements with their translations 87 | int index = -1; 88 | 89 | foreach (object arg in args) 90 | { 91 | index++; 92 | 93 | if (arg.GetType().Name != "String") continue; 94 | 95 | string argString = args[index].ToString(); 96 | 97 | args[index] = Term(argString, argString); 98 | } 99 | 100 | //translate the format term and apply the formatting 101 | return string.Format(Term(FormatTerm, FormatTerm), args); 102 | } 103 | 104 | //Example XML format we're expecting, excell can open and edit files in this format (although it may add more non-essential crap) 105 | /* 106 | 107 | 108 | 113 | 114 | 115 | 116 | 117 | Key Title 118 | 119 | Value Title 120 | 121 | 122 | 123 | Key 124 | 125 | Value 126 | 127 |
128 |
129 |
130 | */ 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /LibModMaker/LibModMaker.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {CB8A16DF-34F8-4103-8DF1-895A9A3E3670} 8 | Library 9 | Properties 10 | LibModMaker 11 | LibModMaker 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | ..\..\ModMaster\LibModMaker\bin\Release\TargaImage.dll 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 86 | -------------------------------------------------------------------------------- /LibModMaker/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("LibModMaker")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("LibModMaker")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("cb8a16df-34f8-4103-8df1-895a9a3e3670")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /LibModMaker/SoundScriptKeyValues.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace LibModMaker 5 | { 6 | 7 | /// 8 | /// Sounds in Source are generally not referenced directly, but via sounds scripts that allows non-programmers to change and configure sounds 9 | /// 10 | public class SoundScriptKeyValues : KeyValues 11 | { 12 | protected override int IndentLevel() 13 | { 14 | return -1; 15 | } 16 | 17 | public static SoundScriptKeyValues Load(string FilePath) 18 | { 19 | if (!File.Exists(FilePath)) 20 | { 21 | return null; 22 | } 23 | 24 | SoundScriptKeyParser Helper = new SoundScriptKeyParser(); 25 | 26 | using (StreamReader SR = File.OpenText(FilePath)) 27 | { 28 | return Helper.Parse(SR) as SoundScriptKeyValues; 29 | } 30 | } 31 | 32 | public override void Save(string FilePath, System.Text.Encoding Encoding = null) 33 | { 34 | if (Encoding == null) 35 | { 36 | Encoding = System.Text.Encoding.Unicode; 37 | } 38 | 39 | using (StreamWriter SR = new StreamWriter(FilePath, false, Encoding)) 40 | { 41 | if (Keys != null && Keys.Count > 0) 42 | { 43 | foreach (var Child in Keys) 44 | { 45 | SR.WriteLine(Child.ToString()); 46 | } 47 | } 48 | 49 | SR.Flush(); 50 | } 51 | } 52 | 53 | private class SoundScriptKeyParser : KeyValvesParser 54 | { 55 | 56 | public override KeyValues Parse(TextReader Source) 57 | { 58 | Context = new SoundScriptKeyValues(); 59 | InnerParser.Parse(Source); 60 | 61 | KeyValues Result = Context; 62 | 63 | Context = null; 64 | 65 | while (Result.Parent != null) 66 | { 67 | Result = Result.Parent; 68 | } 69 | 70 | return Result; 71 | } 72 | } 73 | } //End class 74 | 75 | } -------------------------------------------------------------------------------- /LibModMaker/SourceMod.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Diagnostics; 5 | 6 | namespace LibModMaker 7 | { 8 | /// 9 | /// Represtenation of a mod running on the Source engine game 10 | /// 11 | public class SourceMod : SourceGame 12 | { 13 | public SourceMod() : base() 14 | { 15 | } 16 | 17 | public SourceMod(string GamePath) 18 | { 19 | InstallPath = SourceFileSystem.FormatFolderPath(GamePath); 20 | _GameInfo = KeyValues.LoadFile(GameInfoPath); 21 | } 22 | 23 | public override int AppId 24 | { 25 | get 26 | { 27 | return (_GameInfo["FileSystem"]).GetInt("SteamAppId", (_GameInfo["FileSystem"]).GetInt("AppId", 218)); 28 | } 29 | } 30 | 31 | public override void Play(string Arguments = "") 32 | { 33 | Process.Start(Steam.ExePath, 34 | string.Format("-applaunch {0} -game \"{1}\" {2}", AppId, InstallPath, Arguments)); 35 | } 36 | 37 | 38 | protected override string GetSDKPath(string RootFolder, string SDKVersion) 39 | { 40 | string Result = RootFolder; 41 | Dictionary Apps = Steam.InstalledApps(); 42 | string AppPath = Steam.AppPath(ToolsAppId); 43 | 44 | switch (SDKVersion) 45 | { 46 | case "2": 47 | case "3": 48 | case "4": 49 | case "5": 50 | // classic SDK 51 | if (AppPath == null) 52 | AppPath = Environment.GetEnvironmentVariable("sourcesdk"); 53 | //fallback to the env var 54 | if (AppPath == null) 55 | AppPath = RootFolder; 56 | //Fail! Fallback! 57 | 58 | Result = Path.Combine(AppPath, "bin"); 59 | 60 | switch (SDKVersion) 61 | { 62 | case "2": 63 | Result = Path.Combine(Result, "ep1"); 64 | break; 65 | case "3": 66 | Result = Path.Combine(Result, "source2007"); break; 67 | case "4": 68 | Result = Path.Combine(Result, "source2009"); break; 69 | case "5": 70 | Result = Path.Combine(Result, "orangebox"); break; 71 | } 72 | break; 73 | case "6": 74 | //base 2013 SP 75 | 76 | Result = AppPath; 77 | break; 78 | //If Result Is Nothing Then Result = Path.Combine(Result, "Source SDK Base 2013 Singleplayer") 79 | case "7": 80 | //base 2013 MP 81 | 82 | Result = AppPath; 83 | break; 84 | //If Result Is Nothing Then Result = Path.Combine(Result, "Source SDK Base 2013 Multiplayer") 85 | } 86 | 87 | if (Result == null) 88 | { 89 | return RootFolder; 90 | } 91 | 92 | //Fail! Fallback! 93 | 94 | Result = Path.Combine(Result, "bin"); 95 | 96 | return Result; 97 | } 98 | 99 | }//end class 100 | 101 | } -------------------------------------------------------------------------------- /LibModMaker/ValveCommentStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace LibModMaker 5 | { 6 | /// 7 | /// A text stream filter that strips out C style comments 8 | /// 9 | internal class ValveCommentStream 10 | { 11 | 12 | protected TextReader Source; 13 | public ValveCommentStream(TextReader source) 14 | { 15 | Source = source; 16 | } 17 | 18 | public string ReadLine() 19 | { 20 | string buffer = Source.ReadLine(); 21 | 22 | if (buffer == null) 23 | { 24 | return null; 25 | } 26 | 27 | while (buffer.TrimStart().StartsWith("//")) 28 | { 29 | buffer = Source.ReadLine(); 30 | 31 | if (buffer == null) 32 | { 33 | return null; 34 | } 35 | } 36 | 37 | int commentIndex = buffer.IndexOf("//", StringComparison.InvariantCultureIgnoreCase); 38 | 39 | if (commentIndex > -1) 40 | { 41 | //looks like a C comment, but may be inside a quoted string 42 | bool IsQuoted = false; 43 | 44 | char[] bufferChars = buffer.ToCharArray(); 45 | 46 | for (int I = 0; I <= commentIndex; I++) 47 | { 48 | if (bufferChars[I] == '"') 49 | { 50 | IsQuoted = !IsQuoted; 51 | } 52 | } 53 | 54 | if (!IsQuoted) 55 | { 56 | buffer = buffer.Substring(0, commentIndex); 57 | } 58 | } 59 | 60 | return buffer; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /LibModMaker/WeaponManifest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace LibModMaker 6 | { 7 | /// 8 | /// Helper for working with the Source game engine's weapons manifest 9 | /// 10 | public class WeaponManifest : Dictionary 11 | { 12 | 13 | public SourceMod Game { get; set; } 14 | 15 | private SourceFileSystem SFS = null; 16 | 17 | protected string ManifestFilePath { 18 | get { 19 | if (Game == null) 20 | return null; 21 | 22 | return Path.Combine(Path.Combine(Game.InstallPath, "scripts"), "weapon_manifest.txt"); 23 | } 24 | } 25 | 26 | public WeaponManifest(SourceMod Game) 27 | { 28 | this.Game = Game; 29 | 30 | SFS = new SourceFileSystem(Game); 31 | 32 | PrepareFile("scripts/weapon_manifest.txt"); 33 | 34 | if (LoadFile(ManifestFilePath)) 35 | return; 36 | 37 | LoadFolder(); 38 | } 39 | 40 | public bool LoadFile(string FilePath) 41 | { 42 | KeyValues Manifest = KeyValues.LoadFile(FilePath); 43 | 44 | if (Manifest == null) return false; 45 | 46 | string ScriptPath; 47 | 48 | foreach (KeyValues WeaponKey in Manifest.Keys) { 49 | PrepareFile(WeaponKey.Value); 50 | ScriptPath = Path.Combine(Game.InstallPath, WeaponKey.Value); 51 | Add(ScriptPath, KeyValues.LoadFile(ScriptPath)); 52 | } 53 | 54 | return Count > 0; 55 | } 56 | 57 | private void PrepareFile(string relativeFilePath) 58 | { 59 | if (File.Exists(Path.Combine(Game.InstallPath, String.Format(relativeFilePath)))) return; 60 | 61 | if (SFS.Contains(relativeFilePath)) 62 | { 63 | SFS.Extract(relativeFilePath, Game.InstallPath); 64 | } 65 | } 66 | 67 | public void LoadFolder() 68 | { 69 | string[] WeaponScripts = Directory.GetFiles(Path.Combine(Game.InstallPath, "scripts"), "weapon_*.txt"); 70 | 71 | foreach (string WeaponScript in WeaponScripts) { 72 | if (SourceFileSystem.IsBackupFile(WeaponScript)) 73 | continue; 74 | 75 | KeyValues WeaponKey = KeyValues.LoadFile(WeaponScript); 76 | 77 | if (WeaponKey == null) 78 | continue; 79 | 80 | Add(WeaponScript, WeaponKey); 81 | } 82 | } 83 | 84 | public void Save() 85 | { 86 | KeyValues Result = new KeyValues("weapon_manifest"); 87 | 88 | foreach (string FilePath in this.Keys) { 89 | KeyValues FileEntry = new KeyValues("file", FilePath.Substring(Game.InstallPath.Length), Result); 90 | } 91 | 92 | Result.Save(ManifestFilePath); 93 | } 94 | }//end class 95 | } -------------------------------------------------------------------------------- /LibModMaker/WeaponScript.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace LibModMaker 4 | { 5 | /// 6 | /// Helper class for working with weapon scripts, that allows non-programmers to control the assets and behaviour of Source weapons 7 | /// 8 | public class WeaponScript 9 | { 10 | public SourceMod Game { get; set; } 11 | public string Name { get; set; } 12 | 13 | 14 | private LibModMaker.SoundManifest Manifest = null; 15 | public enum item_flag 16 | { 17 | SELECTONEMPTY = 1, 18 | NOAUTORELOAD = 2, 19 | NOAUTOSWITCHEMPTY = 4, 20 | LIMITINWORLD = 8, 21 | EXHAUSTIBLE = 16, 22 | DOHITLOCATIONDMG = 32, 23 | NOAMMOPICKUPS = 64, 24 | NOITEMPICKUP = 128 25 | } 26 | 27 | 28 | public static string[] AmmoTypes = { "None","357","AR2","AR2AltFire","Buckshot","Grenade","Pistol","RPG_Round","slam","SMG1","SMG1_Grenade","XBowBolt" }; 29 | public WeaponScript(SourceMod Game) 30 | { 31 | this.Game = Game; 32 | Manifest = new SoundManifest(Game); 33 | Manifest.Load(); 34 | } 35 | 36 | public string GetSoundWav(KeyValues WeaponScript, string KeyName) 37 | { 38 | if (WeaponScript == null) 39 | return string.Empty; 40 | if (string.IsNullOrEmpty(KeyName)) 41 | return string.Empty; 42 | 43 | string SoundScript = WeaponScript.GetString(KeyName); 44 | 45 | if (SoundScript.Length == 0) 46 | return string.Empty; 47 | 48 | return Manifest.GetWavPathByScriptName(SoundScript); 49 | } 50 | 51 | public void SetSoundKey(KeyValues SoundData, string KeyName, string WavFile) 52 | { 53 | if (string.IsNullOrEmpty(WavFile)) 54 | return; 55 | 56 | //Lookup a script sound using the WAV file we picked 57 | string ScriptName = Manifest.GetScriptNameByWavPath(WavFile); 58 | 59 | //if there isn't one we need to create it 60 | if (ScriptName == null) { 61 | //not scripted , add to "game_sounds_weapons.txt" 62 | string ScriptFileName = "game_sounds_weapons.txt"; 63 | //of somehow it's not in the manifest add it 64 | if (!Manifest.SoundScriptFiles.ContainsKey(ScriptFileName)) { 65 | Manifest.SoundScriptFiles.Add(ScriptFileName, new SoundScriptKeyValues()); 66 | Manifest.Manifest.SetValue(ScriptFileName, "1"); 67 | Manifest.Manifest.Save(Manifest.ManifestPath); 68 | } 69 | 70 | //create the script entry 71 | SoundScriptKeyValues SoundScriptFile = Manifest.SoundScriptFiles[ScriptFileName]; 72 | 73 | ScriptName = string.Format("{0}.{1}", Name, KeyName); 74 | 75 | KeyValues Script = new KeyValues(ScriptName, SoundScriptFile); 76 | 77 | Script.SetValue("channel", "CHAN_AUTO"); 78 | Script.SetValue("volume", "VOL_NORM"); 79 | Script.SetValue("soundlevel", "SNDLVL_NORM"); 80 | Script.SetValue("pitch", "PITCH_NORM"); 81 | Script.SetValue("wave", WavFile); 82 | 83 | Manifest.BackUpFile(ScriptFileName); 84 | SoundScriptFile.Save(ScriptFileName); 85 | } 86 | 87 | KeyValues Result = new KeyValues(KeyName, ScriptName, SoundData); 88 | } 89 | 90 | public KeyValues MakeWeapon(string Name) 91 | { 92 | KeyValues Result = new KeyValues("WeaponData"); 93 | 94 | Result.SetValue("printname", string.Format("#{0}{1}", Game.InstallFolder, Name.ToUpper())); 95 | Result.SetValue("viewmodel", string.Format("weapons/v_{0}.mdl", Name)); 96 | Result.SetValue("playermodel", string.Format("weapons/p_{0}.mdl", Name)); 97 | Result.SetValue("anim_prefix", Name); 98 | 99 | KeyValues SoundData = new KeyValues("SoundData", Result); 100 | KeyValues TextureData = new KeyValues("TextureData", Result); 101 | 102 | return Result; 103 | } 104 | 105 | //for some bizzare reason kill icons are scripted in "scripts/mod_textures.txt" not in the weapon scripts 106 | public void SetDeathTexture(string WeaponName, KeyValues TextureData) 107 | { 108 | string mod_texturesFilePath = Path.Combine(Game.InstallPath, "scripts/mod_textures.txt"); 109 | KeyValues mod_textures = KeyValues.LoadFile(mod_texturesFilePath); 110 | 111 | if (mod_textures == null) 112 | mod_textures = new KeyValues("sprites/640_hud"); 113 | 114 | KeyValues ModTextureData = mod_textures.GetKey("TextureData"); 115 | 116 | if (ModTextureData == null) { 117 | ModTextureData = new KeyValues("TextureData"); 118 | mod_textures["TextureData"] = ModTextureData; 119 | } 120 | 121 | KeyValues CurrentTexture = ModTextureData.GetKey("death_" + WeaponName); 122 | 123 | if (CurrentTexture != null) 124 | TextureData.Keys.Remove(CurrentTexture); 125 | 126 | TextureData["death_" + WeaponName] = TextureData; 127 | 128 | SourceFileSystem.BackUpFile(mod_texturesFilePath); 129 | mod_textures.Save(mod_texturesFilePath); 130 | } 131 | } //end class 132 | } -------------------------------------------------------------------------------- /LibModMaker/iFileSystem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace LibModMaker 6 | { 7 | public struct FileSystemInfo 8 | { 9 | public string Path; 10 | public string Mount; 11 | public ulong Size; 12 | public bool IsFolder; 13 | } 14 | 15 | /// 16 | /// Interface for virtual file system components used in Source games (loose files, GCFs, VPKS) 17 | /// 18 | internal interface iFileSystem 19 | { 20 | bool Contains(string path); 21 | bool Extract(string path, string folderPath); 22 | List Listing(); 23 | ulong GetSize(string path); 24 | FileSystemInfo GetInfo(string path); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /LibModMaker/test.xls: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
KeyValue
KeyValue
14 | 15 | 16 | -------------------------------------------------------------------------------- /ModMaker.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModMaker", "ModMaker\ModMaker.csproj", "{E3BD9110-0662-4E6F-9BA6-0C61C3DCA0CF}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibModMaker", "LibModMaker\LibModMaker.csproj", "{CB8A16DF-34F8-4103-8DF1-895A9A3E3670}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModMakerTests", "ModMakerTests\ModMakerTests.csproj", "{FDF4E7BC-14CB-48FB-8E41-CBFBE88A705F}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "warHammer", "warHammer\warHammer.csproj", "{57882540-E235-4360-A36E-AA81FDC5C8B3}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {E3BD9110-0662-4E6F-9BA6-0C61C3DCA0CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {E3BD9110-0662-4E6F-9BA6-0C61C3DCA0CF}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {E3BD9110-0662-4E6F-9BA6-0C61C3DCA0CF}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {E3BD9110-0662-4E6F-9BA6-0C61C3DCA0CF}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {CB8A16DF-34F8-4103-8DF1-895A9A3E3670}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {CB8A16DF-34F8-4103-8DF1-895A9A3E3670}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {CB8A16DF-34F8-4103-8DF1-895A9A3E3670}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {CB8A16DF-34F8-4103-8DF1-895A9A3E3670}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {FDF4E7BC-14CB-48FB-8E41-CBFBE88A705F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {FDF4E7BC-14CB-48FB-8E41-CBFBE88A705F}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {FDF4E7BC-14CB-48FB-8E41-CBFBE88A705F}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {FDF4E7BC-14CB-48FB-8E41-CBFBE88A705F}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {57882540-E235-4360-A36E-AA81FDC5C8B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {57882540-E235-4360-A36E-AA81FDC5C8B3}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {57882540-E235-4360-A36E-AA81FDC5C8B3}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {57882540-E235-4360-A36E-AA81FDC5C8B3}.Release|Any CPU.Build.0 = Release|Any CPU 36 | EndGlobalSection 37 | GlobalSection(SolutionProperties) = preSolution 38 | HideSolutionNode = FALSE 39 | EndGlobalSection 40 | EndGlobal 41 | -------------------------------------------------------------------------------- /ModMaker/7z.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/7z.dll -------------------------------------------------------------------------------- /ModMaker/7z64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/7z64.dll -------------------------------------------------------------------------------- /ModMaker/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ModMaker/Controls/FGD/FGD_ChoicesControl.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.Windows.Forms; 4 | using Microsoft.VisualBasic; 5 | 6 | namespace ModMaker 7 | { 8 | /// 9 | /// Provide the mapper with a dropdown list of choices for an enity property 10 | /// 11 | /// 12 | /// Part of the MM FGD editor 13 | /// 14 | public partial class FGD_ChoicesControl 15 | { 16 | 17 | private ForgeGameData.ChoicesProperty _Choices; 18 | public event OnDeleteEventHandler OnDelete; 19 | 20 | public delegate void OnDeleteEventHandler(object sender, String Name); 21 | 22 | public ForgeGameData.ChoicesProperty ChoicesProperty 23 | { 24 | get 25 | { 26 | _Choices._Name = txtClassName.Text; 27 | _Choices.LabelText = txtNotes.Text; 28 | 29 | if(cboOptions.SelectedItem != null) 30 | { 31 | foreach (string X in _Choices.choices.Keys) 32 | { 33 | if (_Choices.choices[X] == cboOptions.SelectedItem.ToString()) 34 | { 35 | _Choices.DefaultValue = X; 36 | 37 | break; // TODO: might not be correct. Was : Exit For 38 | } 39 | } 40 | } 41 | 42 | return _Choices; 43 | } 44 | set 45 | { 46 | _Choices = value; 47 | 48 | if (value == null) 49 | return; 50 | 51 | txtClassName.Text = _Choices._Name; 52 | txtNotes.Text = _Choices.LabelText; 53 | RefreshOptionList(); 54 | cboOptions.SelectedValue = _Choices.DefaultValue; 55 | } 56 | } 57 | 58 | public bool IsReadOnly 59 | { 60 | get { return !txtClassName.Enabled; } 61 | set 62 | { 63 | txtClassName.Enabled = !value; 64 | txtNotes.Enabled = !value; 65 | btnManageOptions.Enabled = !value; 66 | lblChoices.Enabled = !value; 67 | 68 | txtClassName.BorderStyle = value ? BorderStyle.None : BorderStyle.Fixed3D; 69 | txtNotes.BorderStyle = value ? BorderStyle.None : BorderStyle.Fixed3D; 70 | btnDelete.Visible = !value; 71 | } 72 | } 73 | 74 | public FGD_ChoicesControl() 75 | { 76 | // This call is required by the designer. 77 | InitializeComponent(); 78 | 79 | // Add any initialization after the InitializeComponent() call. 80 | } 81 | 82 | public FGD_ChoicesControl(ForgeGameData.ChoicesProperty BaseProperty) 83 | { 84 | InitializeComponent(); 85 | 86 | this.Name = BaseProperty._Name; 87 | this.ChoicesProperty = BaseProperty; 88 | } 89 | 90 | void RefreshOptionList() 91 | { 92 | int Index = 0; 93 | int DefaultIndex = -1; 94 | 95 | cboOptions.Items.Clear(); 96 | 97 | foreach (string Value in _Choices.choices.Keys) 98 | { 99 | if (Value == _Choices.DefaultValue) 100 | DefaultIndex = Index; 101 | 102 | Index += 1; 103 | cboOptions.Items.Add(_Choices.choices[Value]); 104 | } 105 | 106 | cboOptions.SelectedIndex = DefaultIndex; 107 | } 108 | 109 | private void btnManageOptions_Click(System.Object sender, System.EventArgs e) 110 | { 111 | FGDChoicesForm Dialog = new FGDChoicesForm(); 112 | 113 | Dialog.ChoicesProperty = _Choices; 114 | 115 | if (Dialog.ShowDialog() == DialogResult.Cancel) 116 | return; 117 | 118 | ChoicesProperty = Dialog.ChoicesProperty; 119 | } 120 | 121 | 122 | private void btnDelete_Click(System.Object sender, System.EventArgs e) 123 | { 124 | if ( 125 | Interaction.MsgBox("Delete the property " + _Choices.Name + "?", MsgBoxStyle.Question & MsgBoxStyle.YesNo, 126 | "Delete Property?") != MsgBoxResult.Yes) 127 | return; 128 | 129 | if (OnDelete != null) 130 | { 131 | OnDelete(this, _Choices.Name); 132 | } 133 | } 134 | } 135 | 136 | } -------------------------------------------------------------------------------- /ModMaker/Controls/FGD/FGD_FlagControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ModMaker 2 | { 3 | 4 | [Microsoft.VisualBasic.CompilerServices.DesignerGenerated()] 5 | partial class FGD_FlagControl : System.Windows.Forms.UserControl 6 | { 7 | 8 | //UserControl overrides dispose to clean up the component list. 9 | [System.Diagnostics.DebuggerNonUserCode()] 10 | protected override void Dispose(bool disposing) 11 | { 12 | try 13 | { 14 | if (disposing && components != null) 15 | { 16 | components.Dispose(); 17 | } 18 | } 19 | finally 20 | { 21 | base.Dispose(disposing); 22 | } 23 | } 24 | 25 | //Required by the Windows Form Designer 26 | 27 | private System.ComponentModel.IContainer components; 28 | //NOTE: The following procedure is required by the Windows Form Designer 29 | //It can be modified using the Windows Form Designer. 30 | //Do not modify it using the code editor. 31 | [System.Diagnostics.DebuggerStepThrough()] 32 | private void InitializeComponent() 33 | { 34 | this.numValue = new System.Windows.Forms.NumericUpDown(); 35 | this.chkDefault = new System.Windows.Forms.CheckBox(); 36 | this.txtLabel = new System.Windows.Forms.TextBox(); 37 | this.btnDelete = new System.Windows.Forms.Button(); 38 | ((System.ComponentModel.ISupportInitialize)(this.numValue)).BeginInit(); 39 | this.SuspendLayout(); 40 | // 41 | // numValue 42 | // 43 | this.numValue.Location = new System.Drawing.Point(1, 1); 44 | this.numValue.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 45 | this.numValue.Maximum = new decimal(new int[] { 46 | 1048576, 47 | 0, 48 | 0, 49 | 0}); 50 | this.numValue.Name = "numValue"; 51 | this.numValue.Size = new System.Drawing.Size(60, 20); 52 | this.numValue.TabIndex = 0; 53 | // 54 | // chkDefault 55 | // 56 | this.chkDefault.AutoSize = true; 57 | this.chkDefault.Location = new System.Drawing.Point(84, 3); 58 | this.chkDefault.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 59 | this.chkDefault.Name = "chkDefault"; 60 | this.chkDefault.Size = new System.Drawing.Size(15, 14); 61 | this.chkDefault.TabIndex = 1; 62 | this.chkDefault.UseVisualStyleBackColor = true; 63 | // 64 | // txtLabel 65 | // 66 | this.txtLabel.Location = new System.Drawing.Point(118, 2); 67 | this.txtLabel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 68 | this.txtLabel.Name = "txtLabel"; 69 | this.txtLabel.Size = new System.Drawing.Size(254, 20); 70 | this.txtLabel.TabIndex = 2; 71 | // 72 | // btnDelete 73 | // 74 | this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Popup; 75 | this.btnDelete.Font = new System.Drawing.Font("Lucida Console", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 76 | this.btnDelete.Location = new System.Drawing.Point(373, 2); 77 | this.btnDelete.Margin = new System.Windows.Forms.Padding(1); 78 | this.btnDelete.Name = "btnDelete"; 79 | this.btnDelete.Size = new System.Drawing.Size(17, 19); 80 | this.btnDelete.TabIndex = 5; 81 | this.btnDelete.Text = "X"; 82 | this.btnDelete.TextAlign = System.Drawing.ContentAlignment.BottomCenter; 83 | this.btnDelete.UseVisualStyleBackColor = true; 84 | this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); 85 | // 86 | // FGD_FlagControl 87 | // 88 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 89 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 90 | this.Controls.Add(this.btnDelete); 91 | this.Controls.Add(this.txtLabel); 92 | this.Controls.Add(this.chkDefault); 93 | this.Controls.Add(this.numValue); 94 | this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 95 | this.Name = "FGD_FlagControl"; 96 | this.Size = new System.Drawing.Size(395, 21); 97 | ((System.ComponentModel.ISupportInitialize)(this.numValue)).EndInit(); 98 | this.ResumeLayout(false); 99 | this.PerformLayout(); 100 | 101 | } 102 | 103 | internal System.Windows.Forms.NumericUpDown numValue; 104 | internal System.Windows.Forms.CheckBox chkDefault; 105 | internal System.Windows.Forms.TextBox txtLabel; 106 | 107 | internal System.Windows.Forms.Button btnDelete; 108 | } 109 | 110 | } -------------------------------------------------------------------------------- /ModMaker/Controls/FGD/FGD_FlagControl.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using Microsoft.VisualBasic; 4 | 5 | namespace ModMaker 6 | { 7 | /// 8 | /// Provide the mapper with a checkbox to toggle a flag on an enity 9 | /// 10 | /// 11 | /// Part of the MM FGD editor 12 | /// 13 | public partial class FGD_FlagControl 14 | { 15 | 16 | private ForgeGameData.SpawnFlag _Flag; 17 | public event OnDeleteEventHandler OnDelete; 18 | 19 | public delegate void OnDeleteEventHandler(object sender, String Name); 20 | 21 | public FGD_FlagControl() 22 | { 23 | InitializeComponent(); 24 | } 25 | 26 | public ForgeGameData.SpawnFlag Flag 27 | { 28 | get 29 | { 30 | _Flag.BitFlags = (int) numValue.Value; 31 | _Flag.DefaultSetting = chkDefault.Checked; 32 | _Flag.Name = txtLabel.Text; 33 | return _Flag; 34 | } 35 | set 36 | { 37 | _Flag = value; 38 | 39 | if (value == null) 40 | { 41 | return; 42 | } 43 | 44 | numValue.Value = _Flag.BitFlags; 45 | chkDefault.Checked = _Flag.DefaultSetting; 46 | txtLabel.Text = _Flag.Name; 47 | } 48 | } 49 | 50 | public bool IsReadOnly 51 | { 52 | get { return txtLabel.ReadOnly; } 53 | set 54 | { 55 | txtLabel.ReadOnly = value; 56 | numValue.ReadOnly = value; 57 | chkDefault.Enabled = !value; 58 | btnDelete.Visible = !value; 59 | } 60 | } 61 | 62 | private void btnDelete_Click(System.Object sender, System.EventArgs e) 63 | { 64 | if ( 65 | Interaction.MsgBox("Delete the flag " + _Flag.Name + "?", MsgBoxStyle.Question & MsgBoxStyle.YesNo, "Delete Flag?") != 66 | MsgBoxResult.Yes) 67 | return; 68 | 69 | if (OnDelete != null) 70 | { 71 | OnDelete(this, _Flag.Name); 72 | } 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /ModMaker/Controls/FGD/FGD_IOControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ModMaker 2 | { 3 | 4 | 5 | [Microsoft.VisualBasic.CompilerServices.DesignerGenerated()] 6 | partial class FGD_IOControl : System.Windows.Forms.UserControl 7 | { 8 | 9 | //UserControl overrides dispose to clean up the component list. 10 | [System.Diagnostics.DebuggerNonUserCode()] 11 | protected override void Dispose(bool disposing) 12 | { 13 | try 14 | { 15 | if (disposing && components != null) 16 | { 17 | components.Dispose(); 18 | } 19 | } 20 | finally 21 | { 22 | base.Dispose(disposing); 23 | } 24 | } 25 | 26 | //Required by the Windows Form Designer 27 | 28 | private System.ComponentModel.IContainer components; 29 | //NOTE: The following procedure is required by the Windows Form Designer 30 | //It can be modified using the Windows Form Designer. 31 | //Do not modify it using the code editor. 32 | [System.Diagnostics.DebuggerStepThrough()] 33 | private void InitializeComponent() 34 | { 35 | this.txtName = new System.Windows.Forms.TextBox(); 36 | this.cboDataType = new System.Windows.Forms.ComboBox(); 37 | this.txtNotes = new System.Windows.Forms.TextBox(); 38 | this.btnDelete = new System.Windows.Forms.Button(); 39 | this.SuspendLayout(); 40 | // 41 | // txtName 42 | // 43 | this.txtName.Location = new System.Drawing.Point(0, 2); 44 | this.txtName.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 45 | this.txtName.Name = "txtName"; 46 | this.txtName.Size = new System.Drawing.Size(114, 20); 47 | this.txtName.TabIndex = 0; 48 | // 49 | // cboDataType 50 | // 51 | this.cboDataType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 52 | this.cboDataType.FormattingEnabled = true; 53 | this.cboDataType.Items.AddRange(new object[] { 54 | "void", 55 | "string", 56 | "integer", 57 | "float", 58 | "color255", 59 | "angle", 60 | "origin", 61 | "studio", 62 | "target_source", 63 | "target_destination", 64 | "node_dest", 65 | "filterclass", 66 | "sound", 67 | "material", 68 | "sprite", 69 | "sidelist", 70 | "vector", 71 | "decal", 72 | "vecline", 73 | "axis"}); 74 | this.cboDataType.Location = new System.Drawing.Point(114, 1); 75 | this.cboDataType.Name = "cboDataType"; 76 | this.cboDataType.Size = new System.Drawing.Size(100, 21); 77 | this.cboDataType.TabIndex = 3; 78 | // 79 | // txtNotes 80 | // 81 | this.txtNotes.Location = new System.Drawing.Point(214, 2); 82 | this.txtNotes.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 83 | this.txtNotes.Name = "txtNotes"; 84 | this.txtNotes.Size = new System.Drawing.Size(160, 20); 85 | this.txtNotes.TabIndex = 4; 86 | // 87 | // btnDelete 88 | // 89 | this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Popup; 90 | this.btnDelete.Font = new System.Drawing.Font("Lucida Console", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 91 | this.btnDelete.Location = new System.Drawing.Point(374, 1); 92 | this.btnDelete.Margin = new System.Windows.Forms.Padding(1); 93 | this.btnDelete.Name = "btnDelete"; 94 | this.btnDelete.Size = new System.Drawing.Size(17, 19); 95 | this.btnDelete.TabIndex = 5; 96 | this.btnDelete.Text = "X"; 97 | this.btnDelete.TextAlign = System.Drawing.ContentAlignment.BottomCenter; 98 | this.btnDelete.UseVisualStyleBackColor = true; 99 | this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); 100 | // 101 | // FGD_IOControl 102 | // 103 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 104 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 105 | this.Controls.Add(this.btnDelete); 106 | this.Controls.Add(this.txtNotes); 107 | this.Controls.Add(this.cboDataType); 108 | this.Controls.Add(this.txtName); 109 | this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 110 | this.Name = "FGD_IOControl"; 111 | this.Size = new System.Drawing.Size(394, 21); 112 | this.ResumeLayout(false); 113 | this.PerformLayout(); 114 | 115 | } 116 | 117 | internal System.Windows.Forms.TextBox txtName; 118 | internal System.Windows.Forms.ComboBox cboDataType; 119 | internal System.Windows.Forms.TextBox txtNotes; 120 | 121 | internal System.Windows.Forms.Button btnDelete; 122 | } 123 | 124 | } -------------------------------------------------------------------------------- /ModMaker/Controls/FGD/FGD_IOControl.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using Microsoft.VisualBasic; 4 | 5 | 6 | namespace ModMaker 7 | { 8 | 9 | /// 10 | /// Provide the mapper with a control to define inputs or outputs from and enity 11 | /// 12 | /// 13 | /// Part of the MM FGD editor 14 | /// 15 | public partial class FGD_IOControl 16 | { 17 | 18 | private ForgeGameData.IOConnector _Connector; 19 | public event OnDeleteEventHandler OnDelete; 20 | 21 | public delegate void OnDeleteEventHandler(object sender, String Name); 22 | 23 | public FGD_IOControl() 24 | { 25 | InitializeComponent(); 26 | } 27 | 28 | public ForgeGameData.IOConnector Connector 29 | { 30 | get 31 | { 32 | _Connector.Name = txtName.Text; 33 | _Connector.DataType = cboDataType.SelectedItem.ToString(); 34 | _Connector.Notes = txtNotes.Text; 35 | 36 | return _Connector; 37 | } 38 | set 39 | { 40 | _Connector = value; 41 | 42 | 43 | if (value == null) 44 | { 45 | return; 46 | } 47 | 48 | txtName.Text = _Connector.Name; 49 | cboDataType.SelectedItem = _Connector.DataType; 50 | txtNotes.Text = _Connector.Notes; 51 | } 52 | } 53 | 54 | public bool IsReadonly 55 | { 56 | get { return txtName.ReadOnly; } 57 | set 58 | { 59 | txtName.ReadOnly = value; 60 | txtNotes.ReadOnly = value; 61 | cboDataType.Enabled = !value; 62 | btnDelete.Visible = !value; 63 | } 64 | } 65 | 66 | private void btnDelete_Click(System.Object sender, System.EventArgs e) 67 | { 68 | if ( 69 | Interaction.MsgBox(string.Format("Delete the {0} {1}?", _Connector.IsInput ? "input" : "output", _Connector.Name), 70 | MsgBoxStyle.Question & MsgBoxStyle.YesNo, 71 | string.Format("Delete {0}?", _Connector.IsInput ? "input" : "output")) != MsgBoxResult.Yes) 72 | return; 73 | 74 | if (OnDelete != null) 75 | { 76 | OnDelete(this, _Connector.Name); 77 | } 78 | } 79 | } 80 | 81 | } -------------------------------------------------------------------------------- /ModMaker/Controls/FGD/FGD_PropertyControl.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.Windows.Forms; 4 | using Microsoft.VisualBasic; 5 | 6 | namespace ModMaker 7 | { 8 | 9 | /// 10 | /// Provide the mapper with an editor for a generic enity property 11 | /// 12 | /// 13 | /// Part of the MM FGD editor 14 | /// 15 | public partial class FGD_PropertyControl 16 | { 17 | 18 | private ForgeGameData.BaseProperty _BaseProperty; 19 | public event OnDeleteEventHandler OnDelete; 20 | 21 | public delegate void OnDeleteEventHandler(object sender, String Name); 22 | 23 | public ForgeGameData.BaseProperty BaseProperty 24 | { 25 | get 26 | { 27 | _BaseProperty._Name = txtClassName.Text; 28 | _BaseProperty.DefaultValue = txtDefault.Text; 29 | _BaseProperty.LabelText = txtNotes.Text; 30 | 31 | if(cboDataType.SelectedItem == null) 32 | { 33 | if(_BaseProperty._Name == "spawnflags") 34 | { 35 | _BaseProperty.DataType = "flags"; 36 | } else 37 | { 38 | _BaseProperty.DataType = "string"; 39 | } 40 | } else 41 | { 42 | _BaseProperty.DataType = cboDataType.SelectedItem.ToString(); 43 | } 44 | 45 | 46 | return _BaseProperty; 47 | } 48 | set 49 | { 50 | _BaseProperty = value; 51 | 52 | if (value == null) 53 | return; 54 | 55 | txtClassName.Text = _BaseProperty._Name; 56 | txtDefault.Text = _BaseProperty.DefaultValue; 57 | txtNotes.Text = _BaseProperty.LabelText; 58 | cboDataType.SelectedItem = _BaseProperty.DataType; 59 | } 60 | } 61 | 62 | public bool IsReadOnly 63 | { 64 | get { return !txtClassName.Enabled; } 65 | set 66 | { 67 | txtClassName.Enabled = !value; 68 | txtDefault.Enabled = !value; 69 | txtNotes.Enabled = !value; 70 | cboDataType.Enabled = !value; 71 | 72 | txtClassName.BorderStyle = value ? BorderStyle.None : BorderStyle.Fixed3D; 73 | txtDefault.BorderStyle = value ? BorderStyle.None : BorderStyle.Fixed3D; 74 | txtNotes.BorderStyle = value ? BorderStyle.None : BorderStyle.Fixed3D; 75 | btnDelete.Visible = !value; 76 | } 77 | } 78 | 79 | public FGD_PropertyControl() 80 | { 81 | // This call is required by the designer. 82 | InitializeComponent(); 83 | 84 | // Add any initialization after the InitializeComponent() call. 85 | } 86 | 87 | public FGD_PropertyControl(ForgeGameData.BaseProperty BaseProperty) 88 | { 89 | InitializeComponent(); 90 | 91 | this.Name = BaseProperty._Name; 92 | this.BaseProperty = BaseProperty; 93 | } 94 | 95 | private void btnDelete_Click(System.Object sender, System.EventArgs e) 96 | { 97 | if ( 98 | Interaction.MsgBox("Delete the property " + BaseProperty.Name + "?", MsgBoxStyle.Question & MsgBoxStyle.YesNo, 99 | "Delete Property?") != MsgBoxResult.Yes) 100 | return; 101 | 102 | if (OnDelete != null) 103 | { 104 | OnDelete(this, BaseProperty.Name); 105 | } 106 | } 107 | } 108 | 109 | } -------------------------------------------------------------------------------- /ModMaker/Controls/FGD/FGD_WidgetControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ModMaker 2 | { 3 | 4 | 5 | [Microsoft.VisualBasic.CompilerServices.DesignerGenerated()] 6 | partial class FGD_WidgetControl : System.Windows.Forms.UserControl 7 | { 8 | 9 | //UserControl overrides dispose to clean up the component list. 10 | [System.Diagnostics.DebuggerNonUserCode()] 11 | protected override void Dispose(bool disposing) 12 | { 13 | try 14 | { 15 | if (disposing && components != null) 16 | { 17 | components.Dispose(); 18 | } 19 | } 20 | finally 21 | { 22 | base.Dispose(disposing); 23 | } 24 | } 25 | 26 | //Required by the Windows Form Designer 27 | 28 | private System.ComponentModel.IContainer components; 29 | //NOTE: The following procedure is required by the Windows Form Designer 30 | //It can be modified using the Windows Form Designer. 31 | //Do not modify it using the code editor. 32 | [System.Diagnostics.DebuggerStepThrough()] 33 | private void InitializeComponent() 34 | { 35 | this.txtName = new System.Windows.Forms.TextBox(); 36 | this.txtSeperator = new System.Windows.Forms.TextBox(); 37 | this.cboParameters = new System.Windows.Forms.ComboBox(); 38 | this.btnDelete = new System.Windows.Forms.Button(); 39 | this.SuspendLayout(); 40 | // 41 | // txtName 42 | // 43 | this.txtName.Location = new System.Drawing.Point(0, 2); 44 | this.txtName.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 45 | this.txtName.Name = "txtName"; 46 | this.txtName.Size = new System.Drawing.Size(151, 20); 47 | this.txtName.TabIndex = 0; 48 | // 49 | // txtSeperator 50 | // 51 | this.txtSeperator.Location = new System.Drawing.Point(151, 2); 52 | this.txtSeperator.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 53 | this.txtSeperator.Name = "txtSeperator"; 54 | this.txtSeperator.Size = new System.Drawing.Size(76, 20); 55 | this.txtSeperator.TabIndex = 1; 56 | // 57 | // cboParameters 58 | // 59 | this.cboParameters.FormattingEnabled = true; 60 | this.cboParameters.Location = new System.Drawing.Point(228, 1); 61 | this.cboParameters.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 62 | this.cboParameters.Name = "cboParameters"; 63 | this.cboParameters.Size = new System.Drawing.Size(148, 21); 64 | this.cboParameters.TabIndex = 2; 65 | this.cboParameters.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cboParameters_KeyUp); 66 | // 67 | // btnDelete 68 | // 69 | this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Popup; 70 | this.btnDelete.Font = new System.Drawing.Font("Lucida Console", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 71 | this.btnDelete.Location = new System.Drawing.Point(376, 2); 72 | this.btnDelete.Margin = new System.Windows.Forms.Padding(1); 73 | this.btnDelete.Name = "btnDelete"; 74 | this.btnDelete.Size = new System.Drawing.Size(17, 19); 75 | this.btnDelete.TabIndex = 5; 76 | this.btnDelete.Text = "X"; 77 | this.btnDelete.TextAlign = System.Drawing.ContentAlignment.BottomCenter; 78 | this.btnDelete.UseVisualStyleBackColor = true; 79 | this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); 80 | // 81 | // FGD_WidgetControl 82 | // 83 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 84 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 85 | this.Controls.Add(this.btnDelete); 86 | this.Controls.Add(this.cboParameters); 87 | this.Controls.Add(this.txtSeperator); 88 | this.Controls.Add(this.txtName); 89 | this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 90 | this.Name = "FGD_WidgetControl"; 91 | this.Size = new System.Drawing.Size(396, 21); 92 | this.ResumeLayout(false); 93 | this.PerformLayout(); 94 | 95 | } 96 | 97 | internal System.Windows.Forms.TextBox txtName; 98 | internal System.Windows.Forms.TextBox txtSeperator; 99 | internal System.Windows.Forms.ComboBox cboParameters; 100 | 101 | internal System.Windows.Forms.Button btnDelete; 102 | } 103 | 104 | } -------------------------------------------------------------------------------- /ModMaker/Controls/FGD/FGD_WidgetControl.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using Microsoft.VisualBasic; 3 | using System; 4 | using System.Windows.Forms; 5 | 6 | namespace ModMaker 7 | { 8 | 9 | /// 10 | /// Provide the mapper with a widget for an enity property 11 | /// 12 | /// 13 | /// Part of the MM FGD editor 14 | /// 15 | public partial class FGD_WidgetControl 16 | { 17 | 18 | private ForgeGameData.Widget _Widget; 19 | public event OnDeleteEventHandler OnDelete; 20 | 21 | public delegate void OnDeleteEventHandler(object sender, String Name); 22 | 23 | public FGD_WidgetControl() 24 | { 25 | InitializeComponent(); 26 | } 27 | 28 | public ForgeGameData.Widget Widget 29 | { 30 | get 31 | { 32 | _Widget.Name = txtName.Text; 33 | _Widget.Seperator = txtSeperator.Text; 34 | _Widget.Parameters.Clear(); 35 | 36 | foreach (string paramater in cboParameters.Items) 37 | { 38 | _Widget.Parameters.Add(paramater); 39 | } 40 | 41 | return _Widget; 42 | } 43 | set 44 | { 45 | _Widget = value; 46 | 47 | txtName.Text = _Widget.Name; 48 | txtSeperator.Text = _Widget.Seperator; 49 | cboParameters.Items.Clear(); 50 | cboParameters.Items.AddRange(_Widget.Parameters.ToArray()); 51 | } 52 | } 53 | 54 | public bool IsReadOnly 55 | { 56 | get { return !txtName.Enabled; } 57 | set 58 | { 59 | txtName.Enabled = !value; 60 | txtSeperator.Enabled = !value; 61 | cboParameters.Enabled = !value; 62 | btnDelete.Visible = !value; 63 | } 64 | } 65 | 66 | private void cboParameters_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) 67 | { 68 | if (e.KeyCode == Keys.Enter) 69 | { 70 | cboParameters.Items.Add(cboParameters.Text); 71 | } 72 | } 73 | 74 | private void btnDelete_Click(System.Object sender, System.EventArgs e) 75 | { 76 | if ( 77 | Interaction.MsgBox("Delete the property " + _Widget.Name + "?", MsgBoxStyle.Question & MsgBoxStyle.YesNo, 78 | "Delete Property?") != MsgBoxResult.Yes) 79 | return; 80 | 81 | if (OnDelete != null) 82 | { 83 | OnDelete(this, _Widget.Name); 84 | } 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /ModMaker/Controls/TextureDataControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ModMaker 2 | { 3 | 4 | [Microsoft.VisualBasic.CompilerServices.DesignerGenerated()] 5 | partial class TextureDataControl : System.Windows.Forms.UserControl 6 | { 7 | 8 | //UserControl overrides dispose to clean up the component list. 9 | [System.Diagnostics.DebuggerNonUserCode()] 10 | protected override void Dispose(bool disposing) 11 | { 12 | try 13 | { 14 | if (disposing && components != null) 15 | { 16 | components.Dispose(); 17 | } 18 | } 19 | finally 20 | { 21 | base.Dispose(disposing); 22 | } 23 | } 24 | 25 | //Required by the Windows Form Designer 26 | 27 | private System.ComponentModel.IContainer components; 28 | //NOTE: The following procedure is required by the Windows Form Designer 29 | //It can be modified using the Windows Form Designer. 30 | //Do not modify it using the code editor. 31 | [System.Diagnostics.DebuggerStepThrough()] 32 | private void InitializeComponent() 33 | { 34 | this.btnEdit = new System.Windows.Forms.Button(); 35 | this.txtValue = new System.Windows.Forms.TextBox(); 36 | this.SuspendLayout(); 37 | // 38 | // btnEdit 39 | // 40 | this.btnEdit.Dock = System.Windows.Forms.DockStyle.Right; 41 | this.btnEdit.Location = new System.Drawing.Point(225, 5); 42 | this.btnEdit.Name = "btnEdit"; 43 | this.btnEdit.Size = new System.Drawing.Size(25, 20); 44 | this.btnEdit.TabIndex = 0; 45 | this.btnEdit.Text = "..."; 46 | this.btnEdit.UseVisualStyleBackColor = true; 47 | this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); 48 | // 49 | // txtValue 50 | // 51 | this.txtValue.Dock = System.Windows.Forms.DockStyle.Top; 52 | this.txtValue.Location = new System.Drawing.Point(0, 5); 53 | this.txtValue.Name = "txtValue"; 54 | this.txtValue.ReadOnly = true; 55 | this.txtValue.Size = new System.Drawing.Size(225, 20); 56 | this.txtValue.TabIndex = 1; 57 | this.txtValue.TextChanged += new System.EventHandler(this.txtValue_TextChanged); 58 | // 59 | // TextureDataControl 60 | // 61 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 62 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 63 | this.Controls.Add(this.txtValue); 64 | this.Controls.Add(this.btnEdit); 65 | this.Name = "TextureDataControl"; 66 | this.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); 67 | this.Size = new System.Drawing.Size(250, 30); 68 | this.ResumeLayout(false); 69 | this.PerformLayout(); 70 | 71 | } 72 | 73 | internal System.Windows.Forms.Button btnEdit; 74 | 75 | internal System.Windows.Forms.TextBox txtValue; 76 | } 77 | 78 | } -------------------------------------------------------------------------------- /ModMaker/Controls/TextureDataControl.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | using LibModMaker; 3 | 4 | namespace ModMaker 5 | { 6 | /// 7 | /// part of the Weapon Editor UI ... something to do with HUD textures IO think 8 | /// 9 | public partial class TextureDataControl 10 | { 11 | 12 | private KeyValues _Data; 13 | public string Key { get; set; } 14 | public SourceMod Game { get; set; } 15 | 16 | public KeyValues Data 17 | { 18 | get 19 | { 20 | if (_Data == null) 21 | _Data = new KeyValues(Key); 22 | 23 | _Data.Name = Key; 24 | 25 | return _Data; 26 | } 27 | set 28 | { 29 | _Data = value; 30 | 31 | if (_Data == null) 32 | { 33 | this.Value = ""; 34 | } 35 | else 36 | { 37 | Key = _Data.Name; 38 | this.Value = _Data.ToString(); 39 | } 40 | } 41 | } 42 | 43 | public string Value 44 | { 45 | get { return txtValue.Text; } 46 | set 47 | { 48 | if (string.IsNullOrEmpty(value)) 49 | { 50 | txtValue.Text = ""; 51 | } 52 | else 53 | { 54 | txtValue.Text = 55 | value.Replace("\t", "") 56 | .Replace("\r\n", "") 57 | .Replace("\r", ""); 58 | } 59 | } 60 | } 61 | 62 | public TextureDataControl() 63 | { 64 | InitializeComponent(); 65 | } 66 | 67 | private void btnEdit_Click(System.Object sender, System.EventArgs e) 68 | { 69 | frmTextureData Dialog = new frmTextureData(); 70 | Dialog.Game = Game; 71 | Dialog.TextureData = _Data; 72 | 73 | if (Dialog.ShowDialog() != DialogResult.OK) 74 | return; 75 | 76 | Data = Dialog.TextureData; 77 | } 78 | 79 | private void txtValue_TextChanged(System.Object sender, System.EventArgs e) 80 | { 81 | if (txtValue.Text.Length == 0) 82 | _Data = null; 83 | } 84 | } 85 | 86 | } -------------------------------------------------------------------------------- /ModMaker/Controls/WeaponSoundPickerControl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace ModMaker 2 | { 3 | [Microsoft.VisualBasic.CompilerServices.DesignerGenerated()] 4 | partial class WeaponSoundPickerControl : System.Windows.Forms.UserControl 5 | { 6 | 7 | //UserControl overrides dispose to clean up the component list. 8 | [System.Diagnostics.DebuggerNonUserCode()] 9 | protected override void Dispose(bool disposing) 10 | { 11 | try 12 | { 13 | if (disposing && components != null) 14 | { 15 | components.Dispose(); 16 | } 17 | } 18 | finally 19 | { 20 | base.Dispose(disposing); 21 | } 22 | } 23 | 24 | //Required by the Windows Form Designer 25 | 26 | private System.ComponentModel.IContainer components; 27 | //NOTE: The following procedure is required by the Windows Form Designer 28 | //It can be modified using the Windows Form Designer. 29 | //Do not modify it using the code editor. 30 | [System.Diagnostics.DebuggerStepThrough()] 31 | private void InitializeComponent() 32 | { 33 | this.btnBrowse = new System.Windows.Forms.Button(); 34 | this.txtPath = new System.Windows.Forms.TextBox(); 35 | this.SuspendLayout(); 36 | // 37 | // btnBrowse 38 | // 39 | this.btnBrowse.AutoSize = true; 40 | this.btnBrowse.Dock = System.Windows.Forms.DockStyle.Right; 41 | this.btnBrowse.Location = new System.Drawing.Point(368, 6); 42 | this.btnBrowse.Margin = new System.Windows.Forms.Padding(0); 43 | this.btnBrowse.Name = "btnBrowse"; 44 | this.btnBrowse.Size = new System.Drawing.Size(40, 25); 45 | this.btnBrowse.TabIndex = 0; 46 | this.btnBrowse.Text = "..."; 47 | this.btnBrowse.UseVisualStyleBackColor = true; 48 | this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click); 49 | // 50 | // txtPath 51 | // 52 | this.txtPath.Dock = System.Windows.Forms.DockStyle.Fill; 53 | this.txtPath.Location = new System.Drawing.Point(0, 6); 54 | this.txtPath.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); 55 | this.txtPath.Name = "txtPath"; 56 | this.txtPath.Size = new System.Drawing.Size(368, 22); 57 | this.txtPath.TabIndex = 1; 58 | // 59 | // WeaponSoundPickerControl 60 | // 61 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); 62 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 63 | this.Controls.Add(this.txtPath); 64 | this.Controls.Add(this.btnBrowse); 65 | this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); 66 | this.Name = "WeaponSoundPickerControl"; 67 | this.Padding = new System.Windows.Forms.Padding(0, 6, 0, 6); 68 | this.Size = new System.Drawing.Size(408, 37); 69 | this.ResumeLayout(false); 70 | this.PerformLayout(); 71 | 72 | } 73 | 74 | internal System.Windows.Forms.Button btnBrowse; 75 | 76 | internal System.Windows.Forms.TextBox txtPath; 77 | } 78 | } -------------------------------------------------------------------------------- /ModMaker/Controls/WeaponSoundPickerControl.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Forms; 2 | using System.IO; 3 | 4 | namespace ModMaker 5 | { 6 | /// 7 | /// Part of the weapon editor UI, enables picking a sound script for one of the events a weapon can do (firing, reloading etc.) 8 | /// 9 | public partial class WeaponSoundPickerControl 10 | { 11 | public string ModInstallFolder { get; set; } 12 | 13 | public string SoundPath 14 | { 15 | get 16 | { 17 | if (DesignMode) return string.Empty; 18 | 19 | return txtPath.Text; 20 | } 21 | set 22 | { 23 | if (DesignMode) return; 24 | 25 | txtPath.Text = value; 26 | } 27 | } 28 | 29 | public WeaponSoundPickerControl() 30 | { 31 | InitializeComponent(); 32 | } 33 | 34 | private void btnBrowse_Click(System.Object sender, System.EventArgs e) 35 | { 36 | OpenFileDialog Dialog = new OpenFileDialog 37 | { 38 | Title = "Select sound", 39 | Filter = "Uncompressed Sound (*.wav)|*.wav|Compressed Sound (*.mp3)|*.mp3", 40 | DefaultExt = ".wav" 41 | }; 42 | 43 | if (SoundPath.Length > 0) 44 | { 45 | string FullPath = Path.Combine(ModInstallFolder, SoundPath); 46 | 47 | Dialog.InitialDirectory = Path.GetDirectoryName(FullPath); 48 | Dialog.FileName = Path.GetFileName(FullPath); 49 | } 50 | 51 | if (Dialog.ShowDialog() != DialogResult.OK) 52 | return; 53 | 54 | if (Dialog.FileName.StartsWith(ModInstallFolder)) 55 | { 56 | SoundPath = Dialog.FileName.Substring(ModInstallFolder.Length); 57 | } 58 | else 59 | { 60 | SoundPath = Dialog.FileName; 61 | } 62 | } 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /ModMaker/Forms/AboutForm.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | using System.Drawing; 4 | using System.Windows.Forms; 5 | using System.Diagnostics; 6 | 7 | namespace ModMaker 8 | { 9 | /// 10 | /// UI to give credit to contributors to this project 11 | /// 12 | public partial class AboutForm 13 | { 14 | public AboutForm() 15 | { 16 | InitializeComponent(); 17 | 18 | OKButton.Click += new EventHandler(OKButton_Click); 19 | 20 | } 21 | 22 | private void frmAboutvb_Load(System.Object sender, System.EventArgs e) 23 | { 24 | PictureBox1.Image = Properties.Resources.ModMaker.ToBitmap(); 25 | 26 | // Set the title of the form. 27 | this.Text = string.Format("About {0}", Application.ProductName); 28 | // Initialize all of the text displayed on the About Box. 29 | // TODO: Customize the application's assembly information in the "Application" pane of the project 30 | // properties dialog (under the "Project" menu). 31 | this.LabelProductName.Text = Application.ProductName; 32 | this.LabelVersion.Text = string.Format("Version {0}", Application.ProductVersion); 33 | this.LabelCopyright.Text = "Copyright Matthew Rye"; 34 | this.LabelCompanyName.Text = Application.CompanyName; 35 | //Me.TextBoxDescription.Text = My.Application.Info.Description 36 | this.TextBoxDescription.Text = 37 | "Mod Maker (MM) is a utility to assist with Source modding from day to day. \n\n" + 38 | "Please report any bugs to me@chromeangel.co.uk \n\n" + 39 | "MM makes use of the following libraries:\nSeven Zip Sharp for patch compression, \n" + 40 | "NSIS to script and compile installers, \n" + 41 | "Targa image reader by David Polomis, \n" + 42 | "VTFLib for VTF image reading by Neil Jedrzejewski and Ryan Gregg"; 43 | } 44 | 45 | private void OKButton_Click(System.Object sender, System.EventArgs e) 46 | { 47 | this.Close(); 48 | } 49 | 50 | private void frmAboutvb_Resize(object sender, System.EventArgs e) 51 | { 52 | RefreshModListBackground(); 53 | } 54 | 55 | void RefreshModListBackground() 56 | { 57 | if (this.Size.Width*this.Size.Height == 0) 58 | return; 59 | 60 | GraphicsUnit pixel = GraphicsUnit.Pixel; 61 | Bitmap Buffer = new Bitmap(this.Width, this.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); 62 | Graphics Gfx = Graphics.FromImage(Buffer); 63 | 64 | System.Drawing.Drawing2D.LinearGradientBrush Grad = new System.Drawing.Drawing2D.LinearGradientBrush(new Point(0, 0), 65 | new Point(0, this.Height), Color.FromArgb(255, 16, 16, 16), Color.FromArgb(255, 48, 48, 48)); 66 | 67 | Gfx.FillRectangle(Grad, Buffer.GetBounds(ref pixel)); 68 | Gfx.Flush(); 69 | this.BackgroundImage = Buffer; 70 | } 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /ModMaker/Forms/AdvancedStartupForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace ModMaker 6 | { 7 | /// 8 | /// UI for "Advanced" command line options for starting a game/mod 9 | /// 10 | public partial class AdvancedStartupForm 11 | { 12 | public AdvancedStartupForm() 13 | { 14 | InitializeComponent(); 15 | 16 | base.Load += new EventHandler(frmAdvancedStartup_Load); 17 | chkMap.CheckStateChanged += new EventHandler(chkMap_CheckedChanged); 18 | } 19 | 20 | 21 | public string Parameters 22 | { 23 | get 24 | { 25 | System.Text.StringBuilder Arguments = new System.Text.StringBuilder(""); 26 | 27 | if (chkDeveloper.Checked) 28 | Arguments.Append(" -dev"); 29 | if (chkAllowDebug.Checked) 30 | Arguments.Append(" -allowdebug"); 31 | if (chkCondebug.Checked) 32 | Arguments.Append(" -condebug"); 33 | if (chkWindowed.Checked) 34 | Arguments.Append(" -windowed"); 35 | if (chkNoBorder.Checked) 36 | Arguments.Append(" -noborder"); 37 | if (chkNoIntro.Checked) 38 | Arguments.Append(" -novid"); 39 | if (chkToolsMode.Checked) 40 | Arguments.Append(" -tools -nop4"); 41 | if (chkToConsole.Checked) 42 | Arguments.Append(" -toconsole"); 43 | if (!string.IsNullOrEmpty(txtOther.Text)) 44 | Arguments.Append(" " + txtOther.Text); 45 | if (chkMap.Checked & !string.IsNullOrEmpty(cboMap.SelectedValue.ToString())) 46 | Arguments.Append(" +map " + cboMap.SelectedValue); 47 | 48 | return Arguments.ToString(); 49 | } 50 | } 51 | 52 | public bool SkipIntro 53 | { 54 | get { return chkNoIntro.Checked; } 55 | set { chkNoIntro.Checked = value; } 56 | } 57 | 58 | public bool Windowed 59 | { 60 | get { return chkWindowed.Checked; } 61 | set { chkWindowed.Checked = value; } 62 | } 63 | 64 | public bool AllowDebug 65 | { 66 | get { return chkAllowDebug.Checked; } 67 | set { chkAllowDebug.Checked = value; } 68 | } 69 | 70 | private void frmAdvancedStartup_Load(object sender, System.EventArgs e) 71 | { 72 | //TODO revisit this 73 | //this.Icon = Properties.Resources.ModMaker; 74 | } 75 | 76 | public void RefreshMapList(string Folder) 77 | { 78 | string[] RawBSPs = Directory.GetFiles(Folder, "*.bsp"); 79 | List BSPs = new List(); 80 | 81 | foreach (string RawBsp in RawBSPs) 82 | { 83 | string InnerRawBsp = RawBsp.Substring(Folder.Length + 1); 84 | // trim the maps path 85 | InnerRawBsp = InnerRawBsp.Substring(0, InnerRawBsp.Length - 4); 86 | // trim the trailing .bsp 87 | BSPs.Add(InnerRawBsp); 88 | } 89 | 90 | cboMap.DataSource = BSPs; 91 | } 92 | 93 | // ERROR: Handles clauses are not supported in C# 94 | private void chkMap_CheckedChanged(System.Object sender, System.EventArgs e) 95 | { 96 | cboMap.Enabled = chkMap.Checked; 97 | } 98 | 99 | public void SelectMap(string MapName) 100 | { 101 | if (MapName == null) 102 | { 103 | chkMap.Checked = false; 104 | } 105 | else 106 | { 107 | chkMap.Checked = true; 108 | cboMap.SelectedItem = MapName; 109 | } 110 | } 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /ModMaker/Forms/FGDChoicesForm.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using LibModMaker; 3 | 4 | namespace ModMaker 5 | { 6 | /// 7 | /// UI for specifying the choices a mapper has for an enity property 8 | /// 9 | public partial class FGDChoicesForm 10 | { 11 | private ForgeGameData.ChoicesProperty _BaseProperty; 12 | 13 | private DataTable _Source; 14 | 15 | public FGDChoicesForm() 16 | { 17 | // This call is required by the designer. 18 | InitializeComponent(); 19 | 20 | // Add any initialization after the InitializeComponent() call. 21 | _Source = new DataTable("Options"); 22 | _Source.Columns.Add("Value"); 23 | _Source.Columns.Add("Text"); 24 | } 25 | 26 | public ForgeGameData.ChoicesProperty ChoicesProperty 27 | { 28 | get 29 | { 30 | _BaseProperty.choices.Clear(); 31 | 32 | foreach (DataRow Row in _Source.Rows) 33 | { 34 | _BaseProperty.choices.Add(Row["Value"].ToString(), Row["Text"].ToString()); 35 | } 36 | 37 | return _BaseProperty; 38 | } 39 | set 40 | { 41 | _BaseProperty = value; 42 | 43 | if (value == null) 44 | return; 45 | 46 | _Source.Rows.Clear(); 47 | 48 | foreach (string ItemValue in _BaseProperty.choices.Keys) 49 | { 50 | DataRow Row = _Source.NewRow(); 51 | Row["Value"] = ItemValue; 52 | Row["Text"] = _BaseProperty.choices[ItemValue]; 53 | _Source.Rows.Add(Row); 54 | } 55 | 56 | dbgGrid.DataSource = _Source; 57 | } 58 | } 59 | 60 | 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /ModMaker/Forms/KeyBindingForm.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System.IO; 3 | using System.Windows.Forms; 4 | using Microsoft.VisualBasic; 5 | 6 | namespace ModMaker 7 | { 8 | 9 | /// 10 | /// UI for editing key bindings 11 | /// 12 | public partial class KeyBindingForm 13 | { 14 | public KeyBindingForm() 15 | { 16 | InitializeComponent(); 17 | } 18 | 19 | private void frmKeyBinding_Load(object sender, System.EventArgs e) 20 | { 21 | Icon = Properties.Resources.Keys; 22 | } 23 | 24 | 25 | string MyConfig = null; 26 | public void LoadFiles(SourceMod Game) 27 | { 28 | this.KeyBindControl1.Game = Game; 29 | this.KeyBindControl1.LoadFiles(); 30 | 31 | MyConfig = Path.Combine(Game.InstallPath, "cfg/config.cfg"); 32 | btnUseMyKeys.Visible = File.Exists(MyConfig); 33 | } 34 | 35 | private void btnOK_Click(System.Object sender, System.EventArgs e) 36 | { 37 | KeyBindControl1.Save(); 38 | 39 | DialogResult = DialogResult.OK; 40 | } 41 | 42 | private void btnNewGroup_Click(System.Object sender, System.EventArgs e) 43 | { 44 | string Group = Interaction.InputBox("Enter the name of your new group", "New Group"); 45 | 46 | if (Group == null) 47 | return; 48 | 49 | KeyBindControl1.AddGroup(Group); 50 | } 51 | 52 | private void btnUseMyKeys_Click(System.Object sender, System.EventArgs e) 53 | { 54 | this.KeyBindControl1.LoadKeyBindings(MyConfig); 55 | } 56 | } 57 | 58 | } -------------------------------------------------------------------------------- /ModMaker/Forms/NewModProgressForm.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualBasic; 2 | 3 | namespace ModMaker 4 | { 5 | /// 6 | /// Progress indicator for the new mod wizard 7 | /// 8 | public partial class NewModProgressForm 9 | { 10 | private MakeModWizard _wizard; 11 | public MakeModWizard Wizard 12 | { 13 | get 14 | { 15 | return _wizard; 16 | } 17 | set 18 | { 19 | _wizard = value; 20 | TitleLabel.Text = string.Format("Please wait {0} is being set up.", _wizard.Title); 21 | _wizard.Failed += new MakeModWizard.FailedEventHandler(Wizard_Failed); 22 | _wizard.Finished += new MakeModWizard.FinishedEventHandler(Wizard_Finished); 23 | _wizard.Progress += new MakeModWizard.ProgressEventHandler(Wizard_Progress); 24 | } 25 | } 26 | public NewModProgressForm() 27 | { 28 | // This call is required by the designer. 29 | InitializeComponent(); 30 | 31 | // Add any initialization after the InitializeComponent() call. 32 | this.Icon = Properties.Resources.ModMaker; 33 | } 34 | 35 | private void Wizard_Failed(object sender, string msg) 36 | { 37 | } 38 | 39 | private void Wizard_Progress(object sender, MakeModWizard.ProgressEventArgs e) 40 | { 41 | if (e.msg.StartsWith("Downloaded")) 42 | { 43 | ProgressDownload.Value = e.percent; 44 | lblConfigured.Text = e.msg; 45 | return; 46 | } 47 | 48 | if (e.msg.StartsWith("Extracted")) 49 | { 50 | ProgressUnzip.Value = e.percent; 51 | return; 52 | } 53 | 54 | lblConfigured.Text = e.msg; 55 | } 56 | 57 | private void Wizard_Finished(object sender, string folder) 58 | { 59 | Interaction.MsgBox(string.Format("Mod Maker has finished it's automatic setup of {0}", Wizard.Title), MsgBoxStyle.Information, "New Mod - Mod Maker"); 60 | Close(); 61 | } 62 | } 63 | 64 | } -------------------------------------------------------------------------------- /ModMaker/Forms/OptionsForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using LibModMaker; 4 | using System.IO; 5 | using System.Data; 6 | 7 | namespace ModMaker 8 | { 9 | /// 10 | /// User interface for configuring MM 11 | /// 12 | public partial class OptionsForm 13 | { 14 | public OptionsForm() 15 | { 16 | InitializeComponent(); 17 | 18 | Icon = Properties.Resources.ModMaker; 19 | 20 | Load += new EventHandler(frmOptions_Load); 21 | btnOK.Click += new EventHandler(btnOK_Click); 22 | } 23 | 24 | private void frmOptions_Load(object sender, System.EventArgs e) 25 | { 26 | FillGridData(); 27 | } 28 | 29 | private void btnOK_Click(object sender, System.EventArgs e) 30 | { 31 | SaveGridData(); 32 | 33 | this.DialogResult = DialogResult.OK; 34 | } 35 | 36 | public string AppsFilePath 37 | { 38 | get { return Path.Combine(Application.StartupPath, "options/apps.txt"); } 39 | } 40 | 41 | public void FillGridData() 42 | { 43 | KeyValues FileTypeKey = KeyValues.LoadFile(Compiler.FileTypesPath()); 44 | 45 | GridData.Tables["FileType"].Rows.Clear(); 46 | 47 | foreach (KeyValues FileType in FileTypeKey.Keys) 48 | { 49 | DataRow R = GridData.Tables["FileType"].NewRow(); 50 | 51 | R["extension"] = FileType.Name; 52 | R["filter"] = FileType.GetString("filter"); 53 | R["command"] = FileType.GetString("command"); 54 | R["logwindow"] = FileType.GetBool("logwindow"); 55 | 56 | GridData.Tables["FileType"].Rows.Add(R); 57 | } 58 | 59 | KeyValues AppList = KeyValues.LoadFile(AppsFilePath); 60 | 61 | GridData.Tables["Apps"].Rows.Clear(); 62 | 63 | foreach (KeyValues App in AppList.Keys) 64 | { 65 | DataRow R = GridData.Tables["Apps"].NewRow(); 66 | 67 | R["AppID"] = int.Parse(App.Name); 68 | R["game"] = App.GetString("game"); 69 | R["sdkversion"] = App.GetString("sdkversion"); 70 | R["engine"] = App.GetString("engine"); 71 | R["gameexe"] = App.GetString("gameexe"); 72 | 73 | GridData.Tables["Apps"].Rows.Add(R); 74 | } 75 | 76 | } 77 | 78 | public void SaveGridData() 79 | { 80 | KeyValues FileTypeKey = new KeyValues("FileType"); 81 | 82 | foreach (DataRow R in GridData.Tables["FileType"].Rows) 83 | { 84 | KeyValues Key = new KeyValues(R["extension"].ToString(), FileTypeKey); 85 | KeyValues Value = new KeyValues("filter", R["filter"].ToString(), Key); 86 | 87 | Value = new KeyValues("command", R["command"].ToString(), Key); 88 | Value = new KeyValues("logwindow", (bool)R["logwindow"] ? "1" : "0", Key); 89 | } 90 | 91 | FileTypeKey.Save(Compiler.FileTypesPath()); 92 | 93 | KeyValues AppList = new KeyValues("Apps"); 94 | 95 | foreach (DataRow R in GridData.Tables["Apps"].Rows) 96 | { 97 | KeyValues Key = new KeyValues(R["Appid"].ToString(), AppList); 98 | KeyValues Value = new KeyValues("game", R["game"].ToString(), Key); 99 | 100 | Value = new KeyValues("sdkversion", R["sdkversion"].ToString(), Key); 101 | Value = new KeyValues("engine", R["engine"].ToString(), Key); 102 | Value = new KeyValues("gameexe", R["gameexe"].ToString(), Key); 103 | } 104 | 105 | AppList.Save(AppsFilePath); 106 | } 107 | } 108 | 109 | } -------------------------------------------------------------------------------- /ModMaker/Forms/SMDtoQCForm.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using System.Windows.Forms; 4 | using Microsoft.VisualBasic; 5 | using LibModMaker; 6 | 7 | namespace ModMaker 8 | { 9 | /// 10 | /// UI for the SMD to QC/MDL tool 11 | /// 12 | public partial class SMDtoQCForm 13 | { 14 | public const string defaultSurfaceTypes = 15 | "default,weapon,item,player,concrete,solidmetal,metal,Wood_solid,Wood_Box,flesh,alienflesh,bloodyflesh,armorflesh,foliage,glass,plastic,rubber,pottery,computer"; 16 | private List _SurfaceProperties = new List(); 17 | 18 | public SMDtoQCForm() 19 | { 20 | // This call is required by the designer. 21 | InitializeComponent(); 22 | 23 | // Add any initialization after the InitializeComponent() call. 24 | _SurfaceProperties.AddRange(defaultSurfaceTypes.Split(',')); 25 | 26 | Icon = Properties.Resources.ModMaker; 27 | } 28 | 29 | public List SurfaceProperties 30 | { 31 | get { return _SurfaceProperties; } 32 | set 33 | { 34 | _SurfaceProperties = value; 35 | cboSurfaceProps.Items.Clear(); 36 | 37 | if (value == null) 38 | return; 39 | if (value.Count > 0) 40 | { 41 | cboSurfaceProps.Items.AddRange(_SurfaceProperties.ToArray()); 42 | } 43 | else 44 | { 45 | cboSurfaceProps.Items.AddRange( defaultSurfaceTypes .Split(',')); 46 | } 47 | } 48 | } 49 | 50 | public string SurfaceProperty 51 | { 52 | get { return cboSurfaceProps.SelectedItem.ToString(); } 53 | } 54 | 55 | public string FilePath 56 | { 57 | get { return txtFilePath.Text; } 58 | set { txtFilePath.Text = value; } 59 | } 60 | 61 | public SourceMod Game { get; set; } 62 | 63 | 64 | //Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 65 | // cboSurfaceProps.Items.Clear() 66 | // cboSurfaceProps.Items.AddRange(_SurfaceProperties.ToArray()) 67 | //End Sub 68 | 69 | private void btnBrowseSMD_Click(System.Object sender, System.EventArgs e) 70 | { 71 | OpenFileDialog Dialog = new OpenFileDialog 72 | { 73 | Title = "Select SMD", 74 | Filter = "Model Geometry(*.smd)|*.smd|Obj Model(*.obj)|*.obj", 75 | FileName = txtFilePath.Text 76 | }; 77 | 78 | if (Game != null) 79 | { 80 | Dialog.CustomPlaces.Add(Game.InstallPath); 81 | Dialog.CustomPlaces.Add(Game.SourcePath); 82 | Dialog.InitialDirectory = Path.Combine(Game.SourcePath, "modelsrc"); 83 | } 84 | 85 | if (Dialog.ShowDialog() == DialogResult.Cancel) 86 | return; 87 | 88 | txtFilePath.Text = Dialog.FileName; 89 | } 90 | 91 | private void txtFilePath_TextChanged(object sender, System.EventArgs e) 92 | { 93 | string FilePath = txtFilePath.Text.ToLowerInvariant(); 94 | 95 | btnGo.Enabled = File.Exists(FilePath) && (FilePath.EndsWith(".smd") || FilePath.EndsWith(".obj")); 96 | } 97 | 98 | private void txtFilePath_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) 99 | { 100 | txtFilePath.Text = e.Data.GetData("FileNameW").ToString(); 101 | } 102 | 103 | private void txtFilePath_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) 104 | { 105 | bool Match = false; 106 | 107 | foreach (string Format in e.Data.GetFormats()) 108 | { 109 | if (Format != "FileNameW") continue; 110 | 111 | Match = true; 112 | 113 | break; // TODO: might not be correct. Was : Exit For 114 | } 115 | 116 | if (!Match) return; 117 | 118 | e.Effect = DragDropEffects.All; 119 | } 120 | } 121 | 122 | } -------------------------------------------------------------------------------- /ModMaker/Forms/TextureDataform.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using Microsoft.VisualBasic; 3 | 4 | namespace ModMaker 5 | { 6 | 7 | 8 | public partial class frmTextureData 9 | { 10 | public frmTextureData() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | public SourceMod Game 16 | { 17 | get { 18 | if (Editor == null) 19 | { 20 | return null; 21 | } else { 22 | return Editor.Game; 23 | } 24 | } 25 | set { 26 | if (Editor == null) return; 27 | 28 | Editor.Game = value; 29 | } 30 | } 31 | 32 | public KeyValues TextureData 33 | { 34 | get { 35 | if (Editor == null) 36 | { 37 | return null; 38 | } 39 | else 40 | { 41 | return Editor.TextureData; 42 | } 43 | 44 | } 45 | set { 46 | if (Editor == null) return; 47 | 48 | Editor.TextureData = value; 49 | } 50 | } 51 | 52 | // ERROR: Handles clauses are not supported in C# 53 | private void mnuHelp_Click(System.Object sender, System.EventArgs e) 54 | { 55 | Interaction.MsgBox( 56 | "Texture Data is how Source enables scripting of graphics.\r\n\r\n" + 57 | "VTF bitmaps pixelate or blur as they are scaled up to higher\r\n" + 58 | "resolutions, to combat this weakness Source also supports the\r\n" + 59 | "use of single colour vector graphics (that can be scaled up\r\n" + 60 | "very large, without any loss of sharpness) in the form of\r\n" + 61 | "True Type fonts." + "\r\n\r\n" + 62 | "The texture data format allows modders to specify a graphic\r\n" + 63 | "in the form of either:" + "\r\n" + 64 | "A single glyph (letter/number/symbol) from a font\r\n" + 65 | "A region within a VTF bitmap image\r\n\r\n" + 66 | "Windows system fonts are assumed to be available,\r\n" + 67 | "custom fonts can be loaded by adding them to the\r\n" + 68 | "fonts section of your resources/clientscheme.res\r\n" + 69 | "Windows charmap utility can be used to find specific glyphs.\r\n\r\n" + 70 | "Regions are used to reduce the number of files needed.", MsgBoxStyle.Information, "Texture Data Help"); 71 | } 72 | } 73 | 74 | } -------------------------------------------------------------------------------- /ModMaker/Forms/ZipForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using LibModMaker; 4 | using System.IO; 5 | using System.Windows.Forms; 6 | 7 | namespace ModMaker 8 | { 9 | 10 | /// 11 | /// UI for generating ZIP patches of a game/mod 12 | /// 13 | public partial class ZipForm 14 | { 15 | 16 | protected ZipPatchTool MyPatchTool; 17 | public ZipPatchTool PatchTool 18 | { 19 | get { return MyPatchTool; } 20 | set 21 | { 22 | MyPatchTool = value; 23 | MyPatchTool.Progress += new ZipPatchTool.ProgressEventHandler(PatchTool_Progress); 24 | 25 | RefreshPath(); 26 | } 27 | } 28 | 29 | public ZipForm() 30 | { 31 | InitializeComponent(); 32 | } 33 | 34 | void RefreshPath() 35 | { 36 | if (MyPatchTool == null) 37 | return; 38 | 39 | string ProductName = MyPatchTool.MyGame.Name.Trim(); 40 | 41 | if (ProductName.EndsWith(txtVersion.Text)) 42 | { 43 | ProductName = ProductName.Substring(0, ProductName.Length - txtVersion.Text.Length).Trim(); 44 | } 45 | 46 | string PatchFileName = string.Format("{0}_patch_{1}.{2}", ProductName, txtVersion.Text, radZip.Checked ? "zip" : "7z"); 47 | 48 | string PatchFolder; 49 | KeyValues ModKeys = MainForm.ModOptions[MyPatchTool.MyGame.InstallFolder]; 50 | 51 | if (ModKeys == null) 52 | { 53 | PatchFolder = MyPatchTool.MyGame.SourcePath; 54 | } 55 | else 56 | { 57 | PatchFolder = ModKeys.GetString("ZipPath", MyPatchTool.MyGame.SourcePath); 58 | } 59 | 60 | if (PatchFolder == null) 61 | { 62 | PatchFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); 63 | } 64 | 65 | //Not Source folder for the mod! 66 | txtSaveAs.Text = Path.Combine(PatchFolder, PatchFileName); 67 | } 68 | 69 | private void PatchTool_Progress(object sender, int Percentage) 70 | { 71 | Progress.Maximum = 100; 72 | Progress.Value = Percentage; 73 | } 74 | 75 | private void radZip_CheckedChanged(System.Object sender, System.EventArgs e) 76 | { 77 | RefreshPath(); 78 | } 79 | 80 | private void txtVersion_TextChanged(System.Object sender, System.EventArgs e) 81 | { 82 | RefreshPath(); 83 | } 84 | 85 | private void btnStart_Click(System.Object sender, System.EventArgs e) 86 | { 87 | MyPatchTool.PatchFilePath = txtSaveAs.Text; 88 | grpFormat.Enabled = false; 89 | pnlVersion.Enabled = false; 90 | pnlSaveAs.Enabled = false; 91 | pnlCleanup.Enabled = false; 92 | Label1.Visible = true; 93 | Progress.Visible = true; 94 | btnStart.Enabled = false; 95 | UseWaitCursor = true; 96 | Application.DoEvents(); 97 | 98 | try 99 | { 100 | CleanupTool Cleanup = new CleanupTool { ShouldPrompt = false }; 101 | Cleanup.Launch(MyPatchTool.MyGame); 102 | 103 | MyPatchTool.Start(); 104 | } 105 | finally 106 | { 107 | UseWaitCursor = false; 108 | } 109 | } 110 | 111 | private void btnBrowse_Click(System.Object sender, System.EventArgs e) 112 | { 113 | SaveFileDialog Dialog = new SaveFileDialog 114 | { 115 | FileName = txtSaveAs.Text, 116 | DefaultExt = radZip.Checked ? ".zip" : ".7z", 117 | Filter = "Zip Archive (*.zip)|*.zip|7 zip Archive (*.7z)|*.7z", 118 | InitialDirectory = Path.GetDirectoryName(txtSaveAs.Text), 119 | OverwritePrompt = true 120 | }; 121 | 122 | if (Dialog.ShowDialog() == DialogResult.Cancel) 123 | return; 124 | 125 | txtSaveAs.Text = Dialog.FileName; 126 | } 127 | 128 | private void frmZip_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e) 129 | { 130 | KeyValues ModKeys = MainForm.ModOptions[MyPatchTool.MyGame.InstallFolder]; 131 | 132 | if (ModKeys != null) 133 | { 134 | ModKeys.SetValue("ZipPath", Path.GetDirectoryName(txtSaveAs.Text)); 135 | } 136 | } 137 | } 138 | 139 | } -------------------------------------------------------------------------------- /ModMaker/Logic/CPP_generators/CPlusPlus.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | 6 | namespace ModMaker 7 | { 8 | 9 | /// 10 | /// Helper for generating valid C++ class, method and varible names 11 | /// 12 | public class CPlusPlus 13 | { 14 | public static string ToID(string Plain) 15 | { 16 | if (string.IsNullOrEmpty(Plain)) 17 | throw new ArgumentException("Plain required"); 18 | 19 | System.Text.StringBuilder Result = new System.Text.StringBuilder(Plain.Length); 20 | 21 | char[] plainChars = Plain.ToCharArray(); 22 | 23 | if (char.IsDigit(plainChars[0])) 24 | Result.Append("_"); 25 | 26 | foreach (char C in plainChars) 27 | { 28 | if (char.IsLetterOrDigit(C) | C == '_') 29 | Result.Append(C); 30 | } 31 | 32 | return Result.ToString(); 33 | } 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /ModMaker/Logic/CPP_generators/VGUI_ScriptGenerator.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | using Microsoft.VisualBasic; 6 | using System.Collections.Generic; 7 | 8 | namespace ModMaker 9 | { 10 | 11 | /// 12 | /// Generates C++ code for a VGUI panel given a Resource file 13 | /// 14 | public class VGUI_ScriptGenerator 15 | { 16 | public KeyValues ResourceFile; 17 | public SourceMod Game; 18 | private string ClassName; 19 | private string PanelName; 20 | private string HeaderName; 21 | private StreamWriter Header; 22 | private StreamWriter Body; 23 | 24 | public void Export(SourceMod Game, KeyValues ResourceFile, string Folder, string FileName) 25 | { 26 | this.ResourceFile = ResourceFile; 27 | PanelName = Path.GetFileNameWithoutExtension(FileName); 28 | ClassName = "C_" + ToCPP_ID(PanelName); 29 | HeaderName = PanelName + ".h"; 30 | 31 | string HeaderPath = Path.Combine(Folder, HeaderName); 32 | string BodyPath = Path.Combine(Folder, PanelName + ".cpp"); 33 | 34 | using (var Header = new StreamWriter(HeaderPath)) 35 | { 36 | using (var Body = new StreamWriter(BodyPath)) 37 | { 38 | this.Header = Header; 39 | this.Body = Body; 40 | 41 | WriteFileHeaders(); 42 | WriteMembers(); 43 | WriteFileFooters(FileName); 44 | } 45 | } 46 | 47 | Interaction.MsgBox("Exported " + BodyPath, MsgBoxStyle.Information, "Mod Maker"); 48 | } 49 | 50 | string ToCPP_ID(string Plain) 51 | { 52 | return CPlusPlus.ToID(Plain); 53 | } 54 | 55 | void WriteFileHeaders() 56 | { 57 | Header.WriteLine("// Purpose: Header for " + ClassName); 58 | Header.WriteLine("// Boilerplate generated by ModMaker on " + DateTime.Now.ToString()); 59 | Header.WriteLine(); 60 | Header.WriteLine("#ifndef {0}_H", PanelName.ToUpper()); 61 | Header.WriteLine("#define {0}_H", PanelName.ToUpper()); 62 | Header.WriteLine("#ifdef _WIN32"); 63 | Header.WriteLine("#pragma once"); 64 | Header.WriteLine("#endif"); 65 | Header.WriteLine(); 66 | WriteControlHeaderIncludes(); 67 | Header.WriteLine(); 68 | Header.WriteLine("class {0} : public vgui::EditPanel", ClassName); 69 | Header.WriteLine("{"); 70 | Header.WriteLine("public:"); 71 | Header.WriteLine(" {0}(Panel *parent, const char *panelName);", ClassName); 72 | Header.WriteLine(); 73 | 74 | Body.WriteLine("// Purpose: Body for " + ClassName); 75 | Body.WriteLine("// Boilerplate generated by ModMaker on " + DateTime.Now.ToString()); 76 | Body.WriteLine(); 77 | Body.WriteLine("#include \"cbase.h\""); 78 | Body.WriteLine("#include \"{0}\"", HeaderName); 79 | Body.WriteLine(); 80 | Body.WriteLine("// memdbgon must be the last include file in a .cpp file!!!"); 81 | Body.WriteLine("#include \"tier0/memdbgon.h\""); 82 | Body.WriteLine(); 83 | Body.WriteLine("{0}::{0}(Panel *parent, const char *panelName): EditPanel(parent, panelName)", ClassName); 84 | Body.WriteLine("{"); 85 | } 86 | 87 | void WriteControlHeaderIncludes() 88 | { 89 | Dictionary ControlNames = new Dictionary(); 90 | string memberType; 91 | 92 | foreach (KeyValues Panel in ResourceFile.Keys) 93 | { 94 | if (PanelName == Panel.Name) 95 | continue; 96 | 97 | memberType = Panel.GetString("controlname", "Panel"); 98 | ControlNames[memberType] = memberType; 99 | } 100 | 101 | foreach (string aMemberType in ControlNames.Keys) 102 | { 103 | Header.WriteLine("#include ", aMemberType); 104 | } 105 | } 106 | 107 | void WriteMembers() 108 | { 109 | string varName; 110 | string memberType; 111 | 112 | foreach (KeyValues Panel in ResourceFile.Keys) 113 | { 114 | if (PanelName == Panel.Name) 115 | continue; 116 | 117 | memberType = Panel.GetString("controlname", "Panel"); 118 | varName = "m_p" + ToCPP_ID(Panel.Name); 119 | 120 | Header.WriteLine(" vgui::{0} * {1};", memberType, varName); 121 | Body.WriteLine(" {0} = new vgui::{1}(this,\"{2}\");", varName, memberType, 122 | Panel.GetString("fieldname")); 123 | } 124 | } 125 | 126 | void WriteFileFooters(string FileName) 127 | { 128 | Header.WriteLine("};"); 129 | Header.WriteLine(); 130 | Header.WriteLine("#endif // {0}_H", PanelName.ToUpper()); 131 | 132 | Body.WriteLine(); 133 | Body.WriteLine(" LoadControlSettings(\"{0}\");", FileName); 134 | Body.WriteLine("}"); 135 | } 136 | } 137 | 138 | } -------------------------------------------------------------------------------- /ModMaker/Logic/ObjToSMD.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace ModMaker 4 | { 5 | /// 6 | /// Tool for converting an OBJ 3D model file into a refrence SMD file 7 | /// 8 | public class ObjToSMD 9 | { 10 | Obj anObj; 11 | 12 | string DefaultMaterial; 13 | 14 | public ObjToSMD(string FilePath) 15 | { 16 | if (!File.Exists(FilePath)) 17 | return; 18 | 19 | this.anObj = Obj.Load(FilePath); 20 | 21 | DefaultMaterial = Path.GetFileNameWithoutExtension(FilePath) + "_sheet"; 22 | 23 | string OutputPath = Path.Combine(Path.GetDirectoryName(FilePath), 24 | Path.GetFileNameWithoutExtension(FilePath) + ".smd"); 25 | 26 | using (StreamWriter File = new StreamWriter(OutputPath)) 27 | { 28 | File.WriteLine("version 1"); 29 | File.WriteLine("nodes"); 30 | File.WriteLine("0 \"root\" -1"); 31 | File.WriteLine("end"); 32 | File.WriteLine("skeleton"); 33 | File.WriteLine("time 0"); 34 | File.WriteLine("0 0 0 0 0 0 0"); 35 | File.WriteLine("end"); 36 | File.WriteLine("triangles"); 37 | 38 | int IFace = 1; 39 | 40 | foreach (Obj.Face Face in this.anObj.faces) 41 | { 42 | // File.WriteLine("// {0}", IFace) 43 | Triangulate(Face, File); 44 | IFace += 1; 45 | } 46 | 47 | File.WriteLine("end"); 48 | } 49 | } 50 | 51 | protected void Triangulate(Obj.Face Face, StreamWriter File) 52 | { 53 | int I; 54 | 55 | for (I = 1; I <= Face.verticies.Length - 3; I++) 56 | { 57 | if (anObj.materials.Count == 0) 58 | { 59 | File.WriteLine(DefaultMaterial); 60 | } 61 | else 62 | { 63 | if (Face.materialIndex < 0) 64 | { 65 | File.WriteLine(anObj.materials[0]); 66 | } 67 | else 68 | { 69 | File.WriteLine(anObj.materials[Face.materialIndex]); 70 | } 71 | } 72 | 73 | File.WriteLine(VertToString(Face.verticies[0])); 74 | File.WriteLine(VertToString(Face.verticies[I])); 75 | File.WriteLine(VertToString(Face.verticies[I + 1])); 76 | } 77 | } 78 | 79 | object VertToString(Obj.Vertex V) 80 | { 81 | Obj.Vector3 Point = new Obj.Vector3(); 82 | Obj.Vector3 Normal = new Obj.Vector3(); 83 | Obj.Vector2 UV = new Obj.Vector2(); 84 | 85 | if (V.pointIndex < anObj.points.Count) 86 | Point = anObj.points[V.pointIndex]; 87 | if (V.normalIndex < anObj.normals.Count) 88 | Normal = anObj.normals[V.normalIndex]; 89 | if (V.texcoordIndex < anObj.texcoords.Count) 90 | UV = anObj.texcoords[V.texcoordIndex]; 91 | 92 | return string.Format("0 {0:F6} {1:F6} {2:F6} {3:F6} {4:F6} {5:F6} {6:F6} {7:F6} 1 0 1.000000", Point.x, Point.y, Point.z, Normal.x, Normal.y, Normal.z, UV.x, UV.y); 93 | } 94 | } 95 | 96 | } -------------------------------------------------------------------------------- /ModMaker/Logic/ShortCutIcon.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Drawing; 7 | 8 | namespace ModMaker.Logic 9 | { 10 | class ShortCutIcon 11 | { 12 | //[StructLayout(LayoutKind.Sequential)] 13 | //public struct SHFILEINFO 14 | //{ 15 | // public const int NAMESIZE = 80; 16 | // public IntPtr hIcon; 17 | // public int iIcon; 18 | // public uint dwAttributes; 19 | // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)] 20 | // public string szDisplayName; 21 | // [MarshalAs(UnmanagedType.ByValTStr, SizeConst = NAMESIZE)] 22 | // public string szTypeName; 23 | //}; 24 | 25 | //[DllImport("Shell32.dll")] 26 | //public static extern IntPtr SHGetFileInfo( 27 | // string pszPath, 28 | // uint dwFileAttributes, 29 | // ref SHFILEINFO psfi, 30 | // uint cbFileInfo, 31 | // uint uFlags 32 | //); 33 | 34 | //public static System.Drawing.Icon GetFileIcon(string name, IconSize size, 35 | // bool linkOverlay) 36 | //{ 37 | // Shell32.SHFILEINFO shfi = new Shell32.SHFILEINFO(); 38 | // uint flags = Shell32.SHGFI_ICON | Shell32.SHGFI_USEFILEATTRIBUTES; 39 | 40 | // if (true == linkOverlay) flags += Shell32.SHGFI_LINKOVERLAY; 41 | 42 | 43 | // /* Check the size specified for return. */ 44 | // if (IconSize.Small == size) 45 | // { 46 | // flags += Shell32.SHGFI_SMALLICON; // include the small icon flag 47 | // } 48 | // else 49 | // { 50 | // flags += Shell32.SHGFI_LARGEICON; // include the large icon flag 51 | // } 52 | 53 | // Shell32.SHGetFileInfo(name, 54 | // Shell32.FILE_ATTRIBUTE_NORMAL, 55 | // ref shfi, 56 | // (uint)System.Runtime.InteropServices.Marshal.SizeOf(shfi), 57 | // flags); 58 | 59 | 60 | // // Copy (clone) the returned icon to a new object, thus allowing us 61 | // // to call DestroyIcon immediately 62 | // System.Drawing.Icon icon = (System.Drawing.Icon) 63 | // System.Drawing.Icon.FromHandle(shfi.hIcon).Clone(); 64 | // User32.DestroyIcon(shfi.hIcon); // Cleanup 65 | // return icon; 66 | //} 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /ModMaker/Options/Cleansweep.txt: -------------------------------------------------------------------------------- 1 | "Cleansweep.txt" 2 | { 3 | files 4 | { 5 | "MS Games For Windows Live" "^gfwlivesetup\.exe$" 6 | "MS Visual C++ Redist" "^(vcredist){1}.*(\.exe)$" 7 | "NVidia PhysX" "^(physx){1}.+(systemsoftware.exe){1}$" 8 | "GameSpy Arcade" "^(arcadeinstallfull){1}.*(\.exe)$" 9 | "GameSpy Arcade" "^gamespyinstaller220std\.exe$" 10 | "MS XNA Framework Redist" "^(xna){1}.*(\.msi)$" 11 | "MS XNA Framework Redist" "^xnafx\d\d_redist\.msi$" 12 | "MS .NET Framework Redist" "^(dotnet).*(setup\.exe)$" 13 | "MS .NET Framework Redist (64-bit)" "^(dotnet).*(x86_x64\.exe)$" 14 | "MS .NET Framework Redist" "^dotnetfx35\.exe$" 15 | "OpenAL" "^openalweax\.exe$" 16 | "MS DirectX Web Installer" "^dxwebsetup\.exe$" 17 | "Takedown Red Sabre Redist" "^ndP451-kb2872776-x86-x64-allos-enu\.exe$" 18 | "Rapture 3D" "^(rapture3d_){1}.*(game\.exe)$" 19 | "AMD Dual-Core Optimizer" "^amd_dcoptsetup\.exe?$" 20 | "MS XML Redist" "^msxml4-kb954430-enu\.exe$" 21 | "MS XML Redist" "^msxml4-kb973688-enu\.exe$" 22 | "MS XML Redist" "^msxml4-kb\d{6}-enu\.exe$" 23 | "MS .NET Framework Redist" "^wic_x64_enu\.exe$" 24 | "MS .NET Framework Redist" "^wic_x86_enu\.exe$" 25 | "MS .NET Framework Redist (64-bit)" "^xpsepsc-amd64-en-us\.exe$" 26 | "MS .NET Framework Redist" "^xpsepsc-x86-en-us\.exe$" 27 | "MS .NET Framework Redist (64-bit)" "^dotnetfx\d\d_client_x86_x64\.exe$" 28 | "MS .NET Framework Redist (Itanium)" "^netfx\d\d_ia64\.exe$" 29 | "MS .NET Framework Redist (64-bit)" "^netfx\d\d_x64\.exe$" 30 | "MS .NET Framework Redist" "^netfx\d\d_x86\.exe$" 31 | "BattlEye Anti-Cheat Engine" "^setup_battleyearma2\.exe$" 32 | "Crash Dump" "^.*\.mdmp$" 33 | } 34 | folders 35 | { 36 | "MS DirectX" "^directx$" 37 | "MS DirectX" "^dxredist$" 38 | "MS DirectX" "^directx_redist$" 39 | "MS DirectX" "^dx_redist_install$" 40 | "MS DirectX" "^directxredist$" 41 | "MS DirectX" "^dx\sredist$" 42 | "MS DirectX" "^directx_\a{3}_\d{4}$" 43 | "MS Visual C++ Redist(s)" "^msvcrt$" 44 | "MS Visual C++ Redist(s)" "^vcredist$" 45 | "MS Games For Windows Live" "^g4w$" 46 | "Many redistributables" "^dependencies$" 47 | "Many redistributables" "^prerequisite(s)?" 48 | "Many redistributables" "^installer(s)?" 49 | "Many redistributables" "^redist(s)?" 50 | "Many redistributables" "^redistributable(s)?" 51 | "Many UE3 redistributables" "^ue3Redist?" 52 | } 53 | } -------------------------------------------------------------------------------- /ModMaker/Options/FileType.txt: -------------------------------------------------------------------------------- 1 | FileType 2 | { 3 | qc 4 | { 5 | command "{SDKPath}/StudioMdl.exe -game {ModPath} {FilePath}" 6 | filter "Quake C (model) script" 7 | logwindow 1 8 | } 9 | vmf 10 | { 11 | command "BatchCompiler.exe {FilePath}" 12 | filter "Valve Map Format" 13 | } 14 | png 15 | { 16 | command "VTFEdit.exe {FilePath}" 17 | filter "Portable Network Graphics" 18 | } 19 | tga 20 | { 21 | command "VTFEdit.exe {FilePath}" 22 | filter "Targa Truevision Image" 23 | } 24 | bmp 25 | { 26 | command "VTFEdit.exe {FilePath}" 27 | filter "Bitmap Image" 28 | } 29 | psd 30 | { 31 | command "VTFEdit.exe {FilePath}" 32 | filter "Photoshop Data" 33 | } 34 | smd 35 | { 36 | command "QCScriptMaker {FilePath}" 37 | filter "Studio Model Data" 38 | } 39 | bsp 40 | { 41 | command "{SteamPath}/Steam.exe -applaunch {AppId} -game {ModPath} -map {FilePath}" 42 | filter "Binary Space Partion (map)" 43 | } 44 | txt 45 | { 46 | command "Notepad.exe {FilePath}" 47 | filter "Text Document" 48 | } 49 | res 50 | { 51 | command "Notepad.exe {FilePath}" 52 | filter "Resource File" 53 | } 54 | cfg 55 | { 56 | command "Notepad.exe {FilePath}" 57 | filter "Configuration" 58 | } 59 | } -------------------------------------------------------------------------------- /ModMaker/Options/apps.txt: -------------------------------------------------------------------------------- 1 | Apps 2 | { 3 | 215 4 | { 5 | game "Source SDK Base 2006" 6 | sdkversion 2 7 | engine 2006 8 | gameexe "{0}half-life 2/hl2.exe" 9 | supress 1 10 | } 11 | 218 12 | { 13 | game "Source SDK Base 2007" 14 | sdkversion 3 15 | engine 2007 16 | gameexe "{0}source sdk base 2007/hl2.exe" 17 | supress 1 18 | } 19 | 220 20 | { 21 | game "Half-Life 2" 22 | sdkversion 4 23 | engine 2009 24 | gameexe "{0}half-life 2/hl2.exe" 25 | } 26 | 240 27 | { 28 | game "Counter-Strike: Source" 29 | sdkversion 5 30 | engine 2009 31 | gameexe "" 32 | } 33 | 280 34 | { 35 | game "Half-Life: Source" 36 | sdkversion 2 37 | engine 2006 38 | gameexe "" 39 | } 40 | 300 41 | { 42 | game "Day of Defeat: Source" 43 | sdkversion 5 44 | engine 2009 45 | gameexe "" 46 | } 47 | 320 48 | { 49 | game "Half-Life 2: Deathmatch" 50 | sdkversion 2 51 | engine 2006 52 | gameexe "" 53 | } 54 | 321 55 | { 56 | game "Half-Life 2: Deathmatch" 57 | sdkversion 2 58 | engine 2006 59 | gameexe "" 60 | } 61 | 340 62 | { 63 | game "Half-Life 2: Lost Coast" 64 | sdkversion 3 65 | engine 2007 66 | gameexe "" 67 | } 68 | 360 69 | { 70 | game "Half-Life Deathmatch: Source" 71 | sdkversion 3 72 | engine 2007 73 | gameexe "" 74 | } 75 | 380 76 | { 77 | game "Half-Life 2: Episode One" 78 | sdkversion 4 79 | engine 2009 80 | gameexe "" 81 | } 82 | 400 83 | { 84 | game Portal 85 | sdkversion 4 86 | engine 2009 87 | gameexe "" 88 | } 89 | 420 90 | { 91 | game "Half-Life 2: Episode Two" 92 | sdkversion 4 93 | engine 2009 94 | gameexe "{1}half-life 2/hl2.exe" 95 | } 96 | 440 97 | { 98 | game "Team Fortress 2" 99 | sdkversion 5 100 | engine 2009 101 | gameexe "" 102 | } 103 | 500 104 | { 105 | game "Left 4 Dead" 106 | sdkversion 4 107 | engine 2009 108 | gameexe "" 109 | } 110 | 550 111 | { 112 | game "Left 4 Dead 2" 113 | sdkversion 4 114 | engine 2009 115 | gameexe "" 116 | } 117 | 620 118 | { 119 | game "Portal 2" 120 | sdkversion 4 121 | engine 2009 122 | gameexe "" 123 | } 124 | 630 125 | { 126 | game "Alien Swarm" 127 | sdkversion 4 128 | engine 2009 129 | gameexe "" 130 | } 131 | 1800 132 | { 133 | game "Counter-Strike: Global Offensive" 134 | sdkversion 5 135 | engine 2009 136 | gameexe "" 137 | } 138 | 243730 139 | { 140 | game "Source SDK Base Singleplayer 2013" 141 | sdkversion 6 142 | engine 2013 143 | gameexe "{1}Source SDK Base 2013 Singleplayer/hl2.exe" 144 | supress 1 145 | } 146 | 243750 147 | { 148 | game "Source SDK Base Multiplayer 2013" 149 | sdkversion 7 150 | engine 2013 151 | gameexe "{1}Source SDK Base 2013 Multiplayer/hl2.exe" 152 | supress 1 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /ModMaker/Options/mods.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Options/mods.txt -------------------------------------------------------------------------------- /ModMaker/Options/tools.txt: -------------------------------------------------------------------------------- 1 | tools 2 | { 3 | "cd" 4 | { 5 | overview "Changes the working folder to one the specified. Must be on the correct drive already" 6 | description "Path of the folder to be made current" 7 | control "folderpicker" 8 | anonArg 1 9 | 10 | } 11 | "rem" 12 | { 13 | overview "Remarks or comments for documentation." 14 | description "text to be included" 15 | control "textbox" 16 | anonArg 1 17 | } 18 | "{SDKPath}vbsp.exe" 19 | { 20 | overview "Takes a VMF from hammer and produces a basic BSP" 21 | description "Path to the .vmf to be compiled" 22 | control "filepicker" 23 | anonArg 1 24 | arguments 25 | { 26 | "-v" 27 | { 28 | description "Turn on verbose output (also shows more command-line options)." 29 | control checkbox 30 | } 31 | "-onlyents" 32 | { 33 | description "Only import the entities from the VMF. Brushes and internal entities are not modified. Conserves existing lighting data." 34 | control checkbox 35 | } 36 | "-onlyprops" 37 | { 38 | description "Only update static and detail props (i.e. the internal entities). Does not generate a .prt file, making VVIS fail!" 39 | control checkbox 40 | } 41 | "-glview" 42 | { 43 | description "Writes glview data to the VMF's directory. -tmpout will cause the files will be written to \tmp instead." 44 | control checkbox 45 | } 46 | "-nodetail" 47 | { 48 | description "Removes func_detail brushes. The geometry left over is what affects visibility." 49 | control checkbox 50 | } 51 | "-nowater" 52 | { 53 | description "Get rid of water brushes." 54 | control checkbox 55 | } 56 | "-low" 57 | { 58 | description "Run as an idle-priority process." 59 | control checkbox 60 | } 61 | // "-vproject " 62 | // { 63 | // description "Specify the game/mod to compile for" 64 | // control folderpicker 65 | // anonArg 1 66 | // } 67 | "-game " 68 | { 69 | description "Specify the game/mod to compile for" 70 | control folderpicker 71 | anonArg 1 72 | default "{ModPath}" 73 | } 74 | //here be advanced options 75 | "-novconfig" 76 | { 77 | advanced 1 78 | control checkbox 79 | description "Don't bring up graphical UI on vproject errors." 80 | } 81 | "-threads" 82 | { 83 | description "Control the number of threads vbsp uses (defaults to the # of processors (times 2 for Hypertreading/SMT CPU's) on your machine)." 84 | control textbox 85 | } 86 | "-verboseentities" 87 | { 88 | advanced 1 89 | control checkbox 90 | description "If verbose is on, this disables verbose output for submodels." 91 | } 92 | "-noweld" 93 | { 94 | advanced 1 95 | control checkbox 96 | description "Don't join face vertexes together." 97 | } 98 | "-nocsg" 99 | { 100 | advanced 1 101 | control checkbox 102 | description "Don't chop out intersecting brush areas." 103 | } 104 | "-noshare" 105 | { 106 | advanced 1 107 | control checkbox 108 | description "Emit unique face edges instead of sharing them." 109 | } 110 | "-notjunc" 111 | { 112 | advanced 1 113 | control checkbox 114 | description "Don't fixup t-junctions." 115 | } 116 | "-noopt" 117 | { 118 | advanced 1 119 | control checkbox 120 | description "Disable vbsp default behaviour wher it removes the 'outer shell' of the map (all the faces outside the map)." 121 | } 122 | "-noprune" 123 | { 124 | advanced 1 125 | control checkbox 126 | description "Don't prune neighboring solid nodes." 127 | } 128 | "-nomerge" 129 | { 130 | advanced 1 131 | control checkbox 132 | description "Don't merge together chopped faces on nodes." 133 | } 134 | "-nomergewater" 135 | { 136 | advanced 1 137 | control checkbox 138 | description "Don't merge together chopped faces on water." 139 | } 140 | "-nosubdiv" 141 | { 142 | advanced 1 143 | control checkbox 144 | description "Don't subdivide faces for lightmapping." 145 | } 146 | "-micro" 147 | { 148 | advanced 1 149 | control textbox 150 | description "vbsp will warn when brushes are output with a volume less than this number." 151 | default "1.0" 152 | } 153 | } 154 | } 155 | } -------------------------------------------------------------------------------- /ModMaker/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace ModMaker 5 | { 6 | static class Program 7 | { 8 | /// 9 | /// The main entry point for the application. 10 | /// 11 | [STAThread] 12 | static void Main() 13 | { 14 | Application.EnableVisualStyles(); 15 | Application.SetCompatibleTextRenderingDefault(false); 16 | Application.Run(new MainForm()); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ModMaker/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ModMaker")] 9 | [assembly: AssemblyDescription("Launcher and tools to aid mod creation for the Source game engine")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Matthew Rye")] 12 | [assembly: AssemblyProduct("ModMaker")] 13 | [assembly: AssemblyCopyright("Copyright © Matthew Rye 2011-2021")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e3bd9110-0662-4e6f-9ba6-0c61c3dca0cf")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("2.0.0.1")] 36 | [assembly: AssemblyFileVersion("2.0.0.1")] 37 | -------------------------------------------------------------------------------- /ModMaker/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ModMaker.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ModMaker/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ModMaker/Resources/Chapter2014.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/Chapter2014.ico -------------------------------------------------------------------------------- /ModMaker/Resources/Clean2014.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/Clean2014.ico -------------------------------------------------------------------------------- /ModMaker/Resources/Folder_Closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/Folder_Closed.png -------------------------------------------------------------------------------- /ModMaker/Resources/Folder_Open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/Folder_Open.png -------------------------------------------------------------------------------- /ModMaker/Resources/FormRunHS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/FormRunHS.png -------------------------------------------------------------------------------- /ModMaker/Resources/Hard_Drive.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/Hard_Drive.ico -------------------------------------------------------------------------------- /ModMaker/Resources/Keys2014.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/Keys2014.ico -------------------------------------------------------------------------------- /ModMaker/Resources/Light2014.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/Light2014.ico -------------------------------------------------------------------------------- /ModMaker/Resources/Localization2014.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/Localization2014.ico -------------------------------------------------------------------------------- /ModMaker/Resources/ModMaker128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/ModMaker128.png -------------------------------------------------------------------------------- /ModMaker/Resources/ModMaker2014.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/ModMaker2014.ico -------------------------------------------------------------------------------- /ModMaker/Resources/Refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/Refresh.png -------------------------------------------------------------------------------- /ModMaker/Resources/Sound2014.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/Sound2014.ico -------------------------------------------------------------------------------- /ModMaker/Resources/Weapon2014.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/Weapon2014.ico -------------------------------------------------------------------------------- /ModMaker/Resources/computer.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/computer.ico -------------------------------------------------------------------------------- /ModMaker/Resources/modern-install-full.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/modern-install-full.ico -------------------------------------------------------------------------------- /ModMaker/Resources/orange-install.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMaker/Resources/orange-install.ico -------------------------------------------------------------------------------- /ModMaker/Tools/CompilerTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using LibModMaker; 7 | using System.Drawing; 8 | using System.Windows.Forms; 9 | 10 | namespace ModMaker 11 | { 12 | internal class CompilerTool : iFileTool 13 | { 14 | Compiler oCompiler = null; 15 | 16 | public string Name { get { return "Compiler"; } } 17 | public Image Image { get { return Properties.Resources.ModMaker.ToBitmap(); } } 18 | public string TipText { get { return "Drag and drop source files on to this icon"; } } 19 | public bool IsValidForMod(SourceMod Game) 20 | { 21 | if (Game == null) return false; 22 | return true; 23 | } 24 | 25 | /// 26 | /// Launch a dialog to pick a file to compile for a given game 27 | /// 28 | /// 29 | public void Launch(SourceMod Game) 30 | { 31 | if (oCompiler == null) oCompiler = new Compiler(Game); 32 | 33 | var dialog = new OpenFileDialog() { Title = "Select file to Compile" }; 34 | 35 | dialog.Filter = oCompiler.GetFileTypeFilter(); 36 | 37 | if (dialog.ShowDialog() == DialogResult.Cancel) return; 38 | 39 | string FilePath = dialog.FileName; 40 | 41 | LaunchFile(Game, FilePath); 42 | } 43 | 44 | /// 45 | /// Launch the compiler with the given file and game 46 | /// 47 | /// 48 | /// 49 | public void LaunchFile(SourceMod Game, string FilePath) 50 | { 51 | if (oCompiler == null) oCompiler = new Compiler(Game); 52 | 53 | oCompiler.Compile(FilePath); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ModMaker/Tools/FGD_Tool.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | 6 | namespace ModMaker 7 | { 8 | 9 | /// 10 | /// Tool for launching the FGD editor for the given game 11 | /// 12 | public class FGD_Tool : iTool 13 | { 14 | 15 | private SourceMod _game = null; 16 | 17 | public Image Image 18 | { 19 | get 20 | { 21 | if (_game == null) 22 | return Properties.Resources.ModMaker.ToBitmap(); 23 | 24 | Icon HammerIcon = GetHammerIcon(); 25 | 26 | if (HammerIcon == null) 27 | return Properties.Resources.ModMaker.ToBitmap(); 28 | 29 | Image Result = HammerIcon.ToBitmap(); 30 | 31 | if (Result == null) 32 | return Properties.Resources.ModMaker.ToBitmap(); 33 | 34 | return Result; 35 | } 36 | } 37 | 38 | public bool IsValidForMod(LibModMaker.SourceMod Game) 39 | { 40 | _game = Game; 41 | 42 | return true; 43 | } 44 | 45 | public void Launch(LibModMaker.SourceMod Game) 46 | { 47 | _game = Game; 48 | 49 | FGDForm Dialog = new FGDForm {Game = Game}; 50 | 51 | Dialog.Show(); 52 | } 53 | 54 | public string Name 55 | { 56 | get { return "FGD Editor"; } 57 | } 58 | 59 | public string TipText 60 | { 61 | get { return "Edit Forge Game Data (FGD) files for Hammer"; } 62 | } 63 | 64 | public System.Drawing.Icon GetHammerIcon() 65 | { 66 | if (!_game.HasSDKInstalled()) 67 | return null; 68 | 69 | string HammerExe = Path.Combine(_game.SDKPath, "hammer.exe"); 70 | 71 | if (!File.Exists(HammerExe)) 72 | return null; 73 | 74 | return System.Drawing.Icon.ExtractAssociatedIcon(HammerExe); 75 | } 76 | } 77 | 78 | } -------------------------------------------------------------------------------- /ModMaker/Tools/FacePoserTool.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System.IO; 3 | using System.Drawing; 4 | using System.Diagnostics; 5 | 6 | namespace ModMaker 7 | { 8 | 9 | /// 10 | /// Tool for launching the Face Poser tool for the given game 11 | /// 12 | public class FacePoserTool : iTool 13 | { 14 | private SourceMod _game = null; 15 | 16 | public System.Drawing.Image Image 17 | { 18 | get 19 | { 20 | if (_game == null) 21 | return Properties.Resources.ModMaker.ToBitmap(); 22 | 23 | Icon ToolIcon = GetToolIcon(); 24 | 25 | if (ToolIcon == null) 26 | return Properties.Resources.ModMaker.ToBitmap(); 27 | 28 | return ToolIcon.ToBitmap(); 29 | } 30 | } 31 | 32 | public bool IsValidForMod(LibModMaker.SourceMod Game) 33 | { 34 | _game = Game; 35 | 36 | return HasTool(); 37 | } 38 | 39 | public void Launch(LibModMaker.SourceMod Game) 40 | { 41 | _game = Game; 42 | LaunchTool(); 43 | } 44 | 45 | public string Name 46 | { 47 | get { return "Face Poser"; } 48 | } 49 | 50 | public string TipText 51 | { 52 | get { return "Launch the Valve Face Poser"; } 53 | } 54 | 55 | private string ToolPath 56 | { 57 | get 58 | { 59 | string AppPath = Steam.AppPath(_game.AppId); 60 | 61 | if (AppPath == null) 62 | return null; 63 | 64 | return Path.Combine(Path.Combine(AppPath, "bin"), "hlfaceposer.exe"); 65 | } 66 | } 67 | 68 | public bool HasTool() 69 | { 70 | return File.Exists(ToolPath); 71 | } 72 | 73 | public void LaunchTool() 74 | { 75 | var S = new ProcessStartInfo 76 | { 77 | FileName = ToolPath, 78 | UseShellExecute = false, 79 | CreateNoWindow = true, 80 | WindowStyle = ProcessWindowStyle.Hidden 81 | }; 82 | 83 | S.EnvironmentVariables["VProject"] = _game.InstallPath.TrimEnd('/').TrimEnd('\\'); 84 | S.EnvironmentVariables["VPPROJECT"] = _game.InstallPath.TrimEnd('/').TrimEnd('\\'); 85 | 86 | Process.Start(S); 87 | } 88 | 89 | public Icon GetToolIcon() 90 | { 91 | if (!File.Exists(ToolPath)) 92 | return null; 93 | 94 | return System.Drawing.Icon.ExtractAssociatedIcon(ToolPath); 95 | } 96 | } 97 | 98 | } -------------------------------------------------------------------------------- /ModMaker/Tools/HammerTool.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | using System.Diagnostics; 6 | 7 | namespace ModMaker 8 | { 9 | 10 | /// 11 | /// Launch the Valve Hammer for the given game 12 | /// 13 | public class HammerTool : iTool 14 | { 15 | private SourceMod _game = null; 16 | 17 | public Image Image 18 | { 19 | get 20 | { 21 | if (_game == null) 22 | return Properties.Resources.ModMaker.ToBitmap(); 23 | 24 | Icon HammerIcon = GetHammerIcon(); 25 | 26 | if (HammerIcon == null) 27 | return Properties.Resources.ModMaker.ToBitmap(); 28 | 29 | return HammerIcon.ToBitmap(); 30 | } 31 | } 32 | 33 | public bool IsValidForMod(LibModMaker.SourceMod Game) 34 | { 35 | _game = Game; 36 | 37 | return HasHammer(); 38 | } 39 | 40 | public void Launch(LibModMaker.SourceMod Game) 41 | { 42 | _game = Game; 43 | LaunchHammer(); 44 | } 45 | 46 | public string Name 47 | { 48 | get { return "Hammer"; } 49 | } 50 | 51 | public string TipText 52 | { 53 | get { return "Launch the Valve Hammer"; } 54 | } 55 | 56 | private string HammerPath 57 | { 58 | get 59 | { 60 | string AppPath = Steam.AppPath(_game.AppId); 61 | 62 | if (AppPath == null) 63 | return null; 64 | 65 | return Path.Combine(AppPath, "bin", "hammer.exe"); 66 | } 67 | } 68 | 69 | public bool HasHammer() 70 | { 71 | return File.Exists(HammerPath); 72 | } 73 | 74 | public void LaunchHammer() 75 | { 76 | ProcessStartInfo S = new ProcessStartInfo 77 | { 78 | FileName = HammerPath, 79 | UseShellExecute = false, 80 | CreateNoWindow = true, 81 | WindowStyle = ProcessWindowStyle.Hidden 82 | }; 83 | 84 | S.EnvironmentVariables["VProject"] = _game.InstallPath.TrimEnd('/').TrimEnd('\\'); 85 | S.EnvironmentVariables["VPPROJECT"] = _game.InstallPath.TrimEnd('/').TrimEnd('\\'); 86 | 87 | Process.Start(S); 88 | } 89 | 90 | public Icon GetHammerIcon() 91 | { 92 | if (!File.Exists(HammerPath)) 93 | return null; 94 | 95 | return System.Drawing.Icon.ExtractAssociatedIcon(HammerPath); 96 | } 97 | } 98 | 99 | } -------------------------------------------------------------------------------- /ModMaker/Tools/HitBoxFix.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | using Microsoft.VisualBasic; 6 | 7 | namespace ModMaker 8 | { 9 | 10 | /// 11 | /// Experimental tool for dealing with hitboxes on models that use the $scale option 12 | /// 13 | public class HitBoxFix : iTool 14 | { 15 | 16 | 17 | private double dblScale; 18 | 19 | public System.Drawing.Image Image 20 | { 21 | get { return Properties.Resources.ModMaker.ToBitmap(); } 22 | } 23 | 24 | public bool IsValidForMod(LibModMaker.SourceMod Game) 25 | { 26 | return true; 27 | } 28 | 29 | public void Launch(LibModMaker.SourceMod Game) 30 | { 31 | string QCIPath = Interaction.InputBox("Please enter the path to the hitbox QCI installed", "QCI Path", Game.SourcePath); 32 | 33 | if (!File.Exists(QCIPath)) 34 | return; 35 | if (!QCIPath.EndsWith(".qci")) 36 | return; 37 | 38 | string strScale = Interaction.InputBox("Please enter the $scale", "$scale", "1.0"); 39 | 40 | this.dblScale = 1.0; 41 | 42 | if (!double.TryParse(strScale, out this.dblScale)) 43 | return; 44 | 45 | this.dblScale = 1.0/this.dblScale; 46 | 47 | SourceFileSystem.BackUpFile(QCIPath); 48 | 49 | string Result = File.ReadAllText(QCIPath); 50 | 51 | Result = Result.Replace("$hbox ", "\r\n$hbox "); 52 | 53 | string[] Lines = Result.Split('\n'); 54 | 55 | for (int Index = 0; Index <= Lines.Length - 1; Index++) 56 | { 57 | if (Lines[Index].Contains("$hbox ")) 58 | { 59 | Lines[Index] = ScaleHitbox(Lines[Index]); 60 | } 61 | } 62 | 63 | File.Delete(QCIPath); 64 | 65 | using (FileStream fs = File.OpenWrite(QCIPath)) 66 | { 67 | using (StreamWriter sr = new StreamWriter(fs)) 68 | { 69 | foreach (string Line in Lines) 70 | { 71 | sr.WriteLine(Line); 72 | } 73 | 74 | sr.Flush(); 75 | } 76 | } 77 | } 78 | 79 | public string Name 80 | { 81 | get { return "Hit Box Fix"; } 82 | } 83 | 84 | public string TipText 85 | { 86 | get { return "Scale hitboxes generated by model viewer"; } 87 | } 88 | 89 | private string ScaleHitbox(string Source) 90 | { 91 | int LastQuote = Source.IndexOf(ControlChars.Quote) + 1; 92 | 93 | LastQuote = Source.IndexOf(ControlChars.Quote, LastQuote) + 1; 94 | 95 | string Result = Source.Substring(0, LastQuote) + '\t'; 96 | // Source up to the second quote 97 | string NumberString = Source.Substring(LastQuote); 98 | 99 | NumberString = NumberString.Replace('\t', ' '); 100 | 101 | for (int i = 1; i <= 20; i++) 102 | { 103 | NumberString = NumberString.Replace(" ", " "); 104 | } 105 | 106 | NumberString = NumberString.Trim(); 107 | 108 | string[] Numbers = NumberString.Split(' '); 109 | 110 | foreach (string strNumber in Numbers) 111 | { 112 | double dblNumber = double.Parse(strNumber); 113 | 114 | dblNumber = dblNumber * this.dblScale; 115 | 116 | Result += dblNumber.ToString("N2") + '\t'; 117 | } 118 | 119 | return Result; 120 | } 121 | } 122 | 123 | } -------------------------------------------------------------------------------- /ModMaker/Tools/InstallScriptTool.cs: -------------------------------------------------------------------------------- 1 | namespace ModMaker 2 | { 3 | 4 | /// 5 | /// Launch the NSI install script builder 6 | /// 7 | public class InstallScriptTool : iTool 8 | { 9 | public string PropertyScriptPath; 10 | 11 | public System.Drawing.Image Image 12 | { 13 | get { return Properties.Resources.modern_install_full.ToBitmap(); } 14 | } 15 | 16 | public bool IsValidForMod(LibModMaker.SourceMod Game) 17 | { 18 | return true; 19 | } 20 | 21 | public void Launch(LibModMaker.SourceMod Game) 22 | { 23 | InstallScriptMaker Helper = new InstallScriptMaker(Game); 24 | InstallerForm Dialog = new InstallerForm(); 25 | 26 | Dialog.InstallerTool = Helper; 27 | Dialog.Show(); 28 | } 29 | 30 | public string Name 31 | { 32 | get { return "Make Installer"; } 33 | } 34 | 35 | public string TipText 36 | { 37 | get { return "Make a stand alone installer using the Nullsoft install system"; } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /ModMaker/Tools/KeyBindingsTool.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | 6 | namespace ModMaker 7 | { 8 | 9 | /// 10 | /// Launch a tool for managing key bindings in game 11 | /// 12 | public class KeyBindingsTool : iTool 13 | { 14 | 15 | public System.Drawing.Image Image 16 | { 17 | get { return Properties.Resources.Keys.ToBitmap(); } 18 | } 19 | 20 | public bool IsValidForMod(LibModMaker.SourceMod Game) 21 | { 22 | return true; 23 | } 24 | 25 | public void Launch(LibModMaker.SourceMod Game) 26 | { 27 | KeyBindingForm x = new KeyBindingForm(); 28 | 29 | x.LoadFiles(Game); 30 | x.ShowDialog(); 31 | } 32 | 33 | public string Name 34 | { 35 | get { return "Key Menu Editor"; } 36 | } 37 | 38 | public string TipText 39 | { 40 | get { return "Edit which commands can be bound to keys via the menu and specify default keys"; } 41 | } 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /ModMaker/Tools/LightTool.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | 6 | namespace ModMaker 7 | { 8 | 9 | /// 10 | /// Launch a tool for managing texture lights 11 | /// 12 | public class LightTool : iTool 13 | { 14 | 15 | public System.Drawing.Image Image 16 | { 17 | get { return Properties.Resources.Light.ToBitmap(); } 18 | } 19 | 20 | public bool IsValidForMod(LibModMaker.SourceMod Game) 21 | { 22 | return true; 23 | } 24 | 25 | public void Launch(LibModMaker.SourceMod Game) 26 | { 27 | LightsForm Dialog = new LightsForm(); 28 | 29 | Dialog.Game = Game; 30 | Dialog.Show(); 31 | } 32 | 33 | public string Name 34 | { 35 | get { return "Lights"; } 36 | } 37 | 38 | public string TipText 39 | { 40 | get { return "Texture Lights (.rad) Editor"; } 41 | } 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /ModMaker/Tools/LocalizationTool.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | 6 | namespace ModMaker 7 | { 8 | 9 | /// 10 | /// Launch a tool to aid localization of a game into multiple languages 11 | /// 12 | public class LocalizationTool : iTool 13 | { 14 | 15 | public System.Drawing.Image Image 16 | { 17 | get { return Properties.Resources.Localization.ToBitmap(); } 18 | } 19 | 20 | public bool IsValidForMod(LibModMaker.SourceMod Game) 21 | { 22 | return true; 23 | } 24 | 25 | public void Launch(LibModMaker.SourceMod Game) 26 | { 27 | var LocalForm = new LocalForm(); 28 | 29 | LocalForm.GameDir = Game.InstallFolder; 30 | LocalForm.Show(); 31 | } 32 | 33 | public string Name 34 | { 35 | get { return "Localization"; } 36 | } 37 | 38 | public string TipText 39 | { 40 | get { return "Translate your mod into other languages"; } 41 | } 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /ModMaker/Tools/MapBuilderTool.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | using System.Diagnostics; 6 | 7 | namespace ModMaker 8 | { 9 | /// 10 | /// Experimental tool for launching an external map compiler 11 | /// 12 | public class MapBuilderTool : iTool 13 | { 14 | private SourceMod _game = null; 15 | 16 | public System.Drawing.Image Image 17 | { 18 | get 19 | { 20 | if (_game == null) 21 | return Properties.Resources.ModMaker.ToBitmap(); 22 | 23 | Image Result = GetHammerIcon().ToBitmap(); 24 | 25 | if (Result == null) 26 | return Properties.Resources.ModMaker.ToBitmap(); 27 | 28 | return Result; 29 | } 30 | } 31 | 32 | public bool IsValidForMod(LibModMaker.SourceMod Game) 33 | { 34 | _game = Game; 35 | 36 | return true; 37 | } 38 | 39 | public void Launch(LibModMaker.SourceMod Game) 40 | { 41 | _game = Game; 42 | 43 | System.Diagnostics.Process _Process = new System.Diagnostics.Process(); 44 | 45 | _Process.StartInfo.WorkingDirectory = Environment.CurrentDirectory; 46 | _Process.StartInfo.FileName = "MapBuilder.exe"; 47 | _Process.StartInfo.Arguments = "-game \"" + Game.InstallPath + "\""; 48 | _Process.StartInfo.WindowStyle = ProcessWindowStyle.Normal; 49 | _Process.StartInfo.UseShellExecute = true; 50 | 51 | _Process.Start(); 52 | _Process.WaitForExit(); 53 | } 54 | 55 | public string Name 56 | { 57 | get { return "Map Builder"; } 58 | } 59 | 60 | public string TipText 61 | { 62 | get { return "Compile maps outside Hammer"; } 63 | } 64 | 65 | public System.Drawing.Icon GetHammerIcon() 66 | { 67 | string HammerExe = Path.Combine(_game.SDKPath, "hammer.exe"); 68 | 69 | if (!File.Exists(HammerExe)) 70 | return null; 71 | 72 | return System.Drawing.Icon.ExtractAssociatedIcon(HammerExe); 73 | } 74 | } 75 | 76 | } -------------------------------------------------------------------------------- /ModMaker/Tools/ModelViewerTool.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | using System.Diagnostics; 6 | 7 | namespace ModMaker 8 | { 9 | /// 10 | /// Tool to launch the HL model viewer for a given game 11 | /// 12 | public class ModelViewerTool : iTool 13 | { 14 | private SourceMod _game = null; 15 | 16 | public System.Drawing.Image Image 17 | { 18 | get 19 | { 20 | if (_game == null) 21 | return Properties.Resources.ModMaker.ToBitmap(); 22 | 23 | if (!HasHLMV()) 24 | return null; 25 | 26 | return System.Drawing.Icon.ExtractAssociatedIcon(HLMVPath).ToBitmap(); 27 | } 28 | } 29 | 30 | public bool HasHLMV() 31 | { 32 | return File.Exists(HLMVPath); 33 | } 34 | 35 | public bool IsValidForMod(LibModMaker.SourceMod Game) 36 | { 37 | _game = Game; 38 | 39 | return HasHLMV(); 40 | } 41 | 42 | public void Launch(LibModMaker.SourceMod Game) 43 | { 44 | _game = Game; 45 | ProcessStartInfo S = new ProcessStartInfo 46 | { 47 | FileName = HLMVPath, 48 | Arguments = "-game \"" + Game.InstallPath.TrimEnd('/').TrimEnd('\\') + "\"", 49 | UseShellExecute = false, 50 | CreateNoWindow = true, 51 | WindowStyle = ProcessWindowStyle.Hidden 52 | }; 53 | 54 | S.EnvironmentVariables["VProject"] = _game.InstallPath.TrimEnd('/').TrimEnd('\\'); 55 | S.EnvironmentVariables["VPPROJECT"] = _game.InstallPath.TrimEnd('/').TrimEnd('\\'); 56 | 57 | Process.Start(S); 58 | } 59 | 60 | public string Name 61 | { 62 | get { return "Model Viewer"; } 63 | } 64 | 65 | public string TipText 66 | { 67 | get { return "Launch the Model Viewer"; } 68 | } 69 | 70 | private string HLMVPath 71 | { 72 | get 73 | { 74 | string AppPath = Steam.AppPath(_game.AppId); 75 | 76 | if (AppPath == null) 77 | return null; 78 | 79 | return Path.Combine(Path.Combine(AppPath, "bin"), "hlmv.exe"); 80 | } 81 | } 82 | } 83 | 84 | } -------------------------------------------------------------------------------- /ModMaker/Tools/SDKInstallTool.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | 6 | namespace ModMaker 7 | { 8 | /// 9 | /// A Tool to install the Software Development Kit (SDK) for this game's version of Source (so that modmaker can act as a launcher for much of it's functionality 10 | /// 11 | public class SDKInstallTool : iTool 12 | { 13 | 14 | public System.Drawing.Image Image 15 | { 16 | get { return Steam.Icon.ToBitmap(); } 17 | } 18 | 19 | public bool IsValidForMod(LibModMaker.SourceMod Game) 20 | { 21 | return !Game.HasSDKInstalled(); 22 | } 23 | 24 | public void Launch(LibModMaker.SourceMod Game) 25 | { 26 | Steam.InstallApp(Game.ToolsAppId); 27 | } 28 | 29 | public string Name 30 | { 31 | get { return "Install Source SDK"; } 32 | } 33 | 34 | public string TipText 35 | { 36 | get { return "Installs the version of the Source SDK used by this mod"; } 37 | } 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /ModMaker/Tools/ScriptSoundsTool.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | using System.Collections.Generic; 6 | using Microsoft.VisualBasic; 7 | 8 | namespace ModMaker 9 | { 10 | /// 11 | /// A tool for making sound scripts for loose WAV and MP3 files 12 | /// 13 | public class ScriptSoundsTool : iTool 14 | { 15 | private LibModMaker.SoundManifest SoundManifest; 16 | private List Log; 17 | private List Scripts; 18 | private List Sounds; 19 | 20 | public string Name 21 | { 22 | get { return "Sound Scripter"; } 23 | } 24 | 25 | public string TipText 26 | { 27 | get { return "Creates sound script entries for loose WAVs and MP3s in the Intall/sound folder"; } 28 | } 29 | 30 | public System.Drawing.Image Image 31 | { 32 | get { return Properties.Resources.Sound.ToBitmap(); } 33 | } 34 | 35 | public bool IsValidForMod(LibModMaker.SourceMod Game) 36 | { 37 | return true; 38 | } 39 | 40 | public void Launch(LibModMaker.SourceMod Game) 41 | { 42 | SoundManifest = new LibModMaker.SoundManifest(Game); 43 | Log = new List(); 44 | Scripts = new List(); 45 | Sounds = new List(); 46 | 47 | SoundManifest.CreatedScriptEntry += new SoundManifest.CreatedScriptEntryEventHandler(SoundManifest_CreatedScriptEntry); 48 | SoundManifest.CreatedScriptFile += new SoundManifest.CreatedScriptFileEventHandler(SoundManifest_CreatedScriptFile); 49 | SoundManifest.Progress += new SoundManifest.ProgressEventHandler(SoundManifest_Progress); 50 | SoundManifest.AddLooseFilesToManifest(); 51 | 52 | if (Log.Count > 0) 53 | { 54 | Interaction.MsgBox(string.Join("\r\n", Log.ToArray()), MsgBoxStyle.Information); 55 | } 56 | 57 | if (Scripts.Count > 0) 58 | { 59 | Interaction.MsgBox("Created new script files :\r\n" + string.Join("\r\n", Scripts.ToArray()), 60 | MsgBoxStyle.Information); 61 | } 62 | } 63 | 64 | private void SoundManifest_CreatedScriptEntry(object sender, string ScriptFilePath, string SoundFile, 65 | string ScriptSoundName) 66 | { 67 | Sounds.Add(SoundFile); 68 | } 69 | 70 | private void SoundManifest_CreatedScriptFile(object sender, string FilePath) 71 | { 72 | Scripts.Add(FilePath); 73 | } 74 | 75 | private void SoundManifest_Progress(object sender, string Text) 76 | { 77 | Log.Add(Text); 78 | } 79 | } 80 | 81 | } -------------------------------------------------------------------------------- /ModMaker/Tools/ShaderEditorTool.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace ModMaker 4 | { 5 | 6 | public class ShaderEditorTool : iTool 7 | { 8 | 9 | public System.Drawing.Image Image 10 | { 11 | get { return Properties.Resources.ModMaker.ToBitmap(); } 12 | } 13 | 14 | public bool IsValidForMod(LibModMaker.SourceMod Game) 15 | { 16 | if (Game == null) 17 | return false; 18 | 19 | string BinPath = Path.Combine(Game.InstallPath, "bin"); 20 | 21 | if (!Directory.Exists(BinPath)) 22 | return false; 23 | 24 | string[] ShaderEditorDLLs = Directory.GetFiles(BinPath, "shadereditor_*.dll"); 25 | 26 | return ShaderEditorDLLs.Length > 0; 27 | } 28 | 29 | public void Launch(LibModMaker.SourceMod Game) 30 | { 31 | Game.Play("-shaderedit"); 32 | } 33 | 34 | public string Name 35 | { 36 | get { return "Shader Editor"; } 37 | } 38 | 39 | public string TipText 40 | { 41 | get { return "Launch the Shader Editor"; } 42 | } 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /ModMaker/Tools/SourceSDKSetupTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | using LibModMaker; 5 | using Microsoft.VisualBasic; 6 | using System.IO; 7 | 8 | namespace ModMaker 9 | { 10 | /// 11 | /// Tool to confugure the SDK (and Hammer specifically) to work with this game 12 | /// 13 | public class SourceSDKSetupTool : iTool, InstallScriptMaker.iPrereqisite 14 | { 15 | 16 | public System.Drawing.Image Image 17 | { 18 | get { return Properties.Resources.orange_install.ToBitmap(); } 19 | } 20 | 21 | public bool IsValidForMod(LibModMaker.SourceMod Game) 22 | { 23 | return Game.HasSDKInstalled(); 24 | } 25 | 26 | public string Name 27 | { 28 | get { return "Setup Source SDK"; } 29 | } 30 | 31 | public string TipText 32 | { 33 | get { return "Configures the Source SDK for this mod"; } 34 | } 35 | 36 | public void Launch(LibModMaker.SourceMod Game) 37 | { 38 | var Dialog = new System.Windows.Forms.FolderBrowserDialog 39 | { 40 | Description = "Please select the folder where this mods Source is kept", 41 | SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) // My.Computer.FileSystem.SpecialDirectories.MyDocuments 42 | }; 43 | 44 | if (Dialog.ShowDialog() == DialogResult.Cancel) 45 | return; 46 | 47 | Game.SourcePath = Dialog.SelectedPath; 48 | 49 | SetupSDK(Game); 50 | 51 | if (Game.ToolsAppId == 211) 52 | { 53 | if ( 54 | Interaction.MsgBox("Done. Run the Source SDK now?", MsgBoxStyle.Question & MsgBoxStyle.YesNo, 55 | "Source SDK Setup") == MsgBoxResult.No) 56 | return; 57 | 58 | Steam.LaunchApp("211"); 59 | } 60 | else 61 | { 62 | Interaction.MsgBox("SDK Setup Complete", MsgBoxStyle.Information, "Source SDK Setup"); 63 | } 64 | } 65 | 66 | 67 | public List FGDs = new List(); 68 | 69 | public void SetupSDK(SourceMod Game) 70 | { 71 | string SDKConfigFile = Path.Combine(Game.SDKPath, "GameConfig.txt"); 72 | KeyValues SDKConfig = KeyValues.LoadFile(SDKConfigFile); 73 | string GameExeDir = Game.GameExeFolder(); 74 | KeyValues Temp; 75 | KeyValues Games; 76 | 77 | if (SDKConfig == null) 78 | { 79 | SDKConfig = new KeyValues("Configs"); 80 | Temp = new KeyValues("SDKVersion", Game.GetSDKVersion(), SDKConfig); 81 | } 82 | 83 | Games = SDKConfig["Games"]; 84 | 85 | if (Games == null) 86 | { 87 | Games = new KeyValues("Games", SDKConfig); 88 | } 89 | 90 | KeyValues ModKey = Games.GetKey(Game.Name); 91 | 92 | if (ModKey == null) 93 | { 94 | ModKey = new KeyValues(Game.Name, Games); 95 | } 96 | 97 | KeyValues Hammer = new KeyValues("hammer", ModKey); 98 | 99 | Temp = new KeyValues("GameDir", Game.InstallPath.TrimEnd('\\'), ModKey); 100 | 101 | Hammer.SetValue("TextureFormat", "5"); 102 | Hammer.SetValue("MapFormat", "4"); 103 | Hammer.SetValue("DefaultTextureScale", "0.250000"); 104 | Hammer.SetValue("DefaultLightmapScale", "16"); 105 | Hammer.SetValue("DefaultSolidEntity", "func_detail"); 106 | Hammer.SetValue("DefaultPointEntity", "info_player_start"); 107 | Hammer.SetValue("GameExeDir", GameExeDir.TrimEnd('\\')); 108 | Hammer.SetValue("MapDir", Path.Combine(Game.SourcePath, "mapsrc")); 109 | Hammer.SetValue("CordonTexture", "tools\\toolsskybox"); 110 | Hammer.SetValue("MaterialExcludeCount", "0"); 111 | Hammer.SetValue("GameExe", Path.Combine(GameExeDir, "hl2.exe")); 112 | Hammer.SetValue("BSP", Path.Combine(Game.SDKPath, "vbsp.exe")); 113 | Hammer.SetValue("Vis", Path.Combine(Game.SDKPath, "vvis.exe")); 114 | Hammer.SetValue("Light", Path.Combine(Game.SDKPath, "vrad.exe")); 115 | Hammer.SetValue("BSPDir", Path.Combine(Game.InstallPath, "maps")); 116 | 117 | int GameDataIndex = 0; 118 | 119 | FGDs.AddRange(Directory.GetFiles(Game.InstallPath, "*.fgd")); 120 | 121 | foreach (string File in FGDs) 122 | { 123 | Hammer.SetValue("GameData" + GameDataIndex.ToString(), File); 124 | GameDataIndex += 1; 125 | } 126 | 127 | FGDs.Clear(); 128 | 129 | SourceFileSystem.BackUpFile(SDKConfigFile); 130 | 131 | SDKConfig.Save(SDKConfigFile, System.Text.Encoding.ASCII); 132 | } 133 | 134 | public bool Test(LibModMaker.SourceMod Subject) 135 | { 136 | if (Subject.SourcePath == null) 137 | Launch(Subject); 138 | 139 | return Directory.Exists(Subject.SourcePath); 140 | } 141 | } 142 | 143 | } -------------------------------------------------------------------------------- /ModMaker/Tools/SourceSDKTool.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | 6 | namespace ModMaker 7 | { 8 | /// 9 | /// Tool for launching the old (2007) Source SDK 10 | /// 11 | public class SourceSDKTool : iTool 12 | { 13 | private SourceMod _game; 14 | 15 | public System.Drawing.Image Image 16 | { 17 | get 18 | { 19 | Icon ExeIcon = Icon.ExtractAssociatedIcon(GetExePath()); 20 | 21 | if (ExeIcon == null) 22 | ExeIcon = Steam.Icon; 23 | 24 | return ExeIcon.ToBitmap(); 25 | } 26 | } 27 | 28 | public bool IsValidForMod(LibModMaker.SourceMod Game) 29 | { 30 | _game = Game; 31 | 32 | if (int.Parse( _game.GetSDKVersion()) > 5) 33 | return false; 34 | 35 | if (GetExePath() == null) 36 | return false; 37 | 38 | return true; 39 | } 40 | 41 | 42 | public void Launch(LibModMaker.SourceMod Game) 43 | { 44 | Steam.LaunchApp(Game.ToolsAppId.ToString()); 45 | } 46 | 47 | public string Name 48 | { 49 | get { return "Source SDK"; } 50 | } 51 | 52 | public string TipText 53 | { 54 | get { return "Launch the Source SDK"; } 55 | } 56 | 57 | private string GetExePath() 58 | { 59 | try 60 | { 61 | string SDKEnvVar = _game.SDKPath; 62 | string Result = Path.Combine(SDKEnvVar, "SDKLauncher.exe"); 63 | 64 | if (File.Exists(Result)) return Result; 65 | 66 | Result = Path.Combine(Steam.CommonPath, "SourceSDK", "bin", "SDKLauncher.exe"); 67 | 68 | if (File.Exists(Result)) return Result; 69 | 70 | Result = Path.Combine(Steam.UserPath, "SourceSDK", "bin", "SDKLauncher.exe"); 71 | 72 | if (File.Exists(Result)) return Result; 73 | 74 | } 75 | catch (ApplicationException) 76 | { 77 | return null; 78 | } 79 | 80 | return null; 81 | } //end GetExePath 82 | } //end class 83 | 84 | } -------------------------------------------------------------------------------- /ModMaker/Tools/VGUI_RES_EditTool.cs: -------------------------------------------------------------------------------- 1 | namespace ModMaker 2 | { 3 | /// 4 | /// Tool for editing VGUI res files 5 | /// 6 | public class VGUI_RES_EditTool : iTool 7 | { 8 | 9 | public System.Drawing.Image Image 10 | { 11 | get { return Properties.Resources.ModMaker.ToBitmap(); } 12 | } 13 | 14 | public bool IsValidForMod(LibModMaker.SourceMod Game) 15 | { 16 | return true; 17 | } 18 | 19 | public void Launch(LibModMaker.SourceMod Game) 20 | { 21 | var Dialog = new ResEditorForm(); 22 | 23 | Dialog.Game = Game; 24 | Dialog.Show(); 25 | } 26 | 27 | public string Name 28 | { 29 | get { return "RES Editor"; } 30 | } 31 | 32 | public string TipText 33 | { 34 | get { return "VGUI Resource (.res) Editor"; } 35 | } 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /ModMaker/Tools/WeaponsTool.cs: -------------------------------------------------------------------------------- 1 | using LibModMaker; 2 | using System; 3 | using System.IO; 4 | using System.Drawing; 5 | 6 | namespace ModMaker 7 | { 8 | 9 | /// 10 | /// Launch a tool for editing the Source weapons manifest and weapons scripts 11 | /// 12 | public class WeaponsTool : iTool 13 | { 14 | 15 | public Image Image 16 | { 17 | get { return Properties.Resources.Weapon.ToBitmap(); } 18 | } 19 | 20 | public bool IsValidForMod(LibModMaker.SourceMod Game) 21 | { 22 | return true; 23 | } 24 | 25 | public void Launch(LibModMaker.SourceMod Game) 26 | { 27 | WeaponsForm ToolWindow = new WeaponsForm {Game = Game}; 28 | 29 | ToolWindow.Show(); 30 | } 31 | 32 | public string Name 33 | { 34 | get { return "Weapon Editor"; } 35 | } 36 | 37 | public string TipText 38 | { 39 | get { return "Edit weapon the behaviour and appearance"; } 40 | } 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /ModMaker/Tools/iTool.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using LibModMaker; 3 | 4 | namespace ModMaker 5 | { 6 | /// 7 | /// Interface for tools to be exposed through the Mod Maker tools view 8 | /// 9 | public interface iTool 10 | { 11 | string Name { get; } 12 | Image Image { get; } 13 | string TipText { get; } 14 | bool IsValidForMod(SourceMod Game); 15 | void Launch(SourceMod Game); 16 | } 17 | 18 | /// 19 | /// Endtend iTool interface for tools that support being passed a file to work with (via drag and drop) 20 | /// 21 | public interface iFileTool : iTool 22 | { 23 | 24 | void LaunchFile(SourceMod Game, string FilePath); 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /ModMakerTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ModMakerTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("ModMakerTests")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("fdf4e7bc-14cb-48fb-8e41-cbfbe88a705f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ModMakerTests/Samples/Chapters_Ref.txt: -------------------------------------------------------------------------------- 1 | \cfg\chapter.cfg 2 | //List of commands, just map for us 3 | 4 | //Add tokens to the localization 5 | _Chapter_Title "" 6 | 7 | //Add section to scripts/titles.txt like... 8 | 9 | $fadein 0.01 10 | $holdtime 3.5 11 | $position -1 0.58 12 | 13 | CHAPTER_TITLE 14 | { 15 | #_Chapter_Title 16 | } 17 | 18 | //Create thumbnails 19 | \materials\vgui\chapters\chapter.vmt 20 | //Images scales to 152x86 at the topleft of a 256x128 image , compiled with the vtex settings nomip and nolod 21 | "UnlitGeneric" 22 | { 23 | "$baseTexture" "VGUI/chapters/chapter" 24 | "$vertexalpha" 1 25 | } 26 | 27 | //Skip this bit 28 | 29 | //Create menu backgrounds 30 | \scripts\chapterbackgrounds.txt 31 | //like 32 | chapters 33 | { 34 | 1 "" 35 | 2 "my_background02" 36 | 3 "my_background03" 37 | } 38 | //Images should be saved in 39 | \materials\console\ -------------------------------------------------------------------------------- /ModMakerTests/Samples/Cleansweep.txt: -------------------------------------------------------------------------------- 1 | "Cleansweep.txt" 2 | { 3 | files 4 | { 5 | "MS Games For Windows Live" "^gfwlivesetup\.exe$" 6 | "MS Visual C++ Redist" "^(vcredist){1}.*(\.exe)$" 7 | "NVidia PhysX" "^(physx){1}.+(systemsoftware.exe){1}$" 8 | "GameSpy Arcade" "^(arcadeinstallfull){1}.*(\.exe)$" 9 | "GameSpy Arcade" "^gamespyinstaller220std\.exe$" 10 | "MS XNA Framework Redist" "^(xna){1}.*(\.msi)$" 11 | "MS XNA Framework Redist" "^xnafx40_redist\.msi$" 12 | "MS .NET Framework Redist" "^(dotnet).*(setup\.exe)$" 13 | "MS .NET Framework Redist (64-bit)" "^(dotnet).*(x86_x64\.exe)$" 14 | "MS .NET Framework Redist" "^dotnetfx35\.exe$" 15 | "OpenAL" "^openalweax\.exe$" 16 | "MS DirectX Web Installer" "^dxwebsetup\.exe$" 17 | "Takedown Red Sabre Redist" "^ndP451-kb2872776-x86-x64-allos-enu\.exe$" 18 | "Rapture 3D" "^(rapture3d_){1}.*(game\.exe)$" 19 | "AMD Dual-Core Optimizer" "^amd_dcoptsetup\.exe$" 20 | "AMD Dual-Core Optimizer" "^amd_dcoptsetup\.ex$" 21 | "MS XML Redist" "^msxml4-kb954430-enu\.exe$" 22 | "MS XML Redist" "^msxml4-kb973688-enu\.exe$" 23 | "MS .NET Framework Redist" "^wic_x64_enu\.exe$" 24 | "MS .NET Framework Redist" "^wic_x86_enu\.exe$" 25 | "MS .NET Framework Redist (64-bit)" "^xpsepsc-amd64-en-us\.exe$" 26 | "MS .NET Framework Redist" "^xpsepsc-x86-en-us\.exe$" 27 | "MS .NET Framework Redist (64-bit)" "^dotnetfx40_client_x86_x64\.exe$" 28 | "MS .NET Framework Redist (Itanium)" "^netfx35_ia64\.exe$" 29 | "MS .NET Framework Redist (64-bit)" "^netfx35_x64\.exe$" 30 | "MS .NET Framework Redist" "^netfx35_x86\.exe$" 31 | "BattlEye Anti-Cheat Engine" "^setup_battleyearma2\.exe$" 32 | } 33 | folders 34 | { 35 | "MS DirectX" "^directx$" 36 | "MS DirectX" "^dxredist$" 37 | "MS DirectX" "^directx_redist$" 38 | "MS DirectX" "^dx_redist_install$" 39 | "MS DirectX" "^directxredist$" 40 | "MS DirectX" "^dx\p{Space}redist$" 41 | "MS DirectX" "^directx_jun_2010$" 42 | "MS DirectX" "^directx_aug_2009$" 43 | "MS Visual C++ Redist(s)" "^msvcrt$" 44 | "MS Visual C++ Redist(s)" "^vcredist$" 45 | "MS Games For Windows Live" "^g4w$" 46 | "Many redistributables" "^dependencies$" 47 | "Many redistributables" "^prerequisite(s)?$" 48 | "Many redistributables" "^installer(s)?$" 49 | "Many redistributables" "^redist(s)?$" 50 | "Many redistributables" "^redistributable(s)?$" 51 | "Many UE3 redistributables" "^ue3Redist?$" 52 | } 53 | } -------------------------------------------------------------------------------- /ModMakerTests/Samples/GameInfo.txt: -------------------------------------------------------------------------------- 1 | "GameInfo" 2 | { 3 | game "Exterminatus - Beta v5.51" 4 | title "" 5 | type multiplayer_only 6 | nomodels 1 7 | nohimodel 1 8 | nocrosshair 1 9 | developer "Rival Species Team" 10 | developer_url "http://www.40ksource.com" 11 | manual "http://www.40ksource.com/common/wiki_manual" 12 | icon "ex_installed" 13 | hidden_maps 14 | { 15 | "test_speakers" 1 16 | "test_hardware" 1 17 | } 18 | 19 | 20 | FileSystem 21 | { 22 | SteamAppId 218 // This will mount all the GCFs we need (215=Source Base SDK, 240=CS:S, 220=HL2, 320=HL2DM). 23 | //Was 320 24 | //Was 215 at version 0.89 25 | //Was 218 at version 0.91 26 | ToolsAppId 211 // Tools will load this (ie: source SDK caches) to get things like materials\debug, materials\editor, etc. 27 | AppId 218 // Un-borking valves fuckup 24/12/05 28 | 29 | // 30 | // The code that loads this file automatically does a few things here: 31 | // 32 | // 1. For each "Game" search path, it adds a "GameBin" path, in \bin 33 | // 2. For each "Game" search path, it adds another "Game" path in front of it with _ at the end. 34 | // For example: c:\hl2\cstrike on a french machine would get a c:\hl2\cstrike_french path added to it. 35 | // 3. For the first "Game" search path, it adds a search path called "MOD". 36 | // 4. For the first "Game" search path, it adds a search path called "DEFAULT_WRITE_PATH". 37 | // 38 | 39 | // 40 | // Search paths are relative to the base directory, which is where hl2.exe is found. 41 | // 42 | // |gameinfo_path| points at the directory where gameinfo.txt is. 43 | // We always want to mount that directory relative to gameinfo.txt, so 44 | // people can mount stuff in c:\mymod, and the main game resources are in 45 | // someplace like c:\program files\valve\steam\steamapps\half-life 2. 46 | // 47 | SearchPaths 48 | { 49 | Game |gameinfo_path|. 50 | Game hl2mp 51 | Game ep2 52 | Game episodic 53 | Game hl2 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /ModMakerTests/Samples/GameLogo.res: -------------------------------------------------------------------------------- 1 | Resource/GameLogo.res 2 | { 3 | GameLogo 4 | { 5 | ControlName EditablePanel 6 | fieldName GameLogo 7 | xpos 0 8 | ypos 0 9 | zpos 50 10 | wide 400 11 | tall 100 12 | autoResize 1 13 | pinCorner 0 14 | visible 1 15 | enabled 1 16 | offsetX -20 17 | offsetY -15 18 | } 19 | 20 | Logo 21 | { 22 | ControlName ImagePanel 23 | fieldName Logo 24 | xpos 0 25 | ypos 0 26 | zpos 50 27 | wide 400 28 | tall 100 29 | visible 1 30 | enabled 1 31 | image ../logo/TF2_Logo 32 | scaleImage 1 33 | } 34 | } -------------------------------------------------------------------------------- /ModMakerTests/Samples/apps.txt: -------------------------------------------------------------------------------- 1 | Apps 2 | { 3 | 215 4 | { 5 | game "Source SDK Base 2006" 6 | engine 2006 7 | } 8 | 218 9 | { 10 | game "Source SDK Base 2007" 11 | engine 2007 12 | } 13 | 220 14 | { 15 | game "Half-Life 2" 16 | engine 2006 17 | } 18 | 240 19 | { 20 | game "Counter-Strike: Source" 21 | engine 2006 22 | } 23 | 280 24 | { 25 | game "Half-Life: Source" 26 | engine 2006 27 | } 28 | 300 29 | { 30 | game "Day of Defeat: Source" 31 | engine 2006 32 | } 33 | 320 34 | { 35 | game "Half-Life 2: Deathmatch" 36 | engine 2006 37 | } 38 | 321 39 | { 40 | game "Half-Life 2: Deathmatch" 41 | engine 2006 42 | } 43 | 340 44 | { 45 | game "Half-Life 2: Lost Coast" 46 | engine 2007 47 | } 48 | 360 49 | { 50 | game "Half-Life Deathmatch: Source" 51 | engine 2007 52 | } 53 | 380 54 | { 55 | game "Half-Life 2: Episode One" 56 | engine 2007 57 | } 58 | 400 59 | { 60 | game "Portal" 61 | engine 2009 62 | } 63 | 420 64 | { 65 | game "Half-Life 2: Episode Two" 66 | engine 2009 67 | } 68 | 440 69 | { 70 | game "Team Fortress 2" 71 | engine 2009 72 | } 73 | 500 74 | { 75 | game "Left 4 Dead" 76 | engine 2009 77 | } 78 | 550 79 | { 80 | game "Left 4 Dead 2" 81 | engine 2009 82 | } 83 | 620 84 | { 85 | game "Portal 2" 86 | engine 2009 87 | } 88 | 630 89 | { 90 | game "Alien Swarm" 91 | engine 2009 92 | } 93 | 1800 94 | { 95 | game "Counter-Strike: Global Offensive" 96 | engine 2009 97 | } 98 | } -------------------------------------------------------------------------------- /ModMakerTests/Samples/base.fgd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMakerTests/Samples/base.fgd -------------------------------------------------------------------------------- /ModMakerTests/Samples/halflife2.fgd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChromeAngel/ModMaker/9687904fd9cbd8df85a74f2f5cf46942c729bbd7/ModMakerTests/Samples/halflife2.fgd -------------------------------------------------------------------------------- /ModMakerTests/Samples/lights.rad: -------------------------------------------------------------------------------- 1 | lights/fluorescentcool001a 189 231 232 350 2 | lights/fluorescentcool001b 236 255 182 350 3 | lights/fluorescentcool002a 189 231 232 400 4 | lights/fluorescentcool002b 236 255 182 400 5 | lights/fluorescentcool003a 189 231 232 300 6 | lights/fluorescentwarm001a 239 216 193 350 7 | lights/fluorescentwarm002a 239 216 193 400 8 | lights/fluorescentwhite001a 245 245 245 350 9 | lights/fluorescentwhite002a 245 245 245 400 10 | 11 | 12 | lights/hazzardred001a 228 37 0 300 13 | lights/hazzardyellow001a 250 215 74 300 14 | 15 | lights/HIDcool001a 145 222 172 650 16 | lights/HIDcool001b 205 232 255 650 17 | lights/HIDwarm001a 255 201 116 650 18 | 19 | lights/white001 250 240 205 100 20 | lights/white002 189 233 247 425 21 | lights/white003 232 246 190 350 22 | lights/white004 170 228 247 425 23 | lights/white005 234 235 220 375 24 | lights/white006 234 235 220 100 25 | 26 | lights/white001_nochop 250 240 205 100 27 | lights/white002_nochop 189 233 247 425 28 | lights/white003_nochop 232 246 190 350 29 | lights/white004_nochop 170 228 247 425 30 | lights/white005_nochop 234 235 220 375 31 | lights/white006_nochop 234 235 220 100 32 | 33 | lights/incandescentcool001a 235 235 235 300 34 | lights/incandescentwarm001a 250 226 129 300 35 | 36 | 37 | glass/glassscreen001a 172 192 161 225 38 | glass/glasspipe001f 214 72 44 200 39 | glass/glassscreen001c 172 192 161 225 40 | glass/glassscreen001d 211 187 134 225 41 | glass/glassblock001a 70 194 209 200 42 | composite/citadelfloor001a 103 143 203 200 43 | props/tvscreen006a 196 0 0 200 44 | shadertest/gooinglass 149 49 15 50 45 | 46 | glass/glasswindow002e 189 233 247 425 47 | glass/glasswindow035a 145 222 172 100 48 | 49 | dev/DEV_INTERIORLIGHT02B 151 176 204 225 50 | 51 | plaster/plasterwall029h 189 223 227 125 52 | building_template/Building_Trainstation_Template001d 230 230 200 65 53 | building_template/Building_Trainstation_Template001e 230 230 200 150 54 | building_template/Building_Trainstation_window002d 230 230 200 300 55 | building_template/Building_Trainstation_window002e 230 230 200 300 56 | 57 | lights/physgunlight 189 231 232 20 58 | -------------------------------------------------------------------------------- /ModMakerTests/Samples/test.rad: -------------------------------------------------------------------------------- 1 | lights/fluorescentcool001a 255 128 255 350 2 | lights/fluorescentcool001b 236 255 182 350 3 | lights/fluorescentcool002a 189 231 232 400 4 | lights/fluorescentcool002b 236 255 182 400 5 | lights/fluorescentcool003a 189 231 232 300 6 | lights/fluorescentwarm001a 239 216 193 350 7 | lights/fluorescentwarm002a 239 216 193 400 8 | lights/fluorescentwhite001a 245 245 245 350 9 | lights/fluorescentwhite002a 245 245 245 400 10 | lights/hazzardyellow001a 250 215 74 300 11 | lights/white001_nochop 250 240 205 100 12 | lights/white002_nochop 189 233 247 425 13 | lights/white003_nochop 232 246 190 350 14 | lights/white004_nochop 170 228 247 425 15 | lights/white005_nochop 234 235 220 375 16 | lights/white006_nochop 234 235 220 100 17 | lights/incandescentcool001a 235 235 235 300 18 | lights/incandescentwarm001a 250 226 129 300 19 | composite/citadelfloor001a 103 143 203 200 20 | dev/DEV_INTERIORLIGHT02B 151 176 204 225 21 | building_template/Building_Trainstation_Template001d 230 230 200 65 22 | building_template/Building_Trainstation_Template001e 230 230 200 150 23 | building_template/Building_Trainstation_window002d 230 230 200 300 24 | building_template/Building_Trainstation_window002e 230 230 200 300 25 | lights/physgunlight 189 231 232 20 26 | noshadow Foo 27 | noshadow bar 28 | forcetextureshadow items/foo 29 | -------------------------------------------------------------------------------- /ModMakerTests/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | using LibModMaker; 5 | 6 | namespace ModMakerTests 7 | { 8 | [TestClass] 9 | public class UnitTest1 10 | { 11 | [TestMethod] 12 | public void FGDParser() 13 | { 14 | var Subject = new ForgeGameData(); 15 | 16 | Subject.Load("Samples/base.fgd"); 17 | 18 | Debug.WriteLine("bases:{0}", Subject.Bases.Count); 19 | Debug.WriteLine("solids:{0}", Subject.Solids.Count); 20 | Debug.WriteLine("points:{0}", Subject.Points.Count); 21 | Debug.WriteLine("filters:{0}", Subject.Filters.Count); 22 | } 23 | 24 | [TestMethod] 25 | public void RadParser() 26 | { 27 | var Subject = Lights.Load("Samples/test.rad"); 28 | 29 | Debug.WriteLine("{0} rules loaded", Subject.Rules.Count); 30 | 31 | foreach (var aRule in Subject.Rules) 32 | { 33 | Debug.WriteLine(aRule.ToString()); 34 | } 35 | } 36 | }//end class 37 | } 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Mod Maker 2 | ========= 3 | 4 | Mod Maker (MM) is primarily a Source mod and tool launcher with productivity features to make it easier to mod for Source including: 2013 Mod Creation, Mod Shortcuts, Automatic Source SDK configuration, FGD editor, RES editor, Compiler, Mod Localization, RAD file editor, Steampipe packing, Installer and Patch file creation. 5 | 6 | ![MM main window](https://media.moddb.com/images/downloads/1/139/138344/ModMaker2.PNG) 7 | 8 | Features include (but are not limited to) : 9 | 10 | * 2013 Mod Creation 11 | * Shortcuts for all your mod's important files and folders 12 | * Automatic Source SDK configuration 13 | * FGD editor / entity creator 14 | * Drag and drop model compiling 15 | * Mod Localization 16 | * RAD file editor 17 | * VGUI RES editor 18 | * Weapon Editor 19 | * Chapter Maker 20 | * Key Menu Editor 21 | * Sound Scripter 22 | * Steampipe packing 23 | * Installer and Patch file creation 24 | 25 | MM was something I (ChromeAngel) built over the years of Source mod development to help me with repetative or obscure tasks. As such it has just enough polish to be useable to me, but I could always just fire up visual studio and debug it when it broke... which meant the build quality was not as solid as it could have been. By opening the mod maker source I hope more developers will be able to benefit from the time savings that Mod Maker can bring. 26 | 27 | ### Downloads 28 | If you just want to download a pre-compiled version, the latest stable build is at: 29 | ### Structure 30 | MM is developed in C# using Visual Studio 2015. The soloution (ModMaker.sln) contains 2 main projects and some offshoots: 31 | 32 | * LibModMaker - Contains abstract classes that encode the behaviour and structures of Steam, Source Games, Source Mods, Source File Systems and KeyValue files. 33 | * ModMaker - The winforms user interface, that makes use of LibModMaker and is rooted in its main form and the ModView control. This project contains many Tool classess, that impliment the iTool interface and provide stand -alone features, like setting up the SDK, launching hammer or scripting chapters. 34 | * WarHammmer - A standalone app that uses LibModMaker to configure and launch the SDK and Hammer to enable an easier start to mapping for a specific mod. 35 | * ModMakerTests - Some basic experimentation with automated testing and samples of various file formats. 36 | 37 | ### Help the Project 38 | Even if you are not a programmer or an artist you *can* help this project, read CONTRIBUTION.md to find out how. 39 | -------------------------------------------------------------------------------- /warHammer/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /warHammer/Launcher.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using LibModMaker; 7 | using System.IO; 8 | using System.Diagnostics; 9 | 10 | namespace warHammer 11 | { 12 | class Launcher 13 | { 14 | public SourceMod Game; 15 | private string HammerPath 16 | { 17 | get 18 | { 19 | string AppPath = Steam.AppPath(Game.AppId); 20 | 21 | if (AppPath == null) 22 | return null; 23 | 24 | return Path.Combine(AppPath, "bin", "hammer.exe"); 25 | } 26 | } 27 | 28 | public bool HasHammer() 29 | { 30 | return File.Exists(HammerPath); 31 | } 32 | 33 | public void LaunchHammer() 34 | { 35 | ProcessStartInfo S = new ProcessStartInfo 36 | { 37 | FileName = HammerPath, 38 | UseShellExecute = false, 39 | CreateNoWindow = true, 40 | WindowStyle = ProcessWindowStyle.Hidden 41 | }; 42 | 43 | S.EnvironmentVariables["VProject"] = Game.InstallPath.TrimEnd('/').TrimEnd('\\'); 44 | S.EnvironmentVariables["VPPROJECT"] = Game.InstallPath.TrimEnd('/').TrimEnd('\\'); 45 | 46 | Process.Start(S); 47 | } 48 | 49 | private string _GameConfigPath = null; 50 | 51 | private KeyValues GetGameConfig() 52 | { 53 | _GameConfigPath = Path.Combine(Game.SDKPath, "GameConfig.txt"); 54 | KeyValues result = KeyValues.LoadFile(_GameConfigPath); 55 | 56 | if (result == null) 57 | { 58 | result = new KeyValues("Configs"); 59 | var temp = new KeyValues("SDKVersion", Game.GetSDKVersion(), result); 60 | 61 | result.Save(_GameConfigPath); 62 | } 63 | 64 | return result; 65 | } 66 | 67 | private KeyValues GetModConfig() 68 | { 69 | KeyValues SDKConfig = GetGameConfig(); 70 | KeyValues Games = SDKConfig["Games"]; 71 | 72 | if (Games == null) 73 | { 74 | Games = new KeyValues("Games", SDKConfig); 75 | SDKConfig.Save(_GameConfigPath); 76 | } 77 | 78 | return Games[Game.Name]; 79 | } 80 | 81 | public bool IsSDKConfigured() 82 | { 83 | KeyValues modConfig = GetModConfig(); 84 | 85 | if (modConfig == null) return false; 86 | if (string.IsNullOrEmpty(modConfig.GetString("GameDir"))) return false; 87 | 88 | return true; 89 | } 90 | 91 | public void SetupSDK() 92 | { 93 | string gameExeDir = Game.GameExeFolder(); 94 | KeyValues Temp = null; 95 | KeyValues Games = null; 96 | KeyValues ModKey = GetModConfig(); 97 | KeyValues Hammer = null; 98 | 99 | if (ModKey == null) 100 | { 101 | KeyValues SDKConfig = GetGameConfig(); 102 | Games = SDKConfig["Games"]; 103 | 104 | if (Game == null) Games = new KeyValues("Games", SDKConfig); 105 | 106 | ModKey = new KeyValues(Game.Name, Games); 107 | Hammer = new KeyValues("hammer", ModKey); 108 | } 109 | else 110 | { 111 | Hammer = ModKey["hammer"]; 112 | } 113 | 114 | Temp = new KeyValues("GameDir", Game.InstallPath.TrimEnd('\\'), ModKey); 115 | 116 | Hammer.SetValue("TextureFormat", "5"); 117 | Hammer.SetValue("MapFormat", "4"); 118 | Hammer.SetValue("DefaultTextureScale", "0.250000"); 119 | Hammer.SetValue("DefaultLightmapScale", "16"); 120 | Hammer.SetValue("DefaultSolidEntity", "func_detail"); 121 | Hammer.SetValue("DefaultPointEntity", "info_player_start"); 122 | if(gameExeDir != null) Hammer.SetValue("GameExeDir", gameExeDir.TrimEnd('\\')); 123 | Hammer.SetValue("MapDir", Path.Combine(Game.SourcePath, "mapsrc")); 124 | Hammer.SetValue("CordonTexture", "tools\\toolsskybox"); 125 | Hammer.SetValue("MaterialExcludeCount", "0"); 126 | if (gameExeDir != null) Hammer.SetValue("GameExe", Path.Combine(gameExeDir, "hl2.exe")); 127 | Hammer.SetValue("BSP", Path.Combine(Game.SDKPath, "vbsp.exe")); 128 | Hammer.SetValue("Vis", Path.Combine(Game.SDKPath, "vvis.exe")); 129 | Hammer.SetValue("Light", Path.Combine(Game.SDKPath, "vrad.exe")); 130 | Hammer.SetValue("BSPDir", Path.Combine(Game.InstallPath, "maps")); 131 | 132 | int GameDataIndex = 0; 133 | var FGDs = new List(); 134 | 135 | FGDs.AddRange(Directory.GetFiles(Game.InstallPath, "*.fgd")); 136 | 137 | foreach(string filePath in FGDs) 138 | { 139 | Hammer.SetValue(string.Format("GameData{0}", GameDataIndex), filePath); 140 | GameDataIndex += 1; 141 | } 142 | 143 | FGDs.Clear(); 144 | 145 | SourceFileSystem.BackUpFile(_GameConfigPath); 146 | 147 | ModKey.Parent.Parent.Save(_GameConfigPath, System.Text.Encoding.ASCII); 148 | } 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /warHammer/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | using System.Diagnostics; 7 | using System.IO; 8 | using System.Runtime.CompilerServices; 9 | using LibModMaker; 10 | 11 | namespace warHammer 12 | { 13 | static class Program 14 | { 15 | /// 16 | /// The main entry point for the application. 17 | /// 18 | [STAThread] 19 | static void Main(string[] args) 20 | { 21 | //Is Steam installed? 22 | try 23 | { 24 | if (Steam.ExePath == null) 25 | { 26 | Exclaim(string.Format("{0} cannot find your Steam installation. Steam must be installed to use {0}",Application.ProductName), "Steam not found"); 27 | } 28 | } 29 | catch (ApplicationException) 30 | { 31 | Exclaim(string.Format("{0} cannot find your Steam installation. Steam must be installed to use {0}", Application.ProductName), "Steam not found"); 32 | } 33 | 34 | SourceMod Game = null; 35 | 36 | //Get the gameinfo for this mod 37 | if (args.Length == 2 && args[0] == "-game" && Directory.Exists(args[1])) 38 | { 39 | //specify the mod folder with the -game command line arguments 40 | Game = new SourceMod(args[1]); 41 | } 42 | else 43 | { 44 | var BinPath = Application.StartupPath; 45 | var InstallPathInfo = Directory.GetParent(BinPath); //Assume we're in the mod's /bin folder 46 | Game = new SourceMod(InstallPathInfo.FullName); 47 | } 48 | 49 | //Check the mods GameInfo exists 50 | if (!File.Exists(Game.GameInfoPath)) 51 | { 52 | Exclaim( 53 | string.Format("{0} is expecting {1} , but could not find it.", Application.ProductName, Game.GameInfoPath), 54 | "GameInfo not found" 55 | ); 56 | } 57 | 58 | //Check where the base game is installed 59 | string AppPath = Steam.AppPath(Game.AppId); 60 | 61 | if (AppPath == null) 62 | { 63 | if ( 64 | MessageBox.Show( 65 | string.Format("The game {0} is based on is not installed. Would you like to install it now?",Game.Name), 66 | "Install?", 67 | MessageBoxButtons.YesNo, 68 | MessageBoxIcon.Question 69 | ) == DialogResult.Cancel) 70 | { 71 | Application.Exit(); 72 | } 73 | 74 | Steam.InstallApp(Game.AppId); 75 | 76 | MessageBox.Show( 77 | string.Format("Please restart {0} once the installation is complete", Application.ProductName), 78 | "Restart required", 79 | MessageBoxButtons.OK, 80 | MessageBoxIcon.Information 81 | ); 82 | Application.Exit(); 83 | } 84 | 85 | //Check if hammer is in the base game's /bin folder as we expect 86 | string HammerPath = Path.Combine(AppPath, "bin", "hammer.exe"); 87 | 88 | if (!File.Exists(HammerPath)) 89 | { 90 | Exclaim( string.Format("{0} cannot find Hammer. It was expected to be installed in {1}", Application.ProductName, HammerPath), "Hammer not found"); 91 | } 92 | 93 | //Check if it's configured for this mod 94 | Launcher launcher = new Launcher(); 95 | launcher.Game = Game; 96 | 97 | if (!launcher.IsSDKConfigured()) 98 | { 99 | launcher.SetupSDK(); 100 | } 101 | 102 | //Launch Hammer 103 | launcher.LaunchHammer(); 104 | } 105 | 106 | private static void Exclaim(string message, string title) 107 | { 108 | MessageBox.Show( 109 | message, 110 | title, 111 | MessageBoxButtons.OK, 112 | MessageBoxIcon.Exclamation 113 | ); 114 | Application.Exit(); 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /warHammer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("warHammer")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("warHammer")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("57882540-e235-4360-a36e-aa81fdc5c8b3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /warHammer/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace warHammer.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("warHammer.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /warHammer/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace warHammer.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /warHammer/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /warHammer/warHammer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {57882540-E235-4360-A36E-AA81FDC5C8B3} 8 | WinExe 9 | Properties 10 | warHammer 11 | warHammer 12 | v4.5.2 13 | 512 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | ResXFileCodeGenerator 54 | Resources.Designer.cs 55 | Designer 56 | 57 | 58 | True 59 | Resources.resx 60 | 61 | 62 | SettingsSingleFileGenerator 63 | Settings.Designer.cs 64 | 65 | 66 | True 67 | Settings.settings 68 | True 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | {cb8a16df-34f8-4103-8df1-895a9a3e3670} 77 | LibModMaker 78 | 79 | 80 | 81 | 88 | --------------------------------------------------------------------------------