Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fcc4242
Refactor + IStarMapOnUi
KlaasWhite Nov 15, 2025
3e02cf8
Fix package release
KlaasWhite Nov 15, 2025
9024850
Merge pull request #19 from StarMapLoader/dev
KlaasWhite Nov 15, 2025
586dda4
Merge pull request #21 from StarMapLoader/dev
KlaasWhite Nov 15, 2025
8bc22e1
Merge pull request #22 from StarMapLoader/dev
KlaasWhite Nov 15, 2025
e96e2d3
Merge pull request #24 from StarMapLoader/dev
KlaasWhite Nov 16, 2025
07f52d5
Merge pull request #25 from StarMapLoader/dev
KlaasWhite Nov 16, 2025
2ae154a
Merge pull request #26 from StarMapLoader/dev
KlaasWhite Nov 16, 2025
d8a9ced
Merge pull request #27 from StarMapLoader/dev
KlaasWhite Nov 16, 2025
4be4d11
Merge pull request #29 from StarMapLoader/dev
KlaasWhite Nov 17, 2025
b3a9012
Merge pull request #30 from StarMapLoader/dev
KlaasWhite Nov 17, 2025
4e2f5b0
Merge pull request #31 from StarMapLoader/dev
KlaasWhite Nov 17, 2025
11c2601
Merge pull request #32 from StarMapLoader/dev
KlaasWhite Nov 22, 2025
35c0876
Merge pull request #34 from StarMapLoader/dev
KlaasWhite Nov 23, 2025
a7c3eef
Merge pull request #37 from StarMapLoader/dev
KlaasWhite Nov 29, 2025
91017ce
Merge pull request #39 from StarMapLoader/dev
KlaasWhite Nov 30, 2025
1578a95
Merge pull request #41 from StarMapLoader/dev
KlaasWhite Nov 30, 2025
822bb49
Merge pull request #43 from StarMapLoader/dev
KlaasWhite Dec 6, 2025
69c97c0
Merge pull request #49 from StarMapLoader/dev
KlaasWhite Dec 15, 2025
0ef4388
Merge pull request #59 from StarMapLoader/dev
KlaasWhite Feb 21, 2026
6ec882c
Merge pull request #62 from StarMapLoader/dev
KlaasWhite Feb 21, 2026
b430caa
Fix PR logic and release flow
KlaasWhite Feb 23, 2026
0107531
Fix typo in mod loading console log message
Ybalrid Feb 21, 2026
637b392
Fix version determine logic
KlaasWhite Feb 23, 2026
a00a102
Rename actions and steps
KlaasWhite Feb 23, 2026
9a478c9
Merge pull request #67 from StarMapLoader/dev
KlaasWhite Feb 23, 2026
c7915db
FIx release
KlaasWhite Feb 23, 2026
2f4e545
Merge pull request #68 from StarMapLoader/dev
KlaasWhite Feb 23, 2026
b2e7d64
Feature/external/pr 65 fix local mods folder dev (#69)
KlaasWhite Mar 1, 2026
0565def
Merge pull request #70 from StarMapLoader/dev
KlaasWhite Mar 1, 2026
93cd07c
Fix OnDrawUi harmony patch for KSA 2026.4.6.4036 (#71)
KlaasWhite Apr 9, 2026
aec7e9e
Merge pull request #72 from StarMapLoader/dev
KlaasWhite Apr 9, 2026
886035e
Add config option for game CLI arguments
KlaasWhite Apr 10, 2026
9c05b6c
Merge pull request #75 from StarMapLoader/dev
KlaasWhite Apr 10, 2026
0a35575
Merge branch 'StarMapLoader:main' into yba/typo
Ybalrid Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ permissions:
packages: read

jobs:
preview:
preview-build:
# 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
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/pr-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ 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

steps:
Expand All @@ -29,8 +31,8 @@ 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
Expand All @@ -49,7 +51,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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/rc-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release new version
name: Release new RC release

on:
push:
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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
29 changes: 15 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ 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
Expand All @@ -69,6 +69,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 \
Expand Down Expand Up @@ -106,18 +115,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 }}
Expand Down Expand Up @@ -170,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
Expand Down Expand Up @@ -207,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
Expand Down Expand Up @@ -250,7 +251,7 @@ jobs:
uses: actions/download-artifact@v4
with:
name: publish
path: publish
path: ./build_artifacts

# Install Inno Setup via Chocolatey
- name: Install Inno Setup
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<ModName>/` (recommended, persists across game updates)
- `<KSA Installation>/Content/<ModName>/`

StarMap uses the game's manifest system to discover mods from both locations.

## Mod creation

Expand Down
2 changes: 1 addition & 1 deletion StarMap.API/StarMap.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' != 'Debug'">
<PackageReference Include="StarMap.KSA.Dummy" Version="1.0.13">
<PackageReference Include="StarMap.KSA.Dummy" Version="1.0.22">
<IncludeAssets>compile; build; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
7 changes: 1 addition & 6 deletions StarMap.Core/ModRepository/ModLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,14 @@ private void PrepareMods()
var mods = ModLibrary.Manifest.Mods;
if (mods is null) return;

string rootPath = "Content";
string path = Path.Combine(new ReadOnlySpan<string>(in rootPath));

foreach (var mod in mods)
{
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;
}

var modPath = Path.Combine(path, mod.Id);

if (!RuntimeMod.TryCreateMod(mod, _coreAssemblyLoadContext, out var runtimeMod))
continue;

Expand Down
7 changes: 6 additions & 1 deletion StarMap.Core/ModRepository/RuntimeMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RootConfig>(File.ReadAllText(modTomlPath));
if (tomlConfig?.StarMap is not StarMapConfig starMapConfig)
{
Expand Down
7 changes: 4 additions & 3 deletions StarMap.Core/Patches/ProgramPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -22,7 +23,7 @@ public static void BeforeOnDrawUi(double dt)
}
}

[HarmonyPatch(OnDrawUiMethodName)]
[HarmonyPatch(OnAfterDrawUiMethodName)]
[HarmonyPostfix]
public static void AfterOnDrawUi(double dt)
{
Expand Down
2 changes: 1 addition & 1 deletion StarMap.Core/StarMap.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' != 'Debug'">
<PackageReference Include="StarMap.KSA.Dummy" Version="1.0.13">
<PackageReference Include="StarMap.KSA.Dummy" Version="1.0.22">
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions StarMap.Loader/GameSurveyer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions StarMap.Loader/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand All @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions StarMap.Types/LoaderConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; } = [];
}
}