From 9a002d32550f4fa5754802e54e323f13404f0377 Mon Sep 17 00:00:00 2001 From: gwigz Date: Mon, 7 Oct 2024 19:11:37 +0100 Subject: Port Firestorm/Catznip refresh attachments feature --- indra/newview/llattachmentsmgr.cpp | 25 ++++++++++++++++++++++ indra/newview/llattachmentsmgr.h | 3 +++ indra/newview/llviewermenu.cpp | 13 +++++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 7 ++++++ 4 files changed, 48 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp index deabcd9f42..0c87b60e7f 100644 --- a/indra/newview/llattachmentsmgr.cpp +++ b/indra/newview/llattachmentsmgr.cpp @@ -545,3 +545,28 @@ void LLAttachmentsMgr::spamStatusInfo() } #endif } + +// [SL:KB] - Patch: Appearance-PhantomAttach | Checked: Catznip-5.0 +void LLAttachmentsMgr::refreshAttachments() +{ + if (!isAgentAvatarValid()) + return; + + for (const auto& kvpAttachPt : gAgentAvatarp->mAttachmentPoints) + { + for (const LLViewerObject* pAttachObj : kvpAttachPt.second->mAttachedObjects) + { + const LLUUID& idItem = pAttachObj->getAttachmentItemID(); + if ( (mAttachmentRequests.wasRequestedRecently(idItem)) || (pAttachObj->isTempAttachment()) ) + continue; + + AttachmentsInfo attachment; + attachment.mItemID = idItem; + attachment.mAttachmentPt = kvpAttachPt.first; + attachment.mAdd = true; + mPendingAttachments.push_back(attachment); + mAttachmentRequests.addTime(idItem); + } + } +} +// [/SL:KB] diff --git a/indra/newview/llattachmentsmgr.h b/indra/newview/llattachmentsmgr.h index 2428acfb38..de36253339 100644 --- a/indra/newview/llattachmentsmgr.h +++ b/indra/newview/llattachmentsmgr.h @@ -87,6 +87,9 @@ public: bool isAttachmentStateComplete() const; + // [SL:KB] - Patch: Appearance-PhantomAttach | Checked: Catznip-5.0 + void refreshAttachments(); + private: class LLItemRequestTimes: public std::map diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5a1228768c..58019d2e87 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -52,6 +52,9 @@ #include "llagentui.h" #include "llagentwearables.h" #include "llagentpilot.h" +// [SL:KB] - Patch: Appearance-PhantomAttach | Checked: Catznip-5.0 +#include "llattachmentsmgr.h" +// [/SL:KB] #include "llcompilequeue.h" #include "llconsole.h" #include "lldebugview.h" @@ -2188,6 +2191,13 @@ class LLAdvancedRebakeTextures : public view_listener_t }; +// [SL:KB] - Patch: Appearance-PhantomAttach | Checked: Catznip-5.0 +void handle_refresh_attachments() +{ + LLAttachmentsMgr::instance().refreshAttachments(); +} +// [/SL:KB] + #if 1 //ndef LL_RELEASE_FOR_DOWNLOAD /////////////////////////// // DEBUG AVATAR TEXTURES // @@ -10026,6 +10036,9 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedCheckDebugCharacterVis(), "Advanced.CheckDebugCharacterVis"); view_listener_t::addMenu(new LLAdvancedDumpAttachments(), "Advanced.DumpAttachments"); view_listener_t::addMenu(new LLAdvancedRebakeTextures(), "Advanced.RebakeTextures"); +// [SL:KB] - Patch: Appearance-PhantomAttach | Checked: Catznip-5.0 + commit.add("Advanced.RefreshAttachments", boost::bind(&handle_refresh_attachments)); +// [/SL:KB] view_listener_t::addMenu(new LLAdvancedDebugAvatarTextures(), "Advanced.DebugAvatarTextures"); view_listener_t::addMenu(new LLAdvancedDumpAvatarLocalTextures(), "Advanced.DumpAvatarLocalTextures"); // Advanced > Network diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 50a8d248f8..911f61f346 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -492,6 +492,13 @@ + + + -- cgit v1.2.3