diff options
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rwxr-xr-x | indra/newview/llselectmgr.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index fdc95c7784..fa7674f772 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -619,10 +619,41 @@ bool LLSelectMgr::linkObjects() bool LLSelectMgr::unlinkObjects() { + LLViewerObject *object = mSelectedObjects->getFirstRootObject(); + if (!object) return false; + + S32 min_objects_for_confirm = gSavedSettings.getS32("MinObjectsForUnlinkConfirm"); + for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++) + { + object = (*iter)->getObject(); + if(object) + { + S32 objects_in_linkset = object->numChildren() + 1; + if(objects_in_linkset >= min_objects_for_confirm) + { + LLNotificationsUtil::add("ConfirmUnlink", LLSD(), LLSD(), boost::bind(&LLSelectMgr::confirmUnlinkObjects, this, _1, _2)); + return true; + } + } + } + LLSelectMgr::getInstance()->sendDelink(); return true; } +void LLSelectMgr::confirmUnlinkObjects(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + // if Cancel pressed + if (option == 1) + { + return; + } + + LLSelectMgr::getInstance()->sendDelink(); + return; +} + // in order to link, all objects must have the same owner, and the // agent must have the ability to modify all of the objects. However, // we're not answering that question with this method. The question @@ -2103,7 +2134,7 @@ void LLSelectMgr::selectionRemoveMaterial() { LL_DEBUGS("Materials") << "Removing material from object " << object->getID() << " face " << face << LL_ENDL; LLMaterialMgr::getInstance()->remove(object->getID(),face); - object->setTEMaterialParams(face, NULL); + object->setTEMaterialParams(face, NULL, FALSE); } return true; } |