From 4f75f926108e0bcdc01a7c758cb58f09ef81a0b5 Mon Sep 17 00:00:00 2001 From: ulukyn Date: Tue, 24 Jul 2018 21:30:35 +0200 Subject: [PATCH] Added: Add "@LUA " prefix to url set on shapes with text. When player click on shape, run the lua code getDbProp64 return a variable instead of node->getValue64() return value. --HG-- branch : patches-from-atys --- code/ryzom/client/src/cursor_functions.cpp | 22 +++++++++++-------- .../client/src/interface_v3/lua_ihm_ryzom.cpp | 7 ++++-- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/code/ryzom/client/src/cursor_functions.cpp b/code/ryzom/client/src/cursor_functions.cpp index 7b581b808..8b1963e25 100644 --- a/code/ryzom/client/src/cursor_functions.cpp +++ b/code/ryzom/client/src/cursor_functions.cpp @@ -897,8 +897,18 @@ void contextWebIG(bool rightClick, bool dblClick) { if (pGC != NULL) pGC->setActive(false); - CAHManager::getInstance()->runActionHandler("browse", NULL, "name=ui:interface:webig:content:html|url="+selectedInstanceURL); + + if (selectedInstanceURL.substr(0, 5) == "@LUA ") + { + string header = toString("doubleClick = %s\nrightClick = %s\nSelectedInstanceId = %u\n", dblClick?"true":"false", rightClick?"true":"false", InstanceId); + CLuaManager::getInstance().executeLuaScript(header+selectedInstanceURL.substr(5), true); + } + else + { + CAHManager::getInstance()->runActionHandler("browse", NULL, "name=ui:interface:webig:content:html|url="+selectedInstanceURL); + } } + }// contextWebIG // //----------------------------------------------- @@ -906,15 +916,9 @@ void contextWebIG(bool rightClick, bool dblClick) //----------------------------------------------- void contextARKitect(bool rightClick, bool dblClick) { - string header; - if (rightClick) - { - header = toString("rightClick = true\nSelectedInstanceId = %u\n", InstanceId); - } else { - header = toString("rightClick = false\nSelectedInstanceId = %u\n", InstanceId); - } + string header = toString("doubleClick = %s\nrightClick = %s\nSelectedInstanceId = %u\n", dblClick?"true":"false", rightClick?"true":"false", InstanceId); - CLuaManager::getInstance().executeLuaScript(string(header)+selectedInstanceURL, true); + CLuaManager::getInstance().executeLuaScript(header+selectedInstanceURL, true); }// contextARKitect // 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 41c16b4bc..1b1886efe 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -2593,10 +2593,13 @@ sint64 CLuaIHMRyzom::getDbProp64(const std::string &dbProp) CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp(dbProp, false); if (node) - return node->getValue64(); + { + sint64 prop = node->getValue64(); + return prop; + } else { - debugInfo(toString("getDbProp(): '%s' dbProp Not found", dbProp.c_str())); + debugInfo(toString("getDbProp64(): '%s' dbProp Not found", dbProp.c_str())); return 0; } }