summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterobjectweights.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterobjectweights.cpp')
-rw-r--r--indra/newview/llfloaterobjectweights.cpp36
1 files changed, 31 insertions, 5 deletions
diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp
index 80a753757e..d39a93991f 100644
--- a/indra/newview/llfloaterobjectweights.cpp
+++ b/indra/newview/llfloaterobjectweights.cpp
@@ -34,6 +34,15 @@
#include "llselectmgr.h"
#include "llviewerparcelmgr.h"
+#include "llviewerregion.h"
+
+struct LLCrossParcelFunctor : public LLSelectedObjectFunctor
+{
+ /*virtual*/ bool apply(LLViewerObject* obj)
+ {
+ return obj->crossesParcelBounds();
+ }
+};
/**
* Class LLLandImpactsObserver
@@ -159,13 +168,30 @@ void LLFloaterObjectWeights::refresh()
mSelectedObjects->setText(llformat("%d", link_count));
mSelectedPrims->setText(llformat("%d", prim_count));
- LLViewerObject* selected_object = mObjectSelection->getPrimaryObject();
- if (selected_object)
+ LLCrossParcelFunctor func;
+ if (LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, true))
{
- // Select a parcel at the currently selected object's position.
- LLViewerParcelMgr::getInstance()->selectParcelAt(selected_object->getPositionGlobal());
+ // Some of the selected objects cross parcel bounds.
+ // We don't display land impacts in this case.
+ const std::string text = getString("nothing_selected");
+
+ mSelectedOnLand->setText(text);
+ mRezzedOnLand->setText(text);
+ mRemainingCapacity->setText(text);
+ mTotalCapacity->setText(text);
- toggleLandImpactsLoadingIndicators(true);
+ toggleLandImpactsLoadingIndicators(false);
+ }
+ else
+ {
+ LLViewerObject* selected_object = mObjectSelection->getFirstObject();
+ if (selected_object)
+ {
+ // Select a parcel at the currently selected object's position.
+ LLViewerParcelMgr::getInstance()->selectParcelAt(selected_object->getPositionGlobal());
+
+ toggleLandImpactsLoadingIndicators(true);
+ }
}
}
}