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

--HG--
branch : compatibility-develop
hg/compatibility-develop
ulukyn 7 years ago
parent 741aac46de
commit 9cc97b8eba

@ -498,6 +498,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),
@ -2577,6 +2578,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)

@ -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);

Loading…
Cancel
Save