From 4608c2d36871a5976d551dd050f14b6a604ca8ac Mon Sep 17 00:00:00 2001 From: gfgtdf Date: Tue, 11 Apr 2017 03:59:22 +0200 Subject: [PATCH] wesnoth.set_dialog_value can now unfold treeview nodes (#978) --- src/scripting/lua_gui2.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/scripting/lua_gui2.cpp b/src/scripting/lua_gui2.cpp index 310a91996fd..8b3cafe740e 100644 --- a/src/scripting/lua_gui2.cpp +++ b/src/scripting/lua_gui2.cpp @@ -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(w)) { + const bool unfolded = luaW_toboolean(L, 1); + if(unfolded) { + node->unfold(); + } + else { + node->fold(); + } + } else { t_string v = luaW_checktstring(L, 1);