From 711e275085580a67c559529b8d59f9568f3974f9 Mon Sep 17 00:00:00 2001 From: Lunar Snail Date: Thu, 5 Mar 2026 20:25:47 +0100 Subject: [PATCH 1/4] Fix existing VSCode Tasks This commit fixes the VSCode tasks that were already present by using the correct arguments when running the CLI. A problem matcher has also been added for the compile mod task. This will make errors and warnings show up in the problems tab in VSCode, marked `Unrealscript Compilation`, alongside the UnrealScript extension errors, which are marked `unrealscript`. --- ModdingTools/Properties/Resources.Designer.cs | 53 ++--- ModdingTools/Properties/Resources.resx | 219 +++++++++++------- 2 files changed, 158 insertions(+), 114 deletions(-) diff --git a/ModdingTools/Properties/Resources.Designer.cs b/ModdingTools/Properties/Resources.Designer.cs index 5823721..3cc23dd 100644 --- a/ModdingTools/Properties/Resources.Designer.cs +++ b/ModdingTools/Properties/Resources.Designer.cs @@ -546,35 +546,28 @@ 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 Compilation", + /// "pattern": [ + /// { + /// "regexp": "(?<=(Error|Warn)\\]\\s{2})(.*(?=\\.uc)\\.uc).(\\d*).(?:\\s|:)* [rest of string was truncated]";. /// internal static string VSCodeTaskTemplate { get { @@ -591,7 +584,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..536f575 100644 --- a/ModdingTools/Properties/Resources.resx +++ b/ModdingTools/Properties/Resources.resx @@ -271,89 +271,140 @@ { - "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 + } + ] + }, + "group": "build" + }, + { + "label": "Cook Mod", + "type": "shell", + "command": "##OMM:OMM_EXE_PATH##", + "args": [ + "--mod", + "${workspaceFolderBasename}", + "--cookmod", + "--nologo" + ], + "group": "build" + }, + { + "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" + }, + { + "label": "Launch Game (No Workshop Mods)", + "type": "shell", + "command": "##OMM:OMM_EXE_PATH##", + "args": [ + "--mod", + "${workspaceFolderBasename}", + "--testmap", + "${input:TestMap}", + "--nologo" + ], + "group": "test" + }, + { + "label": "Launch Game (With Workshop Mods)", + "type": "shell", + "command": "##OMM:OMM_EXE_PATH##", + "args": [ + "--mod", + "${workspaceFolderBasename}", + "--testmapall", + "${input:TestMap}", + "--nologo" + ], + "group": "test" + }, + { + "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." + } + ], + "inputs": [ + // Map input for launching the game. Defaults to titlescreen + { + "id": "TestMap", + "description": "Map:", + "type": "promptString", + "default": "titlescreen_final", + } + ] } @@ -365,7 +416,7 @@ "path": "./" }, { - // Docs and release notes + // A Hat In Time Source "name": "AHiT Source", "path": "##AHIT:SRC_ROOT##" } From 8d1ab3197ce92ddd6e6f4f5e3f72e535ef137e3a Mon Sep 17 00:00:00 2001 From: Lunar Snail Date: Thu, 5 Mar 2026 20:46:25 +0100 Subject: [PATCH 2/4] Add Kill Editor VSCode Task Does what it says on the tin --- ModdingTools/Headless/CommandLineOptions.cs | 3 +++ ModdingTools/Headless/ProgramHeadless.cs | 6 ++++++ ModdingTools/Properties/Resources.resx | 16 ++++++++++++++++ 3 files changed, 25 insertions(+) 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..6f0c105 100644 --- a/ModdingTools/Headless/ProgramHeadless.cs +++ b/ModdingTools/Headless/ProgramHeadless.cs @@ -121,6 +121,12 @@ static int RunOptionsAndReturnExitCode(CommandLineOptions o) } else { + if(o.KillEditor) + { + Utils.KillEditor(); + return 0; + } + if (o.TestMapAll != null) { RunSteamAPI(true); diff --git a/ModdingTools/Properties/Resources.resx b/ModdingTools/Properties/Resources.resx index 536f575..0fde40b 100644 --- a/ModdingTools/Properties/Resources.resx +++ b/ModdingTools/Properties/Resources.resx @@ -394,6 +394,22 @@ ], "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" + ], + + "group": "none", // Utility, but VSCode doesn't have a group for that + "detail": "Instantly ends the editor process. Be careful of unsaved progress!", + "presentation": { + "echo": true, + "reveal": "never", + "focus": false + } } ], "inputs": [ From db1d52316fe3a55e5109132dbe3cd35a047e4629 Mon Sep 17 00:00:00 2001 From: Lunar Snail Date: Thu, 5 Mar 2026 21:11:21 +0100 Subject: [PATCH 3/4] It did not, in fact, do what it said on the tin --- ModdingTools/Headless/ProgramHeadless.cs | 3 +- ModdingTools/Properties/Resources.Designer.cs | 37 ++- ModdingTools/Properties/Resources.resx | 279 +++++++++--------- 3 files changed, 159 insertions(+), 160 deletions(-) diff --git a/ModdingTools/Headless/ProgramHeadless.cs b/ModdingTools/Headless/ProgramHeadless.cs index 6f0c105..94c47ba 100644 --- a/ModdingTools/Headless/ProgramHeadless.cs +++ b/ModdingTools/Headless/ProgramHeadless.cs @@ -123,7 +123,8 @@ static int RunOptionsAndReturnExitCode(CommandLineOptions o) { if(o.KillEditor) { - Utils.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; } diff --git a/ModdingTools/Properties/Resources.Designer.cs b/ModdingTools/Properties/Resources.Designer.cs index 3cc23dd..32d0d2b 100644 --- a/ModdingTools/Properties/Resources.Designer.cs +++ b/ModdingTools/Properties/Resources.Designer.cs @@ -548,26 +548,23 @@ internal static System.Drawing.Bitmap uploaded { /// Looks up a localized string similar to { /// "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|:)* [rest of string was truncated]";. + /// { + /// "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 { diff --git a/ModdingTools/Properties/Resources.resx b/ModdingTools/Properties/Resources.resx index 0fde40b..e06a4f4 100644 --- a/ModdingTools/Properties/Resources.resx +++ b/ModdingTools/Properties/Resources.resx @@ -273,145 +273,146 @@ { "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 - } - ] - }, - "group": "build" - }, - { - "label": "Cook Mod", - "type": "shell", - "command": "##OMM:OMM_EXE_PATH##", - "args": [ - "--mod", - "${workspaceFolderBasename}", - "--cookmod", - "--nologo" - ], - "group": "build" - }, - { - "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" - }, - { - "label": "Launch Game (No Workshop Mods)", - "type": "shell", - "command": "##OMM:OMM_EXE_PATH##", - "args": [ - "--mod", - "${workspaceFolderBasename}", - "--testmap", - "${input:TestMap}", - "--nologo" - ], - "group": "test" - }, - { - "label": "Launch Game (With Workshop Mods)", - "type": "shell", - "command": "##OMM:OMM_EXE_PATH##", - "args": [ - "--mod", - "${workspaceFolderBasename}", - "--testmapall", - "${input:TestMap}", - "--nologo" - ], - "group": "test" - }, - { - "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" - ], - - "group": "none", // Utility, but VSCode doesn't have a group for that - "detail": "Instantly ends the editor process. Be careful of unsaved progress!", - "presentation": { - "echo": true, - "reveal": "never", - "focus": false - } - } - ], + { + "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 + } + ] + }, + "group": "build" + }, + { + "label": "Cook Mod", + "type": "shell", + "command": "##OMM:OMM_EXE_PATH##", + "args": [ + "--mod", + "${workspaceFolderBasename}", + "--cookmod", + "--nologo" + ], + "group": "build" + }, + { + "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" + }, + { + "label": "Launch Game (No Workshop Mods)", + "type": "shell", + "command": "##OMM:OMM_EXE_PATH##", + "args": [ + "--mod", + "${workspaceFolderBasename}", + "--testmap", + "${input:TestMap}", + "--nologo" + ], + "group": "test" + }, + { + "label": "Launch Game (With Workshop Mods)", + "type": "shell", + "command": "##OMM:OMM_EXE_PATH##", + "args": [ + "--mod", + "${workspaceFolderBasename}", + "--testmapall", + "${input:TestMap}", + "--nologo" + ], + "group": "test" + }, + { + "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 { From 3701db78bbb3a6d1cd37151436adfe4d772c28b4 Mon Sep 17 00:00:00 2001 From: Lunar Snail Date: Thu, 5 Mar 2026 21:30:09 +0100 Subject: [PATCH 4/4] Update presentation for Tasks --- ModdingTools/Properties/Resources.resx | 57 ++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/ModdingTools/Properties/Resources.resx b/ModdingTools/Properties/Resources.resx index e06a4f4..39addaf 100644 --- a/ModdingTools/Properties/Resources.resx +++ b/ModdingTools/Properties/Resources.resx @@ -300,6 +300,16 @@ } ] }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "revealProblems": "onProblem", + "clear": true, + "group": "Building" + }, "group": "build" }, { @@ -312,7 +322,16 @@ "--cookmod", "--nologo" ], - "group": "build" + "group": "build", + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": false, + "clear": true, + "group": "Building" + } }, { "label": "Compile and Cook", @@ -332,7 +351,17 @@ "--nologo" ], "problemMatcher": [], - "group": "test" + "group": "test", + + "presentation": { + "echo": true, + "reveal": "never", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false, + "group": "Testing" + } }, { "label": "Launch Game (No Workshop Mods)", @@ -345,7 +374,17 @@ "${input:TestMap}", "--nologo" ], - "group": "test" + "group": "test", + + "presentation": { + "echo": true, + "reveal": "never", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false, + "group": "Testing" + } }, { "label": "Launch Game (With Workshop Mods)", @@ -358,7 +397,17 @@ "${input:TestMap}", "--nologo" ], - "group": "test" + "group": "test", + + "presentation": { + "echo": true, + "reveal": "never", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false, + "group": "Testing" + } }, { "label": "Compile & Launch Editor",