Mod Buttons
ModButtons is a centralized action hub for Idol Manager. It dynamically injects a custom menu popup that allows mods to cleanly integrate their own interactive UI buttons.
Instead of writing complex Harmony UI patches for every single mod you create, you simply provide a JSON file and your target methods. ModButtons handles all the UI generation, layout, visual styling, and asynchronous icon loading. You just need to provide C# code for what your mod’s buttons do.
Note: ModButtons is entirely standalone. While it is fully compatible with the ModMenu framework and will position itself cleanly next to it if detected, ModMenu is NOT required.
Adding buttons to the hub requires absolutely zero UI code. You just need to create a JSON file in your mod’s directory that tells ModButtons what methods to execute.
Create a ModButtons folder in your mod’s root directory. Place your buttons.json and any optional icons directly inside it:
This JSON file is a simple array of objects. Every object represents one button you want to add to the menu under your mod’s name.
JSON Properties:
- label: (Required) The fallback text displayed on the button or tooltip.
- codeLabel: (Optional) The translation key used for localizing this button’s text.
- icon: (Optional) The exact filename of the PNG to use as the button graphic. Must be in the ModButtons folder alongside the JSON.
- assembly: (Required) The name of your compiled DLL (without the .dll extension).
- class: (Required) The full namespace and class name where your target method lives.
- method: (Required) The exact name of the C# method to execute.
The method you specify in your JSON must be both public and static, and it must take zero arguments.
ModButtons features a built-in, multi-mod localization manager. It automatically detects the player’s active language settings and translates your button labels, tooltips, and your Mod’s title header.
Create a Localization folder in your mod’s root directory. Inside, create folders for your supported language codes (e.g., en, jp, cn, ru).
The localization file uses a simple key=value format.
Example Localization/en/strings.txt:
Localization Logic:
- No codeLabel provided in JSON? ModButtons will automatically generate a translation key using YourClass.YourMethod.
- Missing Translations? The manager will always load Localization/en/strings.txt as a baseline. If the user plays in Japanese but you haven’t translated a specific button, it will safely fall back to your English baseline.
- Size Requirements: Square 1:1 ratio images are recommended.
- Format: PNG is highly recommended.
- Fallback: If you do not provide an icon, ModButtons automatically generates a standard, rectangular text-button cloned from the game’s native UI style instead of using the icon grid.