The Battle for Wesnoth  1.13.4+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, CVideo &video)
 Displays a window. More...
 
int show_message_dialog (lua_State *L, CVideo &video)
 Displays a message window. More...
 
int show_popup_dialog (lua_State *L, CVideo &video)
 Displays a popup message. 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 *, CVideo &video, lua_kernel_base *lk)
 
int show_gamestate_inspector (CVideo &video, const vconfig &cfg)
 
int intf_add_dialog_tree_node (lua_State *L)
 Sets a widget's state to active or inactive. More...
 

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

References gui2::ttree_view_node::add_child(), find_widget(), lua_gettop(), luaL_argerror(), luaL_checkinteger(), and luaL_checkstring.

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

References find_widget(), i, lua_createtable(), lua_gettop(), lua_pushboolean(), lua_pushinteger(), lua_pushstring(), lua_rawseti(), and luaL_argerror().

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

References find_widget(), gui2::ttree_view::get_root_node(), lua_gettop(), luaL_argerror(), luaL_checkinteger(), schema_validation::number, and pos.

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

References find_widget(), lua_gettop(), luaL_argerror(), luaW_toboolean(), and gui2::tcontrol::set_active().

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

References gui2::tcontrol::canvas(), find_widget(), i, lua_gettop(), luaL_argerror(), luaL_checkinteger(), luaW_checkconfig(), and gui2::twidget::set_is_dirty().

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

References find_widget(), lua_gettop(), luaL_argerror(), luaW_toboolean(), and gui2::tcontrol::set_use_markup().

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

References find_widget(), lua_gettop(), luaL_argerror(), luaL_checkinteger(), luaW_checktstring(), luaW_toboolean(), gui2::tcontrol::set_label(), and t_string::str().

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

References find_widget(), game_config::images::flag, lua_gettop(), LUA_TBOOLEAN, lua_tostring, LUA_TSTRING, lua_type(), luaL_argerror(), luaL_typerror(), luaW_toboolean(), and gui2::twidget::set_visible().

Referenced by lua_kernel_base::lua_kernel_base().

int lua_gui2::show_dialog ( lua_State L,
CVideo video 
)

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

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

Referenced by lua_kernel_base::intf_show_dialog().

int lua_gui2::show_gamestate_inspector ( CVideo video,
const vconfig cfg 
)

Definition at line 743 of file lua_gui2.cpp.

References gui2::tdialog::show().

Referenced by game_lua_kernel::intf_gamestate_inspector().

int lua_gui2::show_lua_console ( lua_State ,
CVideo video,
lua_kernel_base lk 
)

Definition at line 737 of file lua_gui2.cpp.

References gui2::tlua_interpreter::display().

Referenced by lua_kernel_base::intf_show_lua_console().

int lua_gui2::show_message_dialog ( lua_State L,
CVideo video 
)

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

References gui2::tlegacy_menu_item::description(), config::empty(), ERR_LUA, error(), i, gui2::tlegacy_menu_item::icon(), gui2::tlegacy_menu_item::is_default(), gui2::tlegacy_menu_item::label(), 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(), preferences::options(), and gui2::show_wml_message().

Referenced by lua_kernel_base::intf_show_message_dialog().

int lua_gui2::show_popup_dialog ( lua_State L,
CVideo video 
)

Displays a popup message.

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

Definition at line 351 of file lua_gui2.cpp.

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

Referenced by lua_kernel_base::intf_show_popup_dialog().