diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2024-09-03 00:55:55 +0200 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2024-09-03 02:14:59 +0200 |
commit | ee9f7ec670c4c94f871f7abed68a573b844a69a6 (patch) | |
tree | 39ab191dc2ec764c2f868730a4d8d603de1a6dc4 /indra/newview/llviewermenu.cpp | |
parent | 470f35b10937ff649b50fcacff4fe40a9c0e52de (diff) |
#2403 Reset Skeleton issues
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index e1664752e7..a32e5d23e3 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6748,17 +6748,11 @@ class LLAvatarToggleSearch : public view_listener_t } }; -class LLAvatarResetSkeleton: public view_listener_t +class LLAvatarResetSkeleton : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLVOAvatar* avatar = NULL; - LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); - if (obj) - { - avatar = obj->getAvatar(); - } - if(avatar) + if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject())) { avatar->resetSkeleton(false); } @@ -6766,12 +6760,11 @@ class LLAvatarResetSkeleton: public view_listener_t } }; -class LLAvatarEnableResetSkeleton: public view_listener_t +class LLAvatarEnableResetSkeleton : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); - if (obj && obj->getAvatar()) + if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject())) { return true; } @@ -6779,13 +6772,11 @@ class LLAvatarEnableResetSkeleton: public view_listener_t } }; - class LLAvatarResetSkeletonAndAnimations : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); - if (avatar) + if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject())) { avatar->resetSkeleton(true); } @@ -6793,12 +6784,27 @@ class LLAvatarResetSkeletonAndAnimations : public view_listener_t } }; +class LLAvatarResetSelfSkeleton : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject())) + { + avatar->resetSkeleton(false); + } + else + { + gAgentAvatarp->resetSkeleton(false); + } + return true; + } +}; + class LLAvatarResetSelfSkeletonAndAnimations : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); - if (avatar) + if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject())) { avatar->resetSkeleton(true); } @@ -6810,7 +6816,6 @@ class LLAvatarResetSelfSkeletonAndAnimations : public view_listener_t } }; - class LLAvatarAddContact : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -10106,6 +10111,7 @@ void initialize_menus() view_listener_t::addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeleton"); view_listener_t::addMenu(new LLAvatarEnableResetSkeleton(), "Avatar.EnableResetSkeleton"); view_listener_t::addMenu(new LLAvatarResetSkeletonAndAnimations(), "Avatar.ResetSkeletonAndAnimations"); + view_listener_t::addMenu(new LLAvatarResetSelfSkeleton(), "Avatar.ResetSelfSkeleton"); view_listener_t::addMenu(new LLAvatarResetSelfSkeletonAndAnimations(), "Avatar.ResetSelfSkeletonAndAnimations"); enable.add("Avatar.IsMyProfileOpen", boost::bind(&my_profile_visible)); enable.add("Avatar.IsPicksTabOpen", boost::bind(&picks_tab_visible)); |