From a9692c233e4e4a910e6a01f06a6ce3641af5735d Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 10 Oct 2014 09:20:42 +0300 Subject: MAINT-3202 FIXED Cancel of selected colour in "Colour picker" floater does not return colour icon to previous condition --- indra/newview/llselectmgr.cpp | 73 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index eb3a4c37d9..2a0a2f31be 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1766,6 +1766,40 @@ void LLSelectMgr::selectionRevertColors() getSelection()->applyToObjects(&sendfunc); } +void LLSelectMgr::selectionRevertShinyColors() +{ + struct f : public LLSelectedTEFunctor + { + LLObjectSelectionHandle mSelectedObjects; + f(LLObjectSelectionHandle sel) : mSelectedObjects(sel) {} + bool apply(LLViewerObject* object, S32 te) + { + if (object->permModify()) + { + LLSelectNode* nodep = mSelectedObjects->findNode(object); + if (nodep && te < (S32)nodep->mSavedShinyColors.size()) + { + LLColor4 color = nodep->mSavedShinyColors[te]; + // update viewer side color in anticipation of update from simulator + LLMaterialPtr old_mat = object->getTE(te)->getMaterialParams(); + if (!old_mat.isNull()) + { + LLMaterialPtr new_mat = gFloaterTools->getPanelFace()->createDefaultMaterial(old_mat); + new_mat->setSpecularLightColor(color); + object->getTE(te)->setMaterialParams(new_mat); + LLMaterialMgr::getInstance()->put(object->getID(), te, *new_mat); + } + } + } + return true; + } + } setfunc(mSelectedObjects); + getSelection()->applyToTEs(&setfunc); + + LLSelectMgrSendFunctor sendfunc; + getSelection()->applyToObjects(&sendfunc); +} + BOOL LLSelectMgr::selectionRevertTextures() { struct f : public LLSelectedTEFunctor @@ -4501,6 +4535,19 @@ void LLSelectMgr::saveSelectedObjectColors() getSelection()->applyToNodes(&func); } +void LLSelectMgr::saveSelectedShinyColors() +{ + struct f : public LLSelectedNodeFunctor + { + virtual bool apply(LLSelectNode* node) + { + node->saveShinyColors(); + return true; + } + } func; + getSelection()->applyToNodes(&func); +} + void LLSelectMgr::saveSelectedObjectTextures() { // invalidate current selection so we update saved textures @@ -5752,6 +5799,7 @@ LLSelectNode::LLSelectNode(LLViewerObject* object, BOOL glow) mCreationDate(0) { saveColors(); + saveShinyColors(); } LLSelectNode::LLSelectNode(const LLSelectNode& nodep) @@ -5797,6 +5845,11 @@ LLSelectNode::LLSelectNode(const LLSelectNode& nodep) { mSavedColors.push_back(*color_iter); } + mSavedShinyColors.clear(); + for (color_iter = nodep.mSavedShinyColors.begin(); color_iter != nodep.mSavedShinyColors.end(); ++color_iter) + { + mSavedShinyColors.push_back(*color_iter); + } saveTextures(nodep.mSavedTextures); } @@ -5880,6 +5933,26 @@ void LLSelectNode::saveColors() } } +void LLSelectNode::saveShinyColors() +{ + if (mObject.notNull()) + { + mSavedShinyColors.clear(); + for (S32 i = 0; i < mObject->getNumTEs(); i++) + { + const LLMaterialPtr mat = mObject->getTE(i)->getMaterialParams(); + if (!mat.isNull()) + { + mSavedShinyColors.push_back(mat->getSpecularLightColor()); + } + else + { + mSavedShinyColors.push_back(LLColor4::white); + } + } + } +} + void LLSelectNode::saveTextures(const uuid_vec_t& textures) { if (mObject.notNull()) -- cgit v1.2.3 From f0db860b8a08e076814f4a3586cdef7ead8acb9c Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 18 Nov 2014 17:22:02 +0200 Subject: MAINT-1789 FIXED Object inspector doesn't show any information about object if user uses Select Only My Objects option --- indra/newview/llselectmgr.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 2a0a2f31be..9d088d02f8 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -368,7 +368,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectOnly(LLViewerObject* object, S3 //----------------------------------------------------------------------------- // Select the object, parents and children. //----------------------------------------------------------------------------- -LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, BOOL add_to_end) +LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, BOOL add_to_end, BOOL ignore_select_owned) { llassert( obj ); @@ -385,7 +385,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, return NULL; } - if (!canSelectObject(obj)) + if (!canSelectObject(obj,ignore_select_owned)) { //make_ui_sound("UISndInvalidOp"); return NULL; @@ -6771,29 +6771,32 @@ void LLSelectMgr::validateSelection() getSelection()->applyToObjects(&func); } -BOOL LLSelectMgr::canSelectObject(LLViewerObject* object) +BOOL LLSelectMgr::canSelectObject(LLViewerObject* object, BOOL ignore_select_owned) { // Never select dead objects if (!object || object->isDead()) { return FALSE; } - + if (mForceSelection) { return TRUE; } - if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !object->permYouOwner()) || - (gSavedSettings.getBOOL("SelectMovableOnly") && (!object->permMove() || object->isPermanentEnforced()))) + if(!ignore_select_owned) { - // only select my own objects - return FALSE; + if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !object->permYouOwner()) || + (gSavedSettings.getBOOL("SelectMovableOnly") && (!object->permMove() || object->isPermanentEnforced()))) + { + // only select my own objects + return FALSE; + } } // Can't select orphans if (object->isOrphaned()) return FALSE; - + // Can't select avatars if (object->isAvatar()) return FALSE; -- cgit v1.2.3 From 1cea21dcb9071bd68b8e36e73c96bd74a8ac6dcd Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 1 Dec 2014 19:31:09 +0200 Subject: MAINT-4700 FIXED Viewer cursor defaults to 'grab' mode when clicking on child prim of linkset that was recently physical and sat-upon --- indra/newview/llselectmgr.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9d088d02f8..b13c30b6d4 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -4643,11 +4643,18 @@ struct LLSelectMgrApplyFlags : public LLSelectedObjectFunctor BOOL mState; virtual bool apply(LLViewerObject* object) { - if ( object->permModify() && // preemptive permissions check - object->isRoot()) // don't send for child objects + if ( object->permModify()) { - object->setFlags( mFlags, mState); - } + if (object->isRoot()) // don't send for child objects + { + object->setFlags( mFlags, mState); + } + else if (FLAGS_WORLD & mFlags && ((LLViewerObject*)object->getRoot())->isSelected()) + { + // FLAGS_WORLD are shared by all items in linkset + object->setFlagsWithoutUpdate(FLAGS_WORLD & mFlags, mState); + } + }; return true; } }; -- cgit v1.2.3