From 1225fc0fe82cb6c8195ab9a3fe7fa320ed17954b Mon Sep 17 00:00:00 2001 From: Nuno Date: Wed, 6 Jan 2021 12:50:57 +0100 Subject: [PATCH 1/3] Added onover options for createArkPointButton in map --- code/ryzom/client/src/interface_v3/group_map.cpp | 2 ++ code/ryzom/client/src/interface_v3/group_map.h | 6 ++++-- code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp | 9 +++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/group_map.cpp b/code/ryzom/client/src/interface_v3/group_map.cpp index a7f326220..9bae00d6c 100644 --- a/code/ryzom/client/src/interface_v3/group_map.cpp +++ b/code/ryzom/client/src/interface_v3/group_map.cpp @@ -2755,6 +2755,8 @@ CGroupMap::CLandMarkButton *CGroupMap::createArkPointButton(const CArkPoint &poi lmb->setParamsOnLeftClick(point.LeftClickParam); lmb->setActionOnRightClick(point.RightClickAction); lmb->setParamsOnRightClick(point.RightClickParam); + lmb->setActionOnOver(point.OverClickAction); + lmb->setParamsOnOver(point.OverClickParam); lmb->setColor(point.Color); lmb->setColorOver(point.Color); lmb->setColorPushed(point.Color); diff --git a/code/ryzom/client/src/interface_v3/group_map.h b/code/ryzom/client/src/interface_v3/group_map.h index e138c6b71..9cfc5bae6 100644 --- a/code/ryzom/client/src/interface_v3/group_map.h +++ b/code/ryzom/client/src/interface_v3/group_map.h @@ -95,6 +95,8 @@ public: std::string LeftClickParam; std::string RightClickAction; std::string RightClickParam; + std::string OverClickAction; + std::string OverClickParam; public: CArkPoint() @@ -230,7 +232,7 @@ public: void addUserLandMark(const NLMISC::CVector2f &pos, const ucstring &title, NLMISC::CRGBA color); void addUserRespawnPoint(const NLMISC::CVector2f &pos); void delArkPoints(); - + // set landmarks visibility based text query void setLandmarkFilter(const std::string &s); @@ -602,7 +604,7 @@ private: CLandMarkButton *createLandMarkButton(const CLandMarkOptions &options); // Create a Ark landmark button, but do not add it to this group CLandMarkButton *createArkPointButton(const CArkPoint &point); - + // update a landmark button void updateLandMarkButton(CLandMarkButton *lmb, const CLandMarkOptions &options); 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 1d1b01684..68a39bb2c 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -4178,7 +4178,7 @@ int CLuaIHMRyzom::addLandMark(CLuaState &ls) { const char* funcName = "addLandMark"; 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, 2, LUA_TNUMBER); // y CLuaIHM::checkArgType(ls, funcName, 3, LUA_TSTRING); // title @@ -4187,6 +4187,9 @@ int CLuaIHMRyzom::addLandMark(CLuaState &ls) CLuaIHM::checkArgType(ls, funcName, 6, LUA_TSTRING); // left click param CLuaIHM::checkArgType(ls, funcName, 7, LUA_TSTRING); // right click action 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; point.x = (sint32)(ls.toNumber(1)*1000.f); @@ -4197,10 +4200,12 @@ int CLuaIHMRyzom::addLandMark(CLuaState &ls) point.LeftClickParam = ls.toString(6); point.RightClickAction = ls.toString(7); point.RightClickParam = ls.toString(8); + point.OverClickAction = ls.toString(9); + point.OverClickParam = ls.toString(10); point.Color = CRGBA(255,255,255,255); - if (ls.getTop() >= 9) + if (ls.getTop() >= 11) CLuaIHM::pop(ls, point.Color); CGroupMap *pMap = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:actual_map")); From b984e2e3d81f4c5d20367cf0dffa332b0a1c5947 Mon Sep 17 00:00:00 2001 From: Nuno Date: Wed, 6 Jan 2021 12:51:59 +0100 Subject: [PATCH 2/3] Missing definition of getSheetShape --- code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 78b5a2a00..1ca8de42a 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -15,7 +15,7 @@ private: static int luaClientCfgIndex(CLuaState &ls); static int luaClientCfgNewIndex(CLuaState &ls); - + // CInterfaceElement management on stack, stored by a CRefPtr. public: @@ -204,6 +204,7 @@ private: static bool isDynStringAvailable(sint32 dynStringId); static bool isFullyPatched(); static std::string getSheetType(const std::string &sheet); + static std::string getSheetShape(const std::string &sheet); static std::string getSheetFamily(const std::string &sheet); static std::string getSheetName(uint32 sheetId); static sint32 getFameIndex(const std::string &factionName); @@ -251,7 +252,7 @@ private: static int addRespawnPoint(CLuaState &ls); static int delArkPoints(CLuaState &ls); static int setArkPowoOptions(CLuaState &ls); - + // open the window to do a tell to 'player', if 'msg' is not empty, then the message will be sent immediatly // else, current command of the chat window will be replaced with tell 'player' @@ -260,7 +261,7 @@ private: static void updateTooltipCoords(); // test if the ctrl key is down (NB nico : I didn't add other key, // because it would be too easy to write a key recorder ...) - static bool isCtrlKeyDown(); + static bool isCtrlKeyDown(); static std::string encodeURLUnicodeParam(const ucstring &text); static std::string encodeURLParam(const std::string &text); From 9771d79bc3033af9a97f18dd15645d79f84dfa00 Mon Sep 17 00:00:00 2001 From: Nuno Date: Wed, 6 Jan 2021 19:32:42 +0100 Subject: [PATCH 3/3] Fixed bad conversion in getPlayerVp*Hex and getTargetVp*Hex --- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 43 +++++++++---------- .../client/src/interface_v3/lua_ihm_ryzom.h | 12 +++--- 2 files changed, 26 insertions(+), 29 deletions(-) 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 68a39bb2c..75b588ce0 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -3904,40 +3904,40 @@ sint32 CLuaIHMRyzom::getPlayerLevel() // *************************************************************************** std::string CLuaIHMRyzom::getPlayerVpaHex() { - uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64(); - return NLMISC::toString("%X", prop); + sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64(); + return NLMISC::toString("%" NL_I64 "X", prop); } // *************************************************************************** std::string CLuaIHMRyzom::getPlayerVpbHex() { - uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64(); - return NLMISC::toString("%X", prop); + sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64(); + return NLMISC::toString("%" NL_I64 "X", prop); } // *************************************************************************** std::string CLuaIHMRyzom::getPlayerVpcHex() { - uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64(); - return NLMISC::toString("%X", prop); + sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64(); + return NLMISC::toString("%" NL_I64 "X", prop); } // *************************************************************************** -sint64 CLuaIHMRyzom::getPlayerVpa() +uint64 CLuaIHMRyzom::getPlayerVpa() { uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64(); return prop; } // *************************************************************************** -sint64 CLuaIHMRyzom::getPlayerVpb() +uint64 CLuaIHMRyzom::getPlayerVpb() { uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64(); return prop; } // *************************************************************************** -sint64 CLuaIHMRyzom::getPlayerVpc() +uint64 CLuaIHMRyzom::getPlayerVpc() { uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E0:P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64(); return prop; @@ -3989,8 +3989,8 @@ std::string CLuaIHMRyzom::getTargetVpaHex() CEntityCL *target = getTargetEntity(); if (!target) return 0; - uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64(); - return NLMISC::toString("%X", prop); + sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64(); + return NLMISC::toString("%" NL_I64 "X", prop); } // *************************************************************************** @@ -3999,8 +3999,8 @@ std::string CLuaIHMRyzom::getTargetVpbHex() CEntityCL *target = getTargetEntity(); if (!target) return 0; - uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64(); - return NLMISC::toString("%X", prop); + sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64(); + return NLMISC::toString("%" NL_I64 "X", prop); } // *************************************************************************** @@ -4009,40 +4009,37 @@ std::string CLuaIHMRyzom::getTargetVpcHex() CEntityCL *target = getTargetEntity(); if (!target) return 0; - uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64(); - return NLMISC::toString("%X", prop); + sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64(); + return NLMISC::toString("%" NL_I64 "X", prop); } // *************************************************************************** -sint64 CLuaIHMRyzom::getTargetVpa() +uint64 CLuaIHMRyzom::getTargetVpa() { CEntityCL *target = getTargetEntity(); if (!target) return 0; uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64(); - return prop; } // *************************************************************************** -sint64 CLuaIHMRyzom::getTargetVpb() +uint64 CLuaIHMRyzom::getTargetVpb() { CEntityCL *target = getTargetEntity(); 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; } // *************************************************************************** -sint64 CLuaIHMRyzom::getTargetVpc() +uint64 CLuaIHMRyzom::getTargetVpc() { CEntityCL *target = getTargetEntity(); if (!target) return 0; - sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64(); - + uint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPC))->getValue64(); return prop; } 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 1ca8de42a..f8db32363 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h @@ -272,9 +272,9 @@ private: static std::string getPlayerVpaHex(); static std::string getPlayerVpbHex(); static std::string getPlayerVpcHex(); - static sint64 getPlayerVpa(); - static sint64 getPlayerVpb(); - static sint64 getPlayerVpc(); + static uint64 getPlayerVpa(); + static uint64 getPlayerVpb(); + static uint64 getPlayerVpc(); static sint32 getTargetLevel(); // get current, precise level of the selected target, or -1 if there's no such selected target static sint32 getTargetForceRegion(); // get 'force region' for current target, or -1 if there's no selected target static sint32 getTargetLevelForce(); // get 'level force' for current target, or -1 if there's no selected target @@ -282,9 +282,9 @@ private: static std::string getTargetVpaHex(); static std::string getTargetVpbHex(); static std::string getTargetVpcHex(); - static sint64 getTargetVpa(); - static sint64 getTargetVpb(); - static sint64 getTargetVpc(); + static uint64 getTargetVpa(); + static uint64 getTargetVpb(); + static uint64 getTargetVpc(); static bool isTargetNPC(); // return 'true' if the target is an npc static bool isTargetPlayer(); // return 'true' if the target is a player static bool isTargetUser(); // return 'true' if the target is the user