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
hg/hotfix/patches-from-atys
ulukyn 7 years ago
parent a50bd10b84
commit 4f75f92610

@ -897,8 +897,18 @@ void contextWebIG(bool rightClick, bool dblClick)
{
if (pGC != NULL)
pGC->setActive(false);
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 //

@ -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;
}
}

Loading…
Cancel
Save