From 6499b1b0535280f17e91da87126c025099bde819 Mon Sep 17 00:00:00 2001 From: ulukyn Date: Wed, 6 Jun 2018 14:15:42 +0200 Subject: [PATCH] Added: getDbProp64 to get 64b values from db with lua --HG-- branch : develop --- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 17 +++++++++++++++++ .../client/src/interface_v3/lua_ihm_ryzom.h | 1 + 2 files changed, 18 insertions(+) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index 241e8f269..36780f9e5 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -491,6 +491,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) luabind::module(L) [ LUABIND_FUNC(getDbProp), + LUABIND_FUNC(getDbProp64), LUABIND_FUNC(setDbProp), LUABIND_FUNC(addDbProp), 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) { //H_AUTO(Lua_CLuaIHM_setDbProp) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h index 0c29bbd3c..fa8e57c9c 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -120,6 +120,7 @@ private: ///////////////////////////// Standard Lua stuff ends here ////////////////////////////////////////////// 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 addDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is created if not present. static void delDbProp(const std::string &dbProp);