UIBottomPanel Class
The multi-purpose panel for launching dialogs / screens and dynamic information.
Method Index
- _factoryIconWitdh()
- _findMessageToShow()
- _initFonts(gfx)
- _initMessageWithDrawerIcon(message_info)
- _messageDoorTick()
- _showMessageIcon(index)
- addBevelPanel(x, y, w, h, colour, highlight_colour, shadow_colour, disabled_colour, lowered_colour, apply_ui_scale) (inherited from Window)
- addColourPanel(x, y, w, h, r, g, b, apply_ui_scale) (inherited from Window)
- addDialog(dialog_class, extra_function)
- addKeyHandler(key, handler, ...) (inherited from Window)
- addPanel(sprite_index, x, y, w, h, apply_ui_scale, draw_flags) (inherited from Window)
- addWindow(window) (inherited from Window)
- afterLoad(old, new) (overrides Window:afterLoad)
- beginDrag(x, y) (inherited from Window)
- bringToTop() (inherited from Window)
- canQueueFax(fax)
- cancelFax(fax_type)
- close() (inherited from Window)
- deleteMessage(owner, icon)
- dialogAdviserHistory(enable)
- dialogBankCommon(enable, stats)
- dialogBankManager(enable)
- dialogBankStats(enable)
- dialogBuildRoom()
- dialogCharts(enable)
- dialogDrugCasebook(enable)
- dialogFurnishCorridor()
- dialogHireStaff()
- dialogMachineMenu(enable)
- dialogPolicy(enable)
- dialogResearch(enable)
- dialogStaffManagement(enable)
- dialogStatus(enable)
- dialogTownMap(enable)
- draw(canvas, x, y) (overrides Window:draw)
- drawDynamicInfo(canvas, x, y)
- drawPanels()
- drawReputationMeter(canvas, x_left, y)
- editRoom()
- getRealXY() (inherited from Window)
- getSavedWindowPositionName() (inherited from Window)
- getTooltipAt(x, y) (inherited from Window)
- getTooltipForElement(elem, x, y) (inherited from Window)
- getWindow(window_class) (inherited from Window)
- getWindows(window_class) (inherited from Window)
- giveResearchAdvice()
- hitTest(x, y, x_offset) (overrides Window:hitTest)
- hitTestPanel(x, y, panel) (inherited from Window)
- hoverTest(active_hover, mouse_x, mouse_y, min_x, max_x, min_y, max_y) (inherited from Window)
- machineMenuButtonExists()
- makeButtonOnPanel(panel, x, y, w, h, sprite, on_click, on_click_self, on_rightclick) (inherited from Window)
- makeDynamicTooltip(callback, x, y, r, b, tooltip_x, tooltip_y) (inherited from Window)
- makeHotkeyBoxOnPanel(panel, confirm_callback, abort_callback) (inherited from Window)
- makeScrollbarOnPanel(panel, slider_colour, callback, min_value, max_value, page_size, value) (inherited from Window)
- makeTextboxOnPanel(panel, confirm_callback, abort_callback) (inherited from Window)
- makeTooltip(text, x, y, r, b, tooltip_x, tooltip_y, apply_ui_scale) (inherited from Window)
- mustPause() (inherited from Window)
- onChangeLanguage() (inherited from Window)
- onChangeResolution() (overrides Window:onChangeResolution)
- onCursorWorldPositionChange(x, y) (inherited from Window)
- onMouseDown(button, x, y) (inherited from Window)
- onMouseMove(x, y, dx, dy) (overrides Window:onMouseMove)
- onMouseUp(button, x, y) (inherited from Window)
- onMouseWheel(x, y) (inherited from Window)
- onTick() (overrides Window:onTick)
- onWorldTick() (inherited from Window)
- openFirstMessage()
- openJukebox()
- openLastMessage()
- openLoad()
- openSave()
- queueMessage(type, message, owner, timeout, default_choice, callback)
- quickLoad()
- quickSave()
- quit()
- registerKeyHandlers()
- removeAllPanels() (inherited from Window)
- removeKeyHandler(keys) (inherited from Window)
- removeWindow(window) (inherited from Window)
- restart()
- sendToBottom(window) (inherited from Window)
- sendToTop(window) (inherited from Window)
- setDefaultPosition(x, y) (inherited from Window)
- setDynamicInfo(info)
- setPosition(x, y) (overrides Window:setPosition)
- setSize(width, height, apply_ui_scale) (inherited from Window)
- showAdditionalButtons(x, y)
- startButtonBlinking(button_index) (inherited from Window)
- stopButtonBlinking() (inherited from Window)
- toggleInformation()
- updateButtonStates()
Member Index
- active_button (*)
- active_scrollbar (*)
- additional_buttons
- additional_panels
- apply_ui_scale (*)
- bank_button
- blink_counter (*)
- blinking_button (*)
- btn_repeat_delay (*)
- buttons
- buttons_down (*)
- closed (*)
- countdown
- cursor_x (*)
- cursor_y (*)
- date_font
- default_button_sound
- draggable (*)
- dragging (*)
- dynamic_info
- factory_counter
- factory_direction
- height
- hotkeyboxes (*)
- key_handlers (*)
- message_door
- message_queue
- message_windows
- money_font
- offset
- on_top
- panel_sprites
- panels (*)
- parent (*)
- pause_font
- scrollbars (*)
- show_animation
- textboxes (*)
- tooltip_regions (*)
- ui
- visible (*)
- white_font
- width
- windows (*)
- world
- x
- x_original (*)
- y
- y_original (*)
function UIBottomPanel:UIBottomPanel(ui)
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| gfx | ? | ? |
Declared on: line 163 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:_initMessageWithDrawerIcon(message_info)
Initialise fax message with an UIMessage object.
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| dialog_class | ? | ? |
| extra_function | ? | ? |
Declared on: line 972 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:afterLoad(old, new)
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| owner | object | optional message owner |
| icon | object | optional drawer icon object |
Declared on: line 588 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogAdviserHistory(enable)
Parameters:
| Name | Type | Description |
|---|---|---|
| enable | ? | ? |
Declared on: line 940 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogBankCommon(enable, stats)
Parameters:
| Name | Type | Description |
|---|---|---|
| enable | ? | ? |
| stats | ? | ? |
Declared on: line 698 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogBankManager(enable)
Parameters:
| Name | Type | Description |
|---|---|---|
| enable | ? | ? |
Declared on: line 690 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogBankStats(enable)
Parameters:
| Name | Type | Description |
|---|---|---|
| enable | ? | ? |
Declared on: line 694 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogCharts(enable)
Parameters:
| Name | Type | Description |
|---|---|---|
| enable | ? | ? |
Declared on: line 895 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogDrugCasebook(enable)
Parameters:
| Name | Type | Description |
|---|---|---|
| enable | ? | ? |
Declared on: line 824 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogFurnishCorridor()
Declared on: line 745 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogMachineMenu(enable)
Parameters:
| Name | Type | Description |
|---|---|---|
| enable | ? | ? |
Declared on: line 925 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogPolicy(enable)
Parameters:
| Name | Type | Description |
|---|---|---|
| enable | ? | ? |
Declared on: line 910 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogResearch(enable)
Parameters:
| Name | Type | Description |
|---|---|---|
| enable | ? | ? |
Declared on: line 839 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogStaffManagement(enable)
Parameters:
| Name | Type | Description |
|---|---|---|
| enable | ? | ? |
Declared on: line 794 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogStatus(enable)
Parameters:
| Name | Type | Description |
|---|---|---|
| enable | ? | ? |
Declared on: line 880 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:dialogTownMap(enable)
Parameters:
| Name | Type | Description |
|---|---|---|
| enable | ? | ? |
Declared on: line 809 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:draw(canvas, x, y)
Parameters:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| canvas | ? | ? |
| x_left | ? | ? |
| y | ? | ? |
Declared on: line 295 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:hitTest(x, y, x_offset)
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
| x_offset | ? | ? |
Overrides: Window:hitTest.
Declared on: line 414 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:machineMenuButtonExists()
Declared on: line 62 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:onChangeResolution()
Overrides: Window:onChangeResolution.
Declared on: line 72 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:onMouseMove(x, y, dx, dy)
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
| dx | ? | ? |
| dy | ? | ? |
Overrides: Window:onMouseMove.
Declared on: line 389 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:onTick()
Overrides: Window:onTick.
Declared on: line 644 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| 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:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
Overrides: Window:setPosition.
Declared on: line 290 of Lua/dialogs/bottom_panel.lua.
function UIBottomPanel:showAdditionalButtons(x, y)
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
Declared on: line 397 of Lua/dialogs/bottom_panel.lua.