The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Functions
lua_gui2 Namespace Reference

Functions

int show_dialog (lua_State *L)
 Displays a window. More...
 
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 intf_set_dialog_value (lua_State *L)
 Sets the value of a widget on the current dialog. More...
 
int intf_get_dialog_value (lua_State *L)
 Gets the value of a widget on the current dialog. More...
 
int intf_remove_dialog_item (lua_State *L)
 Removes an entry from a list. More...
 
int intf_set_dialog_callback (lua_State *L)
 Sets a callback on a widget of the current dialog. More...
 
int intf_set_dialog_markup (lua_State *L)
 Enables/disables Pango markup on the label of a widget of the current dialog. More...
 
int intf_set_dialog_canvas (lua_State *L)
 Sets a canvas on a widget of the current dialog. More...
 
int intf_set_dialog_focus (lua_State *L)
 Sets a widget to have the focus. More...
 
int intf_set_dialog_active (lua_State *L)
 Sets a widget's state to active or inactive. More...
 
int intf_set_dialog_visible (lua_State *L)
 Sets the visiblity of a widget in the current dialog. 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)
 
int intf_add_dialog_tree_node (lua_State *L)
 Sets a widget's state to active or inactive. More...
 
int intf_add_widget_definition (lua_State *L)
 

Function Documentation

int lua_gui2::intf_add_dialog_tree_node ( lua_State L)

Sets a widget's state to active or inactive.

  • Arg 1: string, the type (id of [node_definition]) of the new node.
  • Arg 3: integer, where to insert the new node.
  • Args 3..n: path of strings and integers.

Definition at line 959 of file lua_gui2.cpp.

References find_widget(), lua_gettop(), luaL_argerror(), luaL_checkinteger(), and luaL_checkstring.

Referenced by lua_kernel_base::lua_kernel_base().

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 984 of file lua_gui2.cpp.

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

Referenced by lua_kernel_base::lua_kernel_base().

int lua_gui2::intf_get_dialog_value ( lua_State L)

Gets the value of a widget on the current dialog.

  • Args 1..n: path of strings and integers.
  • Ret 1: scalar.

Definition at line 600 of file lua_gui2.cpp.

References preferences::editor::TransitionUpdateMode::count, find_widget(), i, lua_createtable(), lua_gettop(), lua_newtable, lua_pushboolean(), lua_pushinteger(), lua_pushnumber(), lua_pushstring(), lua_rawseti(), luaL_argerror(), game_config::path, game_config::images::selected, and w.

Referenced by lua_kernel_base::lua_kernel_base().

int lua_gui2::intf_remove_dialog_item ( lua_State L)

Removes an entry from a list.

  • Arg 1: number, index of the element to delete.
  • Arg 2: number, number of the elements to delete. (0 to delete all elements after index)
  • Args 2..n: path of strings and integers.

Definition at line 695 of file lua_gui2.cpp.

References find_widget(), lua_gettop(), luaL_argerror(), luaL_checkinteger(), and w.

Referenced by lua_kernel_base::lua_kernel_base().

int lua_gui2::intf_set_dialog_active ( lua_State L)

Sets a widget's state to active or inactive.

  • Arg 1: boolean.
  • Args 2..n: path of strings and integers.

Definition at line 874 of file lua_gui2.cpp.

References b, c, find_widget(), lua_gettop(), luaL_argerror(), luaW_toboolean(), gui2::styled_widget::set_active(), and w.

Referenced by lua_kernel_base::lua_kernel_base().

int lua_gui2::intf_set_dialog_callback ( lua_State L)
int lua_gui2::intf_set_dialog_canvas ( lua_State L)

Sets a canvas on a widget of the current dialog.

  • Arg 1: integer.
  • Arg 2: WML table.
  • Args 3..n: path of strings and integers.

Definition at line 838 of file lua_gui2.cpp.

References c, find_widget(), gui2::styled_widget::get_canvases(), i, lua_gettop(), luaL_argerror(), luaL_checkinteger(), luaW_checkconfig(), gui2::widget::set_is_dirty(), and w.

Referenced by lua_kernel_base::lua_kernel_base().

int lua_gui2::intf_set_dialog_focus ( lua_State L)

Sets a widget to have the focus.

  • Args 1..n: path of strings and integers.

Definition at line 862 of file lua_gui2.cpp.

References find_widget().

Referenced by lua_kernel_base::lua_kernel_base().

int lua_gui2::intf_set_dialog_markup ( lua_State L)

Enables/disables Pango markup on the label of a widget of the current dialog.

  • Arg 1: boolean.
  • Args 2..n: path of strings and integers.

Definition at line 819 of file lua_gui2.cpp.

References b, c, find_widget(), lua_gettop(), luaL_argerror(), luaW_toboolean(), gui2::styled_widget::set_use_markup(), and w.

Referenced by lua_kernel_base::lua_kernel_base().

int lua_gui2::intf_set_dialog_value ( lua_State L)

Sets the value of a widget on the current dialog.

  • Arg 1: scalar.
  • Args 2..n: path of strings and integers.

Definition at line 469 of file lua_gui2.cpp.

References c, find_widget(), i, lua_check(), lua_gettop(), lua_istable, luaL_argerror(), luaL_checkinteger(), luaW_checktstring(), luaW_toboolean(), luaW_tounit(), luaW_tounittype(), luaW_type_error(), n, game_config::images::selected, gui2::styled_widget::set_label(), t_string::str(), and w.

Referenced by lua_kernel_base::lua_kernel_base().

int lua_gui2::intf_set_dialog_visible ( lua_State L)

Sets the visiblity of a widget in the current dialog.

  • Arg 1: boolean.
  • Args 2..n: path of strings and integers.

Definition at line 892 of file lua_gui2.cpp.

References c, find_widget(), game_config::images::flag, lua_gettop(), LUA_TBOOLEAN, lua_tostring, LUA_TSTRING, lua_type(), luaL_argerror(), luaW_toboolean(), luaW_type_error(), gui2::widget::set_visible(), and w.

Referenced by lua_kernel_base::lua_kernel_base().

int lua_gui2::show_dialog ( lua_State L)

Displays a window.

  • Arg 1: WML table describing the window.
  • Arg 2: function called at pre-show.
  • Arg 3: function called at post-show.
  • Ret 1: integer.

Definition at line 243 of file lua_gui2.cpp.

References gui2::build(), lua_call, lua_isnoneornil, lua_pushinteger(), lua_pushvalue(), luaW_checkconfig(), and w.

Referenced by lua_kernel_base::lua_kernel_base().

int lua_gui2::show_gamestate_inspector ( const vconfig cfg,
const game_data data,
const game_state state 
)
int lua_gui2::show_lua_console ( lua_State ,
lua_kernel_base lk 
)
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 408 of file lua_gui2.cpp.

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

Referenced by lua_kernel_base::lua_kernel_base(), editor::editor_controller::show_menu(), and play_controller::hotkey_handler::show_menu().

int lua_gui2::show_message_box ( lua_State L)
int lua_gui2::show_message_dialog ( lua_State L)
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 381 of file lua_gui2.cpp.

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

Referenced by lua_kernel_base::lua_kernel_base().

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 395 of file lua_gui2.cpp.

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

Referenced by lua_kernel_base::lua_kernel_base().