CorsixTH Lua Documentation

UIConfirmDialog Class

Dialog for "Are you sure you want to quit?" and similar yes/no questions.

Declared on: line 21 of Lua/dialogs/confirm_dialog.lua.
Inheritance: UIConfirmDialog ยป Window
Full description:
This dialog is also used for errors and requires some special handling

Method Index

Member Index

(*) only used in superclass methods
function UIConfirmDialog:UIConfirmDialog(ui, must_pause, text, callback_ok, callback_cancel)

Initialise the Confirmation Dialog

Parameters:

NameTypeDescription
ui ? The UI
must_pause boolean set whether this dialog should pause the game
text string message to show
callback_ok function what to do on yes/ok
callback_cancel function what to do on no/cancel/close

Declared on: line 35 of Lua/dialogs/confirm_dialog.lua.

function UIConfirmDialog:afterLoad(old, new)

Parameters:

NameTypeDescription
old ? ?
new ? ?

Overrides: Window:afterLoad.
Declared on: line 127 of Lua/dialogs/confirm_dialog.lua.

function UIConfirmDialog:close(confirmed)

Closes the confirm dialog

Parameters:

NameTypeDescription
confirmed boolean or or or nil whether to call the confirm callback (true) or cancel callback (false/nil)

Overrides: Window:close.
Declared on: line 103 of Lua/dialogs/confirm_dialog.lua.

function UIConfirmDialog:draw(canvas, x, y)

Parameters:

NameTypeDescription
canvas ? ?
x ? ?
y ? ?

Overrides: Window:draw.
Declared on: line 119 of Lua/dialogs/confirm_dialog.lua.

function UIConfirmDialog:mustPause()

Confirm dialogs are used for errors, if it is an error then pause the game

Overrides: Window:mustPause.
Declared on: line 85 of Lua/dialogs/confirm_dialog.lua.