summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-10-08 10:59:33 +0800
committerGitHub <noreply@github.com>2024-10-08 10:59:33 +0800
commita854c4413e07e42ee0db1b0567503372a752e2df (patch)
tree91e7c40e59c76119bf897b779c3ace3494cb1712
parent93f5747aaacb4109eece1165dd76a5a5f01e0e77 (diff)
parent9a002d32550f4fa5754802e54e323f13404f0377 (diff)
Merge pull request #14 from gwigz/refresh-attachments
Port Firestorm/Catznip refresh attachments feature
-rw-r--r--indra/newview/llattachmentsmgr.cpp25
-rw-r--r--indra/newview/llattachmentsmgr.h3
-rw-r--r--indra/newview/llviewermenu.cpp13
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml7
4 files changed, 48 insertions, 0 deletions
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<LLUUID,LLTimer>
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
@@ -493,6 +493,13 @@
function="Avatar.ResetSelfSkeletonAndAnimations" />
</menu_item_call>
<menu_item_call
+ label="Refresh attachments"
+ name="Refresh attachments"
+ shortcut="alt|shift|R">
+ <menu_item_call.on_click
+ function="Advanced.RefreshAttachments" />
+ </menu_item_call>
+ <menu_item_call
label="Attachment scripts..."
name="MyScripts">
<menu_item_call.on_click