Add a gamemode
Register your mod as a gamemode. It then shows as a row in the Side Hustle hub, and the player starts it from there.
You need: Side Hustle 3.0, a MelonLoader mod project.
-
Reference
SideHustle.dllfrom your game’sModsfolder. Do not copy it into your output.<Reference Include="SideHustle"><HintPath>path\to\Schedule I\Mods\SideHustle.dll</HintPath><Private>false</Private></Reference>Your project also needs
UnityEngine.CoreModule, because the descriptor hasSpriteandTexture2Dfields. -
Copy
SideHustleLink.csinto your project. It keeps your mod working when Side Hustle is not installed. -
Mark Side Hustle as an optional dependency, once in any file:
[assembly: MelonOptionalDependencies("SideHustle")] -
Put every Side Hustle type in its own class. Your
MelonModclass must not mention one.using SideHustle;internal static class Gamemode{internal static GamemodeDescriptor Build() => new GamemodeDescriptor{Id = "you.yourmode", // stable and uniqueDisplayName = "Your Mode",Description = "What your gamemode does.",Author = "You",Support = GamemodeSupport.Singleplayer, // or Multiplayer, HybridSurface = GamemodeSurface.MenuSpace, // MenuSpace = overlay on the menu, World = loads a worldOnLaunchSingleplayer = Start,OnExitToHub = ctx => CleanUp(),};private static void Start(LaunchContext ctx) { /* build your overlay or start your mode */ }private static void CleanUp() { /* remove everything you built */ }}A method that names a Side Hustle type fails before its first line when
SideHustle.dllis missing. Atry/catchinside that method does not help. -
Register from
OnInitializeMelon:public override void OnInitializeMelon(){SideHustleLink.TryRegister(() => Gamemode.Build(), LoggerInstance);} -
Call
ctx.ReturnToHub()when your mode ends, for example on a Back button. Side Hustle then shows the menu and the hub again.
Add an icon
Section titled “Add an icon”Embed a PNG as <AssemblyName>.hub-icon.png. The hub finds it without any code:
<EmbeddedResource Include="icon.png" LogicalName="YourMod.hub-icon.png" />The hub shows this icon also while the boot gate holds your mod back and none of your code has run.
For another resource name, set IconResource on the descriptor. Icon (a Sprite) and IconTex (a Texture2D) win over both.
Check it works
Section titled “Check it works”The log shows:
Gamemode registered: 'Your Mode' (you.yourmode).Your row is in the hub. Click Solo, and OnLaunchSingleplayer runs.

A problem in the descriptor is logged with the gamemode id and the field name.