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 72474e7f6..3688ac08a 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -541,6 +541,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) LUABIND_FUNC(isDynStringAvailable), LUABIND_FUNC(isFullyPatched), LUABIND_FUNC(getSheetType), + LUABIND_FUNC(getSheetFamily), LUABIND_FUNC(getSheetName), LUABIND_FUNC(getFameIndex), LUABIND_FUNC(getFameName), @@ -3315,6 +3316,19 @@ std::string CLuaIHMRyzom::getSheetType(const std::string &sheet) } +// *************************************************************************** +std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet) +{ + CEntitySheet *pES = SheetMngr.get ( CSheetId(sheet) ); + if ((pES != NULL) && (pES->type() == CEntitySheet::ITEM)) + { + CItemSheet *pIS = (CItemSheet*)pES; + + if (pIS) + return ITEMFAMILY::toString(pIS->Family); + } +} + // *************************************************************************** std::string CLuaIHMRyzom::getSheetName(uint32 sheetId) { 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 306ce45f6..027b05b06 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -192,6 +192,7 @@ private: static bool isDynStringAvailable(sint32 dynStringId); static bool isFullyPatched(); static std::string getSheetType(const std::string &sheet); + static std::string getSheetFamily(const std::string &sheet); static std::string getSheetName(uint32 sheetId); static sint32 getFameIndex(const std::string &factionName); static std::string getFameName(sint32 fameIndex);