CorsixTH Lua Documentation

UIBottomPanel Class

The multi-purpose panel for launching dialogs / screens and dynamic information.

Declared on: line 21 of Lua/dialogs/bottom_panel.lua.
Inheritance: UIBottomPanel ยป Window

Method Index

Member Index

(*) only used in superclass methods
function UIBottomPanel:UIBottomPanel(ui)

Parameters:

NameTypeDescription
ui ? ?

Declared on: line 31 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:_findMessageToShow()

Return the index of the first fax message in the queue that is suitable to be shown, and nil if there are none. A message is suitable to be shown if there are less than 5 currently shown messages, no message of the same type is already shown.

Declared on: line 558 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:_initFonts(gfx)

Parameters:

NameTypeDescription
gfx ? ?

Declared on: line 163 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:_initMessageWithDrawerIcon(message_info)

Initialise fax message with an UIMessage object.

Parameters:

NameTypeDescription
message_info table table with message metadata.

Declared on: line 470 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:_showMessageIcon(index)

Pop the message with the given index from the message queue and turn it into an actual message window; if no index is provided the first suitable message in the queue is popped.

Parameters:

NameTypeDescription
index integer or nil the index in the message_queue to pop

Declared on: line 623 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:addDialog(dialog_class, extra_function)

Parameters:

NameTypeDescription
dialog_class ? ?
extra_function ? ?

Declared on: line 972 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:afterLoad(old, new)

Parameters:

NameTypeDescription
old ? ?
new ? ?

Overrides: Window:afterLoad.
Declared on: line 1019 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:canQueueFax(fax)

A fax can be queued if the event the fax causes does not affect an event caused by any other fax that is queued. i.e both emergency and epidemics use the timer, so both faxes cannot appear at the same time. @param fax (table) the fax we want to determine if can be queued. @return true if fax can be queued, false otherwise (boolean)

Parameters:

NameTypeDescription
fax ? ?

Declared on: line 499 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:cancelFax(fax_type)

Cancels a fax of a particular type currently only "emergency" and "epidemy" Handles the cancelling of the event which the fax pertains to. @param fax_type (string) type of fax event to be cancelled

Parameters:

NameTypeDescription
fax_type ? ?

Declared on: line 537 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:deleteMessage(owner, icon)

Removes a message from the message queue (for example if a room is built before the player says what to do with the patient.

Parameters:

NameTypeDescription
owner object optional message owner
icon object optional drawer icon object

Declared on: line 588 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:dialogBankCommon(enable, stats)

Parameters:

NameTypeDescription
enable ? ?
stats ? ?

Declared on: line 698 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:dialogBankManager(enable)

Parameters:

NameTypeDescription
enable ? ?

Declared on: line 690 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:dialogBankStats(enable)

Parameters:

NameTypeDescription
enable ? ?

Declared on: line 694 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:dialogCharts(enable)

Parameters:

NameTypeDescription
enable ? ?

Declared on: line 895 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:dialogDrugCasebook(enable)

Parameters:

NameTypeDescription
enable ? ?

Declared on: line 824 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:dialogMachineMenu(enable)

Parameters:

NameTypeDescription
enable ? ?

Declared on: line 925 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:dialogPolicy(enable)

Parameters:

NameTypeDescription
enable ? ?

Declared on: line 910 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:dialogResearch(enable)

Parameters:

NameTypeDescription
enable ? ?

Declared on: line 839 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:dialogStatus(enable)

Parameters:

NameTypeDescription
enable ? ?

Declared on: line 880 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:dialogTownMap(enable)

Parameters:

NameTypeDescription
enable ? ?

Declared on: line 809 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:draw(canvas, x, y)

Parameters:

NameTypeDescription
canvas ? ?
x ? ?
y ? ?

Overrides: Window:draw.
Declared on: line 248 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:drawDynamicInfo(canvas, x, y)

Adds dynamic text to the bottom panel based on cursor position

Parameters:

NameTypeDescription
canvas ?
x num coordinate
y num coordinate

Declared on: line 305 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:drawReputationMeter(canvas, x_left, y)

Draws the hospital reputation meter on canvas. x_left is the leftmost x-coordinate of the reputation meter y is the y-coordinate of the reputation meter

Parameters:

NameTypeDescription
canvas ? ?
x_left ? ?
y ? ?

Declared on: line 295 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:hitTest(x, y, x_offset)

Parameters:

NameTypeDescription
x ? ?
y ? ?
x_offset ? ?

Overrides: Window:hitTest.
Declared on: line 414 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:onMouseMove(x, y, dx, dy)

Parameters:

NameTypeDescription
x ? ?
y ? ?
dx ? ?
dy ? ?

Overrides: Window:onMouseMove.
Declared on: line 389 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:openFirstMessage()

Opens the first available message in the list of message_windows.

Declared on: line 581 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:openLastMessage()

Opens the last available message. Currently used to open the level completed message.

Declared on: line 550 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:queueMessage(type, message, owner, timeout, default_choice, callback)

The arguments specify a message, which is added to a FIFO queue, and will appear on screen once there is space.

Structure of message (except strike): message = { { text = "first line of text", offset (integer, optional) } { text = "second line of text", offset (integer, optional) } ... choices = { { text = "first choice", choice = "choice_type", enabled = true or false (optional, defaults to true) } ... } }

Parameters:

NameTypeDescription
type string The type of message, can be: "emergency", "epidemy", "personality", "information", "disease", "report" or "strike"
message table or or or number If type == "strike", the amount of pay rise. Else a list of texts to display, including a "choices" table with choices. See below for structure.
owner object or or or nil Some messages are related to one staff or patient or epidemic. Otherwise this is nil.
timeout number or or or nil If given, the message will expire after that many world ticks and be removed.
default_choice number or or or nil If given, the choice with this number will be executed on expiration of the message.
callback function or or or nil If given, it will be called when the message is closed.

Declared on: line 419 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:setDynamicInfo(info)

dividers: { 25, 50, 75 }

}

Parameters:

NameTypeDescription
info table A table containing the information to display. The text

Declared on: line 354 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:setPosition(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

Overrides: Window:setPosition.
Declared on: line 290 of Lua/dialogs/bottom_panel.lua.

function UIBottomPanel:showAdditionalButtons(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

Declared on: line 397 of Lua/dialogs/bottom_panel.lua.