mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 21:08:48 +00:00
add wesnoth.set_dialog_tooltip fixes #3692
This commit is contained in:
parent
fb8770a3d9
commit
ed49d27511
@ -574,6 +574,23 @@ int intf_set_dialog_value(lua_State* L)
|
|||||||
|
|
||||||
return 0;
|
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.
|
* Gets the value of a widget on the current dialog.
|
||||||
|
@ -23,6 +23,7 @@ class game_state;
|
|||||||
namespace lua_gui2 {
|
namespace lua_gui2 {
|
||||||
|
|
||||||
int intf_set_dialog_value(lua_State *L);
|
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_get_dialog_value(lua_State *L);
|
||||||
int intf_set_dialog_callback(lua_State *L);
|
int intf_set_dialog_callback(lua_State *L);
|
||||||
int intf_set_dialog_markup(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 },
|
{ "textdomain", &lua_common::intf_textdomain },
|
||||||
{ "tovconfig", &lua_common::intf_tovconfig },
|
{ "tovconfig", &lua_common::intf_tovconfig },
|
||||||
{ "get_dialog_value", &lua_gui2::intf_get_dialog_value },
|
{ "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_active", &lua_gui2::intf_set_dialog_active },
|
||||||
{ "set_dialog_visible", &lua_gui2::intf_set_dialog_visible },
|
{ "set_dialog_visible", &lua_gui2::intf_set_dialog_visible },
|
||||||
{ "add_dialog_tree_node", &lua_gui2::intf_add_dialog_tree_node },
|
{ "add_dialog_tree_node", &lua_gui2::intf_add_dialog_tree_node },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user