Frontier Wire — Client Exports & Events
Client exports read from memory, with no server request, so they are safe to call every frame. They describe the local player's own character and return nil (or 0) before the character is in the world.
Exports
GetMailbox()
lua
local mailbox = exports.frontier_mailbox:GetMailbox() -- {address, name, characterId, unread} or nilGetMailboxAddress()
lua
local address = exports.frontier_mailbox:GetMailboxAddress() -- 'FW-000123' or nilGetUnreadCount()
lua
local unread = exports.frontier_mailbox:GetUnreadCount() -- numberIsOpen()
lua
local open = exports.frontier_mailbox:IsOpen() -- true while a postal screen has the player's attentionClient events
Local client events, raised at the same moments as the client hooks.
| Event | Arguments |
|---|---|
frontier_mailbox:client:opened | screen |
frontier_mailbox:client:closed | none |
frontier_mailbox:client:unread | count |
screen is 'player' (post office counter), 'compose' (telegram paper), 'bird' (carrier bird sheet), 'admin' (admin desk) or 'ace' (the "no permission" card).
Where to put this code
The code on this page is client-side Lua and goes in Frontier Wire's own open client hooks file:
text
resources/[frontier-forge]/frontier_mailbox/
bridge/
hooks/
client.lua ← paste the examples at the bottom of this file- The file is loaded by Frontier Wire itself; nothing else is needed. Restart
frontier_mailboxafter saving. - Never paste into
frontier_mailbox/client/: those files are escrowed. - Back the file up before installing an update, because an update replaces it.
Example: hide the minimap while the post office is open
File: frontier_mailbox/bridge/hooks/client.lua. Inside this file the moments are hook functions, so replace the empty Hooks.opened and Hooks.closed already in the file:
lua
function Hooks.opened(screen)
DisplayRadar(false)
end
function Hooks.closed()
DisplayRadar(true)
endMore hook examples: Editable Files (Client).
