summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2017-03-13 20:48:44 +0200
committerandreykproductengine <akleshchev@productengine.com>2017-03-13 20:48:44 +0200
commit84dd347ae782b5152fdb0fc3b964e88b1c9975c0 (patch)
treea71229a18ece018159a3a0e99aa67d2c1543374f
parent09869a13ee87a1373763a745103b8c530fa37f40 (diff)
MAINT-1324 Warning should appear that objects in different regions can't be linked
-rw-r--r--indra/newview/llselectmgr.cpp35
-rw-r--r--indra/newview/llselectmgr.h3
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml8
3 files changed, 46 insertions, 0 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 353c61da0c..983a7ca1ae 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -614,6 +614,12 @@ bool LLSelectMgr::linkObjects()
return true;
}
+ if (!LLSelectMgr::getInstance()->selectGetSameRegion())
+ {
+ LLNotificationsUtil::add("CannotLinkAcrossRegions");
+ return true;
+ }
+
LLSelectMgr::getInstance()->sendLink();
return true;
@@ -2778,6 +2784,35 @@ BOOL LLSelectMgr::selectGetRootsModify()
return TRUE;
}
+//-----------------------------------------------------------------------------
+// selectGetSameRegion() - return TRUE if all objects are in same region
+//-----------------------------------------------------------------------------
+BOOL LLSelectMgr::selectGetSameRegion()
+{
+ if (getSelection()->isEmpty())
+ {
+ return TRUE;
+ }
+ LLViewerObject* object = getSelection()->getFirstObject();
+ if (!object)
+ {
+ return FALSE;
+ }
+ LLViewerRegion* current_region = object->getRegion();
+
+ for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
+ iter != getSelection()->root_end(); iter++)
+ {
+ LLSelectNode* node = *iter;
+ object = node->getObject();
+ if (!node->mValid || !object || current_region != object->getRegion())
+ {
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
//-----------------------------------------------------------------------------
// selectGetNonPermanentEnforced() - return TRUE if all objects are not
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 2a893af266..7ef0032645 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -624,6 +624,9 @@ public:
BOOL selectGetRootsModify();
BOOL selectGetModify();
+ // returns TRUE if all objects are in same region
+ BOOL selectGetSameRegion();
+
// returns TRUE if is all objects are non-permanent-enforced
BOOL selectGetRootsNonPermanentEnforced();
BOOL selectGetNonPermanentEnforced();
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index a509adfcbc..bcdd182627 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -1940,6 +1940,14 @@ Please make sure none are locked, and that you own all of them.
<notification
icon="alertmodal.tga"
+ name="CannotLinkAcrossRegions"
+ type="alertmodal">
+Objects cannot be linked across region boundaries.
+ <tag>fail</tag>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
name="CannotLinkDifferentOwners"
type="alertmodal">
Unable to link because not all of the objects have the same owner.