Skip to content

Notices

Notice helpers for sending, receiving, localizing, displaying, and routing Lilia notification messages.


Overview

The notices library centralizes notification delivery under `lia.notices`. Serverside calls send networked notices to one client or broadcast them to all players, while clientside calls build `liaNotice` panels, organize their screen positions, emit the notice sound, and print the message to the console. Localized helpers resolve language keys through `L` before using the normal notice pipeline.

lia.notices.receiveNotify()View Source

Purpose

Reads a networked notification payload and creates a clientside notice panel after running the notice override hook.

Realm

Client

Example Usage

  net.Receive("liaNotificationData", lia.notices.receiveNotify)

lia.notices.receiveNotifyL()View Source

Purpose

Reads a networked localized notification payload, resolves the language key, and creates a clientside notice panel after running the notice override hook.

Realm

Client

Example Usage

  net.Receive("liaNotifyLocal", lia.notices.receiveNotifyL)

lia.notices.notifyInfoLocalized(client, key)View Source

Purpose

Displays a localized info notice for the local client.

Realm

Client

Parameters

Player client optional Retained for API compatibility and passed through to the shared notice function.

string key The localization key to resolve with `L`.

Example Usage

  lia.notices.notifyInfoLocalized(nil, "noticeSaved")

lia.notices.notifyWarningLocalized(client, key)View Source

Purpose

Displays a localized warning notice for the local client.

Realm

Client

Parameters

Player client optional Retained for API compatibility and passed through to the shared notice function.

string key The localization key to resolve with `L`.

Example Usage

  lia.notices.notifyWarningLocalized(nil, "noticeWarning")

lia.notices.notifyErrorLocalized(client, key)View Source

Purpose

Displays a localized error notice for the local client.

Realm

Client

Parameters

Player client optional Retained for API compatibility and passed through to the shared notice function.

string key The localization key to resolve with `L`.

Example Usage

  lia.notices.notifyErrorLocalized(nil, "noticeError")

lia.notices.notifySuccessLocalized(client, key)View Source

Purpose

Displays a localized success notice for the local client.

Realm

Client

Parameters

Player client optional Retained for API compatibility and passed through to the shared notice function.

string key The localization key to resolve with `L`.

Example Usage

  lia.notices.notifySuccessLocalized(nil, "noticeSuccess")

lia.notices.notifyMoneyLocalized(client, key)View Source

Purpose

Displays a localized money notice for the local client.

Realm

Client

Parameters

Player client optional Retained for API compatibility and passed through to the shared notice function.

string key The localization key to resolve with `L`.

Example Usage

  lia.notices.notifyMoneyLocalized(nil, "noticeMoney")

lia.notices.notifyAdminLocalized(client, key)View Source

Purpose

Displays a localized admin notice for the local client.

Realm

Client

Parameters

Player client optional Retained for API compatibility and passed through to the shared notice function.

string key The localization key to resolve with `L`.

Example Usage

  lia.notices.notifyAdminLocalized(nil, "noticeAdmin")

lia.notices.notifyLocalized(client, key, notifType)View Source

Purpose

Sends or displays a localized notice using the provided notice type.

Realm

Shared

Parameters

Player|any client optional On the server, the target player to receive the notice. If nil, the notice is broadcast. If this value is not a Player, it is treated as the first localization argument and the notice is broadcast. On the client, this is retained for API compatibility.

string key The localization key to resolve with `L`.

string notifType optional The notice type to send or display. Defaults to `default`.

Example Usage

  lia.notices.notifyLocalized(client, "noticeSaved", "success")
  lia.notices.notifyLocalized(nil, "noticeWarning", "warning", "Door")

lia.notices.notify(client, message, notifType)View Source

Purpose

Sends a plain notice from the server or displays one immediately on the client.

Realm

Shared

Parameters

Player client optional On the server, the target player to receive the notice. If nil, the notice is broadcast. On the client, this is retained for API compatibility.

string message The notice text to send or display.

string notifType optional The notice type to send or display. Defaults to `default`.

Example Usage

  lia.notices.notify(client, "Settings saved.", "success")
  lia.notices.notify(nil, "Server restart soon.", "warning")

Hooks

Library-specific hooks documented for this library.


LiliaNoticeOverride(message, noticeType)View Source

Purpose

Allows plugins or modules to intercept incoming networked notices before a clientside notice panel is created.

Realm

Client

Parameters

string message The notice text that would be displayed.

string noticeType The notice type used to style the notice.

Returns

boolean|table|nil Return true to block the notice. Return a table with `message` or `msg` and/or `type` to replace the notice data. Return nil or any other value to continue with the original notice.