Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
5 changes: 0 additions & 5 deletions StarMap.Core/ModRepository/ModLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(in rootPath));

foreach (var mod in mods)
{
if (!mod.Enabled)
Expand All @@ -67,8 +64,6 @@ private void PrepareMods()
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
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
Loading