diff options
author | Don Kjer <don@lindenlab.com> | 2007-12-05 23:43:56 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2007-12-05 23:43:56 +0000 |
commit | facf67ae3226105910c983a8fa8760414bf703e9 (patch) | |
tree | b5f7cd6b79a79f769080a65b6fe2cb6b97c8b6fb /indra/newview/llviewermenu.cpp | |
parent | 45057e8881c3166c7c0ef545c02bc177922af6fb (diff) |
EFFECTIVE MERGE: svn merge -r 71520:73420 svn+ssh://svn/svn/linden/branches/maintenance-3 into release
ACTUAL MERGE: svn merge -r 75074:75114 svn+ssh://svn/svn/linden/qa/maintenance-3-merge-75067 into release
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index b5f53e5d88..7aa25266fe 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6053,12 +6053,39 @@ BOOL object_selected_and_point_valid(void *user_data) (selection->getFirstRootObject()->getNVPair("AssetContainer") == NULL); } + +BOOL object_is_wearable() +{ + if (!object_selected_and_point_valid(NULL)) + { + return FALSE; + } + if (sitting_on_selection()) + { + return FALSE; + } + LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + for (LLObjectSelection::valid_root_iterator iter = gSelectMgr->getSelection()->valid_root_begin(); + iter != gSelectMgr->getSelection()->valid_root_end(); iter++) + { + LLSelectNode* node = *iter; + if (node->mPermissions->getOwner() == gAgent.getID()) + { + return TRUE; + } + } + return FALSE; +} + + // Also for seeing if object can be attached. See above. class LLObjectEnableWear : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - return object_selected_and_point_valid(NULL); + bool is_wearable = object_selected_and_point_valid(NULL); + gMenuHolder->findControl(userdata["control"].asString())->setValue(is_wearable); + return TRUE; } }; |