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 aecbe228a..9b1e92994 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), @@ -3321,6 +3322,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 eb92768f6..5e8f8d021 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);