Table with methods to access gui functions.
Definition at line 113 of file api_gui.cc.
◆ click()
| void gui::click |
( |
any_x | x, |
|
|
any_x | y, |
|
|
any_x | shift, |
|
|
any_x | ctrl ) |
Simulate a left mouse click at the given screen coordinates.
- Parameters
-
| x | x coordinate on screen. |
| y | y coordinate on screen. |
| shift | true to click with shift pressed. |
| ctrl | true to click with ctrl pressed. |
◆ close_all_windows()
| void gui::close_all_windows |
( |
| ) |
|
|
static |
Close all windows on the view.
◆ drag()
| void gui::drag |
( |
any_x | from_x, |
|
|
any_x | from_y, |
|
|
any_x | to_x, |
|
|
any_x | to_y, |
|
|
any_x | shift, |
|
|
any_x | ctrl ) |
Simulate a left mouse drag from one screen coordinate to another.
- Parameters
-
| from_x | start x coordinate on screen. |
| from_y | start y coordinate on screen. |
| to_x | end x coordinate on screen. |
| to_y | end y coordinate on screen. |
| shift | true to drag with shift pressed. |
| ctrl | true to drag with ctrl pressed. |
◆ export_minimap()
| void gui::export_minimap |
( |
| ) |
|
|
static |
Render the entire minimap (the whole world, not just the current viewport) to a PNG file in the screenshot folder.
- Returns
- path to the exported file, or empty/null string on failure.
◆ export_minimap_with_mode()
| void gui::export_minimap_with_mode |
( |
any_x | mapmode | ) |
|
|
static |
Render the entire minimap with the given map mode to a PNG file in the screenshot folder. The map mode of the map window is not changed.
- Parameters
-
| mapmode | bit mask as string, or mode names joined by '|', e.g. "MAP_TOWN|MAP_LINES" (MAP_ prefix optional, case insensitive). |
- Returns
- path to the exported file, or empty/null string on failure (also for an invalid mode).
◆ get_window_components()
Get snapshots of components in the given GUI window.
Components are returned as a tree. Each component has role, bounds, screen_bounds, visible, focusable, focused, children, and optional text fields.
- Parameters
-
- Returns
- array of gui_component_x, or null if window_id is invalid.
◆ get_windows()
Get snapshots of currently open GUI windows.
Each entry contains id, z_order, top, title, has_title, bounds, and client_bounds. Pass the id to gui::get_window_components to inspect the components in that window.
◆ jump()
| void gui::jump |
( |
any_x | position | ) |
|
|
static |
Jump view to given position. This function succeeds only when the pos is within the map.
- Parameters
-
| position | Position of the view on the map to jump to. |
- Returns
- true if succeeded.
◆ open_dialog_tool()
| bool gui::open_dialog_tool |
( |
integer | tool_nr | ) |
|
|
static |
Opens a dialog tool for the active player.
- Parameters
-
| tool_nr | dialog tool number, for example DIALOG_MINIMAP = 2 |
- Returns
- whether the dialog tool request was accepted
◆ open_info_win()
| void gui::open_info_win |
( |
| ) |
|
|
static |
Opens scenario info window and shows 'info' tab. In network mode, opens window on all clients and server.
- Note
- Only available in scenario mode.
◆ open_info_win_at()
| void gui::open_info_win_at |
( |
string | tab | ) |
|
|
static |
Opens scenario info window with specific tab open. In network mode, opens window on all clients and server.
- Parameters
-
| tab | possible values are "info", "goal", "rules", "result", "about", "debug" |
- Note
- Only available in scenario mode.
◆ open_info_win_client()
| void gui::open_info_win_client |
( |
string | tab, |
|
|
integer | player_nr ) |
|
static |
Opens scenario info window for certain clients (and the server), with specific tab open.
- Parameters
-
| tab | possible values are "info", "goal", "rules", "result", "about", "debug" |
| player_nr | opens scenario info window on all clients that have this player unlocked. |
- Note
- Window is always opened on server.
◆ set_zoom()
| void gui::set_zoom |
( |
any_x | zoom | ) |
|
|
static |
Set zoom factor.
- Parameters
-
◆ take_screenshot()
| void gui::take_screenshot |
( |
| ) |
|
|
static |
The documentation for this class was generated from the following file: