UI
The UI namespace provides methods to show notifications and toast messages to the player.
Required permission: ui
Import
typescript
import { UI } from "@hotbunny/hackhub-content-sdk";Methods
UI.notify(message)
Show a notification popup to the player. Appears as a system-style notification.
| Parameter | Type | Description |
|---|---|---|
message | string | Notification text |
typescript
UI.notify("New quest available!");
UI.notify("You received a file from an unknown sender.");UI.toast(message, type?)
Show a brief toast message at the bottom of the screen.
| Parameter | Type | Description |
|---|---|---|
message | string | Toast message text |
type | "success" | "error" | "warning" | "info" | Toast style (optional, defaults to info) |
typescript
UI.toast("File downloaded successfully", "success");
UI.toast("Connection failed", "error");
UI.toast("Low disk space", "warning");
UI.toast("Scanning network...", "info");