Changed: updated way to moveToTarget

storyline/s2e1
Ulukyn 5 years ago
parent 1db0300515
commit 4df2489f59

@ -1531,10 +1531,14 @@ int CLuaIHMRyzom::getTargetTitle(CLuaState &ls)
// *************************************************************************** // ***************************************************************************
int CLuaIHMRyzom::moveToTarget(CLuaState &ls) int CLuaIHMRyzom::moveToTarget(CLuaState &ls)
{ {
CLuaIHM::checkArgCount(ls, "moveToTarget", 0); CLuaIHM::checkArgCount(ls, "moveToTarget", 1);
CLuaIHM::checkArgType(ls, "url", 1, LUA_TSTRING);
const std::string &url = ls.toString(1);
CEntityCL *target = getTargetEntity(); CEntityCL *target = getTargetEntity();
if (!target) return 0; if (!target) return 0;
CLuaManager::getInstance().executeLuaScript("ArkTargetUrl = [["+url+"]]", 0);
UserEntity->moveTo(UserEntity->selection(), 1.0, CUserEntity::OpenArkUrl); UserEntity->moveTo(UserEntity->selection(), 1.0, CUserEntity::OpenArkUrl);
return 0; return 0;
} }

@ -1688,7 +1688,7 @@ void CUserEntity::moveToAction(CEntityCL *ent)
break; break;
// openArkUrl // openArkUrl
case CUserEntity::OpenArkUrl: case CUserEntity::OpenArkUrl:
CLuaManager::getInstance().executeLuaScript("game:openTargetArkUrl()", 0); CLuaManager::getInstance().executeLuaScript("getUI('ui:interface:web_transactions'):find('html'):browse(ArkTargetUrl)", 0);
break; break;
default: default:
break; break;

Loading…
Cancel
Save