add onlyEnabled option to tpt.num_menus (probably useless)

This commit is contained in:
jacob1 2016-07-17 23:36:36 -04:00
parent 8a0496e60a
commit eafd8115b0

View File

@ -1820,7 +1820,14 @@ int luatpt_menu_enabled(lua_State* l)
int luatpt_num_menus(lua_State* l)
{
lua_pushinteger(l, luacon_controller->GetNumMenus(true));
int acount = lua_gettop(l);
bool onlyEnabled = true;
if (acount > 0)
{
luaL_checktype(l, 1, LUA_TBOOLEAN);
onlyEnabled = lua_toboolean(l, 1);
}
lua_pushinteger(l, luacon_controller->GetNumMenus(onlyEnabled));
return 1;
}