Menu
The Menu API allows mods to add custom items to the Start Menu.
Import
ts
import { Menu } from "@hotbunny/hackhub-content-sdk";Functions
Menu.addItem(item: MenuItem)
Adds a custom item to the start menu.
ts
Menu.addItem({
id: "my-tool",
label: "My Custom Tool",
icon: "mod-asset://icon.png",
section: "bottom",
onClick: () => {
UI.toast("Tool activated!");
},
});Menu.removeItem(id: string)
Removes a previously added menu item by its ID.
ts
Menu.removeItem("my-tool");Menu.getItems(): MenuItem[]
Returns all mod-added menu items.
ts
const items = Menu.getItems();
console.log(`${items.length} mod menu items registered`);MenuItem Interface
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique identifier for the menu item |
label | string | Yes | Display text for the item |
icon | string | No | Icon URL (supports mod-asset:// protocol) |
section | "top" | "bottom" | No | Where to place the item (default: bottom) |
onClick | () => void | No | Callback when item is clicked |
Example: Tool Launcher
ts
import { Menu, UI } from "@hotbunny/hackhub-content-sdk";
export function setupMenu() {
Menu.addItem({
id: "network-scanner",
label: "Network Scanner",
icon: "mod-asset://scanner-icon.png",
section: "top",
onClick: () => {
UI.toast("Scanning network...");
},
});
}