Added: getDbProp64 to get 64b values from db with lua

--HG--
branch : develop
This commit is contained in:
ulukyn 2018-06-06 14:15:42 +02:00
parent 6573d96fd7
commit 6499b1b053
2 changed files with 18 additions and 0 deletions

View file

@ -491,6 +491,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
luabind::module(L) luabind::module(L)
[ [
LUABIND_FUNC(getDbProp), LUABIND_FUNC(getDbProp),
LUABIND_FUNC(getDbProp64),
LUABIND_FUNC(setDbProp), LUABIND_FUNC(setDbProp),
LUABIND_FUNC(addDbProp), LUABIND_FUNC(addDbProp),
LUABIND_FUNC(delDbProp), LUABIND_FUNC(delDbProp),
@ -2570,6 +2571,22 @@ sint32 CLuaIHMRyzom::getDbProp(const std::string &dbProp)
} }
} }
sint64 CLuaIHMRyzom::getDbProp64(const std::string &dbProp)
{
//H_AUTO(Lua_CLuaIHM_getDbProp)
CInterfaceManager *pIM = CInterfaceManager::getInstance();
CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp(dbProp, false);
if (node)
return node->getValue64();
else
{
debugInfo(toString("getDbProp(): '%s' dbProp Not found", dbProp.c_str()));
return 0;
}
}
void CLuaIHMRyzom::setDbProp(const std::string &dbProp, sint32 value) void CLuaIHMRyzom::setDbProp(const std::string &dbProp, sint32 value)
{ {
//H_AUTO(Lua_CLuaIHM_setDbProp) //H_AUTO(Lua_CLuaIHM_setDbProp)

View file

@ -120,6 +120,7 @@ private:
///////////////////////////// Standard Lua stuff ends here ////////////////////////////////////////////// ///////////////////////////// Standard Lua stuff ends here //////////////////////////////////////////////
static sint32 getDbProp(const std::string &dbProp); // return 0 if not found. static sint32 getDbProp(const std::string &dbProp); // return 0 if not found.
static sint64 getDbProp64(const std::string &dbProp); // return 0 if not found.
static void setDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is not created if not present. static void setDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is not created if not present.
static void addDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is created if not present. static void addDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is created if not present.
static void delDbProp(const std::string &dbProp); static void delDbProp(const std::string &dbProp);