From e09340810953e734c3cbad122de8aafa35dc5305 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 30 Jul 2022 13:19:35 +0200 Subject: [PATCH] Add refresh texture button to profile picture popup view --- indra/newview/llfloaterprofiletexture.cpp | 20 ++++++++++++++-- indra/newview/llfloaterprofiletexture.h | 3 +++ .../xui/en/floater_profile_texture.xml | 23 +++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloaterprofiletexture.cpp b/indra/newview/llfloaterprofiletexture.cpp index bf1f56a6d1..56d9c00267 100644 --- a/indra/newview/llfloaterprofiletexture.cpp +++ b/indra/newview/llfloaterprofiletexture.cpp @@ -36,6 +36,7 @@ #include "lltextureview.h" #include "llviewertexture.h" #include "llviewertexturelist.h" +#include "llviewermenu.h" @@ -68,6 +69,9 @@ BOOL LLFloaterProfileTexture::postBuild() mCloseButton = getChild("close_btn"); mCloseButton->setCommitCallback([this](LLUICtrl*, void*) { closeFloater(); }, nullptr); + // Add refresh function + getChild("btn_refresh")->setCommitCallback([this](LLUICtrl*, void*) { refresh(); }, nullptr); + return TRUE; } @@ -174,8 +178,12 @@ void LLFloaterProfileTexture::loadAsset(const LLUUID &image_id) mProfileIcon->setValue(image_id); mImageID = image_id; - mImage = LLViewerTextureManager::getFetchedTexture(mImageID, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); - mImageOldBoostLevel = mImage->getBoostLevel(); + // Loading speed up fix + //mImage = LLViewerTextureManager::getFetchedTexture(mImageID, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + //mImageOldBoostLevel = mImage->getBoostLevel(); + mImage = LLViewerTextureManager::getFetchedTexture(mImageID, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_PREVIEW, LLViewerTexture::LOD_TEXTURE); + mImageOldBoostLevel = LLGLTexture::BOOST_NONE; + // if ((mImage->getFullWidth() * mImage->getFullHeight()) == 0) { @@ -221,3 +229,11 @@ void LLFloaterProfileTexture::onTextureLoaded( delete handle; } } + +// Add refresh function +void LLFloaterProfileTexture::refresh() +{ + destroy_texture(mImageID); + mImage->forceToRefetchTexture(); +} +// diff --git a/indra/newview/llfloaterprofiletexture.h b/indra/newview/llfloaterprofiletexture.h index 66a61213dd..0faa22c99e 100644 --- a/indra/newview/llfloaterprofiletexture.h +++ b/indra/newview/llfloaterprofiletexture.h @@ -46,6 +46,9 @@ public: void resetAsset(); void loadAsset(const LLUUID &image_id); + // Add refresh function + void refresh(); + static void onTextureLoaded( BOOL success, diff --git a/indra/newview/skins/default/xui/en/floater_profile_texture.xml b/indra/newview/skins/default/xui/en/floater_profile_texture.xml index 3b351a3325..603d8e24d1 100644 --- a/indra/newview/skins/default/xui/en/floater_profile_texture.xml +++ b/indra/newview/skins/default/xui/en/floater_profile_texture.xml @@ -52,6 +52,22 @@ orientation="horizontal" layout="topleft" animate="false"> + +