From 586d84bc20b10d09244ca2bae12e549296826088 Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Wed, 22 Jan 2020 14:16:03 +0100 Subject: [PATCH] Added: getContinentSheet lua function --- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 16 ++++++++++++++++ .../client/src/interface_v3/lua_ihm_ryzom.h | 1 + 2 files changed, 17 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 d88d08d41..77a46abc7 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -470,6 +470,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) ls.registerFunc("disableContextHelp", disableContextHelp); ls.registerFunc("setWeatherValue", setWeatherValue); ls.registerFunc("getWeatherValue", getWeatherValue); + ls.registerFunc("getContinentSheet", getContinentSheet); ls.registerFunc("getCompleteIslands", getCompleteIslands); ls.registerFunc("displayBubble", displayBubble); ls.registerFunc("getIslandId", getIslandId); @@ -1787,6 +1788,21 @@ int CLuaIHMRyzom::getWeatherValue(CLuaState &ls) return 1; } +int CLuaIHMRyzom::getContinentSheet(CLuaState &ls) +{ + const char *funcName = "getContinentSheet"; + CLuaIHM::checkArgCount(ls, funcName, 0); + if (ContinentMngr.cur()) + { + ls.push(ContinentMngr.cur()->SheetName); + return 1; + } + + ls.push(""); + return 1; +} + + int CLuaIHMRyzom::getUICaller(CLuaState &ls) { //H_AUTO(Lua_CLuaIHM_getUICaller) 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 31cda63b1..d9550d3b4 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -63,6 +63,7 @@ private: static int displayChatMessage(CLuaState &ls); static int setWeatherValue(CLuaState &ls); // first value is a boolean to say automatic, second value ranges from of to 1 and gives the weather static int getWeatherValue(CLuaState &ls); // get current real weather value (blend between server driven value & predicted value). Manual weather value is ignored + static int getContinentSheet(CLuaState &ls); static int disableContextHelpForControl(CLuaState &ls); // params: CCtrlBase*. return: none static int disableContextHelp(CLuaState &ls); static int getServerSeason(CLuaState &ls); // get the last season sent by the server