UIMainMenu Class
Class for main menu window.
Inheritance: UIMainMenu » UIResizable » Window
Method 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)
- addKeyHandler(key, handler, ...) (inherited from Window)
- addMenuItem(label, callback, tooltip, y_pos)
- addPanel(sprite_index, x, y, w, h, apply_ui_scale, draw_flags) (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)
- buttonContinueGame()
- buttonCustomCampaign()
- buttonCustomGame()
- buttonExit()
- buttonLoadGame()
- buttonMapEdit()
- buttonNewGame()
- buttonOptions()
- close() (inherited from Window)
- draw(canvas, x, y) (overrides UIResizable:draw)
- getRealXY() (inherited from Window)
- 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)
- hoverTest(active_hover, mouse_x, mouse_y, min_x, max_x, min_y, max_y) (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)
- 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() (inherited from Window)
- onCursorWorldPositionChange(x, y) (inherited from Window)
- onMouseDown(button, x, y) (inherited from UIResizable)
- 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)
- overrideMinSize(min_width, min_height) (inherited from UIResizable)
- removeAllPanels() (inherited from Window)
- removeKeyHandler(keys) (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)
Member Index
- active_button (*)
- active_scrollbar (*)
- apply_ui_scale (*)
- background_panel (*)
- blink_counter (*)
- blinking_button (*)
- border_pos (*)
- border_sprites (*)
- btn_repeat_delay (*)
- buttons (*)
- buttons_down (*)
- closed (*)
- colour (*)
- cursor_x (*)
- cursor_y (*)
- default_button_sound
- draggable (*)
- dragging (*)
- esc_closes
- height
- hotkeyboxes (*)
- key_handlers (*)
- label_font
- min_height (*)
- min_width (*)
- modal_class
- no_menu_entries
- on_top
- panel_sprites (*)
- panels (*)
- parent (*)
- release_string
- resizable (*)
- scrollbars (*)
- textboxes (*)
- tooltip_regions (*)
- ui
- visible (*)
- width (*)
- windows (*)
- x
- x_original (*)
- y
- y_original (*)
function UIMainMenu:UIMainMenu(ui)
Parameters:
| Name | Type | Description |
|---|---|---|
| ui | ? | ? |
Declared on: line 42 of Lua/dialogs/resizables/main_menu.lua.
function UIMainMenu:addMenuItem(label, callback, tooltip, y_pos)
Adds a single menu item to the main menu.
Parameters:
| Name | Type | Description |
|---|---|---|
| label | string | The (localized) label to use for the new button. |
| callback | function | Function to call when the user clicks the button. |
| tooltip | string | Text to show when the player hovers over the button. |
| y_pos | integer | Y-position from where to add the menu item. |
Declared on: line 97 of Lua/dialogs/resizables/main_menu.lua.
function UIMainMenu:buttonContinueGame()
Declared on: line 167 of Lua/dialogs/resizables/main_menu.lua.
function UIMainMenu:buttonCustomCampaign()
Declared on: line 149 of Lua/dialogs/resizables/main_menu.lua.
function UIMainMenu:buttonCustomGame()
Declared on: line 158 of Lua/dialogs/resizables/main_menu.lua.
function UIMainMenu:draw(canvas, x, y)
Parameters:
| Name | Type | Description |
|---|---|---|
| canvas | ? | ? |
| x | ? | ? |
| y | ? | ? |
Overrides: UIResizable:draw.
Declared on: line 115 of Lua/dialogs/resizables/main_menu.lua.
function UIMainMenu:getSavedWindowPositionName()
Overrides: Window:getSavedWindowPositionName.
Declared on: line 111 of Lua/dialogs/resizables/main_menu.lua.
function UIMainMenu:onMouseMove(x, y, dx, dy)
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
| dx | ? | ? |
| dy | ? | ? |
Overrides: Window:onMouseMove.
Declared on: line 139 of Lua/dialogs/resizables/main_menu.lua.
function UIMainMenu:onTick()
Overrides: Window:onTick.
Declared on: line 135 of Lua/dialogs/resizables/main_menu.lua.