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 bb5186f4c..061644335 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -474,6 +474,8 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls) ls.registerFunc("getUserRace", getUserRace); ls.registerFunc("getSheet2idx", getSheet2idx); ls.registerFunc("getTargetSlot", getTargetSlot); + ls.registerFunc("setTargetAsInterlocutor", setTargetAsInterlocutor); + ls.registerFunc("unsetTargetAsInterlocutor", unsetTargetAsInterlocutor); ls.registerFunc("getSlotDataSetId", getSlotDataSetId); ls.registerFunc("addShape", addShape); ls.registerFunc("moveShape", moveShape); @@ -1591,6 +1593,22 @@ int CLuaIHMRyzom::getTargetSlot(CLuaState &ls) return 1; } +// *************************************************************************** +int CLuaIHMRyzom::setTargetAsInterlocutor(CLuaState &ls) +{ + uint32 slot = (uint32)getTargetSlotNr(); + UserEntity->interlocutor(slot); + return 0; +} + +// *************************************************************************** +int CLuaIHMRyzom::unsetTargetAsInterlocutor(CLuaState &ls) +{ + uint32 slot = (uint32)getTargetSlotNr(); + UserEntity->interlocutor(CLFECOMMON::INVALID_SLOT); + return 0; +} + // *************************************************************************** int CLuaIHMRyzom::getSlotDataSetId(CLuaState &ls) { @@ -4231,4 +4249,4 @@ int CLuaIHMRyzom::displayChatMessage(CLuaState &ls) ci.DynamicChat[id].displayMessage(ucstring(msg), prop.getRGBA()); } return 1; -} \ No newline at end of file +} 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 d60279aec..c8241092f 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -98,6 +98,8 @@ private: static int getUserRace(CLuaState &ls); static int getSheet2idx(CLuaState &ls); static int getTargetSlot(CLuaState &ls); + static int setTargetAsInterlocutor(CLuaState &ls); + static int unsetTargetAsInterlocutor(CLuaState &ls); static int getSlotDataSetId(CLuaState &ls); // static int getMaxDynChan(CLuaState &ls);