add wesnoth.set_dialog_tooltip fixes #3692
This commit is contained in:
parent
fb8770a3d9
commit
ed49d27511
3 changed files with 19 additions and 0 deletions
|
@ -574,6 +574,23 @@ int intf_set_dialog_value(lua_State* L)
|
|||
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* Sets the value of a widget on the current dialog.
|
||||
* - Arg 1: text.
|
||||
* - Args 2..n: path of strings and integers.
|
||||
*/
|
||||
int intf_set_dialog_tooltip(lua_State* L)
|
||||
{
|
||||
t_string v = luaW_checktstring(L, 1);
|
||||
gui2::widget *w = find_widget(L, 2, false);
|
||||
gui2::styled_widget* c = dynamic_cast<gui2::styled_widget*>(w);
|
||||
if(!c) {
|
||||
return luaL_argerror(L, lua_gettop(L), "unsupported widget");
|
||||
}
|
||||
c->set_tooltip(v);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of a widget on the current dialog.
|
||||
|
|
|
@ -23,6 +23,7 @@ class game_state;
|
|||
namespace lua_gui2 {
|
||||
|
||||
int intf_set_dialog_value(lua_State *L);
|
||||
int intf_set_dialog_tooltip(lua_State *L);
|
||||
int intf_get_dialog_value(lua_State *L);
|
||||
int intf_set_dialog_callback(lua_State *L);
|
||||
int intf_set_dialog_markup(lua_State *L);
|
||||
|
|
|
@ -497,6 +497,7 @@ lua_kernel_base::lua_kernel_base()
|
|||
{ "textdomain", &lua_common::intf_textdomain },
|
||||
{ "tovconfig", &lua_common::intf_tovconfig },
|
||||
{ "get_dialog_value", &lua_gui2::intf_get_dialog_value },
|
||||
{ "set_dialog_tooltip", &lua_gui2::intf_set_dialog_tooltip },
|
||||
{ "set_dialog_active", &lua_gui2::intf_set_dialog_active },
|
||||
{ "set_dialog_visible", &lua_gui2::intf_set_dialog_visible },
|
||||
{ "add_dialog_tree_node", &lua_gui2::intf_add_dialog_tree_node },
|
||||
|
|
Loading…
Add table
Reference in a new issue