From 30e0018d0ad60d9fc9604bf962043212f976cb37 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 8 Sep 2019 10:38:43 +0300 Subject: [PATCH] Fixed: Use empty placeholder for background images. --HG-- branch : html-improvements --- code/nel/include/nel/gui/group_html.h | 2 +- code/nel/src/gui/group_html.cpp | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index fa5ddb9b2..31330fa51 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -124,7 +124,7 @@ namespace NLGUI void endParagraph(); // add image download (used by view_bitmap.cpp to load web images) - void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage); + void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage, const std::string &placeholder = "web_del.tga"); // remove image from download list if present void removeImageDownload(CViewBase *img); std::string localImageName(const std::string &url); diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 596b663f1..2b9ed3327 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -706,7 +706,7 @@ namespace NLGUI } // Add a image download request in the multi_curl - void CGroupHTML::addImageDownload(const string &url, CViewBase *img, const CStyleParams &style, TImageType type) + void CGroupHTML::addImageDownload(const string &url, CViewBase *img, const CStyleParams &style, TImageType type, const std::string &placeholder) { std::string finalUrl; img->setModulateGlobalColor(style.GlobalColor); @@ -732,8 +732,7 @@ namespace NLGUI std::string temp = dest; if (!CFile::fileExists(temp)) { - // TODO: placeholder - temp = "web_del.tga"; + temp = placeholder; } setImage(img, temp, type); setImageSize(img, style); @@ -3483,7 +3482,7 @@ namespace NLGUI else bitmap->setSizeRef(""); - addImageDownload(bgtex, view); + addImageDownload(bgtex, view, CStyleParams(), TImageType::NormalImage, ""); } } } @@ -6590,7 +6589,7 @@ namespace NLGUI table->setTextureScale(true); string image = _Style.getStyle("background-image"); - addImageDownload(image, table); + addImageDownload(image, table, CStyleParams(), TImageType::NormalImage, ""); } table->setMarginLeft(getIndent()); @@ -6664,7 +6663,7 @@ namespace NLGUI if (_Style.hasStyle("background-image")) { string image = _Style.getStyle("background-image"); - addImageDownload(image, _Cells.back()); + addImageDownload(image, _Cells.back(), CStyleParams(), TImageType::NormalImage, ""); } if (elm.hasNonEmptyAttribute("colspan"))