Frontier Wire — Editable Files (Client)
File: frontier_mailbox/bridge/hooks/client.lua is not escrowed: write your own code inside the functions already in that file (each exists once). Back it up before installing an update, because an update replaces it. Every function is optional. They run on the player's game client and must not block: no long loops and no waiting inside them.
Other resources can listen to the same moments as client events instead.
Hooks.opened(screen)
A postal screen opened. screen: 'player' (post office counter), 'compose' (telegram paper), 'bird' (carrier bird sheet), 'admin' (admin desk) or 'ace' (the "no permission" card).
Example: hide the minimap while a postal screen is open.
function Hooks.opened(screen)
DisplayRadar(false)
endHooks.closed()
The postal screen closed. Example: show the minimap again.
function Hooks.closed()
DisplayRadar(true)
endHooks.unread(count)
The number of unread telegrams of this character changed. Example: a VORP notice when new mail is waiting.
local lastUnread = 0
function Hooks.unread(count)
if count > lastUnread then
-- vorp:TipRight is VORP's own notice (vorp_core/client/notifications.lua)
TriggerEvent('vorp:TipRight', ('You have %d unread telegram(s)'):format(count), 4000)
end
lastUnread = count
endRestart frontier_mailbox after editing the file.
