Improve enable_object_edit() so that the Edit pie menu entry doesn't take forever to enable
Bypasses pointless call to LLSelectMgr::getInstance()->selectGetAllValidAndObjectsFound() Cleans up RLVa patch to read more clearly (this change is better viewed without spaces)
This commit is contained in:
@@ -2338,18 +2338,19 @@ bool enable_object_edit()
|
|||||||
enable = LLViewerParcelMgr::getInstance()->allowAgentBuild()
|
enable = LLViewerParcelMgr::getInstance()->allowAgentBuild()
|
||||||
|| LLSelectMgr::getInstance()->getSelection()->isAttachment();
|
|| LLSelectMgr::getInstance()->getSelection()->isAttachment();
|
||||||
}
|
}
|
||||||
else if (LLSelectMgr::getInstance()->selectGetAllValidAndObjectsFound())
|
// Singu Note: The following check is wasteful, bypass it
|
||||||
|
// The following RLVa patch has been modified from its original version. It been formatted to run in the time allotted.
|
||||||
|
//else if (LLSelectMgr::getInstance()->selectGetAllValidAndObjectsFound())
|
||||||
|
// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified after RLVa-1.3.0c on 2013-05-18
|
||||||
|
else if (!rlv_handler_t::isEnabled() || (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDITOBJ)))
|
||||||
{
|
{
|
||||||
// enable = true;
|
enable = true;
|
||||||
// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c
|
}
|
||||||
bool fRlvCanEdit = (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDITOBJ));
|
else // Restrictions disallow edit, check for an exception for the selection
|
||||||
if (!fRlvCanEdit)
|
{
|
||||||
{
|
LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection();
|
||||||
LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection();
|
RlvSelectIsEditable f;
|
||||||
RlvSelectIsEditable f;
|
enable = (hSel.notNull()) && ((hSel->getFirstRootNode(&f, TRUE)) == NULL);
|
||||||
fRlvCanEdit = (hSel.notNull()) && ((hSel->getFirstRootNode(&f, TRUE)) == NULL);
|
|
||||||
}
|
|
||||||
enable = fRlvCanEdit;
|
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user