summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2008-05-19 17:02:33 +0000
committerDon Kjer <don@lindenlab.com>2008-05-19 17:02:33 +0000
commit38558960978a0741dd9c79c4c7a108b8a1f99eff (patch)
treeb7221183a7c91c1097a78cf5875197431852b0b8 /indra/newview/llselectmgr.cpp
parente77de5d685ae441f72920f0e04d9887ee958745a (diff)
EFFECTIVE MERGES:
svn merge -r 79616:82632 svn+ssh://svn/svn/linden/branches/maintenance/maintenance-7 into release svn merge -r 83211:87215 svn+ssh://svn/svn/linden/branches/php-framework-3 into release ACTUAL MERGE: svn merge -r 87631:87698 svn+ssh://svn/svn/linden/qa/combo-merge-maintenance-7-php-framework-3 into release dataserver-is-deprecated
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r--indra/newview/llselectmgr.cpp52
1 files changed, 38 insertions, 14 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 9d7f183807..103f350b0a 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -2823,27 +2823,53 @@ void LLSelectMgr::selectForceDelete()
SEND_ONLY_ROOTS);
}
-
-// returns TRUE if anything is for sale. calculates the total price
-// and stores that value in price.
-BOOL LLSelectMgr::selectIsForSale(S32& price)
+void LLSelectMgr::selectGetAggregateSaleInfo(U32 &num_for_sale,
+ BOOL &is_for_sale_mixed,
+ BOOL &is_sale_price_mixed,
+ S32 &total_sale_price,
+ S32 &individual_sale_price)
{
- BOOL any_for_sale = FALSE;
- price = 0;
+ num_for_sale = 0;
+ is_for_sale_mixed = FALSE;
+ is_sale_price_mixed = FALSE;
+ total_sale_price = 0;
+ individual_sale_price = 0;
+
+ // Empty set.
+ if (getSelection()->root_begin() == getSelection()->root_end())
+ return;
+
+ LLSelectNode *node = *(getSelection()->root_begin());
+ const BOOL first_node_for_sale = node->mSaleInfo.isForSale();
+ const S32 first_node_sale_price = node->mSaleInfo.getSalePrice();
+
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
iter != getSelection()->root_end(); iter++)
{
LLSelectNode* node = *iter;
- if (node->mSaleInfo.isForSale())
+ const BOOL node_for_sale = node->mSaleInfo.isForSale();
+ const S32 node_sale_price = node->mSaleInfo.getSalePrice();
+
+ // Set mixed if the fields don't match the first node's fields.
+ if (node_for_sale != first_node_for_sale)
+ is_for_sale_mixed = TRUE;
+ if (node_sale_price != first_node_sale_price)
+ is_sale_price_mixed = TRUE;
+
+ if (node_for_sale)
{
- price += node->mSaleInfo.getSalePrice();
- any_for_sale = TRUE;
+ total_sale_price += node_sale_price;
+ num_for_sale ++;
}
}
-
- return any_for_sale;
-
+
+ individual_sale_price = first_node_sale_price;
+ if (is_for_sale_mixed)
+ {
+ is_sale_price_mixed = TRUE;
+ individual_sale_price = 0;
+ }
}
// returns TRUE if all nodes are valid. method also stores an
@@ -3499,8 +3525,6 @@ void LLSelectMgr::selectionSetObjectCategory(const LLCategory& category)
void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info)
{
- // Only one sale info at a time for now
- if(mSelectedObjects->getRootObjectCount() != 1) return;
sendListToRegions("ObjectSaleInfo",
packAgentAndSessionID,
packObjectSaleInfo,