CorsixTH Lua Documentation

UIFileBrowser Class

A file browser with a scrollbar. Used by load_game and save_game.

Declared on: line 145 of Lua/dialogs/resizables/file_browser.lua.
Inheritance: UIFileBrowser » UIResizable » Window
Subclasses: UIChooseFont, UIChooseSoundfont, UILoadGame, UILoadMap, UISaveGame, UISaveMap

Method Index

Member Index

(*) only used in superclass methods
function UIFileBrowser:UIFileBrowser(ui, mode, title, vertical_size, root, show_dates, submit_text)

Constructs the dialog.

Parameters:

NameTypeDescription
ui UI The active ui.
mode string Either "menu" or "game" depending on which mode the game is in right now.
title string The desired title of the dialog.
vertical_size number
root ?
show_dates boolean Whether to show date last modified
submit_text string Optional alternative labelling of the OK button

Declared on: line 157 of Lua/dialogs/resizables/file_browser.lua.

function UIFileBrowser:checkChoice(node)

Check selection is a valid file, and not a directory

Parameters:

NameTypeDescription
node table user selected element

Declared on: line 232 of Lua/dialogs/resizables/file_browser.lua.

function UIFileBrowser:choiceMade(name)

Function stub for dialogs to override. This function is called each time a file is chosen.

Parameters:

NameTypeDescription
name string Name of the file chosen.

Declared on: line 221 of Lua/dialogs/resizables/file_browser.lua.

function UIFileBrowser:setInputValue(label)

Function stub for dialogs with user input option. This will be called for

updating inputs, override it for a proper implementation in the derived class.

Parameters:

NameTypeDescription
label string Name of the file chosen

Declared on: line 226 of Lua/dialogs/resizables/file_browser.lua.