A modding framework for Kitten Space Agency that allows mods to easily add menu entries.
To see ModMenu in action, it is recommended to install ModMenu.ExampleMod and put that mod in your KSA Content folder.
For developers it is also recommended to see how ModMenu.ExampleMod uses the ModMenu.
Add the NuGet package to your mod project in Visual Studio, go to Manage NuGet Packages ->
Click on the settings icon ->
Click Add ->
Put in a name you want and for the source put in this URL: https://nuget.pkg.github.com/MrJeranimo/index.json. Then Click 'Save' ->
You'll see the new Source. Go to back to the Manage NuGet Packages page ->
Change the source to the new ModMenu source you added or All ->
If you do the new source, it should be the only one.
If you do All you must search for ModMenu.Attributes
Once installed add the using ModMenu; to your Mod and add the [ModMenuEntry("Mod Name")] tag to which ever function you want to be called by ModMenu. If you add any ImGui code in the function, it will be drawn inside a submenu that is labeled with the "Mod Name" you put in the tag.
using ModMenu;
public class MyMod
{
[ModMenuEntry("My Mod Name")]
public static void DrawMenu()
{
ImGui.Text("Hello World!");
}
}!!!WARNING!!!
You MUST include the ModMenu.Attributes.dll file in your Mod folder otherwise the mod WILL CRASH on startup. You can either download the ModMenu.Attributes.dll in the releases, or if the ModMenu.Attributes.dll is not showing up when building add
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> to your .csproj file.
Example:
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>Note that this will copy all of your NuGet Packages .dlls into the build folder. I currently do not know a better way to do this.
Once you have the built files, put your Mod's .dll and the ModMenu.Attributes.dll into your Mod's folder. Then make sure you have ModMenu installed and put in your KSA/Content folder and you can launch StarMap and see the Submenu for your mod.
- Download
ModMenu.zipfrom Releases - Extract it to
Kitten Space Agency/Content/ - Add to the
manifest.tomlinDocuments/My Games/Kitten Space Agency/for Windows.
[[mods]]
id = "ModMenu"
enabled = true- Launch the game via StarMap
Any installed mods using ModMenu will automatically appear in the "Mods" menu.
/ModMenu.Attributes/- NuGet package with the[ModMenuEntry]attribute/ModMenu/- Main mod DLL (or wherever your main mod code is)
MIT