summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llviewermenu.cpp40
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml2
2 files changed, 24 insertions, 18 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));
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 40f3e51fca..82d2277dfa 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -483,7 +483,7 @@
layout="topleft"
name="Reset Skeleton">
<menu_item_call.on_click
- function="Avatar.ResetSkeleton" />
+ function="Avatar.ResetSelfSkeleton" />
</menu_item_call>
<menu_item_call
label="Reset skeleton and animations"