|
|
@ -199,12 +199,14 @@ static DECLARE_INTERFACE_USER_FCT(lua)
|
|
|
|
ls.pushNil();
|
|
|
|
ls.pushNil();
|
|
|
|
ls.setTable(-3); //pop pop
|
|
|
|
ls.setTable(-3); //pop pop
|
|
|
|
ls.pop();
|
|
|
|
ls.pop();
|
|
|
|
|
|
|
|
|
|
|
|
// *** execute script
|
|
|
|
// *** execute script
|
|
|
|
std::string script = args[0].getString();
|
|
|
|
std::string script = args[0].getString();
|
|
|
|
// assign return value in retId.
|
|
|
|
// assign return value in retId.
|
|
|
|
script = retId + "= " + script;
|
|
|
|
script = retId + "= " + script;
|
|
|
|
// execute a small script here, because most often exprs are called from xml files => lot of redundant script
|
|
|
|
// execute a small script here, because most often exprs are called from xml files => lot of redundant script
|
|
|
|
CLuaManager::getInstance().executeLuaScript(script, true);
|
|
|
|
CLuaManager::getInstance().executeLuaScript(script, true);
|
|
|
|
|
|
|
|
|
|
|
|
// *** retrieve and convert return value
|
|
|
|
// *** retrieve and convert return value
|
|
|
|
ls.pushGlobalTable();
|
|
|
|
ls.pushGlobalTable();
|
|
|
|
ls.push(retId);
|
|
|
|
ls.push(retId);
|
|
|
@ -254,6 +256,7 @@ static DECLARE_INTERFACE_USER_FCT(lua)
|
|
|
|
else if (type == LUA_TUSERDATA)
|
|
|
|
else if (type == LUA_TUSERDATA)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// NB: the value is poped in obj.set() (no need to do ls.pop());
|
|
|
|
// NB: the value is poped in obj.set() (no need to do ls.pop());
|
|
|
|
|
|
|
|
|
|
|
|
// try with ucstring
|
|
|
|
// try with ucstring
|
|
|
|
ucstring ucstrVal;
|
|
|
|
ucstring ucstrVal;
|
|
|
|
|
|
|
|
|
|
|
@ -378,6 +381,7 @@ void CLuaIHMRyzom::createLuaEnumTable(CLuaState &ls, const std::string &str)
|
|
|
|
void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
|
|
|
|
void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CLuaStackChecker lsc(&ls);
|
|
|
|
CLuaStackChecker lsc(&ls);
|
|
|
|
|
|
|
|
|
|
|
|
// MISC ui ctors
|
|
|
|
// MISC ui ctors
|
|
|
|
struct CUICtor
|
|
|
|
struct CUICtor
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -389,7 +393,9 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ls.registerFunc("SNode", CUICtor::SNode);
|
|
|
|
ls.registerFunc("SNode", CUICtor::SNode);
|
|
|
|
|
|
|
|
|
|
|
|
// *** Register the metatable for access to client.cfg (nb nico this may be more general later -> access to any config file ...)
|
|
|
|
// *** Register the metatable for access to client.cfg (nb nico this may be more general later -> access to any config file ...)
|
|
|
|
ls.pushGlobalTable();
|
|
|
|
ls.pushGlobalTable();
|
|
|
|
CLuaObject globals(ls);
|
|
|
|
CLuaObject globals(ls);
|
|
|
@ -399,6 +405,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
|
|
|
|
mt.setValue("__index", luaClientCfgIndex);
|
|
|
|
mt.setValue("__index", luaClientCfgIndex);
|
|
|
|
mt.setValue("__newindex", luaClientCfgNewIndex);
|
|
|
|
mt.setValue("__newindex", luaClientCfgNewIndex);
|
|
|
|
globals.setNil("__cfmt"); // remove temp metatable
|
|
|
|
globals.setNil("__cfmt"); // remove temp metatable
|
|
|
|
|
|
|
|
|
|
|
|
ls.registerFunc("getUI", getUI);
|
|
|
|
ls.registerFunc("getUI", getUI);
|
|
|
|
ls.registerFunc("validMessageBox", validMessageBox);
|
|
|
|
ls.registerFunc("validMessageBox", validMessageBox);
|
|
|
|
ls.registerFunc("getUICaller", getUICaller);
|
|
|
|
ls.registerFunc("getUICaller", getUICaller);
|
|
|
@ -477,8 +484,10 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
|
|
|
|
ls.registerFunc("setupShape", setupShape);
|
|
|
|
ls.registerFunc("setupShape", setupShape);
|
|
|
|
|
|
|
|
|
|
|
|
lua_State *L = ls.getStatePointer();
|
|
|
|
lua_State *L = ls.getStatePointer();
|
|
|
|
|
|
|
|
|
|
|
|
LUABIND_ENUM(PVP_CLAN::TPVPClan, "game.TPVPClan", PVP_CLAN::NbClans, PVP_CLAN::toString);
|
|
|
|
LUABIND_ENUM(PVP_CLAN::TPVPClan, "game.TPVPClan", PVP_CLAN::NbClans, PVP_CLAN::toString);
|
|
|
|
LUABIND_ENUM(BONUS_MALUS::TBonusMalusSpecialTT, "game.TBonusMalusSpecialTT", BONUS_MALUS::NbSpecialTT, BONUS_MALUS::toString);
|
|
|
|
LUABIND_ENUM(BONUS_MALUS::TBonusMalusSpecialTT, "game.TBonusMalusSpecialTT", BONUS_MALUS::NbSpecialTT, BONUS_MALUS::toString);
|
|
|
|
|
|
|
|
|
|
|
|
luabind::module(L)
|
|
|
|
luabind::module(L)
|
|
|
|
[
|
|
|
|
[
|
|
|
|
LUABIND_FUNC(getDbProp),
|
|
|
|
LUABIND_FUNC(getDbProp),
|
|
|
@ -626,6 +635,7 @@ int CLuaIHMRyzom::getUI(CLuaState &ls)
|
|
|
|
// get the string
|
|
|
|
// get the string
|
|
|
|
std::string eltStr;
|
|
|
|
std::string eltStr;
|
|
|
|
ls.toString(1, eltStr);
|
|
|
|
ls.toString(1, eltStr);
|
|
|
|
|
|
|
|
|
|
|
|
// return the element
|
|
|
|
// return the element
|
|
|
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
|
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
|
|
CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(eltStr);
|
|
|
|
CInterfaceElement *pIE = CWidgetManager::getInstance()->getElementFromId(eltStr);
|
|
|
@ -655,13 +665,16 @@ int CLuaIHMRyzom::formatUI(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//H_AUTO(Lua_CLuaIHM_formatUI)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_formatUI)
|
|
|
|
CLuaStackChecker lsc(&ls, 1);
|
|
|
|
CLuaStackChecker lsc(&ls, 1);
|
|
|
|
|
|
|
|
|
|
|
|
// params: "expr", param1, param2....
|
|
|
|
// params: "expr", param1, param2....
|
|
|
|
// return: string with # and % parsed
|
|
|
|
// return: string with # and % parsed
|
|
|
|
CLuaIHM::checkArgMin(ls, "formatUI", 1);
|
|
|
|
CLuaIHM::checkArgMin(ls, "formatUI", 1);
|
|
|
|
CLuaIHM::check(ls, ls.isString(1), "formatUI() require a string in param1");
|
|
|
|
CLuaIHM::check(ls, ls.isString(1), "formatUI() require a string in param1");
|
|
|
|
|
|
|
|
|
|
|
|
// get the string to format
|
|
|
|
// get the string to format
|
|
|
|
std::string propVal;
|
|
|
|
std::string propVal;
|
|
|
|
ls.toString(1, propVal);
|
|
|
|
ls.toString(1, propVal);
|
|
|
|
|
|
|
|
|
|
|
|
// *** format with %
|
|
|
|
// *** format with %
|
|
|
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
|
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
|
|
std::string newPropVal, defError;
|
|
|
|
std::string newPropVal, defError;
|
|
|
@ -679,6 +692,7 @@ int CLuaIHMRyzom::formatUI(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string paramValue;
|
|
|
|
std::string paramValue;
|
|
|
|
ls.toString(stackIndex, paramValue);
|
|
|
|
ls.toString(stackIndex, paramValue);
|
|
|
|
|
|
|
|
|
|
|
|
// For stack param 4, the param index is 3 (because stack param 2 is the param No 1)
|
|
|
|
// For stack param 4, the param index is 3 (because stack param 2 is the param No 1)
|
|
|
|
sint paramIndex = stackIndex - 1;
|
|
|
|
sint paramIndex = stackIndex - 1;
|
|
|
|
|
|
|
|
|
|
|
@ -698,10 +712,12 @@ int CLuaIHMRyzom::formatDB(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//H_AUTO(Lua_CLuaIHM_formatDB)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_formatDB)
|
|
|
|
CLuaStackChecker lsc(&ls, 1);
|
|
|
|
CLuaStackChecker lsc(&ls, 1);
|
|
|
|
|
|
|
|
|
|
|
|
// params: param1, param2....
|
|
|
|
// params: param1, param2....
|
|
|
|
// return: string with @ and , added
|
|
|
|
// return: string with @ and , added
|
|
|
|
CLuaIHM::checkArgMin(ls, "formatDB", 1);
|
|
|
|
CLuaIHM::checkArgMin(ls, "formatDB", 1);
|
|
|
|
uint top = ls.getTop();
|
|
|
|
uint top = ls.getTop();
|
|
|
|
|
|
|
|
|
|
|
|
std::string dbRes;
|
|
|
|
std::string dbRes;
|
|
|
|
|
|
|
|
|
|
|
|
for (uint i = 1; i <= top; i++)
|
|
|
|
for (uint i = 1; i <= top; i++)
|
|
|
@ -726,10 +742,12 @@ int CLuaIHMRyzom::dumpUI(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//H_AUTO(Lua_CLuaIHM_dumpUI)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_dumpUI)
|
|
|
|
CLuaStackChecker lsc(&ls, 0);
|
|
|
|
CLuaStackChecker lsc(&ls, 0);
|
|
|
|
|
|
|
|
|
|
|
|
// params: CInterfaceElement *
|
|
|
|
// params: CInterfaceElement *
|
|
|
|
// return: none
|
|
|
|
// return: none
|
|
|
|
CLuaIHM::checkArgCount(ls, "dumpUI", 1);
|
|
|
|
CLuaIHM::checkArgCount(ls, "dumpUI", 1);
|
|
|
|
CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "dumpUI() requires a UI object in param 1");
|
|
|
|
CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "dumpUI() requires a UI object in param 1");
|
|
|
|
|
|
|
|
|
|
|
|
// retrieve args
|
|
|
|
// retrieve args
|
|
|
|
CInterfaceElement *pIE = CLuaIHM::getUIOnStack(ls, 1);
|
|
|
|
CInterfaceElement *pIE = CLuaIHM::getUIOnStack(ls, 1);
|
|
|
|
|
|
|
|
|
|
|
@ -753,7 +771,9 @@ int CLuaIHMRyzom::setKeyboardContext(CLuaState &ls)
|
|
|
|
const char *funcName = "setKeyboardContext";
|
|
|
|
const char *funcName = "setKeyboardContext";
|
|
|
|
CLuaIHM::checkArgMin(ls, funcName, 1);
|
|
|
|
CLuaIHM::checkArgMin(ls, funcName, 1);
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
|
|
|
|
|
|
|
|
|
|
|
|
ActionsContext.setContext(ls.toString(1));
|
|
|
|
ActionsContext.setContext(ls.toString(1));
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -803,9 +823,11 @@ int CLuaIHMRyzom::setTextFormatTaged(CLuaState &ls)
|
|
|
|
// params: CViewText*, "text" (or ucstring)
|
|
|
|
// params: CViewText*, "text" (or ucstring)
|
|
|
|
// return: none
|
|
|
|
// return: none
|
|
|
|
CLuaIHM::checkArgCount(ls, "setTextFormatTaged", 2);
|
|
|
|
CLuaIHM::checkArgCount(ls, "setTextFormatTaged", 2);
|
|
|
|
|
|
|
|
|
|
|
|
// *** check and retrieve param 1
|
|
|
|
// *** check and retrieve param 1
|
|
|
|
CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "setTextFormatTaged() requires a UI object in param 1");
|
|
|
|
CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "setTextFormatTaged() requires a UI object in param 1");
|
|
|
|
CInterfaceElement *pIE = CLuaIHM::getUIOnStack(ls, 1);
|
|
|
|
CInterfaceElement *pIE = CLuaIHM::getUIOnStack(ls, 1);
|
|
|
|
|
|
|
|
|
|
|
|
// *** check and retrieve param 2. must be a string or a ucstring
|
|
|
|
// *** check and retrieve param 2. must be a string or a ucstring
|
|
|
|
ucstring text;
|
|
|
|
ucstring text;
|
|
|
|
|
|
|
|
|
|
|
@ -833,6 +855,7 @@ int CLuaIHMRyzom::setTextFormatTaged(CLuaState &ls)
|
|
|
|
|
|
|
|
|
|
|
|
// Set the text as format
|
|
|
|
// Set the text as format
|
|
|
|
vt->setTextFormatTaged(text);
|
|
|
|
vt->setTextFormatTaged(text);
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -853,8 +876,10 @@ struct CEmoteStruct
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string::size_type pos1 = path1.find('|');
|
|
|
|
string::size_type pos1 = path1.find('|');
|
|
|
|
string::size_type pos2 = path2.find('|');
|
|
|
|
string::size_type pos2 = path2.find('|');
|
|
|
|
|
|
|
|
|
|
|
|
ucstring s1 = toUpper(CI18N::get(path1.substr(0, pos1)));
|
|
|
|
ucstring s1 = toUpper(CI18N::get(path1.substr(0, pos1)));
|
|
|
|
ucstring s2 = toUpper(CI18N::get(path2.substr(0, pos2)));
|
|
|
|
ucstring s2 = toUpper(CI18N::get(path2.substr(0, pos2)));
|
|
|
|
|
|
|
|
|
|
|
|
sint result = s1.compare(s2);
|
|
|
|
sint result = s1.compare(s2);
|
|
|
|
|
|
|
|
|
|
|
|
if (result != 0)
|
|
|
|
if (result != 0)
|
|
|
@ -880,14 +905,16 @@ int CLuaIHMRyzom::initEmotesMenu(CLuaState &ls)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_initEmotesMenu)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_initEmotesMenu)
|
|
|
|
CLuaIHM::checkArgCount(ls, "initEmotesMenu", 2);
|
|
|
|
CLuaIHM::checkArgCount(ls, "initEmotesMenu", 2);
|
|
|
|
CLuaIHM::checkArgType(ls, "initEmotesMenu", 2, LUA_TSTRING);
|
|
|
|
CLuaIHM::checkArgType(ls, "initEmotesMenu", 2, LUA_TSTRING);
|
|
|
|
|
|
|
|
|
|
|
|
const std::string &emoteMenu = ls.toString(1);
|
|
|
|
const std::string &emoteMenu = ls.toString(1);
|
|
|
|
const std::string &luaParams = ls.toString(2);
|
|
|
|
const std::string &luaParams = ls.toString(2);
|
|
|
|
|
|
|
|
|
|
|
|
ls.newTable();
|
|
|
|
ls.newTable();
|
|
|
|
CLuaObject result(ls);
|
|
|
|
CLuaObject result(ls);
|
|
|
|
std::map<std::string, std::string> emoteList;
|
|
|
|
std::map<std::string, std::string> emoteList;
|
|
|
|
uint maxVisibleLine = 10;
|
|
|
|
uint maxVisibleLine = 10;
|
|
|
|
CTextEmotListSheet* pTELS = dynamic_cast<CTextEmotListSheet*>(SheetMngr.get(CSheetId("list.text_emotes")));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CTextEmotListSheet *pTELS = dynamic_cast<CTextEmotListSheet*>(SheetMngr.get(CSheetId("list.text_emotes")));
|
|
|
|
if (pTELS == NULL)
|
|
|
|
if (pTELS == NULL)
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
@ -914,8 +941,10 @@ int CLuaIHMRyzom::initEmotesMenu(CLuaState &ls)
|
|
|
|
nlassert(pEmotList->Emots.size() <= 255);
|
|
|
|
nlassert(pEmotList->Emots.size() <= 255);
|
|
|
|
// Get the focus beta tester flag
|
|
|
|
// Get the focus beta tester flag
|
|
|
|
bool betaTester = false;
|
|
|
|
bool betaTester = false;
|
|
|
|
|
|
|
|
|
|
|
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
|
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
|
|
CSkillManager *pSM = CSkillManager::getInstance();
|
|
|
|
CSkillManager *pSM = CSkillManager::getInstance();
|
|
|
|
|
|
|
|
|
|
|
|
betaTester = pSM->isTitleUnblocked(CHARACTER_TITLE::FBT);
|
|
|
|
betaTester = pSM->isTitleUnblocked(CHARACTER_TITLE::FBT);
|
|
|
|
CGroupMenu *pInitRootMenu = dynamic_cast<CGroupMenu*>(CWidgetManager::getInstance()->getElementFromId(emoteMenu));
|
|
|
|
CGroupMenu *pInitRootMenu = dynamic_cast<CGroupMenu*>(CWidgetManager::getInstance()->getElementFromId(emoteMenu));
|
|
|
|
pInitRootMenu->reset();
|
|
|
|
pInitRootMenu->reset();
|
|
|
@ -1016,6 +1045,7 @@ int CLuaIHMRyzom::initEmotesMenu(CLuaState &ls)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
result.push();
|
|
|
|
result.push();
|
|
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1115,8 +1145,10 @@ int CLuaIHMRyzom::enableModalWindow(CLuaState &ls)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_enableModalWindow)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_enableModalWindow)
|
|
|
|
const char *funcName = "enableModalWindow";
|
|
|
|
const char *funcName = "enableModalWindow";
|
|
|
|
CLuaIHM::checkArgCount(ls, funcName, 2);
|
|
|
|
CLuaIHM::checkArgCount(ls, funcName, 2);
|
|
|
|
|
|
|
|
|
|
|
|
CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "enableModalWindow() requires a UI object in param 1");
|
|
|
|
CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "enableModalWindow() requires a UI object in param 1");
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING);
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 2, LUA_TSTRING);
|
|
|
|
|
|
|
|
|
|
|
|
CInterfaceElement *pIE = CLuaIHM::getUIOnStack(ls, 1);
|
|
|
|
CInterfaceElement *pIE = CLuaIHM::getUIOnStack(ls, 1);
|
|
|
|
std::string modalId = ls.toString(2);
|
|
|
|
std::string modalId = ls.toString(2);
|
|
|
|
|
|
|
|
|
|
|
@ -1133,6 +1165,7 @@ int CLuaIHMRyzom::enableModalWindow(CLuaState &ls)
|
|
|
|
if (group)
|
|
|
|
if (group)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
UserControls.stopFreeLook();
|
|
|
|
UserControls.stopFreeLook();
|
|
|
|
|
|
|
|
|
|
|
|
// enable the modal
|
|
|
|
// enable the modal
|
|
|
|
CWidgetManager::getInstance()->enableModalWindow(ctrl, group);
|
|
|
|
CWidgetManager::getInstance()->enableModalWindow(ctrl, group);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1223,8 +1256,6 @@ int CLuaIHMRyzom::getShapeIdAt(CLuaState &ls)
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int CLuaIHMRyzom::getGroundAtMouse(CLuaState &ls)
|
|
|
|
int CLuaIHMRyzom::getGroundAtMouse(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sint32 x, y;
|
|
|
|
sint32 x, y;
|
|
|
@ -1263,9 +1294,6 @@ int CLuaIHMRyzom::getGroundAtMouse(CLuaState &ls)
|
|
|
|
return 3;
|
|
|
|
return 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
int CLuaIHMRyzom::getPlayerPos(CLuaState &ls)
|
|
|
|
int CLuaIHMRyzom::getPlayerPos(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1457,14 +1485,18 @@ int CLuaIHMRyzom::disableContextHelpForControl(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//H_AUTO(Lua_CLuaIHM_disableContextHelpForControl)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_disableContextHelpForControl)
|
|
|
|
CLuaStackChecker lsc(&ls, 0);
|
|
|
|
CLuaStackChecker lsc(&ls, 0);
|
|
|
|
|
|
|
|
|
|
|
|
// params: CCtrlBase*
|
|
|
|
// params: CCtrlBase*
|
|
|
|
// return: none
|
|
|
|
// return: none
|
|
|
|
CLuaIHM::checkArgCount(ls, "disableContextHelpForControl", 1);
|
|
|
|
CLuaIHM::checkArgCount(ls, "disableContextHelpForControl", 1);
|
|
|
|
CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "disableContextHelpForControl() requires a UI object in param 1");
|
|
|
|
CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "disableContextHelpForControl() requires a UI object in param 1");
|
|
|
|
|
|
|
|
|
|
|
|
// retrieve args
|
|
|
|
// retrieve args
|
|
|
|
CInterfaceElement *pIE = CLuaIHM::getUIOnStack(ls, 1);
|
|
|
|
CInterfaceElement *pIE = CLuaIHM::getUIOnStack(ls, 1);
|
|
|
|
|
|
|
|
|
|
|
|
// go
|
|
|
|
// go
|
|
|
|
CWidgetManager::getInstance()->disableContextHelpForControl(dynamic_cast<CCtrlBase*>(pIE));
|
|
|
|
CWidgetManager::getInstance()->disableContextHelpForControl(dynamic_cast<CCtrlBase*>(pIE));
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1511,8 +1543,10 @@ int CLuaIHMRyzom::getSheet2idx(CLuaState &ls)
|
|
|
|
CLuaIHM::checkArgCount(ls, "getSheet2idx", 2);
|
|
|
|
CLuaIHM::checkArgCount(ls, "getSheet2idx", 2);
|
|
|
|
CLuaIHM::checkArgType(ls, "getSheet2idx", 1, LUA_TSTRING);
|
|
|
|
CLuaIHM::checkArgType(ls, "getSheet2idx", 1, LUA_TSTRING);
|
|
|
|
CLuaIHM::checkArgType(ls, "getSheet2idx", 2, LUA_TNUMBER);
|
|
|
|
CLuaIHM::checkArgType(ls, "getSheet2idx", 2, LUA_TNUMBER);
|
|
|
|
|
|
|
|
|
|
|
|
const std::string &sheedtName = ls.toString(1);
|
|
|
|
const std::string &sheedtName = ls.toString(1);
|
|
|
|
uint32 slotId = (uint32)ls.toInteger(2);
|
|
|
|
uint32 slotId = (uint32)ls.toInteger(2);
|
|
|
|
|
|
|
|
|
|
|
|
NLMISC::CSheetId sheetId;
|
|
|
|
NLMISC::CSheetId sheetId;
|
|
|
|
|
|
|
|
|
|
|
|
if (sheetId.buildSheetId(sheedtName))
|
|
|
|
if (sheetId.buildSheetId(sheedtName))
|
|
|
@ -1539,6 +1573,7 @@ int CLuaIHMRyzom::getSlotDataSetId(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CLuaIHM::checkArgCount(ls, "getSlotDataSetId", 1);
|
|
|
|
CLuaIHM::checkArgCount(ls, "getSlotDataSetId", 1);
|
|
|
|
CLuaIHM::checkArgType(ls, "getSlotDataSetId", 1, LUA_TNUMBER);
|
|
|
|
CLuaIHM::checkArgType(ls, "getSlotDataSetId", 1, LUA_TNUMBER);
|
|
|
|
|
|
|
|
|
|
|
|
uint32 slot = (uint32)ls.toInteger(1);
|
|
|
|
uint32 slot = (uint32)ls.toInteger(1);
|
|
|
|
CEntityCL *e = getSlotEntity(slot);
|
|
|
|
CEntityCL *e = getSlotEntity(slot);
|
|
|
|
string id = toString(e->dataSetId());
|
|
|
|
string id = toString(e->dataSetId());
|
|
|
@ -1553,6 +1588,7 @@ int CLuaIHMRyzom::getClientCfgVar(CLuaState &ls)
|
|
|
|
CLuaIHM::checkArgCount(ls, funcName, 1);
|
|
|
|
CLuaIHM::checkArgCount(ls, funcName, 1);
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
|
|
|
|
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
|
|
|
|
std::string varName = ls.toString(1);
|
|
|
|
std::string varName = ls.toString(1);
|
|
|
|
|
|
|
|
|
|
|
|
CConfigFile::CVar *v = ClientCfg.ConfigFile.getVarPtr(varName);
|
|
|
|
CConfigFile::CVar *v = ClientCfg.ConfigFile.getVarPtr(varName);
|
|
|
|
|
|
|
|
|
|
|
|
if (!v) return 0;
|
|
|
|
if (!v) return 0;
|
|
|
@ -1657,6 +1693,7 @@ int CLuaIHMRyzom::getUICaller(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//H_AUTO(Lua_CLuaIHM_getUICaller)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_getUICaller)
|
|
|
|
CLuaStackChecker lsc(&ls, 1);
|
|
|
|
CLuaStackChecker lsc(&ls, 1);
|
|
|
|
|
|
|
|
|
|
|
|
// params: none.
|
|
|
|
// params: none.
|
|
|
|
// return: CInterfaceElement* (nil if error)
|
|
|
|
// return: CInterfaceElement* (nil if error)
|
|
|
|
CInterfaceElement *pIE = CHandlerLUA::getUICaller();
|
|
|
|
CInterfaceElement *pIE = CHandlerLUA::getUICaller();
|
|
|
@ -1679,10 +1716,12 @@ int CLuaIHMRyzom::getIndexInDB(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//H_AUTO(Lua_CLuaIHM_getIndexInDB)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_getIndexInDB)
|
|
|
|
CLuaStackChecker lsc(&ls, 1);
|
|
|
|
CLuaStackChecker lsc(&ls, 1);
|
|
|
|
|
|
|
|
|
|
|
|
// params: CDBCtrlSheet*
|
|
|
|
// params: CDBCtrlSheet*
|
|
|
|
// return: index in DB of a dbctrlsheet (empty if error)
|
|
|
|
// return: index in DB of a dbctrlsheet (empty if error)
|
|
|
|
CLuaIHM::checkArgCount(ls, "getIndexInDB", 1);
|
|
|
|
CLuaIHM::checkArgCount(ls, "getIndexInDB", 1);
|
|
|
|
CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "getIndexInDB() requires a UI object in param 1");
|
|
|
|
CLuaIHM::check(ls, CLuaIHM::isUIOnStack(ls, 1), "getIndexInDB() requires a UI object in param 1");
|
|
|
|
|
|
|
|
|
|
|
|
// retrieve args
|
|
|
|
// retrieve args
|
|
|
|
CInterfaceElement *pIE = CLuaIHM::getUIOnStack(ls, 1);
|
|
|
|
CInterfaceElement *pIE = CLuaIHM::getUIOnStack(ls, 1);
|
|
|
|
CDBCtrlSheet *pCS = dynamic_cast<CDBCtrlSheet*>(pIE);
|
|
|
|
CDBCtrlSheet *pCS = dynamic_cast<CDBCtrlSheet*>(pIE);
|
|
|
@ -1866,7 +1905,9 @@ int CLuaIHMRyzom::displayBubble(CLuaState &ls)
|
|
|
|
links.push_back(it.nextValue().toString());
|
|
|
|
links.push_back(it.nextValue().toString());
|
|
|
|
strs.push_back(it.nextKey().toString());
|
|
|
|
strs.push_back(it.nextKey().toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
InSceneBubbleManager.webIgChatOpen((uint32)ls.toInteger(1), ls.toString(2), strs, links);
|
|
|
|
InSceneBubbleManager.webIgChatOpen((uint32)ls.toInteger(1), ls.toString(2), strs, links);
|
|
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1922,11 +1963,14 @@ int CLuaIHMRyzom::getCompleteIslands(CLuaState &ls)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_getCompleteIslands)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_getCompleteIslands)
|
|
|
|
const char *funcName = "getCompleteIslands";
|
|
|
|
const char *funcName = "getCompleteIslands";
|
|
|
|
CLuaIHM::checkArgCount(ls, funcName, 0);
|
|
|
|
CLuaIHM::checkArgCount(ls, funcName, 0);
|
|
|
|
|
|
|
|
|
|
|
|
ls.newTable();
|
|
|
|
ls.newTable();
|
|
|
|
CLuaObject result(ls);
|
|
|
|
CLuaObject result(ls);
|
|
|
|
|
|
|
|
|
|
|
|
// load entryPoints
|
|
|
|
// load entryPoints
|
|
|
|
CScenarioEntryPoints scenarioEntryPoints = CScenarioEntryPoints::getInstance();
|
|
|
|
CScenarioEntryPoints scenarioEntryPoints = CScenarioEntryPoints::getInstance();
|
|
|
|
const CScenarioEntryPoints::TCompleteIslands &islands = scenarioEntryPoints.getCompleteIslands();
|
|
|
|
const CScenarioEntryPoints::TCompleteIslands &islands = scenarioEntryPoints.getCompleteIslands();
|
|
|
|
|
|
|
|
|
|
|
|
CScenarioEntryPoints::TCompleteIslands::const_iterator island(islands.begin()), lastIsland(islands.end());
|
|
|
|
CScenarioEntryPoints::TCompleteIslands::const_iterator island(islands.begin()), lastIsland(islands.end());
|
|
|
|
|
|
|
|
|
|
|
|
for (; island != lastIsland ; ++island)
|
|
|
|
for (; island != lastIsland ; ++island)
|
|
|
@ -1938,6 +1982,7 @@ int CLuaIHMRyzom::getCompleteIslands(CLuaState &ls)
|
|
|
|
islandTable.setValue("ymin", island->YMin);
|
|
|
|
islandTable.setValue("ymin", island->YMin);
|
|
|
|
islandTable.setValue("xmax", island->XMax);
|
|
|
|
islandTable.setValue("xmax", island->XMax);
|
|
|
|
islandTable.setValue("ymax", island->YMax);
|
|
|
|
islandTable.setValue("ymax", island->YMax);
|
|
|
|
|
|
|
|
|
|
|
|
ls.newTable();
|
|
|
|
ls.newTable();
|
|
|
|
CLuaObject entrypointsTable(ls);
|
|
|
|
CLuaObject entrypointsTable(ls);
|
|
|
|
|
|
|
|
|
|
|
@ -1948,25 +1993,28 @@ int CLuaIHMRyzom::getCompleteIslands(CLuaState &ls)
|
|
|
|
CLuaObject entrypointTable(ls);
|
|
|
|
CLuaObject entrypointTable(ls);
|
|
|
|
entrypointTable.setValue("x", entryPoint.X);
|
|
|
|
entrypointTable.setValue("x", entryPoint.X);
|
|
|
|
entrypointTable.setValue("y", entryPoint.Y);
|
|
|
|
entrypointTable.setValue("y", entryPoint.Y);
|
|
|
|
|
|
|
|
|
|
|
|
entrypointsTable.setValue(entryPoint.Location, entrypointTable);
|
|
|
|
entrypointsTable.setValue(entryPoint.Location, entrypointTable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
islandTable.setValue("entrypoints", entrypointsTable);
|
|
|
|
islandTable.setValue("entrypoints", entrypointsTable);
|
|
|
|
|
|
|
|
|
|
|
|
result.setValue(island->Island, islandTable);
|
|
|
|
result.setValue(island->Island, islandTable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
result.push();
|
|
|
|
result.push();
|
|
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
int CLuaIHMRyzom::getIslandId(CLuaState &ls)
|
|
|
|
int CLuaIHMRyzom::getIslandId(CLuaState &ls)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//H_AUTO(Lua_CLuaIHM_getIslandId)
|
|
|
|
//H_AUTO(Lua_CLuaIHM_getIslandId)
|
|
|
|
const char *funcName = "getIslandId";
|
|
|
|
const char *funcName = "getIslandId";
|
|
|
|
CLuaIHM::checkArgCount(ls, funcName, 1);
|
|
|
|
CLuaIHM::checkArgCount(ls, funcName, 1);
|
|
|
|
CLuaIHM::check(ls, ls.isString(1), "getIslandId() requires a string in param 1");
|
|
|
|
CLuaIHM::check(ls, ls.isString(1), "getIslandId() requires a string in param 1");
|
|
|
|
|
|
|
|
|
|
|
|
CScenarioEntryPoints scenarioEntryPoints = CScenarioEntryPoints::getInstance();
|
|
|
|
CScenarioEntryPoints scenarioEntryPoints = CScenarioEntryPoints::getInstance();
|
|
|
|
uint32 id = scenarioEntryPoints.getIslandId(ls.toString(1));
|
|
|
|
uint32 id = scenarioEntryPoints.getIslandId(ls.toString(1));
|
|
|
|
ls.push(id);
|
|
|
|
ls.push(id);
|
|
|
@ -2532,11 +2580,11 @@ void CLuaIHMRyzom::setDbProp(const std::string &dbProp, sint32 value)
|
|
|
|
static const std::string dbLocal = "LOCAL:";
|
|
|
|
static const std::string dbLocal = "LOCAL:";
|
|
|
|
static const std::string dbLocalR2 = "LOCAL:R2";
|
|
|
|
static const std::string dbLocalR2 = "LOCAL:R2";
|
|
|
|
|
|
|
|
|
|
|
|
if ((0 == dbProp.compare(0, dbServer.size(), dbServer)) ||
|
|
|
|
if ((dbProp.compare(0, dbServer.size(), dbServer) == 0) ||
|
|
|
|
(0 == dbProp.compare(0, dbLocal.size(), dbLocal))
|
|
|
|
(dbProp.compare(0, dbLocal.size(), dbLocal) == 0)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (0 != dbProp.compare(0, dbLocalR2.size(), dbLocalR2))
|
|
|
|
if (dbProp.compare(0, dbLocalR2.size(), dbLocalR2) != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nlstop;
|
|
|
|
nlstop;
|
|
|
|
throw ELuaIHMException("setDbProp(): You are not allowed to write on 'SERVER:...' or 'LOCAL:...' database");
|
|
|
|
throw ELuaIHMException("setDbProp(): You are not allowed to write on 'SERVER:...' or 'LOCAL:...' database");
|
|
|
@ -2561,11 +2609,11 @@ void CLuaIHMRyzom::delDbProp(const string &dbProp)
|
|
|
|
static const string dbLocal = "LOCAL:";
|
|
|
|
static const string dbLocal = "LOCAL:";
|
|
|
|
static const string dbLocalR2 = "LOCAL:R2";
|
|
|
|
static const string dbLocalR2 = "LOCAL:R2";
|
|
|
|
|
|
|
|
|
|
|
|
if ((0 == dbProp.compare(0, dbServer.size(), dbServer)) ||
|
|
|
|
if ((dbProp.compare(0, dbServer.size(), dbServer) == 0) ||
|
|
|
|
(0 == dbProp.compare(0, dbLocal.size(), dbLocal))
|
|
|
|
(dbProp.compare(0, dbLocal.size(), dbLocal) == 0)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (0 != dbProp.compare(0, dbLocalR2.size(), dbLocalR2))
|
|
|
|
if (dbProp.compare(0, dbLocalR2.size(), dbLocalR2) != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nlstop;
|
|
|
|
nlstop;
|
|
|
|
throw ELuaIHMException("setDbProp(): You are not allowed to write on 'SERVER:...' or 'LOCAL:...' database");
|
|
|
|
throw ELuaIHMException("setDbProp(): You are not allowed to write on 'SERVER:...' or 'LOCAL:...' database");
|
|
|
@ -2585,11 +2633,11 @@ void CLuaIHMRyzom::addDbProp(const std::string &dbProp, sint32 value)
|
|
|
|
static const std::string dbLocal = "LOCAL:";
|
|
|
|
static const std::string dbLocal = "LOCAL:";
|
|
|
|
static const std::string dbLocalR2 = "LOCAL:R2";
|
|
|
|
static const std::string dbLocalR2 = "LOCAL:R2";
|
|
|
|
|
|
|
|
|
|
|
|
if ((0 == dbProp.compare(0, dbServer.size(), dbServer)) ||
|
|
|
|
if ((dbProp.compare(0, dbServer.size(), dbServer) == 0) ||
|
|
|
|
(0 == dbProp.compare(0, dbLocal.size(), dbLocal))
|
|
|
|
(dbProp.compare(0, dbLocal.size(), dbLocal) == 0)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (0 != dbProp.compare(0, dbLocalR2.size(), dbLocalR2))
|
|
|
|
if (dbProp.compare(0, dbLocalR2.size(), dbLocalR2) != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nlstop;
|
|
|
|
nlstop;
|
|
|
|
throw ELuaIHMException("setDbProp(): You are not allowed to write on 'SERVER:...' or 'LOCAL:...' database");
|
|
|
|
throw ELuaIHMException("setDbProp(): You are not allowed to write on 'SERVER:...' or 'LOCAL:...' database");
|
|
|
@ -2865,6 +2913,7 @@ ucstring CLuaIHMRyzom::replacePvpEffectParam(const ucstring &str, sint32 paramet
|
|
|
|
ucstring result = str;
|
|
|
|
ucstring result = str;
|
|
|
|
CSString s = str.toString();
|
|
|
|
CSString s = str.toString();
|
|
|
|
std::string p, paramString;
|
|
|
|
std::string p, paramString;
|
|
|
|
|
|
|
|
|
|
|
|
// Locate parameter and store it
|
|
|
|
// Locate parameter and store it
|
|
|
|
p = s.splitTo('%', true);
|
|
|
|
p = s.splitTo('%', true);
|
|
|
|
|
|
|
|
|
|
|
@ -2904,6 +2953,7 @@ ucstring CLuaIHMRyzom::replacePvpEffectParam(const ucstring &str, sint32 paramet
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
strFindReplace(result, paramString.c_str(), p);
|
|
|
|
strFindReplace(result, paramString.c_str(), p);
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3042,6 +3092,7 @@ sint32 CLuaIHMRyzom::getMagicResistChance(bool elementalSpell, sint32 casterSp
|
|
|
|
sint32 chanceToHit = pPM->getSuccessRate(elementalSpell ? CSPhraseManager::STResistMagic : CSPhraseManager::STResistMagicLink,
|
|
|
|
sint32 chanceToHit = pPM->getSuccessRate(elementalSpell ? CSPhraseManager::STResistMagic : CSPhraseManager::STResistMagicLink,
|
|
|
|
casterSpellLvl - victimResistLvl, true);
|
|
|
|
casterSpellLvl - victimResistLvl, true);
|
|
|
|
clamp(chanceToHit, 0, 100);
|
|
|
|
clamp(chanceToHit, 0, 100);
|
|
|
|
|
|
|
|
|
|
|
|
// Thus, the resist chance is 100 - hit chance.
|
|
|
|
// Thus, the resist chance is 100 - hit chance.
|
|
|
|
return 100 - chanceToHit;
|
|
|
|
return 100 - chanceToHit;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3053,8 +3104,10 @@ sint32 CLuaIHMRyzom::getDodgeParryChance(sint32 attLvl, sint32 defLvl)
|
|
|
|
CSPhraseManager *pPM = CSPhraseManager::getInstance();
|
|
|
|
CSPhraseManager *pPM = CSPhraseManager::getInstance();
|
|
|
|
attLvl = std::max(attLvl, sint32(0));
|
|
|
|
attLvl = std::max(attLvl, sint32(0));
|
|
|
|
defLvl = std::max(defLvl, sint32(0));
|
|
|
|
defLvl = std::max(defLvl, sint32(0));
|
|
|
|
|
|
|
|
|
|
|
|
sint32 chance = pPM->getSuccessRate(CSPhraseManager::STDodgeParry, defLvl - attLvl, false);
|
|
|
|
sint32 chance = pPM->getSuccessRate(CSPhraseManager::STDodgeParry, defLvl - attLvl, false);
|
|
|
|
clamp(chance, 0, 100);
|
|
|
|
clamp(chance, 0, 100);
|
|
|
|
|
|
|
|
|
|
|
|
return chance;
|
|
|
|
return chance;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3069,6 +3122,7 @@ void CLuaIHMRyzom::browseNpcWebPage(const std::string &htmlId, const std::string
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// if true, it means that we want to display a web page that use webig auth
|
|
|
|
// if true, it means that we want to display a web page that use webig auth
|
|
|
|
bool webig = urlIn.find("http://") == 0;
|
|
|
|
bool webig = urlIn.find("http://") == 0;
|
|
|
|
|
|
|
|
|
|
|
|
string url;
|
|
|
|
string url;
|
|
|
|
|
|
|
|
|
|
|
|
// append the WebServer to the url
|
|
|
|
// append the WebServer to the url
|
|
|
@ -3121,6 +3175,7 @@ void CLuaIHMRyzom::browseNpcWebPage(const std::string &htmlId, const std::string
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
// set the wanted timeout
|
|
|
|
// set the wanted timeout
|
|
|
|
groupHtml->setTimeout((float)std::max(0.0, timeout));
|
|
|
|
groupHtml->setTimeout((float)std::max(0.0, timeout));
|
|
|
|
|
|
|
|
|
|
|
|
// Browse the url
|
|
|
|
// Browse the url
|
|
|
|
groupHtml->clean();
|
|
|
|
groupHtml->clean();
|
|
|
|
groupHtml->browse(url.c_str());
|
|
|
|
groupHtml->browse(url.c_str());
|
|
|
@ -3393,10 +3448,11 @@ sint32 CLuaIHMRyzom::getGroundZ(uint32 x, sint32 y)
|
|
|
|
vect.y = y;
|
|
|
|
vect.y = y;
|
|
|
|
|
|
|
|
|
|
|
|
UserEntity->getCollisionEntity()->snapToGround(vect);
|
|
|
|
UserEntity->getCollisionEntity()->snapToGround(vect);
|
|
|
|
|
|
|
|
|
|
|
|
return vect.z;
|
|
|
|
return vect.z;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void setMouseCursor(const std::string texture)
|
|
|
|
void setMouseCursor(const std::string &texture)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (texture.empty())
|
|
|
|
if (texture.empty())
|
|
|
|
CTool::setMouseCursor("curs_default.tga");
|
|
|
|
CTool::setMouseCursor("curs_default.tga");
|
|
|
@ -3451,7 +3507,6 @@ void CLuaIHMRyzom::tell(const ucstring &player, const ucstring &msg)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
bool CLuaIHMRyzom::isRingAccessPointInReach()
|
|
|
|
bool CLuaIHMRyzom::isRingAccessPointInReach()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -3558,7 +3613,6 @@ sint32 CLuaIHMRyzom::getTargetLevel()
|
|
|
|
ucstring CLuaIHMRyzom::getTargetSheet()
|
|
|
|
ucstring CLuaIHMRyzom::getTargetSheet()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CEntityCL *target = getTargetEntity();
|
|
|
|
CEntityCL *target = getTargetEntity();
|
|
|
|
|
|
|
|
|
|
|
|
if (!target) return ucstring();
|
|
|
|
if (!target) return ucstring();
|
|
|
|
|
|
|
|
|
|
|
|
return target->sheetId().toString();
|
|
|
|
return target->sheetId().toString();
|
|
|
@ -3568,10 +3622,10 @@ ucstring CLuaIHMRyzom::getTargetSheet()
|
|
|
|
sint64 CLuaIHMRyzom::getTargetVpa()
|
|
|
|
sint64 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();
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPA))->getValue64();
|
|
|
|
|
|
|
|
|
|
|
|
return prop;
|
|
|
|
return prop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3579,10 +3633,10 @@ sint64 CLuaIHMRyzom::getTargetVpa()
|
|
|
|
sint64 CLuaIHMRyzom::getTargetVpb()
|
|
|
|
sint64 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();
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
|
|
|
|
|
|
|
|
return prop;
|
|
|
|
return prop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3590,10 +3644,10 @@ sint64 CLuaIHMRyzom::getTargetVpb()
|
|
|
|
sint64 CLuaIHMRyzom::getTargetVpc()
|
|
|
|
sint64 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();
|
|
|
|
sint64 prop = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:Entities:E" + toString("%d", getTargetSlotNr()) + ":P" + toString("%d", CLFECOMMON::PROPERTY_VPB))->getValue64();
|
|
|
|
|
|
|
|
|
|
|
|
return prop;
|
|
|
|
return prop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|