From 1f530d987740861e203ebcd06ab94f84a7d481ee Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 30 Jun 2018 18:28:13 +0200 Subject: [PATCH] FIRE-22710: Use timer and a 0.2s delay when touching multiple objects in area search --- indra/newview/fsareasearch.cpp | 33 ++++++++++++++++++++++++++++----- indra/newview/fsareasearch.h | 2 +- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/indra/newview/fsareasearch.cpp b/indra/newview/fsareasearch.cpp index d1b0e1752e..53feb7e547 100644 --- a/indra/newview/fsareasearch.cpp +++ b/indra/newview/fsareasearch.cpp @@ -98,6 +98,30 @@ private: FSAreaSearch* mAreaSearchFloater; }; +class FSAreaSearchTouchTimer : public LLEventTimer +{ +public: + FSAreaSearchTouchTimer(const LLUUID& object_id, F32 timeout) : + LLEventTimer(timeout), + mObjectID(object_id) + { + } + + /*virtual*/ BOOL tick() + { + LLViewerObject* objectp = gObjectList.findObject(mObjectID); + if (objectp) + { + FSPanelAreaSearchList::touchObject(objectp); + } + + return TRUE; + } + +private: + LLUUID mObjectID; +}; + FSAreaSearch::FSAreaSearch(const LLSD& key) : LLFloater(key), mActive(false), @@ -1615,6 +1639,7 @@ bool FSPanelAreaSearchList::onContextMenuItemClick(const LLSD& userdata) case 'l': // blacklist { std::vector selected = mResultList->getAllSelected(); + S32 cnt = 0; for(std::vector::iterator item_it = selected.begin(); item_it != selected.end(); ++item_it) @@ -1623,11 +1648,8 @@ bool FSPanelAreaSearchList::onContextMenuItemClick(const LLSD& userdata) { case 't': // touch { - LLViewerObject* objectp = gObjectList.findObject((*item_it)->getUUID()); - if (objectp) - { - touchObject(objectp); - } + new FSAreaSearchTouchTimer((*item_it)->getUUID(), cnt * 0.2f); + cnt++; } break; case 's': // script @@ -1877,6 +1899,7 @@ bool FSPanelAreaSearchList::onContextMenuItemClick(const LLSD& userdata) return true; } +// static void FSPanelAreaSearchList::touchObject(LLViewerObject* objectp) { // *NOTE: Hope the packets arrive safely and in order or else diff --git a/indra/newview/fsareasearch.h b/indra/newview/fsareasearch.h index 98fe81808e..04f1205813 100644 --- a/indra/newview/fsareasearch.h +++ b/indra/newview/fsareasearch.h @@ -286,7 +286,7 @@ public: void setCounterText(LLStringUtil::format_map_t args); void updateScrollList(); void updateName(LLUUID id, std::string name); - void touchObject(LLViewerObject* objectp); + static void touchObject(LLViewerObject* objectp); FSScrollListCtrl* getResultList() { return mResultList; } void updateResultListColumns();