CorsixTH Lua Documentation

Announcer Class

Announces audible messages to the player.

Declared on: line 122 of Lua/announcer.lua.
Full description:
The announcer plays announcements based on their priority. If the caller requests an announcement to be played, it will be played directly if there are no announcements currently being announced. Note that announcements are only played if there is a worker at the reception desk and announcements are enabled in the settings.

Method Index

Member Index

function Announcer:Announcer(app)

Constructor.

Parameters:

NameTypeDescription
app App The CorsixTH app

Declared on: line 132 of Lua/announcer.lua.

function Announcer:_onPlayed(entry)

Private function. Handles the playSound completed event. Also calls the callback of the announcement.

Parameters:

NameTypeDescription
entry AnnouncementEntry The announcement that has been played.

Declared on: line 246 of Lua/announcer.lua.

function Announcer:_play(entry)

Private function. Plays the actual sound of an announcement.

Parameters:

NameTypeDescription
entry AnnouncementEntry The announcement to play.

Declared on: line 236 of Lua/announcer.lua.

function Announcer:_setRandomAnnouncementTarget()

Private function. Sets the new time (in ticks) when a random announcement should be played.

Declared on: line 224 of Lua/announcer.lua.

function Announcer:onTick()

The announcer's (game) tick handler. Plays the actual sound of the announcements, if available. Also queues random announcements if no announcements have been played for a while.

Declared on: line 183 of Lua/announcer.lua.

function Announcer:playAnnouncement(name, priority, decay_hours, played_callback, played_callback_delay)

Requests the announcer to play an announcement.

Parameters:

NameTypeDescription
name string The filename to play.
priority int or nil The priority of the announcement. See AnnouncementPriority.
decay_hours float or nil After this amount of hours the announcement should be considered irrelevant. Provide nil for a decay time based on the provided priority.
played_callback function or nil The callback to trigger when the announcement was successfully played.
played_callback_delay int or nil Delay the callback with this amount of milliseconds.

Declared on: line 143 of Lua/announcer.lua.