Added: getSheetFamily lua bind

--HG--
branch : patches-from-atys
hg/hotfix/patches-from-atys
ulukyn 6 years ago
parent f7f1a6035e
commit e9e2590d53

@ -541,6 +541,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
LUABIND_FUNC(isDynStringAvailable), LUABIND_FUNC(isDynStringAvailable),
LUABIND_FUNC(isFullyPatched), LUABIND_FUNC(isFullyPatched),
LUABIND_FUNC(getSheetType), LUABIND_FUNC(getSheetType),
LUABIND_FUNC(getSheetFamily),
LUABIND_FUNC(getSheetName), LUABIND_FUNC(getSheetName),
LUABIND_FUNC(getFameIndex), LUABIND_FUNC(getFameIndex),
LUABIND_FUNC(getFameName), 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) std::string CLuaIHMRyzom::getSheetName(uint32 sheetId)
{ {

@ -192,6 +192,7 @@ private:
static bool isDynStringAvailable(sint32 dynStringId); static bool isDynStringAvailable(sint32 dynStringId);
static bool isFullyPatched(); static bool isFullyPatched();
static std::string getSheetType(const std::string &sheet); static std::string getSheetType(const std::string &sheet);
static std::string getSheetFamily(const std::string &sheet);
static std::string getSheetName(uint32 sheetId); static std::string getSheetName(uint32 sheetId);
static sint32 getFameIndex(const std::string &factionName); static sint32 getFameIndex(const std::string &factionName);
static std::string getFameName(sint32 fameIndex); static std::string getFameName(sint32 fameIndex);

Loading…
Cancel
Save