From 3e02cf8092da6caf2f7d610720265b846d7c6cc2 Mon Sep 17 00:00:00 2001 From: KlaasWhite <45828001+KlaasWhite@users.noreply.github.com> Date: Sat, 15 Nov 2025 19:47:50 +0100 Subject: [PATCH 1/9] Fix package release --- .github/workflows/release-zip.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release-zip.yml b/.github/workflows/release-zip.yml index 46b6c20..f4cc563 100644 --- a/.github/workflows/release-zip.yml +++ b/.github/workflows/release-zip.yml @@ -141,5 +141,4 @@ jobs: /p:Version=${{ steps.version.outputs.new }} \ /p:AssemblyVersion=${{ steps.version.outputs.new }} \ /p:FileVersion=${{ steps.version.outputs.new }} - dotnet nuget add source --username "${{ github.actor }}" --password "${{ secrets.GITHUB_TOKEN }}" --store-password-in-clear-text --name github "${{ env.NUGET_SOURCE }}" dotnet nuget push ./nupkg/*.nupkg --source github --api-key "${{ secrets.GITHUB_TOKEN }}" --skip-duplicate From b430caa22ad585fff1a883563347ee71917a923c Mon Sep 17 00:00:00 2001 From: KlaasWhite <45828001+KlaasWhite@users.noreply.github.com> Date: Mon, 23 Feb 2026 20:37:06 +0100 Subject: [PATCH 2/9] Fix PR logic and release flow * Only run internal PR actions on internal PR's * Fix release flow --- .github/workflows/pr-build.yml | 2 ++ .github/workflows/pr-version.yml | 10 +++++----- .github/workflows/release.yml | 27 +++++++++++++-------------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 69d144b..21bb862 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -13,6 +13,8 @@ permissions: jobs: preview: + # Only run for local PRs + if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest env: DOTNET_VERSION: 9.0 diff --git a/.github/workflows/pr-version.yml b/.github/workflows/pr-version.yml index af81f92..f49927c 100644 --- a/.github/workflows/pr-version.yml +++ b/.github/workflows/pr-version.yml @@ -12,6 +12,8 @@ permissions: jobs: preview: + # Only run for local PRs + if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest steps: @@ -29,12 +31,10 @@ jobs: git fetch --tags || true current=$(git describe --tags --abbrev=0 2>/dev/null || true) if [ -z "$current" ]; then - echo "No tags found, defaulting to v0.0.0" - current="v0.0.0" + echo "No tags found, defaulting to 0.0.0" + current="0.0.0" fi - # Remove leading 'v' then extract parts using awk - ver=${current#v} major=$(printf "%s" "$ver" | awk -F. '{print $1+0}') minor=$(printf "%s" "$ver" | awk -F. '{print $2+0}') patch=$(printf "%s" "$ver" | awk -F. '{print $3+0}') @@ -49,7 +49,7 @@ jobs: patch=$((patch+1)); type="patch" fi - next="v${major}.${minor}.${patch}" + next="${major}.${minor}.${patch}" # Safely write outputs if [ -n "$GITHUB_OUTPUT" ]; then diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4c1b814..2055c43 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,12 +41,10 @@ jobs: git fetch --tags || true current=$(git describe --tags --abbrev=0 2>/dev/null || true) if [ -z "$current" ]; then - echo "No tags found, defaulting to v0.0.0" - current="v0.0.0" + echo "No tags found, defaulting to 0.0.0" + current="0.0.0" fi - # Remove leading 'v' then extract parts using awk - ver=${current#v} major=$(printf "%s" "$ver" | awk -F. '{print $1+0}') minor=$(printf "%s" "$ver" | awk -F. '{print $2+0}') patch=$(printf "%s" "$ver" | awk -F. '{print $3+0}') @@ -69,6 +67,15 @@ jobs: echo "prev_version=$current" >> $GITHUB_OUTPUT echo "new_version=$new_version" >> $GITHUB_OUTPUT + - name: Tag and push new version + run: | + git config user.name "github-actions" + git config user.email "actions@github.com" + + NEW_VERSION="${{ steps.version.outputs.new_version }}" + git tag "$NEW_VERSION" + git push origin "$NEW_VERSION" + - name: Setup NuGet source run: | dotnet nuget add source \ @@ -106,18 +113,10 @@ jobs: mv ${{ env.LAUNCHER_OUTPUT_PATH }}/StarMap.Launcher.exe ${{ env.LAUNCHER_OUTPUT_PATH }}/StarMap.exe mv ${{ env.STANDALONE_OUTPUT_PATH }}/StarMap.Loader.exe ${{ env.STANDALONE_OUTPUT_PATH }}/StarMap.exe - - name: Tag and push new version - run: | - git config user.name "github-actions" - git config user.email "actions@github.com" - - NEW_VERSION="${{ steps.version.outputs.new_version }}" - git tag "$NEW_VERSION" - git push origin "$NEW_VERSION" - name: Upload build artifacts uses: actions/upload-artifact@v4 with: - name: rc-build + name: publish path: | ${{ env.LAUNCHER_OUTPUT_PATH }} ${{ env.STANDALONE_OUTPUT_PATH }} @@ -250,7 +249,7 @@ jobs: uses: actions/download-artifact@v4 with: name: publish - path: publish + path: ./build_artifacts # Install Inno Setup via Chocolatey - name: Install Inno Setup From 0107531d3ee6bdc219c9d0b700b44095a9cc5008 Mon Sep 17 00:00:00 2001 From: "Ybalrid (Arthur Brainville)" Date: Sat, 21 Feb 2026 15:47:27 +0100 Subject: [PATCH 3/9] Fix typo in mod loading console log message --- StarMap.Core/ModRepository/ModLoader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StarMap.Core/ModRepository/ModLoader.cs b/StarMap.Core/ModRepository/ModLoader.cs index c0a8754..43be698 100644 --- a/StarMap.Core/ModRepository/ModLoader.cs +++ b/StarMap.Core/ModRepository/ModLoader.cs @@ -63,7 +63,7 @@ private void PrepareMods() { if (!mod.Enabled) { - Console.WriteLine($"StarMap - Nod loading mod: {mod.Id} because it is disable in manifest"); + Console.WriteLine($"StarMap - Not loading mod: {mod.Id} because it is disable in manifest"); continue; } From 637b39277cfa99d3480ff70ff58608deed74496f Mon Sep 17 00:00:00 2001 From: KlaasWhite Date: Mon, 23 Feb 2026 20:41:57 +0100 Subject: [PATCH 4/9] Fix version determine logic --- .github/workflows/pr-version.yml | 2 ++ .github/workflows/release.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/pr-version.yml b/.github/workflows/pr-version.yml index f49927c..e5af5e5 100644 --- a/.github/workflows/pr-version.yml +++ b/.github/workflows/pr-version.yml @@ -35,6 +35,8 @@ jobs: current="0.0.0" fi + # Remove leading 'v' then extract parts using awk + ver=${current#v} major=$(printf "%s" "$ver" | awk -F. '{print $1+0}') minor=$(printf "%s" "$ver" | awk -F. '{print $2+0}') patch=$(printf "%s" "$ver" | awk -F. '{print $3+0}') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2055c43..404e28e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,6 +45,8 @@ jobs: current="0.0.0" fi + # Remove leading 'v' then extract parts using awk + ver=${current#v} major=$(printf "%s" "$ver" | awk -F. '{print $1+0}') minor=$(printf "%s" "$ver" | awk -F. '{print $2+0}') patch=$(printf "%s" "$ver" | awk -F. '{print $3+0}') From a00a1026d70c1bcf49b66048edd4a7d92b9cea67 Mon Sep 17 00:00:00 2001 From: KlaasWhite Date: Mon, 23 Feb 2026 20:45:18 +0100 Subject: [PATCH 5/9] Rename actions and steps --- .github/workflows/pr-build.yml | 2 +- .github/workflows/pr-version.yml | 2 +- .github/workflows/rc-build.yml | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 21bb862..75e5d4e 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -12,7 +12,7 @@ permissions: packages: read jobs: - preview: + build: # Only run for local PRs if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest diff --git a/.github/workflows/pr-version.yml b/.github/workflows/pr-version.yml index e5af5e5..dcafbee 100644 --- a/.github/workflows/pr-version.yml +++ b/.github/workflows/pr-version.yml @@ -11,7 +11,7 @@ permissions: contents: read jobs: - preview: + preview-version: # Only run for local PRs if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest diff --git a/.github/workflows/rc-build.yml b/.github/workflows/rc-build.yml index b15d176..7498361 100644 --- a/.github/workflows/rc-build.yml +++ b/.github/workflows/rc-build.yml @@ -1,4 +1,4 @@ -name: Release new version +name: Release new RC release on: push: @@ -62,6 +62,11 @@ jobs: echo "new_version=$new_version" >> $GITHUB_OUTPUT echo "hash_version=$hash_version" >> $GITHUB_OUTPUT + - name: Update RC tag + run: | + git tag -f rc + git push origin rc --force + - name: Setup NuGet source run: | dotnet nuget add source \ @@ -195,8 +200,3 @@ jobs: ./build_artifacts/version.txt env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Update RC tag - run: | - git tag -f rc - git push origin rc --force From c7915db618227264d6a7b70390ed26bb22484caa Mon Sep 17 00:00:00 2001 From: KlaasWhite Date: Mon, 23 Feb 2026 20:51:27 +0100 Subject: [PATCH 6/9] FIx release --- .github/workflows/pr-build.yml | 2 +- .github/workflows/release.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 75e5d4e..c8ac194 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -12,7 +12,7 @@ permissions: packages: read jobs: - build: + preview-build: # Only run for local PRs if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 404e28e..6c184d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -171,7 +171,7 @@ jobs: - name: Download build artifacts uses: actions/download-artifact@v4 with: - name: rc-build + name: publish path: ./build_artifacts - name: Setup NuGet source @@ -208,7 +208,7 @@ jobs: - name: Download build artifacts uses: actions/download-artifact@v4 with: - name: rc-build + name: publish path: ./build_artifacts - name: Ensure zip is available From b2e7d64bbbbe48f481bdecab9b63866aaa674323 Mon Sep 17 00:00:00 2001 From: KlaasWhite <45828001+KlaasWhite@users.noreply.github.com> Date: Sun, 1 Mar 2026 15:44:01 +0100 Subject: [PATCH 7/9] Feature/external/pr 65 fix local mods folder dev (#69) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Support local mods folder from KSA v2026.2.34.3656 RuntimeMod.TryCreateMod() now checks both Content/ and the local mods folder (Documents/My Games/Kitten Space Agency/mods/) when resolving mod directories, matching the game's own fallback behavior. Also removes unused path variables in ModLoader.PrepareMods() and updates the README mod location section. * Update dummy --------- Co-authored-by: Maximilian Neßlauer --- README.md | 7 ++++++- StarMap.API/StarMap.API.csproj | 2 +- StarMap.Core/ModRepository/ModLoader.cs | 5 ----- StarMap.Core/ModRepository/RuntimeMod.cs | 7 ++++++- StarMap.Core/StarMap.Core.csproj | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2f08e97..aec0447 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,12 @@ It makes use of Assembly Load Contexts to ensure mod dependencies are managed se ## Mod location -Mods should be installed in the contents folder in the KSA installation, StarMap makes use of the +Mods can be placed in either of these two locations: + +- `Documents/My Games/Kitten Space Agency/mods//` (recommended, persists across game updates) +- `/Content//` + +StarMap uses the game's manifest system to discover mods from both locations. ## Mod creation diff --git a/StarMap.API/StarMap.API.csproj b/StarMap.API/StarMap.API.csproj index 71d564e..8d55bad 100644 --- a/StarMap.API/StarMap.API.csproj +++ b/StarMap.API/StarMap.API.csproj @@ -18,7 +18,7 @@ - + compile; build; analyzers all diff --git a/StarMap.Core/ModRepository/ModLoader.cs b/StarMap.Core/ModRepository/ModLoader.cs index c0a8754..5c8714d 100644 --- a/StarMap.Core/ModRepository/ModLoader.cs +++ b/StarMap.Core/ModRepository/ModLoader.cs @@ -56,9 +56,6 @@ private void PrepareMods() var mods = ModLibrary.Manifest.Mods; if (mods is null) return; - string rootPath = "Content"; - string path = Path.Combine(new ReadOnlySpan(in rootPath)); - foreach (var mod in mods) { if (!mod.Enabled) @@ -67,8 +64,6 @@ private void PrepareMods() continue; } - var modPath = Path.Combine(path, mod.Id); - if (!RuntimeMod.TryCreateMod(mod, _coreAssemblyLoadContext, out var runtimeMod)) continue; diff --git a/StarMap.Core/ModRepository/RuntimeMod.cs b/StarMap.Core/ModRepository/RuntimeMod.cs index 25bea2e..1cb09b8 100644 --- a/StarMap.Core/ModRepository/RuntimeMod.cs +++ b/StarMap.Core/ModRepository/RuntimeMod.cs @@ -38,7 +38,12 @@ public static bool TryCreateMod(ModEntry manifestEntry, AssemblyLoadContext core var modPath = Path.Combine(_rootContentPath, manifestEntry.Id); var modTomlPath = Path.Combine(modPath, "mod.toml"); - if (!File.Exists(modTomlPath)) return false; + if (!File.Exists(modTomlPath)) + { + modPath = Path.Combine(ModLibrary.LocalModsFolderPath, manifestEntry.Id); + modTomlPath = Path.Combine(modPath, "mod.toml"); + if (!File.Exists(modTomlPath)) return false; + } var tomlConfig = TomletMain.To(File.ReadAllText(modTomlPath)); if (tomlConfig?.StarMap is not StarMapConfig starMapConfig) { diff --git a/StarMap.Core/StarMap.Core.csproj b/StarMap.Core/StarMap.Core.csproj index 53dc1d7..3859eda 100644 --- a/StarMap.Core/StarMap.Core.csproj +++ b/StarMap.Core/StarMap.Core.csproj @@ -23,7 +23,7 @@ - + runtime From 93cd07cb1da5e928e72dc84553c5913a52db924c Mon Sep 17 00:00:00 2001 From: KlaasWhite <45828001+KlaasWhite@users.noreply.github.com> Date: Thu, 9 Apr 2026 19:35:19 +0200 Subject: [PATCH 8/9] Fix OnDrawUi harmony patch for KSA 2026.4.6.4036 (#71) --- StarMap.Core/Patches/ProgramPatcher.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/StarMap.Core/Patches/ProgramPatcher.cs b/StarMap.Core/Patches/ProgramPatcher.cs index 5c819d7..33d2f77 100644 --- a/StarMap.Core/Patches/ProgramPatcher.cs +++ b/StarMap.Core/Patches/ProgramPatcher.cs @@ -7,10 +7,11 @@ namespace StarMap.Core.Patches [HarmonyPatch(typeof(Program))] internal static class ProgramPatcher { - private const string OnDrawUiMethodName = "OnDrawUi"; + private const string OnBeforeDrawUiMethodName = "OnDrawUiFrame"; + private const string OnAfterDrawUiMethodName = "OnDrawUiViewports"; private const string OnFrameMethodName = "OnFrame"; - [HarmonyPatch(OnDrawUiMethodName)] + [HarmonyPatch(OnBeforeDrawUiMethodName)] [HarmonyPrefix] public static void BeforeOnDrawUi(double dt) { @@ -22,7 +23,7 @@ public static void BeforeOnDrawUi(double dt) } } - [HarmonyPatch(OnDrawUiMethodName)] + [HarmonyPatch(OnAfterDrawUiMethodName)] [HarmonyPostfix] public static void AfterOnDrawUi(double dt) { From 886035e0a657262dad55c6f6529b6ee5b78913bb Mon Sep 17 00:00:00 2001 From: KlaasWhite <45828001+KlaasWhite@users.noreply.github.com> Date: Fri, 10 Apr 2026 18:02:55 +0200 Subject: [PATCH 9/9] Add config option for game CLI arguments * Fix package release * Add config option for game CLI arguments --------- Co-authored-by: arthomnix <35371030+arthomnix@users.noreply.github.com> --- StarMap.Loader/GameSurveyer.cs | 8 ++++---- StarMap.Loader/Program.cs | 4 ++-- StarMap.Types/LoaderConfig.cs | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/StarMap.Loader/GameSurveyer.cs b/StarMap.Loader/GameSurveyer.cs index 371a191..2500aa1 100644 --- a/StarMap.Loader/GameSurveyer.cs +++ b/StarMap.Loader/GameSurveyer.cs @@ -10,15 +10,17 @@ internal class GameSurveyer : IDisposable private readonly IGameFacade _facade; private readonly AssemblyLoadContext _gameAssemblyContext; private readonly string _gameLocation; + private readonly string[] _args; private Assembly? _game; private IStarMapCore? _core; - public GameSurveyer(IGameFacade facade, AssemblyLoadContext alc, string location) + public GameSurveyer(IGameFacade facade, AssemblyLoadContext alc, string location, string[] args) { _facade = facade; _gameAssemblyContext = alc; _gameLocation = location; + _args = args; } public bool TryLoadCoreAndGame() @@ -51,9 +53,7 @@ public void RunGame() { Debug.Assert(_game is not null, "Load needs to be called before running game"); - string[] args = []; - - _game.EntryPoint!.Invoke(null, [args]); + _game.EntryPoint!.Invoke(null, [_args]); } public void Dispose() diff --git a/StarMap.Loader/Program.cs b/StarMap.Loader/Program.cs index b5a212a..63b75c7 100644 --- a/StarMap.Loader/Program.cs +++ b/StarMap.Loader/Program.cs @@ -36,7 +36,7 @@ static void SoleModeInner() var gameAssemblyContext = new GameAssemblyLoadContext(gameConfig.GameLocation); var dumbFacade = new SoloGameFacade(); - using var gameSurveyer = new GameSurveyer(dumbFacade, gameAssemblyContext, gameConfig.GameLocation); + using var gameSurveyer = new GameSurveyer(dumbFacade, gameAssemblyContext, gameConfig.GameLocation, gameConfig.GameArguments); if (!gameSurveyer.TryLoadCoreAndGame()) { Console.WriteLine("StarMap - Unable to load mod manager and game in solo mode."); @@ -55,7 +55,7 @@ static async Task MainInner(string pipeName) var gameLocation = await facade.Connect(); var gameAssemblyContext = new GameAssemblyLoadContext(Path.GetFullPath(gameLocation)); - var gameSurveyer = new GameSurveyer(facade, gameAssemblyContext, gameLocation); + var gameSurveyer = new GameSurveyer(facade, gameAssemblyContext, gameLocation, []); if (!gameSurveyer.TryLoadCoreAndGame()) return; gameSurveyer.RunGame(); diff --git a/StarMap.Types/LoaderConfig.cs b/StarMap.Types/LoaderConfig.cs index aede82b..4f4309e 100644 --- a/StarMap.Types/LoaderConfig.cs +++ b/StarMap.Types/LoaderConfig.cs @@ -40,10 +40,14 @@ public bool TryLoadConfig() } GameLocation = path; + + GameArguments = config.GameArguments; + return true; } public string GameLocation { get; set; } = ""; public string RepositoryLocation { get; set; } = ""; + public string[] GameArguments { get; set; } = []; } }