diff --git a/.gitignore b/.gitignore index 0ecbf0e3bc..8a6aff0c47 100644 --- a/.gitignore +++ b/.gitignore @@ -90,7 +90,6 @@ ylwrap *.mk # Visual Studio garbage -.vscode/ *.opensdf UpgradeLog*.XML _UpgradeReport_Files diff --git a/nel/include/nel/gui/group_container.h b/nel/include/nel/gui/group_container.h index 5157c22b1c..cac95121a1 100644 --- a/nel/include/nel/gui/group_container.h +++ b/nel/include/nel/gui/group_container.h @@ -238,8 +238,10 @@ namespace NLGUI std::string getTitle () const; void setTitle (const std::string &title); std::string getTitleOpened () const; + CViewText* getTitleOpenedViewText() { return _TitleOpened; }; void setTitleOpened (const std::string &title); std::string getTitleClosed () const; + CViewText* getTitleClosedViewText() { return _TitleClosed; }; void setTitleClosed (const std::string &title); std::string getTitleColorAsString() const; void setTitleColorAsString(const std::string &col); diff --git a/nel/include/nel/gui/group_editbox.h b/nel/include/nel/gui/group_editbox.h index 1f4f316fc9..0ebf704f25 100644 --- a/nel/include/nel/gui/group_editbox.h +++ b/nel/include/nel/gui/group_editbox.h @@ -194,6 +194,7 @@ namespace NLGUI REFLECT_LUA_METHOD("setFocusOnText", luaSetFocusOnText); REFLECT_LUA_METHOD("cancelFocusOnText", luaCancelFocusOnText); REFLECT_STRING("input_string", getInputString, setInputString); + REFLECT_STRING("prompt", getPrompt, setPrompt); #ifdef RYZOM_LUA_UCSTRING REFLECT_UCSTRING("uc_input_string", getInputStringAsUtf16, setInputStringAsUtf16); // Compatibility #endif diff --git a/nel/src/3d/u_instance.cpp b/nel/src/3d/u_instance.cpp index cb2a273edb..a8ba37e9f0 100644 --- a/nel/src/3d/u_instance.cpp +++ b/nel/src/3d/u_instance.cpp @@ -42,7 +42,8 @@ namespace NL3D void UInstance::getShapeAABBox(NLMISC::CAABBox &bbox) const { CTransformShape *object = getObjectPtr(); - object->getAABBox(bbox); + if (object) + object->getAABBox(bbox); } // *************************************************************************** @@ -108,7 +109,7 @@ void UInstance::selectTextureSet(uint id) void UInstance::enableAsyncTextureMode(bool enable) { CTransformShape *object = getObjectPtr(); - if(object->isMeshBaseInstance()) + if(object && object->isMeshBaseInstance()) { CMeshBaseInstance *mbi = static_cast(object); mbi->enableAsyncTextureMode(enable) ; @@ -118,7 +119,7 @@ void UInstance::enableAsyncTextureMode(bool enable) bool UInstance::getAsyncTextureMode() const { CTransformShape *object = getObjectPtr(); - if(object->isMeshBaseInstance()) + if(object && object->isMeshBaseInstance()) { CMeshBaseInstance *mbi = static_cast(object); return mbi->getAsyncTextureMode() ; @@ -130,7 +131,7 @@ bool UInstance::getAsyncTextureMode() const void UInstance::startAsyncTextureLoading() { CTransformShape *object = getObjectPtr(); - if(object->isMeshBaseInstance()) + if(object && object->isMeshBaseInstance()) { CMeshBaseInstance *mbi = static_cast(object); mbi->startAsyncTextureLoading(getPos()); @@ -140,7 +141,7 @@ void UInstance::startAsyncTextureLoading() bool UInstance::isAsyncTextureReady() { CTransformShape *object = getObjectPtr(); - if(object->isMeshBaseInstance()) + if(object && object->isMeshBaseInstance()) { CMeshBaseInstance *mbi = static_cast(object); return mbi->isAsyncTextureReady(); @@ -152,7 +153,7 @@ bool UInstance::isAsyncTextureReady() void UInstance::setAsyncTextureDistance(float dist) { CTransformShape *object = getObjectPtr(); - if(object->isMeshBaseInstance()) + if(object && object->isMeshBaseInstance()) { CMeshBaseInstance *mbi = static_cast(object); mbi->setAsyncTextureDistance(dist); @@ -162,7 +163,7 @@ void UInstance::setAsyncTextureDistance(float dist) float UInstance::getAsyncTextureDistance() const { CTransformShape *object = getObjectPtr(); - if(object->isMeshBaseInstance()) + if(object && object->isMeshBaseInstance()) { CMeshBaseInstance *mbi = static_cast(object); return mbi->getAsyncTextureDistance(); @@ -174,7 +175,7 @@ float UInstance::getAsyncTextureDistance() const void UInstance::setAsyncTextureDirty(bool flag) { CTransformShape *object = getObjectPtr(); - if(object->isMeshBaseInstance()) + if(object && object->isMeshBaseInstance()) { CMeshBaseInstance *mbi = static_cast(object); mbi->setAsyncTextureDirty(flag); @@ -184,7 +185,7 @@ void UInstance::setAsyncTextureDirty(bool flag) bool UInstance::isAsyncTextureDirty() const { CTransformShape *object = getObjectPtr(); - if(object->isMeshBaseInstance()) + if(object && object->isMeshBaseInstance()) { CMeshBaseInstance *mbi = static_cast(object); return mbi->isAsyncTextureDirty(); diff --git a/nel/src/gui/group_container.cpp b/nel/src/gui/group_container.cpp index 916e95b13c..1bf11266f3 100644 --- a/nel/src/gui/group_container.cpp +++ b/nel/src/gui/group_container.cpp @@ -3970,11 +3970,11 @@ namespace NLGUI setTitleClosed(title); } - // *************************************************************************** - std::string CGroupContainer::getTitleOpened () const - { - return _TitleTextOpened; - } + // *************************************************************************** + std::string CGroupContainer::getTitleOpened() const + { + return _TitleTextOpened; + } // *************************************************************************** void CGroupContainer::setTitleOpened (const std::string &title) diff --git a/nel/src/gui/group_editbox.cpp b/nel/src/gui/group_editbox.cpp index 711d9b8db6..cc2f4e7ac2 100644 --- a/nel/src/gui/group_editbox.cpp +++ b/nel/src/gui/group_editbox.cpp @@ -1308,13 +1308,13 @@ namespace NLGUI { makeTopWindow(); // for french, deutsch and russian, be aware of unicode - std::string command = CUtfStringView(_InputString.substr(1)).toUtf8(); - ICommand::expand(command); + //std::string command = CUtfStringView(_InputString.substr(1)).toUtf8(); + //ICommand::expand(command); // then back to u32string - _InputString = CUtfStringView('/' + command).toUtf32(); - _InputString = _InputString; - _CursorPos = (sint32)_InputString.length(); - _CursorAtPreviousLineEnd = false; + //_InputString = CUtfStringView('/' + command).toUtf32(); + //_InputString = _InputString; + //_CursorPos = (sint32)_InputString.length(); + //_CursorAtPreviousLineEnd = false; triggerOnChangeAH(); return true; } diff --git a/nel/src/gui/group_html.cpp b/nel/src/gui/group_html.cpp index 9478c5bc16..77b8a46d2b 100644 --- a/nel/src/gui/group_html.cpp +++ b/nel/src/gui/group_html.cpp @@ -3521,8 +3521,14 @@ namespace NLGUI else if (form.Entries[i].ComboBox) { CDBGroupComboBox *cb = form.Entries[i].ComboBox; - entryData = form.Entries[i].SelectValues[cb->getSelection()]; - addEntry = true; + if (cb) + { + if (form.Entries[i].SelectValues.size() > 0) + { + entryData = form.Entries[i].SelectValues[cb->getSelection()]; + addEntry = true; + } + } } else if (form.Entries[i].SelectBox) { diff --git a/nel/src/gui/lua_manager.cpp b/nel/src/gui/lua_manager.cpp index 9bdb002a6e..4b2018957d 100644 --- a/nel/src/gui/lua_manager.cpp +++ b/nel/src/gui/lua_manager.cpp @@ -75,19 +75,15 @@ namespace NLGUI } catch( const ELuaError &e ) { - std::string ryzom_version = RYZOM_VERSION; - if (!FINAL_VERSION || ryzom_version.find("Omega") == std::string::npos) // Omega version are the one used on live servers + nlwarning("--- LUA ERROR ---"); + nlwarning(e.luaWhat().c_str()); + std::vector res; + NLMISC::explode(luaScript, std::string("\n"), res); + for(uint k = 0; k < res.size(); ++k) { - nlwarning("--- LUA ERROR ---"); - nlwarning(e.luaWhat().c_str()); - std::vector res; - NLMISC::explode(luaScript, std::string("\n"), res); - for(uint k = 0; k < res.size(); ++k) - { - nlwarning("%.05u %s", k, res[k].c_str()); - } - nlwarning("--- ********* ---"); + nlwarning("%.05u %s", k, res[k].c_str()); } + nlwarning("--- ********* ---"); return false; } diff --git a/nel/src/misc/path.cpp b/nel/src/misc/path.cpp index ce787b1960..f2f97567dd 100644 --- a/nel/src/misc/path.cpp +++ b/nel/src/misc/path.cpp @@ -1107,9 +1107,6 @@ void CFileContainer::addSearchPath (const string &path, bool recurse, bool alter progressCallBack->pushCropedValues ((float)f/(float)filesToProcess.size(), (float)(f+1)/(float)filesToProcess.size()); } - string filename = CFile::getFilename (filesToProcess[f]); - string filepath = CFile::getPath (filesToProcess[f]); -// insertFileInMap (filename, filepath, false, CFile::getExtension(filename)); addSearchFile (filesToProcess[f], false, "", progressCallBack); // Progress bar @@ -1168,6 +1165,12 @@ void CFileContainer::addSearchFile (const string &file, bool remap, const string return; } + string filename = CFile::getFilename (newFile); + string filepath = CFile::getPath (newFile); + map::iterator itss = _RemappedFiles.find(filename); + if (itss != _RemappedFiles.end()) + newFile = filepath+"/"+itss->second; + std::string fileExtension = CFile::getExtension(newFile); // check if it s a big file @@ -1195,7 +1198,7 @@ void CFileContainer::addSearchFile (const string &file, bool remap, const string } string filenamewoext = CFile::getFilenameWithoutExtension (newFile); - string filename, ext; + string ext; if (virtual_ext.empty()) { diff --git a/ryzom/client/client_default.cfg b/ryzom/client/client_default.cfg index 9d813e8df2..28664aa822 100644 --- a/ryzom/client/client_default.cfg +++ b/ryzom/client/client_default.cfg @@ -308,6 +308,9 @@ HDEntityTexture = 1; HDTextureInstalled = 1; WaitVBL = 0; // 0 or 1 to wait Vertical Sync. +EnableEventsBnp = 1; +EnableOccsBnp = 0; + ////////////////// // GAME OPTIONS // ////////////////// diff --git a/ryzom/client/data/gamedev/html/help/interf_action_book_de.html b/ryzom/client/data/gamedev/html/help/interf_action_book_de.html index 9790edee04..91a9d4b95b 100644 --- a/ryzom/client/data/gamedev/html/help/interf_action_book_de.html +++ b/ryzom/client/data/gamedev/html/help/interf_action_book_de.html @@ -8,9 +8,9 @@ - - +
-

Aktionsentwicklungsfenster

+
+

Levels

@@ -36,8 +36,8 @@

Aktionen

Du musst eine Fähigkeit auswählen um Dir die Aktionen, die zu dieser Fähigkeit gehören, anzeigen zu lassen.
Die noch nicht erlernten Aktionen sind ausgegraut.
Die Aktionen, die Du noch nicht lernen kannst, da bestimmte Vorraussetzungen noch nicht erfüllt sind (z.B.: Du hast den benötigten Fähigkeitslevel noch nicht erreicht) werden rot angezeigt.
-Die Aktionen sind in zwei Gruppen aufgeteilt: -Aktionen, and +Die Aktionen sind in zwei Gruppen aufgeteilt: +Aktionen, and Aktions-Verbesserungen.
Du kannst Aktionen von hier aus per Drag'n'Drop in die Aktionsleiste ziehen, bei Aktions-Verbesserungen geht dies nicht, da sie keine eigenständige Aktion verkörpern und somit nicht ausgeführt werden können.

diff --git a/ryzom/client/data/gamedev/html/help/interf_action_book_en.html b/ryzom/client/data/gamedev/html/help/interf_action_book_en.html index b53599e749..37c298890a 100644 --- a/ryzom/client/data/gamedev/html/help/interf_action_book_en.html +++ b/ryzom/client/data/gamedev/html/help/interf_action_book_en.html @@ -8,9 +8,9 @@ - - +
-

Action Progression

+
+

Levels

@@ -22,22 +22,22 @@

Skill Tree allows you to see the state of your skills.
It displays the current level of the skill and its max level (eg: Craft: 1/20). -
The bar indicates the progression in the current skill level. +
The bar indicates the progression in the current skill level.
The color of the skill indicates either:
- transparent: skill not trained
- orange: skill currently trained
- green: skill completed

When you complete a skill, a new part of the tree is opened, which you can see by clicking on "+". -
The whole skill tree is not displayed. Only completed skills, currently trained skills, +
The whole skill tree is not displayed. Only completed skills, currently trained skills, and the untrained skills that relies directly on a trained skill are displayed.

Actions

The Actions part shows the actions you can learn or the actions you have learnt at each skill level.
You have to select a skill to see the actions related to this skill.
The actions you have not learned are grayed out.
The actions you cannot learn because you do not meet the requirements (e.g. you don't have the required skill level) displayed are in red. -

The actions are separated in two groups: -Actions, and +

The actions are separated in two groups: +Actions, and Upgrades.

You can drag and drop an Action to your action bar, but you cannot drag an Action Upgrade because they are either characteristic upgrades, or action upgrades which are not castable directly. diff --git a/ryzom/client/data/gamedev/html/help/interf_action_book_fr.html b/ryzom/client/data/gamedev/html/help/interf_action_book_fr.html index 3956342a27..82ca7c4b2f 100644 --- a/ryzom/client/data/gamedev/html/help/interf_action_book_fr.html +++ b/ryzom/client/data/gamedev/html/help/interf_action_book_fr.html @@ -8,9 +8,9 @@ - - +
-

Progession des Actions

+
+

Niveaux

@@ -30,15 +30,15 @@

Arbre de Compétences

- vert : compétence terminée

Lorsque vous terminez une compétence, vous avez accès à de nouvelles compétences. Vous pouvez explorer l'arbre de compétences en cliquant sur "+".
-L'arbre de compétences n'est pas affiché dans son ensemble. Il n'y a que les compétences terminées ou en cours d'entraînement d'affichées. +L'arbre de compétences n'est pas affiché dans son ensemble. Il n'y a que les compétences terminées ou en cours d'entraînement d'affichées. Les compétences non entraînées en rapport direct avec une compétence entraînée sont également affichées.

Actions

La partie Actions indique les actions que vous pouvez apprendre ou avez appris à chaque niveau de compétence.
Vous devez sélectionner une compétence pour connaître les actions liées à cette compétence.
Les actions que vous ne connaissez pas sont grisées.
Les actions que vous n'avez pas apprises car les prérequis ne sont pas remplis (ex. : vous n'avez pas atteint le niveau de compétence requis) sont en rouge.
-Les actions se distinguent en deux groupes : -Actions, et +Les actions se distinguent en deux groupes : +Actions, et Actions Suprêmes.
Vous pouvez glisser-déposer une Action dans votre barre actions mais vous ne pouvez pas glisser une Action Suprême car il peut s'agir d'une mise à jour de caractéristiques ou d'actions qui ne sont pas utilisables en tant que sorts.
diff --git a/ryzom/client/data/gamedev/interfaces_v3/actions.xml b/ryzom/client/data/gamedev/interfaces_v3/actions.xml index 0a00cb0f64..194434a839 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/actions.xml +++ b/ryzom/client/data/gamedev/interfaces_v3/actions.xml @@ -417,6 +417,7 @@ + diff --git a/ryzom/client/data/gamedev/interfaces_v3/appzone.lua b/ryzom/client/data/gamedev/interfaces_v3/appzone.lua index af9f584cd8..b04472d307 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/appzone.lua +++ b/ryzom/client/data/gamedev/interfaces_v3/appzone.lua @@ -190,3 +190,6 @@ function AppZone:handle(cmd) self:launchApp(cmd) end end + +-- VERSION -- +RYZOM_APPZONE_VERSION = 324 \ No newline at end of file diff --git a/ryzom/client/data/gamedev/interfaces_v3/ark.lua b/ryzom/client/data/gamedev/interfaces_v3/ark.lua index e4f62fbcae..61b2418a26 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/ark.lua +++ b/ryzom/client/data/gamedev/interfaces_v3/ark.lua @@ -25,6 +25,35 @@ function print_r(arr, indentLevel) return str end +function tablelength(T) + if T == nil then + return 0 + end + local count = 0 + for _ in pairs(T) do count = count + 1 end + return count +end + +function table_compare(t1, t2) + local ty1 = type(t1) + local ty2 = type(t2) + if ty1 ~= ty2 then return false end + -- non-table types can be directly compared + if ty1 ~= 'table' and ty2 ~= 'table' then return t1 == t2 end + -- as well as tables which have the metamethod __eq + local mt = getmetatable(t1) + if not ignore_mt and mt and mt.__eq then return t1 == t2 end + + for k1, v1 in pairs(t1) do + local v2 = t2[k1] + if v2 == nil or v1 ~= v2 then return false end + end + for k2,v2 in pairs(t2) do + local v1 = t1[k2] + if v1 == nil or v2 ~= v1 then return false end + end + return true +end function openPageInWebIg(url) getUI("ui:interface:webig:content:html"):browse(url) @@ -42,7 +71,8 @@ function broadcast(text, t) end function fixUrl(url) - return url:gsub("{amp}", "&") + s, n = string.gsub(url, "{amp}", "&") + return s end function openArkScript(id, winid, extra) @@ -68,6 +98,68 @@ function getArkScript(id, selected) return url end + +-------------------------------------------------------------------------------- +--- ARK DYNE --- +-------------------------------------------------------------------------------- + +if DynE == nil then + DynE = {} + DynE.lastWinUpdate = 0 + DynE.otherMapPoints = {} +end + +function DynE:OpenStoryline(season, episode) + ArkMissionCatalog:OpenCat("storyline", "https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=8840&season="..season.."&episode="..tostring(episode+1)) + getUI("ui:interface:encyclopedia").opened = true + getUI("ui:interface:encyclopedia").active = true +end + +function DynE:SetMap(name, x, y, desc) + local link = getUI(DynEWindowId):find(name) + if link ~= nil then + link = link:find(":b") + link.onover = "lua" + link.params_over = "DynE:OpenMap("..x..","..y..")" + end +end + +function DynE:OpenMap(x, y) + local html = [[]]..tostring(i18n.get("uiMovingTargetWarning")) + runAH(nil, "enter_modal", "group=ui:interface:webig_html_modal") + local whm = getUI("ui:interface:webig_html_modal") + whm.child_resize_h=false + whm_html = getUI("ui:interface:webig_html_modal:html") + if whm_html ~= nil then + whm.w = 410 + whm.h = 150 + whm_html:renderHtml(html) + end +end + +function DynE:RunMission(script, posX, posY) + local html = getUI("ui:interface:web_transactions"):find("html") + html:browse("https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script="..script.."&command=reset_all&PosX="..posX.."&PosY="..posY.."&FlagName=Go+to".."&MissionText=Go") +end + +function DynE:OpenHelp(img) + local html = getUI("ui:interface:web_transactions"):find("html") + html:browse("https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=9600&command=reset_all&img="..img) +end + +function DynE:UpdateMapWindow() + if (nltime.getLocalTime() - DynE.lastWinUpdate) > 60000 then + local win_html = getUI("ui:interface:app2453:browser:content:html") + local map_html = getUI("ui:interface:map:content:map_content:lm_events:html") + map_html:browse("home") + if win_html ~= nil then + win_html:renderHtml(map_html.html) + end + + DynE.lastWinUpdate = nltime.getLocalTime() + end +end + -------------------------------------------------------------------------------- --- ARK MISSION CATALOG --- -------------------------------------------------------------------------------- @@ -78,6 +170,16 @@ if ArkMissionCatalog == nil then } end +function openRyward(folder, event) + folder = "f"..tostring(folder) + event = tostring(event) + if not (rykea_selected_path_B == folder and rykea_selected_path_C == event and getUI("ui:interface:encyclopedia").active == true) then + ArkMissionCatalog:OpenCat("rykea","https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=10741&command=reset_all") + end + getUI(ArkMissionCatalog.window_id..":content:htmlB"):browse("https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=10741&command=reset_all&pathB="..folder.."&pathC="..event) + getUI(ArkMissionCatalog.window_id).active = true +end + function ArkMissionCatalog:OpenWindow(urlA, urlB, dont_active) local winframe = getUI(ArkMissionCatalog.window_id) winframe.opened=true @@ -101,7 +203,7 @@ function ArkMissionCatalog:OpenCat(cat, url) local htmlA = getUI(ArkMissionCatalog.window_id..":content:htmlA") local htmlB = getUI(ArkMissionCatalog.window_id..":content:htmlB") local htmlC = getUI(ArkMissionCatalog.window_id..":content:htmlC") - if cat == "title" or cat == "academic" or cat == "rykea" or cat == "workshops" or cat == "etools" then + if cat ~= "storyline" and cat ~= "daily" and cat ~= "achv" and cat ~= "puzzle" then ArkMissionCatalog.posxB = 180 ArkMissionCatalog.widthB = 240 ArkMissionCatalog.widthC = 530 @@ -201,6 +303,151 @@ function ArkMissionCatalog:showLegacyEncyclopedia(state) end end + +function ArkMissionCatalog:setup() + debug("Define Mission Catalag url") + if ArkMissionCatalog ~= nil then + ArkMissionCatalog.posxB = 0 + end + + local urlA = "https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=8746&command=reset_all&no_html_header=1&ig=1" + getUI("ui:interface:encyclopedia:content:htmlA"):browse(urlA) + + ArkMissionCatalog:startResize() + local continent = getContinentSheet() + if continent == "newbieland.continent" then + ArkMissionCatalog:OpenCat("academic","https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=10700&command=reset_all&no_html_header=1") + else + ArkMissionCatalog:OpenCat("storyline","https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=8840&command=reset_all&no_html_header=1&show_latest=1") + end + + debug("Open ency") + getUI("ui:interface:encyclopedia").opened = true; +end + +function translateText(id, script, event, dst_lang) + framewin = getUI("ui:interface:ark_translate_lesson", false) + if framewin == nil then + createRootGroupInstance("webig_browser", "ark_translate_lesson", {h=480, w=980}) + framewin = getUI("ui:interface:ark_translate_lesson", false) + end + + framewin.opened = true + framewin.active = true + framewin.x = math.floor((getUI("ui:interface").w - framewin.w) / 2) + framewin.y = math.floor((getUI("ui:interface").h + framewin.h) / 2) + setTopWindow(framewin) + if dst_lang then + dst_lang = "&dst_lang="..dst_lang + end + framewin:find("html"):browse("https://app.ryzom.com/app_arcc/index.php?action=mTrads_Edit&event="..tostring(event).."&trad_name="..tostring(id).."&reload="..script..dst_lang) +end + + +function setupArkUrls() + debug("Setup Lm Events") + local ui = getUI("ui:interface:map:content:map_content:lm_events:html") + ui.home = "https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=8297&command=reset_all&no_html_header=1&continent="..tostring(game.currentMapContinent) + ui:browse("home") + + debug("Setup Lm Icons") + ui = getUI("ui:interface:map:content:map_content:lm_dynicons:html") + ui.home = "https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=11158&command=reset_all&no_html_header=1" + ui:browse("home") + game.updateRpItemsUrl = "https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=11488&command=reset_all" +end + + +-------------------------------------------------------------------------------- +--- ARK EDITOR --- +-------------------------------------------------------------------------------- + +function ArkSwitchAdvEdition(prefix) + if ArkSwitchAdvEditionSwitch then + ArkSwitchAdvEditionSwitch = false + getUICaller():showDiv("advEditionDiv"..prefix, false) + else + ArkSwitchAdvEditionSwitch = true + getUICaller():showDiv("advEditionDiv"..prefix, true) + end +end + +function ArkShowStageDiv(name, state) + getUICaller():showDiv(name, state) +end + +function ArkSelectRyform(curwin, id, mod) + local curwin = getUICaller().id + local e = ArkGetStageEdit(curwin):find(id..":eb") + e.input_string = mod + ArkGetStageEdit(curwin):find("send:b"):runLeftClickAction() +end + +function ArkSendForm(name) + ArkGetStageEdit(__CURRENT_WINDOW__):find(name.."__command:eb").input_string = "reset" + ArkGetStageEdit(__CURRENT_WINDOW__):find("send:b"):runLeftClickAction() +end + +function ArkGetStageEdit(curwin) + local sid = string.split(curwin, ":") + local eid = sid[#sid] + table.remove(sid, #sid) + local id = sid[1] + for i = 2, #sid do + id = id .. ":" .. sid[i] + end + return getUI(id):find(eid) +end + +function ArkFindUI(name) + local i = 0 + local ui = getUICaller() + while true do + if ui then + local found = ui:find(name) + if found ~= nil then + return found + else + ui = ui.parent + end + i = i +1 + if i >= 100 then + return nil + end + else + return nil + end + end +end + +function ArkOnSelectChanged(name) + local text = ArkRyformV5[name][getUICaller().selection+1] + ArkFindUI(name..":eb").input_string = text +end + +function ArkV5GetSelectEntity(prefix, input) + name = getTargetName() + if name == "" then + name = getTargetTitle() + end + if name ~= "" and name ~= nil then + webig:openUrlInBg("https://app.ryzom.com/app_arcc/scripts/get_bot.php?action=ark_editor&ui="..encodeURLParam(getUICaller().id).."&prefix="..tostring(prefix).."&input="..tostring(input).."&bot="..encodeURLParam(base64.encode(name))) + end +end + +function fixUrl(url) + s, n = string.gsub(url, "{amp}", "&") + return s +end + +function openUrlInBg(url) + getUI("ui:interface:web_transactions"):find("html"):browse(fixUrl(url)) +end + + +-- S2E1 STUFF -- + + if S2E1 == nil then S2E1 = {} end @@ -620,4 +867,5 @@ function S2E1:newQuake(timer) end - +-- VERSION -- +RYZOM_ARK_VERSION = 366 diff --git a/ryzom/client/data/gamedev/interfaces_v3/ark_lessons.lua b/ryzom/client/data/gamedev/interfaces_v3/ark_lessons.lua index eaf6db232a..a222e416f0 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/ark_lessons.lua +++ b/ryzom/client/data/gamedev/interfaces_v3/ark_lessons.lua @@ -1,3 +1,7 @@ +if game == nil then + game= {} +end + if ArkLessons == nil then ArkLessons = {} @@ -24,8 +28,111 @@ function ArkLessons:Callback(event, id, args) end end +game.ArkLessonUsedWindowUrl = "https://app.ryzom.com/app_arcc/index.php?action=mLesson_Run&script=" + webig.urls_to_check = {} + +function ArkOpenLesson(id, require_rpitem) + debug(require_rpitem) + if id ~= 0 and id ~= nil then + local win = getUI("ui:interface:web_transaction_lessons") + if win then + win:find("html"):browse(game.ArkLessonUsedWindowUrl..id) + else + getUI("ui:interface:web_transactions"):find("html"):browse(game.ArkLessonUsedWindowUrl..id) + end + end +end + +function ArkRevealLesson(id, i, total) + if i == game.ArkLessonRevealStep[id] then + game.ArkLessonRevealStep[id] = game.ArkLessonRevealStep[id] + 1 + game:ArkLessonCallback("step", id, i) + game:ArkRevealLessonInfos(id, i, total) + if i == total then + game:ArkAcceptLesson() + end + end +end + +function game:ArkRevealLessonInfos(id, i, total) + local ui = getUI("ui:interface:ArkLessonWin"..tostring(id)) + if ui ~= nil then + local html = ui:find("html") + html:showDiv("enabled_"..tostring(i), false) + html:showDiv("disabled_"..tostring(i), false) + html:showDiv("current_"..tostring(i), true) + if i > 1 then + if i ~= total+1 then + html:showDiv("current_"..tostring(i-1), false) + html:showDiv("enabled_"..tostring(i-1), true) + end + end + if game.ArkLessonRevealCaps and game.ArkLessonRevealCaps[id] then + if total > i then + setCap(game.ArkLessonRevealCaps[id], "p", math.floor((100*i)/total), tostring(i).." / "..tostring(total)) + else + setCap(game.ArkLessonRevealCaps[id], "p", 100, "") + end + end + end +end + + +function ArkLessonUpdateHtml(win, scriptid, title, progression, started, finished, requirement, reward) + win = getUI(win) + win = win:find("div_lesson_"..scriptid..":html") + local top = "" + if requirement ~= [[]] then + requirement = [[]]..ArkLessons.NeedRequirement..[[]] + else + requirement = "" + top = [[]] + end + + local progressionHtml = "
" + local height = "50" + if progression then + if requirement ~= "" then + height = "12" + else + height = "25" + end + pogressionHtml = ""..progression.."" + end + + local color = "AAA" + if started then + if finished then + color = "FFFFFF" + else + color = "FFDD4AFF" + end + end + + win:renderHtml([[ + + + + + + + + +
+ + ]]..top..[[ + + + + ]]..requirement..pogressionHtml..[[ +
]]..title..[[
+
]]..reward..[[
+ + ]]) +end + function ArkLessons:Show(id, w, h, content, scriptid) local ui = getUI("ui:interface:"..id) -- deleteUI(framewin) @@ -119,10 +226,6 @@ function ArkLessons:ArkRevealLessonInfos(scriptid, i, total) end end -function ArkOpenLesson(id) - WebQueue:push("https://app.ryzom.com/app_arcc/index.php?action=mLesson_Run&script="..tostring(id)) -end - function openArkLessonScript(i, script_id, url) if i == ArkLessons.RevealStep[script_id] then getUI("ui:interface:ArkLessonWin"..tostring(script_id)).active = false @@ -316,3 +419,6 @@ function webig:openWin(ui_name) end end + +-- VERSION -- +RYZOM_ARK_LESSONS_VERSION = 324 \ No newline at end of file diff --git a/ryzom/client/data/gamedev/interfaces_v3/ark_shop.lua b/ryzom/client/data/gamedev/interfaces_v3/ark_shop.lua new file mode 100644 index 0000000000..b4500860e7 --- /dev/null +++ b/ryzom/client/data/gamedev/interfaces_v3/ark_shop.lua @@ -0,0 +1,553 @@ +if arkNpcShop == nil then + arkNpcShop = {} +end + +function arkNpcShop:selectSheetItem(item, i, sheet) + for name, value in pairs(arkNpcShop.lockedSlots[item]) do + if value == item.."_"..i then + arkNpcShop.lockedSlots[item][name] = nil + end + end + + local items = arkNpcShop.all_valid_items[item][i][sheet] + arkNpcShop.player_money_per_items[item][i] = items[3] + webig:addSheet("UI:TEMP:ARK:ITEM:"..tostring(item).."_"..tostring(i), items[1], items[2], getDbProp("UI:TEMP:ARK:ITEM:"..tostring(item).."_"..tostring(i)..":QUANTITY"), nil, items[4]) + setDbProp("UI:TEMP:ARK:ITEM:"..tostring(item).."_"..tostring(i)..":SERIAL", items[5]) + arkNpcShop.lockedSlots[item][items[5]] = item.."_"..i + updateSelectedItems() + runAH(nil, "leave_modal", "group=ui:interface:webig_html_modal") +end + + +function arkNpcShop:showBuy() + getUI("ui:interface:ark_shop_buy_item"):find("ok").active=true +end + +function arkNpcShop:openSection(url) + framewin = getUI(arkNpcShop.window):find("buy"):renderHtml(arkNpcShop.PleaseWait) + getUI("ui:interface:web_transactions"):find("html"):browse(url) +end + +function arkNpcShop:updateWindow(px, py) + local stop = false + if px ~= 0 and py ~= 0 then + local x, y, z = getPlayerPos() + if (px-x)*(px-x)+(py-y)*(py-y) > 25 then + stop = true + end + + if arkNpcShop.target ~= getTargetSlot() then + stop = true + end + end + + if stop then + local w = getUI(arkNpcShop.window) + w.active = false + setOnDraw(w, "") + getUI("ui:interface:ark_shop_buy_item").active = false + arkNpcShop.player_can_buy = false + broadcast(arkNpcShop.TooFar) + end + + local diff = math.floor((nltime.getLocalTime() - arkNpcShop.lastMultipleItemsUpdate ) / 10) + if diff >= 120 then + arkNpcShop.lastMultipleItemsUpdate = nltime.getLocalTime() + if arkNpcShop.player_money_per_items ~= nil then + for item, price in pairs(arkNpcShop.player_money_per_items) do + if arkNpcShop.lastMultipleItemsIndex[item] == nil then + arkNpcShop.lastMultipleItemsIndex[item] = {} + end + for i = 1,5 do + local w = getUI(arkNpcShop.window):find("ark_npc_shop_item_"..item.."_price"..tostring(i)) + if w ~= nil and arkNpcShop.all_items[item] ~= nil and arkNpcShop.all_items[item][i] ~= nil then + if price[i] < 1 then + if arkNpcShop.lastMultipleItemsIndex[item][i] == nil then + arkNpcShop.lastMultipleItemsIndex[item][i] = 0 + end + + arkNpcShop.lastMultipleItemsIndex[item][i] = arkNpcShop.lastMultipleItemsIndex[item][i] + 1 + if arkNpcShop.lastMultipleItemsIndex[item][i] > tablelength(arkNpcShop.all_items[item][i]) then + arkNpcShop.lastMultipleItemsIndex[item][i] = 1 + end + + local multiple = arkNpcShop.lastMultipleItemsIndex[item][i] + if multiple ~= nil then + local sheet = arkNpcShop.all_items[item][i][multiple] + if sheet ~= "" then + setDbProp("UI:TEMP:ARK:ITEM:"..item.."_"..tostring(i)..":SHEET", getSheetId(sheet..".sitem")) + end + end + end + end + end + end + end + end +end + +function arkNpcShop:checkitems(db, items, quality, quality_max, id, must_be_equiped, item_i) + if arkNpcShop.lockedSlots[id] == nil then + arkNpcShop.lockedSlots[id] = {} + end + total = 0 + if arkNpcShop.all_valid_items[id] == nil then + arkNpcShop.all_valid_items[id] = {} + end + + arkNpcShop.all_valid_items[id][item_i] = {} + + local selected_item = 9999 + local last_selected = nil + + for i = 0, 499, 1 do + local sheet = getDbProp("SERVER:INVENTORY:BAG:"..tostring(i)..":SHEET") + if sheet ~= 0 then + + local name = string.lower(getSheetName(sheet)) + for item_id, item in pairs(items) do + if item == name or item..".sitem" == name then + local qual = getDbProp("SERVER:INVENTORY:BAG:"..tostring(i)..":QUALITY") + local quant = getDbProp("SERVER:INVENTORY:BAG:"..tostring(i)..":QUANTITY") + local color = getDbProp("SERVER:INVENTORY:BAG:"..tostring(i)..":USER_COLOR") + local locked = getDbProp("SERVER:INVENTORY:BAG:"..tostring(i)..":RESALE_FLAG") == 3 + + if qual >= quality and qual <= quality_max and locked == false then + valid = true + + if must_be_equiped ~= 0 then + valid = false + for j = 0, 19, 1 do + local slot = getDbProp("SERVER:INVENTORY:EQUIP:"..tostring(j)..":INDEX_IN_BAG") + if slot == i then + valid = true + end + end + end + + if valid then + local use_quant = getDbProp("UI:TEMP:ARK:ITEM:"..tostring(id).."_"..tostring(item_i)..":QUANTITY") + + if quant >= use_quant then + table.insert(arkNpcShop.all_valid_items[id][item_i], {sheet, qual, quant, color, i}) + local valid_item_i = #arkNpcShop.all_valid_items[id][item_i] + local db_id = "UI:TEMP:ARK:POPUP_ITEM_"..tostring(id).."_"..tostring(item_i).."_"..tostring(valid_item_i) + webig:deleteItem(db_id) + webig:copyItems("SERVER:INVENTORY:BAG:"..tostring(i), db_id) + setDbProp(db_id..":QUANTITY", use_quant) + + if qual < selected_item then + total = quant + selected_item = qual + if last_selected ~= nil then + arkNpcShop.lockedSlots[id][last_selected] = nil + end + last_selected = i + arkNpcShop.lockedSlots[id][i] = tostring(id).."_"..tostring(item_i) + webig:copyItems("SERVER:INVENTORY:BAG:"..tostring(i), db) + setDbProp(db..":SERIAL", i) + setDbProp(db..":QUANTITY", use_quant) + end + end + end + end + end + end + end + end + + return total +end + +function arkNpcShop:checkslot(db, slotid) + total = 0 + local index = getDbProp("SERVER:INVENTORY:EQUIP:"..tostring(slotid)..":INDEX_IN_BAG")-1 + if index ~= -1 then + local sheet = getDbProp("SERVER:INVENTORY:BAG:"..tostring(index)..":SHEET") + local qual = getDbProp("SERVER:INVENTORY:BAG:"..tostring(index)..":QUALITY") + setDbProp(db..":SHEET", sheet) + setDbProp(db..":QUALITY", qual) + return 1 + end + return 0 +end + + +function arkNpcShop:OpenSheetInfosWindow(id) + local w = getUI(arkNpcShop.window) + local x = w:find("buy") + if x == nil then + x = w + end + x = x:find("ark_npc_shop_item_"..tostring(id)) + runAH(x:find("sheet"), "open_help_auto", "") + +end + +function arkNpcShop:HideHelpWindow(id) + -- Check what help window are active + local help_active={} + for i = 0,7 do + help_active[i] = getUI("ui:interface:sheet_help"..i).active + end + + arkNpcShop:OpenSheetInfosWindow(id) + + -- Apply previous stats of help window + for i = 0,7 do + getUI("ui:interface:sheet_help"..i).active = help_active[i] + end +end + +function arkNpcShop:CheckMoney() + local win = getUI("ui:interface:ark_shop_buy_item") + local value = tonumber(win:find("edit"):find("eb").input_string) + if value == nil or value == 0 then + value = 1 + end + + if arkNpcShop.price == -1 then + arkNpcShop.max_quantity = 1 + end + + if arkNpcShop.max_quantity ~= 0 and value > arkNpcShop.max_quantity then + win:find("edit"):find("eb").input_string = arkNpcShop.max_quantity + value = arkNpcShop.max_quantity + end + + + local total = 9999999999 + if arkNpcShop.price == -1 then + total = getDbProp("UI:TEMP:ARK_MONEY_TOTAL") + else + total = math.floor(arkNpcShop.price*value) + end + + if total > arkNpcShop.player_money then + win:find("ok").hardtext="uiNotEnoughMoney" + arkNpcShop.player_can_buy = false + else + win:find("ok").hardtext = arkNpcShop.ActionName + arkNpcShop.player_can_buy = true + end + setDbProp("UI:TEMP:ARK_MONEY_TOTAL", total) +end + +function arkNpcShop:Close() + if arkNpcShop.window == "ui:interface:ark_npc_shop" then + local framewin = getUI(arkNpcShop.window) + if framewin ~= nil then + framewin.active=false + end + else + local framewin = getUI(arkNpcShop.window) + framewin:renderHtml("please wait...") + end + + framewin = getUI("ui:interface:ark_shop_buy_item") + if framewin ~= nil then + framewin.active=false + end + +end + +function arkNpcShop:CloseShopBuyItem() + framewin = getUI("ui:interface:ark_shop_buy_item") + if framewin ~= nil then + framewin.active=false + end +end + +function arkNpcShop:timer(id, len) + local diff = math.floor((nltime.getLocalTime() - savedTime) / 50) + getUI("ui:interface:current_action").active=true + setDbProp("UI:PHRASE:ACT_BAR_LEN", math.floor(diff * (100/len))) + if diff >= len then + getUI("ui:interface:current_action").active=false + setOnDraw(getUI("ui:interface:current_action"), "") + local quantity = getUI("ui:interface:ark_shop_buy_item"):find("edit"):find("eb").input_string + if id ~= nil then + getUI("ui:interface:web_transactions"):find("html"):browse(arkNpcShop.ValidateUrl..quantity.."&item_id="..tostring(id).."&item_selection="..arkNpcShop.selectedItems[id]) + end + end +end + +function arkNpcShop:StartProgress(id, text, len) + local message = ucstring() + message:fromUtf8(text) + displaySystemInfo(message, "BC") + savedTime = nltime.getLocalTime() + getUI("ui:interface:current_action").active=true + if len > 200 then + len = 200 + end + setOnDraw(getUI("ui:interface:current_action"), "arkNpcShop:timer("..tostring(id)..", "..tostring(len)..")") +end + +function arkNpcShop:Buy(id) + local item = arkNpcShop.items[id] + local win = getUI("ui:interface:ark_shop_buy_item") + local quantity = win:find("edit"):find("eb").input_string + if arkNpcShop.player_can_buy then + local message = ucstring() + message:fromUtf8("@{F5FF}"..getUI("ui:interface:target").title..": @{FF0F}I\'m checking to see if you\'re trying to rip him off... ") + -- displaySystemInfo(message, "BC") + + if arkNpcShop.AtysPoint then + if item[8] == 0 then + arkNpcShop:StartProgress(id, arkNpcShop.AtysPointsBuyMessage, item[1]) + else + if arkNpcShop.AtysProgressBuyLen > 0 then + arkNpcShop:StartProgress("nil", arkNpcShop.AtysProgressBuyMessage, arkNpcShop.AtysProgressBuyLen) + end + getUI("ui:interface:web_transactions"):find("html"):browse(arkNpcShop.ValidateUrl..quantity.."&item_id="..id.."&item_selection="..arkNpcShop.selectedItems[id]) + end + else + if arkNpcShop.AtysProgressBuyLen > 0 then + arkNpcShop:StartProgress("nil", arkNpcShop.AtysProgressBuyMessage, arkNpcShop.AtysProgressBuyLen) + end + getUI("ui:interface:web_transactions"):find("html"):browse(arkNpcShop.ValidateUrl..quantity.."&item_id="..id.."&item_selection="..arkNpcShop.selectedItems[id]) + end + end + arkNpcShop:Close() + if arkNpcShop.window ~= "ui:interface:ark_npc_shop" then + getUI("ui:interface:encyclopedia").active=false + end +end + +function arkNpcShop:generateMp(mps) + local final = {} + local generateMps = {} + for _, mp in pairs(mps) do + if game.RawCreaturesMats ~= nil and string.sub(mp, 1, 1) == "!" then + local params = {} + for str in string.gmatch(string.sub(mp, 2), "([^!]+)") do + table.insert(params, str) + end + local sheets = params[1] + local qual = params[2] + local eco = params[3] + + if qual == "" or qual == nil then + qual = "cdef" + end + + if eco == "" or eco == nil then + eco = "dfljp" + end + + for sheet in string.gmatch(sheets, "([^|]+)") do + if string.sub(sheet, 1, 1) == "#" then + local all_sheets = game.RawCreaturesMats[string.sub(sheet, 2)] + if sheets ~= nil then + for i_sheet, f_sheet in pairs(all_sheets) do + if generateMps[i_sheet] == nil then + generateMps[i_sheet] = {} + end + table.insert(generateMps[i_sheet], f_sheet) + end + end + else + table.insert(final, sheet..c_eco..c_qual.."01") + end + end + + for i = 1, #qual do + local c_qual = string.sub(qual, i, i) + for j = 1, #eco do + local c_eco = string.sub(eco, j, j) + for _, sheets in pairs(generateMps) do + for _, f_sheet in pairs(sheets) do + table.insert(final, f_sheet..c_eco..c_qual.."01") + end + end + end + end + else + table.insert(final, mp) + end + end + + return final +end + + +function arkNpcShop:getHtmlIcon(id, item) + if string.sub(item[2], 1, 1) == "#" then + addDbProp("UI:TEMP:ARK:SELECTITEM:RESALE_FLAG", 0) + + if string.sub(item[3], 1, 1) == "!" then + webig:addSheet("UI:TEMP:ARK:SELECTITEM", getSheetId(item[7]), item[4], tonumber(string.sub(item[3], 2))) + else + webig:addSheet("UI:TEMP:ARK:SELECTITEM", getSheetId(item[7]), item[4], 1) + end + addDbProp("UI:TEMP:ARK:SELECTITEM:USER_COLOR", item[9]) + return [[
]] + else + return [[
]] + end +end + +function arkNpcShop:OpenItemWindow(id, buy) + local item = arkNpcShop.items[id] + if arkNpcShop.all_items[id] ~= nil and arkNpcShop.all_items[id].need_real_item ~= nil then + if string.sub(item[3], 1, 1) == "!" then + arkNpcShop.max_quantity = 1 + else + arkNpcShop.max_quantity = item[3] + for _, price in ipairs(arkNpcShop.player_money_per_items[id]) do + if price < arkNpcShop.max_quantity then + arkNpcShop.max_quantity = price + end + end + end + else + if string.sub(item[3], 1, 1) == "!" then + arkNpcShop.max_quantity = 1 + else + arkNpcShop.max_quantity = item[3] + end + end + + arkNpcShop:HideHelpWindow(id) + + local non_buy_window_w = 400 + + if string.sub(item[2], 1, 1) == "#" then + local item_type = getSheetFamily(item[7]) + local display_preview = item_type == "SHIELD" or item_type == "ARMOR" or item_type == "MELEE_WEAPON" or item_type == "RANGE_WEAPON" + if ui_item_preview then + ui_item_preview.active = display_preview + end + + if display_preview then + non_buy_window_w = 495 + else + -- Items who are not named items must display help window when no buy + if buy == nil and item[2] == "#sheet" then + arkNpcShop:OpenSheetInfosWindow(id) + return + end + end + end + + if buy == true then + arkNpcShop.price = item[1] + setDbProp("UI:TEMP:ARK_MONEY_PRICE", arkNpcShop.price) + setDbProp("UI:TEMP:ARK_MONEY_TOTAL", arkNpcShop.price) + if arkNpcShop.price > arkNpcShop.player_money then + arkNpcShop.player_can_buy = false + else + arkNpcShop.player_can_buy = true + end + end + + framewin = getUI("ui:interface:ark_shop_buy_item") + if framewin == nil then + createRootGroupInstance("webig_bot_chat_buy_item", "ark_shop_buy_item", {id="content", infosclick="arkNpcShop:OpenSheetInfosWindow("..id..")", onclick="arkNpcShop:Buy("..id..")"}) + framewin = getUI("ui:interface:ark_shop_buy_item") + framewin.x = math.ceil(((getUI("ui:interface").w - framewin.w))/2) + framewin.y = math.ceil(((getUI("ui:interface").h + framewin.h))/2) + end + + local ui_item_show_desc = getUI("ui:interface:ark_shop_buy_item:content:header_opened:desc") + if ui_item_show_desc then + ui_item_show_desc.active = item[2] == "#sheet" + end + + runAH(nil, "proc", "ark_shop_animate_preview_body") + + if buy == true then + local eb = framewin:find("edit"):find("eb") + eb.input_string = arkNpcShop.max_quantity + eb:setFocusOnText() + eb:setSelectionAll() + framewin:find("item_total_price"):find("icone").texture = arkNpcShop.MoneyIcon + framewin:find("item_price"):find("icone").texture = arkNpcShop.MoneyIcon + framewin:find("item_total_price"):find("tt").tooltip = arkNpcShop.Money + framewin:find("item_price"):find("tt").tooltip = arkNpcShop.Money + arkNpcShop.window_params = {-70, 305, 408} + else + arkNpcShop.window_params = {-20, 380, non_buy_window_w} + end + + framewin:find("top").active = buy == true -- active onlye if buy + framewin:find("scroll_text").y=arkNpcShop.window_params[1] + framewin:find("scroll_text").h=arkNpcShop.window_params[2] + framewin.w=arkNpcShop.window_params[3] + framewin.uc_title = getUCtf8(item[6]) + + if buy == true then + local html = "" + html = arkNpcShop:getHtmlIcon(id, item) + framewin:find("buy_sell_slot"):renderHtml(html) + if string.sub(item[5], 1 , 8) == "https://" then + framewin:find("ok").active=false + framewin:find("infos"):renderHtml(arkNpcShop.PleaseWait) + framewin:find("infos"):browse(item[5].."&rnd="..tostring(nltime.getLocalTime())) + else + framewin:find("ok").active=true + framewin:find("infos"):renderHtml("
"..item[5].."
") + end + arkNpcShop:CheckMoney() + -- framewin:setModalParentList(arkNpcShop.window) + else + html = arkNpcShop:getHtmlIcon(id, item) + framewin:find("infos"):renderHtml([[ + + + + + +
]]..html..[[]]..item[5]..[[
+ ]]) + end + + framewin:find("desc").params_l = "arkNpcShop:OpenSheetInfosWindow("..id..")" + framewin:find("ok").params_l = "arkNpcShop:Buy("..id..")" + framewin.opened=true + framewin.active=true +end + +function arkNpcShop:selectSheet(item, id) + html = "" + items = arkNpcShop.all_valid_items[item][id] + for i=1,#items do + if arkNpcShop.lockedSlots[item][items[i][5]] == nil then + local params = "arkNpcShop:selectSheetItem("..tostring(item)..","..tostring(id)..","..tostring(i)..")" + html = html..[[
 ]] + end + end + + runAH(nil, "enter_modal", "group=ui:interface:webig_html_modal") + local whm = getUI("ui:interface:webig_html_modal") + whm.child_resize_h = false + whm.w = 240 + if h == nil then + h = 120 + end + whm.h = h + whm_html = getUI("ui:interface:webig_html_modal:html") + whm_html:renderHtml(html) +end + +function arkNpcShop:updateTexts(id, ctrl, text1, text2, text3) + local shop_item = getUI(arkNpcShop.window):find("ark_npc_shop_item_"..id) + if shop_item then + if ctrl then + shop_item:find("ctrl").tooltip = getUCtf8(ctrl) + else + shop_item:find("ctrl").tooltip = "" + end + shop_item:find("text1").uc_hardtext_format = text1 + shop_item:find("text2").uc_hardtext_format = getUCtf8(text2) + if text3 then + shop_item:find("text3").uc_hardtext_format = getUCtf8(text3) + else + shop_item:find("text3").uc_hardtext_format = "" + end + end +end + +-- VERSION -- +RYZOM_ARK_SHOP_VERSION = 366 diff --git a/ryzom/client/data/gamedev/interfaces_v3/base64.lua b/ryzom/client/data/gamedev/interfaces_v3/base64.lua index 203d0aa52d..c5fa529d46 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/base64.lua +++ b/ryzom/client/data/gamedev/interfaces_v3/base64.lua @@ -199,4 +199,3 @@ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ --]] - diff --git a/ryzom/client/data/gamedev/interfaces_v3/bg_downloader.lua b/ryzom/client/data/gamedev/interfaces_v3/bg_downloader.lua index 161012d9e5..8a0789da9f 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/bg_downloader.lua +++ b/ryzom/client/data/gamedev/interfaces_v3/bg_downloader.lua @@ -178,4 +178,6 @@ function bgdownloader:inGamePatchUncompleteWarning() pg:blink(2) messageBoxWithHelp(i18n.get("uiBGD_InGamePatchIncomplete"), "ui:interface", tonumber(getDefine("case_normal"))) displaySystemInfo(i18n.get("uiBGD_InGamePatchIncompleteBC"), "BC") -end \ No newline at end of file +end +-- VERSION -- +RYZOM_BG_DOWNLOADER_VERSION = 324 \ No newline at end of file diff --git a/ryzom/client/data/gamedev/interfaces_v3/bot_chat_v4.lua b/ryzom/client/data/gamedev/interfaces_v3/bot_chat_v4.lua index f0b3ec9130..1398b33e8c 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/bot_chat_v4.lua +++ b/ryzom/client/data/gamedev/interfaces_v3/bot_chat_v4.lua @@ -62,3 +62,6 @@ function game:bcMissionsUpdate() ui = getUI('ui:interface:bot_chat_accept_mission') ui.title = title; end + +-- VERSION -- +RYZOM_BOT_CHAT_V4_VERSION = 324 \ No newline at end of file diff --git a/ryzom/client/data/gamedev/interfaces_v3/check_lua_versions.lua b/ryzom/client/data/gamedev/interfaces_v3/check_lua_versions.lua new file mode 100644 index 0000000000..9599e0a50b --- /dev/null +++ b/ryzom/client/data/gamedev/interfaces_v3/check_lua_versions.lua @@ -0,0 +1,40 @@ +local ryzom_have_all_good_version = true +if RYZOM_APPZONE_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_APPZONE_VERSION, 324, "appzone") end +if RYZOM_ARK_VERSION ~= 366 then broadcastBadLuaVersions(RYZOM_ARK_VERSION, 366, "ark") end +if RYZOM_ARK_LESSONS_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_ARK_LESSONS_VERSION, 324, "ark_lessons") end +if RYZOM_ARK_SHOP_VERSION ~= 366 then broadcastBadLuaVersions(RYZOM_ARK_SHOP_VERSION, 366, "ark_shop") end +if RYZOM_BG_DOWNLOADER_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_BG_DOWNLOADER_VERSION, 324, "bg_downloader") end +if RYZOM_BOT_CHAT_V4_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_BOT_CHAT_V4_VERSION, 324, "bot_chat_v4") end +if RYZOM_COMPASS_VERSION ~= 335 then broadcastBadLuaVersions(RYZOM_COMPASS_VERSION, 335, "compass") end +if RYZOM_GAME_CONFIG_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_GAME_CONFIG_VERSION, 324, "game_config") end +if RYZOM_GAME_R2_LOADING_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_GAME_R2_LOADING_VERSION, 324, "game_r2_loading") end +if RYZOM_GUILD_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_GUILD_VERSION, 324, "guild") end +if RYZOM_HELP_VERSION ~= 335 then broadcastBadLuaVersions(RYZOM_HELP_VERSION, 335, "help") end +if RYZOM_INFO_PLAYER_VERSION ~= 335 then broadcastBadLuaVersions(RYZOM_INFO_PLAYER_VERSION, 335, "info_player") end +if RYZOM_INTERACTION_VERSION ~= 366 then broadcastBadLuaVersions(RYZOM_INTERACTION_VERSION, 366, "interaction") end +if RYZOM_INVENTORY_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_INVENTORY_VERSION, 324, "inventory") end +if RYZOM_JSON_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_JSON_VERSION, 324, "json") end +if RYZOM_MAP_VERSION ~= 366 then broadcastBadLuaVersions(RYZOM_MAP_VERSION, 366, "map") end +if RYZOM_MISC_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_MISC_VERSION, 324, "misc") end +if RYZOM_NAMES_FYROS_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_NAMES_FYROS_VERSION, 324, "names_fyros") end +if RYZOM_NAMES_MATIS_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_NAMES_MATIS_VERSION, 324, "names_matis") end +if RYZOM_NAMES_TRYKER_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_NAMES_TRYKER_VERSION, 324, "names_tryker") end +if RYZOM_NAMES_ZORAI_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_NAMES_ZORAI_VERSION, 324, "names_zorai") end +if RYZOM_OUT_V2_APPEAR_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_OUT_V2_APPEAR_VERSION, 324, "out_v2_appear") end +if RYZOM_OUT_V2_SELECT_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_OUT_V2_SELECT_VERSION, 324, "out_v2_select") end +if RYZOM_OUTPOST_VERSION ~= 335 then broadcastBadLuaVersions(RYZOM_OUTPOST_VERSION, 335, "outpost") end +if RYZOM_PLAYER_VERSION ~= 366 then broadcastBadLuaVersions(RYZOM_PLAYER_VERSION, 366, "player") end +if RYZOM_PLAYER_TRADE_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_PLAYER_TRADE_VERSION, 324, "player_trade") end +if RYZOM_RAW_CREATURE_MATS_VERSION ~= 366 then broadcastBadLuaVersions(RYZOM_RAW_CREATURE_MATS_VERSION, 366, "raw_creature_mats") end +if RYZOM_RING_ACCESS_POINT_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_RING_ACCESS_POINT_VERSION, 324, "ring_access_point") end +if RYZOM_RING_ACCESS_POINT_FILTER_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_RING_ACCESS_POINT_FILTER_VERSION, 324, "ring_access_point_filter") end +if RYZOM_RING_WINDOW_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_RING_WINDOW_VERSION, 324, "ring_window") end +if RYZOM_RYZHOME_TOOLBAR_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_RYZHOME_TOOLBAR_VERSION, 324, "ryzhome_toolbar") end +if RYZOM_SCENEEDIT_VERSION ~= 328 then broadcastBadLuaVersions(RYZOM_SCENEEDIT_VERSION, 328, "sceneedit") end +if RYZOM_SEARCH_COMMAND_VERSION ~= 366 then broadcastBadLuaVersions(RYZOM_SEARCH_COMMAND_VERSION, 366, "search_command") end +if RYZOM_TASKBAR_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_TASKBAR_VERSION, 324, "taskbar") end +if RYZOM_TP_INTERFACE_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_TP_INTERFACE_VERSION, 324, "tp_interface") end +if RYZOM_WEB_QUEUE_VERSION ~= 335 then broadcastBadLuaVersions(RYZOM_WEB_QUEUE_VERSION, 335, "web_queue") end +if RYZOM_WEBBROWSER_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_WEBBROWSER_VERSION, 324, "webbrowser") end +if RYZOM_WEBIG_VERSION ~= 324 then broadcastBadLuaVersions(RYZOM_WEBIG_VERSION, 324, "webig") end +if RYZOM_WORLD_VERSION ~= 366 then broadcastBadLuaVersions(RYZOM_WORLD_VERSION, 366, "world") end diff --git a/ryzom/client/data/gamedev/interfaces_v3/compass.lua b/ryzom/client/data/gamedev/interfaces_v3/compass.lua index 414c9c137f..93ca89fd96 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/compass.lua +++ b/ryzom/client/data/gamedev/interfaces_v3/compass.lua @@ -4,6 +4,25 @@ if (game==nil) then game= {}; end +if DynE == nil then + DynE = {} + DynE.lastWinUpdate = 0 +end + +if DynE.otherMapPoint == nil then + DynE.otherMapPoints = {} +end + +function DynE:AddOtherMapPoints() + if DynE.otherMapPoints ~= nil then + for k, v in pairs(DynE.otherMapPoints) do + for _, point in pairs(v) do + addLandMark(point[1], point[2], point[3], point[4],"","","","","","") + end + end + end +end + function game:areInSilan() polygons = {{8128,-10208}, {11368,-10208}, {11392,-12392}, {8096,-12368}} @@ -48,3 +67,6 @@ function game:displayCalendar() end setOnDraw(getUI("ui:interface:compass"), "game:updateCompass()") + +-- VERSION -- +RYZOM_COMPASS_VERSION = 335 diff --git a/ryzom/client/data/gamedev/interfaces_v3/compass.xml b/ryzom/client/data/gamedev/interfaces_v3/compass.xml index 131d1e1afb..0b3c538279 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/compass.xml +++ b/ryzom/client/data/gamedev/interfaces_v3/compass.xml @@ -783,7 +783,7 @@ w="24" h="24" x="4" - y="-30"> + y="-20"> + value_from_code="getMaxGuildChestSlot()" /> + + + + + + + + + y_decal="-1" /> + + - + + y="-4" /> + y="0" /> + + - + - + - - @@ -89,7 +87,9 @@ - + + + diff --git a/ryzom/client/data/gamedev/interfaces_v3/game_r2_loading.lua b/ryzom/client/data/gamedev/interfaces_v3/game_r2_loading.lua index 33a3810d31..d698e2c4ea 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/game_r2_loading.lua +++ b/ryzom/client/data/gamedev/interfaces_v3/game_r2_loading.lua @@ -636,3 +636,6 @@ function GameR2Loading:buildNewbielandScenarioTree() tree:forceRebuild() end + +-- VERSION -- +RYZOM_GAME_R2_LOADING_VERSION = 324 \ No newline at end of file diff --git a/ryzom/client/data/gamedev/interfaces_v3/guild.lua b/ryzom/client/data/gamedev/interfaces_v3/guild.lua index 4c3bc0646c..e37e5f1862 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/guild.lua +++ b/ryzom/client/data/gamedev/interfaces_v3/guild.lua @@ -96,3 +96,6 @@ function game:guildDeactive() setDbProp('UI:VARIABLES:ISACTIVE:GUILD', 0); end + +-- VERSION -- +RYZOM_GUILD_VERSION = 324 \ No newline at end of file diff --git a/ryzom/client/data/gamedev/interfaces_v3/guild.xml b/ryzom/client/data/gamedev/interfaces_v3/guild.xml index df80a7f4cd..fa18c420ed 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/guild.xml +++ b/ryzom/client/data/gamedev/interfaces_v3/guild.xml @@ -867,9 +867,10 @@ posref="TL TL" group_onclick_r="active_menu" group_params_r="menu=ui:interface:base_menu_with_color"> - @@ -883,6 +884,7 @@ h="-8" inv_branch="%guild_inv_dbentry" inv_branch_nb="%max_guild_invslot" + start_item="0" inv_type="INV_GUILD" /> + + + + + + + + + + + + + + + + + + diff --git a/ryzom/client/data/gamedev/interfaces_v3/info_player.lua b/ryzom/client/data/gamedev/interfaces_v3/info_player.lua index 38ceec1972..f1c9272935 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/info_player.lua +++ b/ryzom/client/data/gamedev/interfaces_v3/info_player.lua @@ -16,7 +16,7 @@ game.PrevSessionMission = - 1 game.InGameDbInitialized = false game.WebMissionLastDesc = {} -game.ArkLessonUsedWindowUrl = "https://app.ryzom.com/app_arcc/index.php?action=mLesson_Run&script=" + ------------------------------------------------------------------------------------------------------------ -- CAP ------------------------------------------------------------------------------------------------------------ @@ -368,12 +368,20 @@ end function game:onDbChangeAppPage() if getDbProp("UI:VARIABLES:CURRENT_SERVER_TICK") > self.NpcWebPage.Timeout then local npcName = getTargetName() - local message = ucstring() - - local text = game:getOpenAppPageMessage() - message:fromUtf8(text) - displaySystemInfo(message, "AMB") + local text = "" + if game.appNpcMessages[npcName] ~= nil then + text = game.appNpcMessages[npcName] + else + text = game:getOpenAppPageMessage() + end + if text == "" then + text = "w_magic_sep2.tga|" + else + text = findReplaceAll(text, "%s", npcName) + end + message:fromUtf8(game:parseLangText(text)) + displaySystemInfo(message, "ZON") removeOnDbChange(getUI("ui:interface:npc_web_browser"),"@UI:VARIABLES:CURRENT_SERVER_TICK") end end @@ -1579,103 +1587,6 @@ function game:setNextUrl(url) game.CapNextUrl = url end -function ArkOpenLesson(id) - if id ~= 0 and id ~= nil then - local win = getUI("ui:interface:web_transaction_lessons") - if win then - win:find("html"):browse(game.ArkLessonUsedWindowUrl..id) - else - getUI("ui:interface:web_transactions"):find("html"):browse(game.ArkLessonUsedWindowUrl..id) - end - end -end - -function ArkRevealLesson(id, i, total) - if i == game.ArkLessonRevealStep[id] then - game.ArkLessonRevealStep[id] = game.ArkLessonRevealStep[id] + 1 - game:ArkLessonCallback("step", id, i) - game:ArkRevealLessonInfos(id, i, total) - if i == total then - game:ArkAcceptLesson() - end - end -end - -function game:ArkRevealLessonInfos(id, i, total) - local ui = getUI("ui:interface:ArkLessonWin"..tostring(id)) - if ui ~= nil then - local html = ui:find("html") - html:showDiv("enabled_"..tostring(i), false) - html:showDiv("disabled_"..tostring(i), false) - html:showDiv("current_"..tostring(i), true) - if i > 1 then - if i ~= total+1 then - html:showDiv("current_"..tostring(i-1), false) - html:showDiv("enabled_"..tostring(i-1), true) - end - end - if game.ArkLessonRevealCaps and game.ArkLessonRevealCaps[id] then - if total > i then - setCap(game.ArkLessonRevealCaps[id], "p", math.floor((100*i)/total), tostring(i).." / "..tostring(total)) - else - setCap(game.ArkLessonRevealCaps[id], "p", 100, "") - end - end - end -end - - -function ArkLessonUpdateHtml(win, scriptid, title, progression, started, finished, requirement, reward) - win = getUI(win) - win = win:find("div_lesson_"..scriptid..":html") - if requirement ~= [[]] then - requirement = game.ArkLessonNeedRequirement - else - requirement = "" - end - - local progressionHtml = "
" - local height = "50" - if progression then - height = "12" - pogressionHtml = ""..progression.."" - end - - local color = "AAA" - if started then - if finished then - color = "FFFFFF" - else - color = "FFDD4AFF" - end - end - - win:renderHtml([[ - - - - - - - - -
- - - - - - - - ]]..pogressionHtml..[[ -
]]..title..[[
]]..requirement..[[
-
]]..reward..[[
- - ]]) -end - - - function setCap(id, element, a, b) if element == nil then game.CapId = id @@ -1714,7 +1625,7 @@ end function game:openMissionsCatalog() - -- Setup this function in webig + getUI("ui:interface:web_transactions"):find("html"):browse("https://app.ryzom.com/app_arcc/index.php?action=mScript_Run&script=8747&command=reset_all") end @@ -1876,6 +1787,12 @@ function game:onInGameDbInitialized() --getUI("ui:interface:db_loading").active=false game.InGameDbInitialized = true debug("IG DB initialized") + -- Add waiters to guild chests + for i=0, 19 do + addOnDbChange(getUI("ui:interface:inv_guild"), "@SERVER:GUILD:CHEST:"..tostring(i)..":NAME", "updateChestList()") + end + addOnDbChange(getUI("ui:interface:inv_guild"), "@SERVER:GUILD:CHEST:0:BULK_MAX", "updateChestList(true)") + -- if the journal is opened, force an update for the fixed entry text -- (says if we're in start island, paying account ...) need DB flags like -- IS_NEWBIE & IS_TRIAL to be received @@ -2267,6 +2184,7 @@ function game:setInfoPlayerCharacterRace() end function game:arkTitlesAddClassics() + local current_title = getUI("ui:interface:player:header_opened:player_title").uc_hardtext runAH(nil, "title_init_combobox", "") local cb = getUI("ui:interface:info_player_skills:content:webinfos:title:player_title") local ui = getUI("ui:interface:encyclopedia:content:htmlC") @@ -2278,7 +2196,12 @@ function game:arkTitlesAddClassics() end table.sort(titles) for i,title in ipairs(titles) do - html = html .. [[
]] end @@ -2286,3 +2209,7 @@ function game:arkTitlesAddClassics() ui:renderHtml(html) end + + +-- VERSION -- +RYZOM_INFO_PLAYER_VERSION = 335 diff --git a/ryzom/client/data/gamedev/interfaces_v3/info_player.xml b/ryzom/client/data/gamedev/interfaces_v3/info_player.xml index 0b5af31f3e..b5036babf0 100644 --- a/ryzom/client/data/gamedev/interfaces_v3/info_player.xml +++ b/ryzom/client/data/gamedev/interfaces_v3/info_player.xml @@ -847,13 +847,13 @@
-