diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp
index 8adfa14fb..c94b8a1ab 100644
--- a/code/nel/src/gui/group_html.cpp
+++ b/code/nel/src/gui/group_html.cpp
@@ -482,6 +482,7 @@ namespace NLGUI
if (Curls.size() < options.curlMaxConnections) {
if (!startCurlDownload(Curls.back()))
{
+ CLuaManager::getInstance().executeLuaScript("downloadedImage('"+this->_Id+"', '"+url+"', '"+dest+"')", true);
Curls.pop_back();
return;
}
@@ -778,6 +779,8 @@ namespace NLGUI
obj.LastModified = it->data->getLastModified();
CHttpCache::getInstance()->store(it->dest, obj);
+
+ CLuaManager::getInstance().executeLuaScript("downloadedImage('"+this->_Id+"', '"+it->url+"', '"+it->dest+"')", true);
}
}
}
@@ -812,6 +815,7 @@ namespace NLGUI
{
setImage(it->imgs[i].Image, it->dest, it->imgs[i].Type);
setImageSize(it->imgs[i].Image, it->imgs[i].Style);
+ CLuaManager::getInstance().executeLuaScript("downloadedImage('"+this->_Id+"', '"+it->url+"', '"+it->dest+"')", true);
}
}
}
@@ -4456,6 +4460,7 @@ namespace NLGUI
{
newImage->setRenderLayer(getRenderLayer()+1);
image = finalUrl;
+ CLuaManager::getInstance().executeLuaScript("downloadedImage('"+this->_Id+"', '"+image+"', '"+finalUrl+"')", true);
}
else
{
diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/webig.lua b/code/ryzom/client/data/gamedev/interfaces_v3/webig.lua
index 10c489ca4..e35973ac3 100644
--- a/code/ryzom/client/data/gamedev/interfaces_v3/webig.lua
+++ b/code/ryzom/client/data/gamedev/interfaces_v3/webig.lua
@@ -8,6 +8,25 @@ if (webig.sheetLists==nil) then
webig.sheetLists = {}
end
+if (webig.downloadedImageCallbacks==nil) then
+ webig.downloadedImageCallbacks = {}
+end
+
+function webig:addDownloadedImageCallbacks(ui, nbr_images, callback)
+ webig.downloadedImageCallbacks[ui] = {nbr_images, callback}
+end
+
+function downloadedImage(ui, src, dest)
+ if webig.downloadedImageCallbacks[ui] ~= nil then
+ local cb = webig.downloadedImageCallbacks[ui]
+ cb[1] = cb[1] - 1
+ if cb[1] <= 0 then
+ local c = cb[2]
+ _G[c]()
+ webig.downloadedImageCallbacks[ui] = nil
+ end
+ end
+end
function webig:addSheet(dst, sheet, quality, quantity, worned, user_color, rm_class_type, rm_faber_stat_type)
if quality == nil then quality=0 end
diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp
index 3eb1c2af5..c9485c2d0 100644
--- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp
+++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp
@@ -499,6 +499,7 @@ void CLuaIHMRyzom::RegisterRyzomFunctions(NLGUI::CLuaState &ls)
[
LUABIND_FUNC(getDbProp),
LUABIND_FUNC(getDbProp64),
+ LUABIND_FUNC(md5),
LUABIND_FUNC(setDbProp),
LUABIND_FUNC(addDbProp),
LUABIND_FUNC(delDbProp),
@@ -2593,6 +2594,11 @@ sint64 CLuaIHMRyzom::getDbProp64(const std::string &dbProp)
}
}
+string CLuaIHMRyzom::md5(const std::string &text)
+{
+ return getMD5((uint8*)text.c_str(), text.size()).toString();
+}
+
void CLuaIHMRyzom::setDbProp(const std::string &dbProp, sint32 value)
{
diff --git a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h
index 49487b3fe..ee954f688 100644
--- a/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h
+++ b/code/ryzom/client/src/interface_v3/lua_ihm_ryzom.h
@@ -121,6 +121,7 @@ private:
static sint32 getDbProp(const std::string &dbProp); // return 0 if not found.
static sint64 getDbProp64(const std::string &dbProp); // return 0 if not found.
+ static std::string md5(const std::string &text);
static void setDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is not created if not present.
static void addDbProp(const std::string &dbProp, sint32 value); // Nb: the db prop is created if not present.
static void delDbProp(const std::string &dbProp);