UIMenuList Class
A menu list with a scrollbar. Used by load_game, save_game and custom_game.
Declared on: line 21 of Lua/dialogs/resizables/menu_list_dialog.lua.
Inheritance: UIMenuList » UIResizable » Window
Subclasses: UICustomGame, UIMakeDebugPatient
Inheritance: UIMenuList » UIResizable » Window
Subclasses: UICustomGame, UIMakeDebugPatient
Method Index
- addBevelPanel(x, y, w, h, colour, highlight_colour, shadow_colour, disabled_colour) (inherited from Window)
- addColourPanel(x, y, w, h, r, g, b) (inherited from Window)
- addKeyHandler(key, handler, ...) (inherited from Window)
- addPanel(sprite_index, x, y, w, h) (inherited from Window)
- addWindow(window) (inherited from Window)
- afterLoad(old, new) (inherited from UIResizable)
- beginDrag(x, y) (inherited from Window)
- beginResize(x, y, mode) (inherited from UIResizable)
- bringToTop() (inherited from Window)
- buttonBack()
- buttonClicked(num)
- close() (overrides Window:close)
- draw(canvas, x, y) (inherited from UIResizable)
- getSavedWindowPositionName() (overrides Window:getSavedWindowPositionName)
- 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)
- hitTest(x, y) (inherited from UIResizable)
- hitTestCorners(x, y) (inherited from UIResizable)
- hitTestPanel(x, y, panel) (inherited from Window)
- 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)
- 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) (inherited from Window)
- onChangeLanguage() (inherited from Window)
- onChangeResolution() (inherited from Window)
- onCursorWorldPositionChange(x, y) (inherited from Window)
- onMouseDown(button, x, y) (inherited from UIResizable)
- onMouseMove(x, y, dx, dy) (inherited from Window)
- onMouseUp(button, x, y) (inherited from Window)
- onTick() (inherited from Window)
- onWorldTick() (inherited from Window)
- removeAllPanels() (inherited from Window)
- removeWindow(window) (inherited from Window)
- sendToBottom(window) (inherited from Window)
- sendToTop(window) (inherited from Window)
- setColour(colour) (inherited from UIResizable)
- setDefaultPosition(x, y) (inherited from Window)
- setPosition(x, y) (inherited from Window)
- setSize(width, height) (inherited from UIResizable)
- startButtonBlinking(button_index) (inherited from Window)
- stopButtonBlinking() (inherited from Window)
- updateButtons()
Member Index
- active_button (*)
- active_scrollbar (*)
- background_panel (*)
- blink_counter (*)
- blinking_button (*)
- border_pos (*)
- border_sprites (*)
- btn_repeat_delay (*)
- buttons (*)
- buttons_down (*)
- closed (*)
- col_bg
- colour (*)
- default_button_sound
- draggable (*)
- dragging (*)
- esc_closes
- height (*)
- item_buttons
- item_panels
- items
- key_handlers (*)
- min_height (*)
- min_width (*)
- modal_class
- mode
- num_rows
- on_top
- panel_sprites (*)
- panels (*)
- parent (*)
- resizable
- scrollbar
- scrollbars (*)
- textboxes (*)
- tooltip_regions (*)
- ui
- visible (*)
- width (*)
- windows (*)
- x (*)
- x_original (*)
- y (*)
- y_original (*)
function UIMenuList:UIMenuList(ui, mode, title, items, num_rows, extra_above_list)
Constructs the menu list dialog.
Parameters:
Name | Type | Description |
---|---|---|
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. |
items | table | A list of items to include in the list. Each listing should be a table with keys "name" and "tooltip" with the corresponding values. |
num_rows | integer | The number of rows displayed at a given time. Default is 10. |
extra_above_list | integer | How much space, if any, the dialog will need above the list. |
Declared on: line 36 of Lua/dialogs/resizables/menu_list_dialog.lua.
function UIMenuList:buttonBack()
Declared on: line 125 of Lua/dialogs/resizables/menu_list_dialog.lua.
function UIMenuList:buttonClicked(num)
Function stub for dialogs to override. This function is called each time a button is clicked.
Parameters:
Name | Type | Description |
---|---|---|
num | integer | Number of the button pressed. |
Declared on: line 102 of Lua/dialogs/resizables/menu_list_dialog.lua.
function UIMenuList:close()
Overrides: Window:close.
Declared on: line 129 of Lua/dialogs/resizables/menu_list_dialog.lua.
function UIMenuList:getSavedWindowPositionName()
Overrides: Window:getSavedWindowPositionName.
Declared on: line 95 of Lua/dialogs/resizables/menu_list_dialog.lua.
function UIMenuList:updateButtons()
Updates buttons when scrolling.
Declared on: line 107 of Lua/dialogs/resizables/menu_list_dialog.lua.