From f7f1a6035e4d7d1b9f6f664826eac0b7ac0072a7 Mon Sep 17 00:00:00 2001 From: ulukyn Date: Wed, 25 Jul 2018 11:41:49 +0200 Subject: [PATCH] Added: getSheetLocalizedName and getSheetLocalizedDesc lua bind --HG-- branch : patches-from-atys --- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 16 ++++++++++++++++ .../client/src/interface_v3/lua_ihm_ryzom.h | 2 ++ 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 1b1886efe..aecbe228a 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -527,6 +527,8 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) LUABIND_FUNC(getPlayerSelectedSlot), LUABIND_FUNC(isInGame), LUABIND_FUNC(isPlayerSlotNewbieLand), + LUABIND_FUNC(getSheetLocalizedName), + LUABIND_FUNC(getSheetLocalizedDesc), LUABIND_FUNC(getSkillIdFromName), LUABIND_FUNC(getSkillLocalizedName), LUABIND_FUNC(getMaxSkillValue), @@ -3113,6 +3115,20 @@ bool CLuaIHMRyzom::isPlayerSlotNewbieLand(uint32 slot) return CharacterSummaries[slot].InNewbieland; } +// *************************************************************************** +ucstring CLuaIHMRyzom::getSheetLocalizedName(const std::string &sheet) +{ + return ucstring(STRING_MANAGER::CStringManagerClient::getItemLocalizedName(CSheetId(sheet))); +} + +// *************************************************************************** +ucstring CLuaIHMRyzom::getSheetLocalizedDesc(const std::string &sheet) +{ + return ucstring(STRING_MANAGER::CStringManagerClient::getItemLocalizedDescription(CSheetId(sheet))); +} + + + // *************************************************************************** sint32 CLuaIHMRyzom::getSkillIdFromName(const std::string &def) { 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 b201fae87..eb92768f6 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -178,6 +178,8 @@ private: static bool isPlayerSlotNewbieLand(uint32 slot); // test if one of the player slot is a newbieland one, if not so, client must be patched in order to continue // GameInfo + static ucstring getSheetLocalizedName(const std::string &sheet); + static ucstring getSheetLocalizedDesc(const std::string &sheet); static sint32 getSkillIdFromName(const std::string &def); static ucstring getSkillLocalizedName(sint32 skillId); static sint32 getMaxSkillValue(sint32 skillId);