|
|
@ -96,6 +96,7 @@
|
|
|
|
#include "../continent_manager.h"
|
|
|
|
#include "../continent_manager.h"
|
|
|
|
#include "../zone_util.h"
|
|
|
|
#include "../zone_util.h"
|
|
|
|
#include "../motion/user_controls.h"
|
|
|
|
#include "../motion/user_controls.h"
|
|
|
|
|
|
|
|
#include "../events_listener.h"
|
|
|
|
#include "group_html_cs.h"
|
|
|
|
#include "group_html_cs.h"
|
|
|
|
#include "group_map.h"
|
|
|
|
#include "group_map.h"
|
|
|
|
#include "bonus_malus.h"
|
|
|
|
#include "bonus_malus.h"
|
|
|
@ -153,6 +154,7 @@ using namespace R2;
|
|
|
|
extern NLMISC::CLog g_log;
|
|
|
|
extern NLMISC::CLog g_log;
|
|
|
|
extern CContinentManager ContinentMngr;
|
|
|
|
extern CContinentManager ContinentMngr;
|
|
|
|
extern CClientChatManager ChatMngr;
|
|
|
|
extern CClientChatManager ChatMngr;
|
|
|
|
|
|
|
|
extern CEventsListener EventsListener; // Inputs Manager
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
class CHandlerLUA : public IActionHandler
|
|
|
|
class CHandlerLUA : public IActionHandler
|
|
|
@ -184,6 +186,21 @@ private:
|
|
|
|
REGISTER_ACTION_HANDLER(CHandlerLUA, "lua");
|
|
|
|
REGISTER_ACTION_HANDLER(CHandlerLUA, "lua");
|
|
|
|
std::deque<CRefPtr<CCtrlBase> > CHandlerLUA::_UICallerStack;
|
|
|
|
std::deque<CRefPtr<CCtrlBase> > CHandlerLUA::_UICallerStack;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
|
|
|
class CHandlerSCRIPT : public IActionHandler
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
void execute(CCtrlBase *pCaller, const std::string &sParams)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string script = sParams;
|
|
|
|
|
|
|
|
while(strFindReplace(script, "[", "〈"));
|
|
|
|
|
|
|
|
while(strFindReplace(script, "]", "〉"));
|
|
|
|
|
|
|
|
strFindReplace(script, "|", "\n");
|
|
|
|
|
|
|
|
CLuaManager::getInstance().executeLuaScript("\ngame:executeRyzomScript([["+script+"]])\n", true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
REGISTER_ACTION_HANDLER(CHandlerSCRIPT, "script");
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
// Allow also to call script from expression
|
|
|
|
// Allow also to call script from expression
|
|
|
|
static DECLARE_INTERFACE_USER_FCT(lua)
|
|
|
|
static DECLARE_INTERFACE_USER_FCT(lua)
|
|
|
@ -428,6 +445,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
|
|
|
|
ls.registerFunc("launchContextMenuInGame", launchContextMenuInGame);
|
|
|
|
ls.registerFunc("launchContextMenuInGame", launchContextMenuInGame);
|
|
|
|
ls.registerFunc("parseInterfaceFromString", parseInterfaceFromString);
|
|
|
|
ls.registerFunc("parseInterfaceFromString", parseInterfaceFromString);
|
|
|
|
ls.registerFunc("updateAllLocalisedElements", updateAllLocalisedElements);
|
|
|
|
ls.registerFunc("updateAllLocalisedElements", updateAllLocalisedElements);
|
|
|
|
|
|
|
|
ls.registerFunc("getTimestampHuman", getTimestampHuman);
|
|
|
|
ls.registerFunc("formatUI", formatUI);
|
|
|
|
ls.registerFunc("formatUI", formatUI);
|
|
|
|
ls.registerFunc("formatDB", formatDB);
|
|
|
|
ls.registerFunc("formatDB", formatDB);
|
|
|
|
ls.registerFunc("dumpUI", dumpUI);
|
|
|
|
ls.registerFunc("dumpUI", dumpUI);
|
|
|
@ -454,6 +472,8 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
|
|
|
|
ls.registerFunc("getMouseDown", getMouseDown),
|
|
|
|
ls.registerFunc("getMouseDown", getMouseDown),
|
|
|
|
ls.registerFunc("getMouseMiddleDown", getMouseMiddleDown),
|
|
|
|
ls.registerFunc("getMouseMiddleDown", getMouseMiddleDown),
|
|
|
|
ls.registerFunc("getMouseRightDown", getMouseRightDown),
|
|
|
|
ls.registerFunc("getMouseRightDown", getMouseRightDown),
|
|
|
|
|
|
|
|
ls.registerFunc("isShiftDown", isShiftDown),
|
|
|
|
|
|
|
|
ls.registerFunc("isCtrlDown", isCtrlDown),
|
|
|
|
ls.registerFunc("getShapeIdAt", getShapeIdAt),
|
|
|
|
ls.registerFunc("getShapeIdAt", getShapeIdAt),
|
|
|
|
ls.registerFunc("getPlayerFront", getPlayerFront);
|
|
|
|
ls.registerFunc("getPlayerFront", getPlayerFront);
|
|
|
|
ls.registerFunc("getPlayerDirection", getPlayerDirection);
|
|
|
|
ls.registerFunc("getPlayerDirection", getPlayerDirection);
|
|
|
@ -565,6 +585,8 @@ 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(getSheetShape),
|
|
|
|
|
|
|
|
LUABIND_FUNC(getCharacterSheetScale),
|
|
|
|
LUABIND_FUNC(getSheetFamily),
|
|
|
|
LUABIND_FUNC(getSheetFamily),
|
|
|
|
LUABIND_FUNC(getSheetName),
|
|
|
|
LUABIND_FUNC(getSheetName),
|
|
|
|
LUABIND_FUNC(getFameIndex),
|
|
|
|
LUABIND_FUNC(getFameIndex),
|
|
|
@ -1254,7 +1276,7 @@ int CLuaIHMRyzom::getMouseDown(CLuaState &ls)
|
|
|
|
sint32 x, y;
|
|
|
|
sint32 x, y;
|
|
|
|
bool down;
|
|
|
|
bool down;
|
|
|
|
CTool::getMouseDown(down, x, y);
|
|
|
|
CTool::getMouseDown(down, x, y);
|
|
|
|
ls.push(down);
|
|
|
|
ls.push(EventsListener.isMouseButtonPushed(leftButton));
|
|
|
|
ls.push(x);
|
|
|
|
ls.push(x);
|
|
|
|
ls.push(y);
|
|
|
|
ls.push(y);
|
|
|
|
|
|
|
|
|
|
|
@ -1266,8 +1288,7 @@ int CLuaIHMRyzom::getMouseMiddleDown(CLuaState &ls)
|
|
|
|
sint32 x, y;
|
|
|
|
sint32 x, y;
|
|
|
|
bool down;
|
|
|
|
bool down;
|
|
|
|
CTool::getMouseMiddleDown(down, x, y);
|
|
|
|
CTool::getMouseMiddleDown(down, x, y);
|
|
|
|
|
|
|
|
ls.push(EventsListener.isMouseButtonPushed(middleButton));
|
|
|
|
ls.push(down);
|
|
|
|
|
|
|
|
ls.push(x);
|
|
|
|
ls.push(x);
|
|
|
|
ls.push(y);
|
|
|
|
ls.push(y);
|
|
|
|
|
|
|
|
|
|
|
@ -1280,13 +1301,30 @@ int CLuaIHMRyzom::getMouseRightDown(CLuaState &ls)
|
|
|
|
bool down;
|
|
|
|
bool down;
|
|
|
|
CTool::getMouseRightDown(down, x, y);
|
|
|
|
CTool::getMouseRightDown(down, x, y);
|
|
|
|
|
|
|
|
|
|
|
|
ls.push(down);
|
|
|
|
ls.push(EventsListener.isMouseButtonPushed(rightButton));
|
|
|
|
ls.push(x);
|
|
|
|
ls.push(x);
|
|
|
|
ls.push(y);
|
|
|
|
ls.push(y);
|
|
|
|
|
|
|
|
|
|
|
|
return 3;
|
|
|
|
return 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int CLuaIHMRyzom::isShiftDown(CLuaState &ls)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ls.push(Driver->AsyncListener.isKeyDown(KeySHIFT) ||
|
|
|
|
|
|
|
|
Driver->AsyncListener.isKeyDown(KeyLSHIFT) ||
|
|
|
|
|
|
|
|
Driver->AsyncListener.isKeyDown(KeyRSHIFT));
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int CLuaIHMRyzom::isCtrlDown(CLuaState &ls)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ls.push(Driver->AsyncListener.isKeyDown(KeyCONTROL) ||
|
|
|
|
|
|
|
|
Driver->AsyncListener.isKeyDown(KeyLCONTROL) ||
|
|
|
|
|
|
|
|
Driver->AsyncListener.isKeyDown(KeyRCONTROL));
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int CLuaIHMRyzom::getShapeIdAt(CLuaState &ls)
|
|
|
|
int CLuaIHMRyzom::getShapeIdAt(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2103,6 +2141,31 @@ int CLuaIHMRyzom::updateAllLocalisedElements(CLuaState &ls)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
|
|
|
int CLuaIHMRyzom::getTimestampHuman(CLuaState &ls)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//H_AUTO(Lua_CLuaIHM_getIslandId)
|
|
|
|
|
|
|
|
const char *funcName = "getTimestampHuman";
|
|
|
|
|
|
|
|
CLuaIHM::checkArgCount(ls, funcName, 1);
|
|
|
|
|
|
|
|
CLuaIHM::check(ls, ls.isString(1), "getTimestampHuman() requires a string in param 1");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static char cstime[25];
|
|
|
|
|
|
|
|
time_t date;
|
|
|
|
|
|
|
|
time (&date);
|
|
|
|
|
|
|
|
struct tm *tms = localtime(&date);
|
|
|
|
|
|
|
|
string param = ls.toString(1);
|
|
|
|
|
|
|
|
if (tms)
|
|
|
|
|
|
|
|
strftime(cstime, 25, param.c_str(), tms);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
strcpy(cstime, "");
|
|
|
|
|
|
|
|
ls.push(string(cstime));
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
int CLuaIHMRyzom::getCompleteIslands(CLuaState &ls)
|
|
|
|
int CLuaIHMRyzom::getCompleteIslands(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -3469,6 +3532,38 @@ std::string CLuaIHMRyzom::getSheetType(const std::string &sheet)
|
|
|
|
return CEntitySheet::typeToString(sheetPtr->Type);
|
|
|
|
return CEntitySheet::typeToString(sheetPtr->Type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
|
|
|
std::string CLuaIHMRyzom::getSheetShape(const std::string &sheet)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//H_AUTO(Lua_CLuaIHM_getSheetType)
|
|
|
|
|
|
|
|
const CEntitySheet *sheetPtr = SheetMngr.get(CSheetId(sheet));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!sheetPtr)
|
|
|
|
|
|
|
|
return "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sheetPtr->type() == CEntitySheet::ITEM)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CItemSheet *sheet = (CItemSheet*)sheetPtr;
|
|
|
|
|
|
|
|
return sheet->getShape();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (sheetPtr->type() == CEntitySheet::FAUNA)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CCharacterSheet *sheet = (CCharacterSheet*)(sheetPtr);
|
|
|
|
|
|
|
|
return sheet->Body.getItem();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return "";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
|
|
|
float CLuaIHMRyzom::getCharacterSheetScale(const std::string &sheet)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
const CEntitySheet *sheetPtr = SheetMngr.get(CSheetId(sheet));
|
|
|
|
|
|
|
|
const CCharacterSheet *charSheet = dynamic_cast<const CCharacterSheet*>(sheetPtr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (charSheet) return charSheet->Scale;
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet)
|
|
|
|
std::string CLuaIHMRyzom::getSheetFamily(const std::string &sheet)
|
|
|
@ -3818,7 +3913,9 @@ void CLuaIHMRyzom::updateTooltipCoords()
|
|
|
|
CWidgetManager::getInstance()->updateTooltipCoords();
|
|
|
|
CWidgetManager::getInstance()->updateTooltipCoords();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
|
|
|
|
// WARNING PROBABLY DON'T WORKS
|
|
|
|
bool CLuaIHMRyzom::isCtrlKeyDown()
|
|
|
|
bool CLuaIHMRyzom::isCtrlKeyDown()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//H_AUTO(Lua_CLuaIHM_isCtrlKeyDown)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_isCtrlKeyDown)
|
|
|
@ -3831,6 +3928,7 @@ bool CLuaIHMRyzom::isCtrlKeyDown()
|
|
|
|
return ctrlDown;
|
|
|
|
return ctrlDown;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
std::string CLuaIHMRyzom::encodeURLUnicodeParam(const ucstring &text)
|
|
|
|
std::string CLuaIHMRyzom::encodeURLUnicodeParam(const ucstring &text)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -3880,41 +3978,41 @@ sint32 CLuaIHMRyzom::getPlayerLevel()
|
|
|
|
std::string CLuaIHMRyzom::getPlayerVpaHex()
|
|
|
|
std::string CLuaIHMRyzom::getPlayerVpaHex()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
|
|
|
|
return NLMISC::toString("%X", prop);
|
|
|
|
return NLMISC::toString("%" NL_I64 "X", prop);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
std::string CLuaIHMRyzom::getPlayerVpbHex()
|
|
|
|
std::string CLuaIHMRyzom::getPlayerVpbHex()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
return NLMISC::toString("%X", prop);
|
|
|
|
return NLMISC::toString("%" NL_I64 "X", prop);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
std::string CLuaIHMRyzom::getPlayerVpcHex()
|
|
|
|
std::string CLuaIHMRyzom::getPlayerVpcHex()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64();
|
|
|
|
return NLMISC::toString("%X", prop);
|
|
|
|
return NLMISC::toString("%" NL_I64 "X", prop);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
sint64 CLuaIHMRyzom::getPlayerVpa()
|
|
|
|
uint64 CLuaIHMRyzom::getPlayerVpa()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
|
|
|
|
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
|
|
|
|
return prop;
|
|
|
|
return prop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
sint64 CLuaIHMRyzom::getPlayerVpb()
|
|
|
|
uint64 CLuaIHMRyzom::getPlayerVpb()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
return prop;
|
|
|
|
return prop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
sint64 CLuaIHMRyzom::getPlayerVpc()
|
|
|
|
uint64 CLuaIHMRyzom::getPlayerVpc()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64();
|
|
|
|
return prop;
|
|
|
|
return prop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3965,7 +4063,7 @@ std::string CLuaIHMRyzom::getTargetVpaHex()
|
|
|
|
if (!target) return 0;
|
|
|
|
if (!target) return 0;
|
|
|
|
|
|
|
|
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
|
|
|
|
return NLMISC::toString("%X", prop);
|
|
|
|
return NLMISC::toString("%" NL_I64 "X", prop);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
@ -3975,7 +4073,7 @@ std::string CLuaIHMRyzom::getTargetVpbHex()
|
|
|
|
if (!target) return 0;
|
|
|
|
if (!target) return 0;
|
|
|
|
|
|
|
|
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
return NLMISC::toString("%X", prop);
|
|
|
|
return NLMISC::toString("%" NL_I64 "X", prop);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
@ -3984,40 +4082,37 @@ std::string CLuaIHMRyzom::getTargetVpcHex()
|
|
|
|
CEntityCL *target = getTargetEntity();
|
|
|
|
CEntityCL *target = getTargetEntity();
|
|
|
|
if (!target) return 0;
|
|
|
|
if (!target) return 0;
|
|
|
|
|
|
|
|
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64();
|
|
|
|
return NLMISC::toString("%X", prop);
|
|
|
|
return NLMISC::toString("%" NL_I64 "X", prop);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
sint64 CLuaIHMRyzom::getTargetVpa()
|
|
|
|
uint64 CLuaIHMRyzom::getTargetVpa()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CEntityCL *target = getTargetEntity();
|
|
|
|
CEntityCL *target = getTargetEntity();
|
|
|
|
if (!target) return 0;
|
|
|
|
if (!target) return 0;
|
|
|
|
|
|
|
|
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
|
|
|
|
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
|
|
|
|
|
|
|
|
|
|
|
|
return prop;
|
|
|
|
return prop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
sint64 CLuaIHMRyzom::getTargetVpb()
|
|
|
|
uint64 CLuaIHMRyzom::getTargetVpb()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CEntityCL *target = getTargetEntity();
|
|
|
|
CEntityCL *target = getTargetEntity();
|
|
|
|
if (!target) return 0;
|
|
|
|
if (!target) return 0;
|
|
|
|
|
|
|
|
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
|
|
|
|
|
|
|
|
return prop;
|
|
|
|
return prop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
sint64 CLuaIHMRyzom::getTargetVpc()
|
|
|
|
uint64 CLuaIHMRyzom::getTargetVpc()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CEntityCL *target = getTargetEntity();
|
|
|
|
CEntityCL *target = getTargetEntity();
|
|
|
|
if (!target) return 0;
|
|
|
|
if (!target) return 0;
|
|
|
|
|
|
|
|
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64();
|
|
|
|
|
|
|
|
|
|
|
|
return prop;
|
|
|
|
return prop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -4153,7 +4248,7 @@ int CLuaIHMRyzom::addLandMark(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const char* funcName = "addLandMark";
|
|
|
|
const char* funcName = "addLandMark";
|
|
|
|
CLuaIHM::checkArgMin(ls, funcName, 4);
|
|
|
|
CLuaIHM::checkArgMin(ls, funcName, 4);
|
|
|
|
CLuaIHM::checkArgMax(ls, funcName, 9);
|
|
|
|
CLuaIHM::checkArgMax(ls, funcName, 11);
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); // x
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TNUMBER); // x
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER); // y
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TNUMBER); // y
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING); // title
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING); // title
|
|
|
@ -4162,6 +4257,9 @@ int CLuaIHMRyzom::addLandMark(CLuaState &ls)
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 6, LUA_TSTRING); // left click param
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 6, LUA_TSTRING); // left click param
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 7, LUA_TSTRING); // right click action
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 7, LUA_TSTRING); // right click action
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 8, LUA_TSTRING); // right click params
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 8, LUA_TSTRING); // right click params
|
|
|
|
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 9, LUA_TSTRING); // over click action
|
|
|
|
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 10, LUA_TSTRING); // over click params
|
|
|
|
|
|
|
|
// 11 : Color
|
|
|
|
|
|
|
|
|
|
|
|
CArkPoint point;
|
|
|
|
CArkPoint point;
|
|
|
|
point.x = (sint32)(ls.toNumber(1)*1000.f);
|
|
|
|
point.x = (sint32)(ls.toNumber(1)*1000.f);
|
|
|
@ -4172,10 +4270,12 @@ int CLuaIHMRyzom::addLandMark(CLuaState &ls)
|
|
|
|
point.LeftClickParam = ls.toString(6);
|
|
|
|
point.LeftClickParam = ls.toString(6);
|
|
|
|
point.RightClickAction = ls.toString(7);
|
|
|
|
point.RightClickAction = ls.toString(7);
|
|
|
|
point.RightClickParam = ls.toString(8);
|
|
|
|
point.RightClickParam = ls.toString(8);
|
|
|
|
|
|
|
|
point.OverClickAction = ls.toString(9);
|
|
|
|
|
|
|
|
point.OverClickParam = ls.toString(10);
|
|
|
|
|
|
|
|
|
|
|
|
point.Color = CRGBA(255,255,255,255);
|
|
|
|
point.Color = CRGBA(255,255,255,255);
|
|
|
|
|
|
|
|
|
|
|
|
if (ls.getTop() >= 9)
|
|
|
|
if (ls.getTop() >= 11)
|
|
|
|
CLuaIHM::pop(ls, point.Color);
|
|
|
|
CLuaIHM::pop(ls, point.Color);
|
|
|
|
|
|
|
|
|
|
|
|
CGroupMap *pMap = dynamic_cast<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
|
|
|
|
CGroupMap *pMap = dynamic_cast<CGroupMap*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map"));
|
|
|
|