From 9badcd022d8074fa489b788b9ba5162b6e9291c7 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Tue, 20 Jan 2009 13:33:29 -0600 Subject: VWR-508/VWR-2199: Create "Worn Items" tab in Inventory Patch by Vadim Bigbear. --- linden/indra/newview/llfolderview.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'linden/indra/newview/llfolderview.cpp') diff --git a/linden/indra/newview/llfolderview.cpp b/linden/indra/newview/llfolderview.cpp index cb9a379..4ef52f0 100644 --- a/linden/indra/newview/llfolderview.cpp +++ b/linden/indra/newview/llfolderview.cpp @@ -4490,6 +4490,7 @@ LLInventoryFilter::LLInventoryFilter(const std::string& name) : mSubStringMatchOffset = 0; mFilterSubString.clear(); + mFilterWorn = false; mFilterGeneration = 0; mMustPassGeneration = S32_MAX; mMinRequiredGeneration = 0; @@ -4521,9 +4522,12 @@ BOOL LLInventoryFilter::check(LLFolderViewItem* item) earliest = 0; } LLFolderViewEventListener* listener = item->getListener(); + const LLUUID& item_id = listener->getUUID(); mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; BOOL passed = (listener->getNInventoryType() & mFilterOps.mFilterTypes || listener->getNInventoryType() == LLInventoryType::NIT_NONE) && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos) + && (mFilterWorn == false || gAgent.isWearingItem(item_id) || + gAgent.getAvatarObject() && gAgent.getAvatarObject()->isWearingAttachment(item_id)) && ((listener->getPermissionMask() & mFilterOps.mPermissions) == mFilterOps.mPermissions) && (listener->getCreationDate() >= earliest && listener->getCreationDate() <= mFilterOps.mMaxDate); return passed; @@ -4544,6 +4548,7 @@ BOOL LLInventoryFilter::isNotDefault() { return mFilterOps.mFilterTypes != mDefaultFilterOps.mFilterTypes || mFilterSubString.size() + || mFilterWorn || mFilterOps.mPermissions != mDefaultFilterOps.mPermissions || mFilterOps.mMinDate != mDefaultFilterOps.mMinDate || mFilterOps.mMaxDate != mDefaultFilterOps.mMaxDate @@ -4554,6 +4559,7 @@ BOOL LLInventoryFilter::isActive() { return mFilterOps.mFilterTypes != LLInventoryType::NIT_ALL || mFilterSubString.size() + || mFilterWorn || mFilterOps.mPermissions != PERM_NONE || mFilterOps.mMinDate != time_min() || mFilterOps.mMaxDate != time_max() @@ -4989,6 +4995,12 @@ std::string LLInventoryFilter::rebuildFilterText() { mFilterText += " - Since Logoff"; } + + if (getFilterWorn()) + { + mFilterText += " - Worn"; + } + return mFilterText; } -- cgit v1.1