Skip to main content

Notification API

Status​

Implemented.

The core game already has a native notification system:

  • Game/UI/Notifications/NotificationManager.cs
  • Game/UI/Notifications/NotificationPanel.cs
  • Shared/Events/NotificationRequested.cs
  • Shared/Events/NotificationType.cs

Lua resources can call that system directly through the client Lua Notification API.

Current Core Behavior​

The native notification system provides:

  • top-right toast notifications
  • severity levels:
    • info
    • success
    • warning
    • error
  • queueing
  • auto-dismiss durations
  • optional persistent notifications in the core event model

Lua API​

The first version should stay minimal and map directly to the existing native system.

Notification.Show(message, options?)​

Shows a notification.

Parameters

  • message: string
  • options?: table
    • type?: "info" | "success" | "warning" | "error"
    • duration?: number
    • persistent?: boolean

Returns

  • true on success
  • false, error on failure

Notes

  • type defaults to "info"
  • duration defaults to the native type-specific default
  • persistent defaults to false

Notification.Info(message, duration?)​

Notification.Success(message, duration?)​

Notification.Warning(message, duration?)​

Notification.Error(message, duration?)​

Convenience wrappers over Notification.Show(...).

Examples​

Notification.Info("Connected to server")
Notification.Success("Map saved successfully")
Notification.Warning("Unsaved changes")
Notification.Error("Failed to open map")
Notification.Show("Bake complete", {
type = "success",
duration = 6.0
})
Notification.Show("Server disconnected", {
type = "error",
persistent = true
})

Scope​

Current scope:

  • client Lua only

Not included in the first version:

  • server Lua direct display API
  • notification actions/buttons
  • notification history
  • icons exposed to Lua
  • deduplication controls

Design Notes​

The Lua API stays thin.

The correct behavior is:

  • Lua calls a small Notification bridge
  • the bridge forwards into the existing native notification system
  • the existing core queue, styling, and durations stay authoritative

This avoids creating a second notification implementation for Lua.