The Battle for Wesnoth  1.17.0-dev
lua_gui2 Namespace Reference


int show_message_dialog (lua_State *L)
 Displays a message window. More...
int show_popup_dialog (lua_State *L)
 Displays a popup message. More...
int show_story (lua_State *L)
 Displays a story screen. More...
int show_menu (lua_State *L)
 Displays a popup menu at the current mouse position Best used from a [set_menu_item], to show a submenu. More...
int show_message_box (lua_State *L)
 Displays a simple message box. More...
int show_lua_console (lua_State *, lua_kernel_base *lk)
int show_gamestate_inspector (const vconfig &cfg, const game_data &data, const game_state &state)
static int show_help (lua_State *L)
int intf_add_widget_definition (lua_State *L)
int luaW_open (lua_State *L)

Function Documentation

◆ intf_add_widget_definition()

int lua_gui2::intf_add_widget_definition ( lua_State L)
  • Arg 1: string, widget type
  • Arg 3: string, id
  • Arg 3: config,

Definition at line 267 of file lua_gui2.cpp.

References gui2::add_single_widget_definition(), e, luaL_argerror(), luaL_checkstring, and luaW_checkconfig().

Referenced by luaW_open().

◆ luaW_open()

int lua_gui2::luaW_open ( lua_State L)

◆ show_gamestate_inspector()

int lua_gui2::show_gamestate_inspector ( const vconfig cfg,
const game_data data,
const game_state state 

◆ show_help()

static int lua_gui2::show_help ( lua_State L)

Definition at line 255 of file lua_gui2.cpp.

References luaL_checkstring, and help::show_help().

Referenced by luaW_open().

◆ show_lua_console()

int lua_gui2::show_lua_console ( lua_State ,
lua_kernel_base lk 

◆ show_menu()

int lua_gui2::show_menu ( lua_State L)

Displays a popup menu at the current mouse position Best used from a [set_menu_item], to show a submenu.

  • Arg 1: Configs defining each item, with keys icon, image/label, second_label, tooltip
  • Args 2, 3: Initial selection (integer); whether to parse markup (boolean)

Definition at line 185 of file lua_gui2.cpp.

References mp_ui_alerts::items, lua_isboolean, lua_isnumber(), lua_pushinteger(), lua_tointeger, luaW_toboolean(), gui2::dialogs::drop_down_menu::selected_item(), and gui2::dialogs::modal_dialog::show().

Referenced by luaW_open(), controller_base::process_keyup_event(), play_controller::hotkey_handler::replay_skip_animation(), editor::editor_controller::save_map(), editor::editor_controller::show_menu(), and play_controller::hotkey_handler::show_menu().

◆ show_message_box()

int lua_gui2::show_message_box ( lua_State L)

Displays a simple message box.

Definition at line 211 of file lua_gui2.cpp.

References c, lua_isnoneornil, lua_pushboolean(), luaL_optstring, luaW_checktstring(), luaW_toboolean(), gui2::OK, and gui2::show_message().

Referenced by luaW_open().

◆ show_message_dialog()

int lua_gui2::show_message_dialog ( lua_State L)

Displays a message window.

  • Arg 1: Table describing the window
  • Arg 2: List of options (nil or empty table - no options)
  • Arg 3: Text input specifications (nil or empty table - no text input)
  • Ret 1: option chosen (if no options: 0 if there's text input, -2 if escape pressed, else -1)
  • Ret 2: string entered (empty if none, nil if no text input)

Definition at line 69 of file lua_gui2.cpp.

References gui2::dialogs::wml_message_input::caption, config::empty(), error(), config::has_attribute(), i, left, lua_getfield(), lua_isnoneornil, lua_isnumber(), lua_pop, lua_pushinteger(), lua_pushlstring(), lua_pushnil(), lua_rawgeti(), lua_rawlen(), lua_tointeger, LUA_TTABLE, lua_type(), lua_typename(), luaL_argerror(), luaL_checktype(), luaW_checkconfig(), luaW_toconfig(), luaW_totstring(), gui2::dialogs::wml_message_input::maximum_length, n, preferences::options(), right, gui2::dialogs::show_wml_message(), gui2::dialogs::wml_message_input::text, and gui2::dialogs::wml_message_input::text_input_was_specified.

Referenced by luaW_open().

◆ show_popup_dialog()

int lua_gui2::show_popup_dialog ( lua_State L)

Displays a popup message.

  • Arg 1: Title (allows Pango markup)
  • Arg 2: Message (allows Pango markup)
  • Arg 3: Image (optional)

Definition at line 158 of file lua_gui2.cpp.

References lua_isnoneornil, luaL_checkstring, luaW_checktstring(), wfl::msg(), and gui2::show_transient_message().

Referenced by luaW_open().

◆ show_story()

int lua_gui2::show_story ( lua_State L)

Displays a story screen.

  • Arg 1: The story config
  • Arg 2: The default title

Definition at line 172 of file lua_gui2.cpp.

References gui2::dialogs::story_viewer::display(), luaW_checkconfig(), and luaW_checktstring().

Referenced by luaW_open().