CLuaInstance: Add additional tableLookup for get userdata

Origin commit data
------------------
Branch: ni/coolstream
Commit: f4c70c96a5
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-03-16 (Sun, 16 Mar 2014)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2014-03-16 11:56:48 +01:00
parent b50f2b4164
commit b1104a81fd
2 changed files with 13 additions and 0 deletions

View File

@@ -677,6 +677,18 @@ bool CLuaInstance::tableLookup(lua_State *L, const char *what, int &value)
return res;
}
bool CLuaInstance::tableLookup(lua_State *L, const char *what, void** value)
{
bool res = false;
lua_pushstring(L, what);
lua_gettable(L, -2);
res = lua_isuserdata(L, -1);
if (res)
*value = lua_unboxpointer(L, -1);
lua_pop(L, 1);
return res;
}
bool CLuaMenuChangeObserver::changeNotify(lua_State *L, const std::string &luaAction, const std::string &luaId, void *Data)
{
const char *optionValue = (const char *) Data;