Module CorsixTH.CorsixTH.Lua.dialogs.bottom_panel

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

Functions

UIBottomPanel:createMessageWindow (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 message in the queue is popped.
UIBottomPanel:drawDynamicInfo (canvas, x, y) Adds dynamic text to the bottom panel based on cursor position
UIBottomPanel:queueMessage (type, message, owner, timeout, default_choice, callback) Queue a fax notification message to appear.
UIBottomPanel:setDynamicInfo (info) Update the information shown in the information box on the panel.
UIBottomPanel:showMessage () Trigger a message to be moved from the queue into a actual window, after first performing the necessary animation.


Functions

UIBottomPanel:createMessageWindow (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 message in the queue is popped.

Parameters:

  • index
UIBottomPanel:drawDynamicInfo (canvas, x, y)
Adds dynamic text to the bottom panel based on cursor position

Parameters:

  • canvas
  • x (num) coordinate
  • y (num) coordinate
UIBottomPanel:queueMessage (type, message, owner, timeout, default_choice, callback)
Queue a fax notification message to appear. The arguments specify a message, which is added to a FIFO queue, and will appear on screen once there is space.

Parameters:

  • type (string) The type of message, can be: "emergency", "epidemy", "personality", "information", "disease", "report" or "strike"
  • message (table 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 (humanoid or nil) Some messages are related to one staff or patient. Otherwise this is nil.
  • timeout (number or nil) If given, the message will expire after that many world ticks and be removed.
  • default_choice (number or nil) If given, the choice with this number will be executed on expiration of the message.
  • callback (function or nil) If given, it will be called when the message is closed. 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) } ... } }
UIBottomPanel:setDynamicInfo (info)
Update the information shown in the information box on the panel.

If the info is nil then a cooldown timer is used before removing the information from the display.

Parameters:

  • info (table) A table containing the information to display. The text key is required and contains an array of lines to show. An optional progress key may be given to draw a progress bar, following the text and and an array of dividers may be provided to draw extra vertical lines in the progress bar.

    info = { text: { "He's not the saviour", "He's very naughty boy" }, progress: 50, dividers: { 25, 50, 75 } }

UIBottomPanel:showMessage ()
Trigger a message to be moved from the queue into a actual window, after first performing the necessary animation.
generated by LDoc TESTING Last updated 2015-01-01 12:00:00