diff --git a/ModdingTools/Headless/CommandLineOptions.cs b/ModdingTools/Headless/CommandLineOptions.cs index d07341b..37e69be 100644 --- a/ModdingTools/Headless/CommandLineOptions.cs +++ b/ModdingTools/Headless/CommandLineOptions.cs @@ -20,6 +20,9 @@ class CommandLineOptions [Option(Group = "task", HelpText = "Launch editor")] public bool Editor { get; set; } + [Option(Group = "task", HelpText = "Kill editor")] + public bool KillEditor { get; set; } + [Option("testmap", HelpText = "Test map", Group = "task")] public string TestMap { get; set; } diff --git a/ModdingTools/Headless/ProgramHeadless.cs b/ModdingTools/Headless/ProgramHeadless.cs index 03ec67c..94c47ba 100644 --- a/ModdingTools/Headless/ProgramHeadless.cs +++ b/ModdingTools/Headless/ProgramHeadless.cs @@ -121,6 +121,13 @@ static int RunOptionsAndReturnExitCode(CommandLineOptions o) } else { + if(o.KillEditor) + { + Logger.Log(LogLevel.Info, $"Killing editor..."); + Utils.KillEditor(false); // no need for async here, we can hold up the line because we're just exiting right after anyways + return 0; + } + if (o.TestMapAll != null) { RunSteamAPI(true); diff --git a/ModdingTools/Properties/Resources.Designer.cs b/ModdingTools/Properties/Resources.Designer.cs index 5823721..32d0d2b 100644 --- a/ModdingTools/Properties/Resources.Designer.cs +++ b/ModdingTools/Properties/Resources.Designer.cs @@ -546,35 +546,25 @@ internal static System.Drawing.Bitmap uploaded { /// /// Looks up a localized string similar to { - /// "version": "2.0.0", - /// "tasks": [ - /// { - /// "label": "OMM: Compile", - /// "type": "shell", - /// "command": "##OMM:OMM_EXE_PATH##", - /// "args": [ - /// "c", - /// "${file}" - /// ], - /// "problemMatcher": [], - /// "group": { - /// "kind": "build", - /// "isDefault": true - /// } - /// }, - /// { - /// "label": "OMM: Compile and Cook", - /// "type": "shell", - /// "command": "##OMM:OMM_EXE_PATH##", - /// "args": [ - /// "cc", - /// "${file}" - /// ], - /// "problemMatcher": [], - /// "group": "build" - /// }, - /// { - /// "label": "OMM: Comp [rest of string was truncated]";. + /// "version": "2.0.0", + /// "tasks": [ + /// { + /// "label": "Compile Mod", + /// "type": "shell", + /// "command": "##OMM:OMM_EXE_PATH##", + /// "args": [ + /// "--mod", + /// "${workspaceFolderBasename}", + /// "--compilemod", + /// "--nologo" + /// ], + /// "problemMatcher": { + /// "owner": "uc", + /// "fileLocation": [ + /// "relative", + /// "${workspaceFolder}\\..\\" + /// ], + /// "source": "Unrealscript Co [rest of string was truncated]";. /// internal static string VSCodeTaskTemplate { get { @@ -591,7 +581,7 @@ internal static string VSCodeTaskTemplate { /// "path": "./" /// }, /// { - /// // Docs and release notes + /// // A Hat In Time Source /// "name": "AHiT Source", /// "path": "##AHIT:SRC_ROOT##" /// } diff --git a/ModdingTools/Properties/Resources.resx b/ModdingTools/Properties/Resources.resx index 449cb6d..39addaf 100644 --- a/ModdingTools/Properties/Resources.resx +++ b/ModdingTools/Properties/Resources.resx @@ -271,89 +271,206 @@ { - "version": "2.0.0", - "tasks": [ - { - "label": "OMM: Compile", - "type": "shell", - "command": "##OMM:OMM_EXE_PATH##", - "args": [ - "c", - "${file}" - ], - "problemMatcher": [], - "group": { - "kind": "build", - "isDefault": true - } - }, - { - "label": "OMM: Compile and Cook", - "type": "shell", - "command": "##OMM:OMM_EXE_PATH##", - "args": [ - "cc", - "${file}" - ], - "problemMatcher": [], - "group": "build" - }, - { - "label": "OMM: Compile and launch editor", - "type": "shell", - "command": "##OMM:OMM_EXE_PATH##", - "args": [ - "ce", - "${file}" - ], - "problemMatcher": [], - "group": "build" - }, - { - "label": "OMM: Compile and Cook and launch game (only mods folder, last visited map)", - "type": "shell", - "command": "##OMM:OMM_EXE_PATH##", - "args": [ - "cg", - "${file}" - ], - "problemMatcher": [], - "group": "build" - }, - { - "label": "OMM: Compile and Cook and launch game (only mods folder, choose map)", - "type": "shell", - "command": "##OMM:OMM_EXE_PATH##", - "args": [ - "cm", - "${file}" - ], - "problemMatcher": [], - "group": "build" - }, - { - "label": "OMM: Compile and Cook and launch game (with workshop mods, last visited map)", - "type": "shell", - "command": "##OMM:OMM_EXE_PATH##", - "args": [ - "ci", - "${file}" - ], - "problemMatcher": [], - "group": "build" - }, - { - "label": "OMM: Compile and Cook and launch game (with workshop mods, choose map)", - "type": "shell", - "command": "##OMM:OMM_EXE_PATH##", - "args": [ - "cn", - "${file}" - ], - "problemMatcher": [], - "group": "build" - } - ] + "version": "2.0.0", + "tasks": [ + { + "label": "Compile Mod", + "type": "shell", + "command": "##OMM:OMM_EXE_PATH##", + "args": [ + "--mod", + "${workspaceFolderBasename}", + "--compilemod", + "--nologo" + ], + "problemMatcher": { + "owner": "uc", + "fileLocation": [ + "relative", + "${workspaceFolder}\\..\\" + ], + "source": "Unrealscript Compilation", + "pattern": [ + { + "regexp": "(?<=(Error|Warn)\\]\\s{2})(.*(?=\\.uc)\\.uc).(\\d*).(?:\\s|:)*(.*)", + "severity": 1, + "file": 2, + "line": 3, + "message": 4 + } + ] + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "revealProblems": "onProblem", + "clear": true, + "group": "Building" + }, + "group": "build" + }, + { + "label": "Cook Mod", + "type": "shell", + "command": "##OMM:OMM_EXE_PATH##", + "args": [ + "--mod", + "${workspaceFolderBasename}", + "--cookmod", + "--nologo" + ], + "group": "build", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": true, + "group": "Building" + } + }, + { + "label": "Compile and Cook", + "dependsOrder": "sequence", + "dependsOn": [ + "Compile Mod", + "Cook Mod" + ], + "group": "build" + }, + { + "label": "Launch Editor", + "type": "shell", + "command": "##OMM:OMM_EXE_PATH##", + "args": [ + "--editor", + "--nologo" + ], + "problemMatcher": [], + "group": "test", + + "presentation": { + "echo": true, + "reveal": "never", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false, + "group": "Testing" + } + }, + { + "label": "Launch Game (No Workshop Mods)", + "type": "shell", + "command": "##OMM:OMM_EXE_PATH##", + "args": [ + "--mod", + "${workspaceFolderBasename}", + "--testmap", + "${input:TestMap}", + "--nologo" + ], + "group": "test", + + "presentation": { + "echo": true, + "reveal": "never", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false, + "group": "Testing" + } + }, + { + "label": "Launch Game (With Workshop Mods)", + "type": "shell", + "command": "##OMM:OMM_EXE_PATH##", + "args": [ + "--mod", + "${workspaceFolderBasename}", + "--testmapall", + "${input:TestMap}", + "--nologo" + ], + "group": "test", + + "presentation": { + "echo": true, + "reveal": "never", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false, + "group": "Testing" + } + }, + { + "label": "Compile & Launch Editor", + "dependsOrder": "sequence", + "dependsOn": [ + "Compile Mod", + "Launch Editor" + ], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "Compile, Cook & Launch Game (No Workshop Mods)", + "dependsOrder": "sequence", + "dependsOn": [ + "Compile and Cook", + "Launch Game (No Workshop Mods)" + ], + "group": { + "kind": "test", + "isDefault": true + }, + "detail": "You will be asked to input a map name when the game is launched." + }, + { + "label": "Compile, Cook & Launch Game (With Workshop Mods)", + "dependsOrder": "sequence", + "dependsOn": [ + "Compile and Cook", + "Launch Game (With Workshop Mods)" + ], + "group": "test", + "detail": "You will be asked to input a map name when the game is launched." + }, + { + "label": "Kill Editor", + "type": "shell", + "command": "##OMM:OMM_EXE_PATH##", + "args": [ + "--killeditor", + "--nologo" + ], + "group": "none", + "detail": "Instantly ends the editor process. Be careful of unsaved progress!", + "presentation": { + "echo": true, + "reveal": "never", + "focus": false + }, + "problemMatcher": [] + } +], + "inputs": [ + // Map input for launching the game. Defaults to titlescreen + { + "id": "TestMap", + "description": "Map:", + "type": "promptString", + "default": "titlescreen_final", + } + ] } @@ -365,7 +482,7 @@ "path": "./" }, { - // Docs and release notes + // A Hat In Time Source "name": "AHiT Source", "path": "##AHIT:SRC_ROOT##" }