-
Notifications
You must be signed in to change notification settings - Fork 3
Mod Call Support
emyhrberg edited this page Jun 11, 2025
·
1 revision
If you want to add more tools to Mod Reloader, you've come to the right place.
Mod Reloader provides support for Mod.Call, see the wiki for more info.

The following call will add a button with an action to Mod Reloader.
"AddButton", string buttonName, Action buttonClickedAction, Asset<Texture2D> buttonTexture, string tooltip
See the following class for an example integration. Change with your own name and actions for the button as desired.
using System;
[JITWhenModsEnabled("ModReloader")]
public class ExampleModReloaderButtonIntegration : ModPlayer
{
public override void OnEnterWorld()
{
if (ModLoader.TryGetMod("ModReloader", out Mod MR))
{
MR.Call(
"AddButton",
"UIEditor", // your name
() => Main.NewText("UIEditor"), // your action
Assets.DragonLensToolIcon, // asset (the preview image has none provided)
"Edit UI layout" // your tooltip
);
}
}
}