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:
dotnet add package ModMenu.Attributesor in Visual Studio go to Manage NuGet Packages -> Search using Github -> ModMenu.Attributes and install that. 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. 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/ - 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