Skip to content

Commit

Permalink
lua gui get/set_dialog_value take numbers for tselectable_
Browse files Browse the repository at this point in the history
This adds lua support for tristate buttons and comboboxes.
  • Loading branch information
gfgtdf committed Jan 19, 2016
1 parent c880d82 commit 3284e5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scripting/lua_gui2.cpp
Expand Up @@ -383,7 +383,7 @@ int intf_set_dialog_value(lua_State *L)
}
else if (gui2::tselectable_ *s = dynamic_cast<gui2::tselectable_ *>(w))
{
s->set_value(luaW_toboolean(L, 1));
s->set_value(luaL_checkinteger(L, 1));
}
else if (gui2::ttext_box *t = dynamic_cast<gui2::ttext_box *>(w))
{
Expand Down Expand Up @@ -438,7 +438,7 @@ int intf_get_dialog_value(lua_State *L)
} else if (gui2::tmulti_page *l = dynamic_cast<gui2::tmulti_page *>(w)) {
lua_pushinteger(L, l->get_selected_page() + 1);
} else if (gui2::tselectable_ *s = dynamic_cast<gui2::tselectable_ *>(w)) {
lua_pushboolean(L, s->get_value());
lua_pushinteger(L, s->get_value());
} else if (gui2::ttext_box *t = dynamic_cast<gui2::ttext_box *>(w)) {
lua_pushstring(L, t->get_value().c_str());
} else if (gui2::tslider *s = dynamic_cast<gui2::tslider *>(w)) {
Expand Down

0 comments on commit 3284e5b

Please sign in to comment.