wesnoth.set_dialog_value can now unfold treeview nodes (#978)

This commit is contained in:
gfgtdf 2017-04-11 03:59:22 +02:00 committed by GitHub
parent 3d0bd73803
commit 4608c2d368

View File

@ -495,6 +495,15 @@ int intf_set_dialog_value(lua_State *L)
return luaW_type_error(L, 1, "unit or unit type");
}
}
else if(gui2::tree_view_node *node = dynamic_cast<gui2::tree_view_node *>(w)) {
const bool unfolded = luaW_toboolean(L, 1);
if(unfolded) {
node->unfold();
}
else {
node->fold();
}
}
else
{
t_string v = luaW_checktstring(L, 1);