diff options
author | gwigz <gwigz@users.noreply.github.com> | 2024-10-21 18:59:05 +0100 |
---|---|---|
committer | gwigz <gwigz@users.noreply.github.com> | 2024-10-21 18:59:05 +0100 |
commit | ad4212f74d4bb4493ab744b0148c37149ad95f0d (patch) | |
tree | 88e0c1c4935f9e4c410344f1680d6d81386514d3 /indra/newview | |
parent | bdd8da4c5e4a3c2d9d58b1d72eda73c9f452c825 (diff) |
Firestorm's resync animations menu option
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 30 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 8 |
2 files changed, 38 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 418c24a25e..135384ab52 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6786,6 +6786,35 @@ class LLAvatarToggleSearch : public view_listener_t } }; +// <FS:CR> Resync Animations +class FSToolsResyncAnimations : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + for (S32 i = 0; i < gObjectList.getNumObjects(); i++) + { + LLViewerObject* object = gObjectList.getObject(i); + if (object && + object->isAvatar()) + { + LLVOAvatar* avatarp = (LLVOAvatar*)object; + if (avatarp) + { + for (LLVOAvatar::AnimIterator anim_it = avatarp->mPlayingAnimations.begin(); + anim_it != avatarp->mPlayingAnimations.end(); + anim_it++) + { + avatarp->stopMotion(anim_it->first, true); + avatarp->startMotion(anim_it->first); + } + } + } + } + return true; + } +}; +// </FS:CR> Resync Animations + class LLAvatarResetSkeleton: public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -10197,6 +10226,7 @@ void initialize_menus() view_listener_t::addMenu(new LLAvatarToggleMyProfile(), "Avatar.ToggleMyProfile"); view_listener_t::addMenu(new LLAvatarTogglePicks(), "Avatar.TogglePicks"); view_listener_t::addMenu(new LLAvatarToggleSearch(), "Avatar.ToggleSearch"); + view_listener_t::addMenu(new FSToolsResyncAnimations(), "Tools.ResyncAnimations"); // <FS:CR> Resync Animations view_listener_t::addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeleton"); view_listener_t::addMenu(new LLAvatarEnableResetSkeleton(), "Avatar.EnableResetSkeleton"); view_listener_t::addMenu(new LLAvatarResetSkeletonAndAnimations(), "Avatar.ResetSkeletonAndAnimations"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 5789b113c1..cd660d7f7a 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -647,6 +647,14 @@ name="World" tear_off="true"> <menu_item_call + label="Resync Animations" + name="Resync Animations" + shortcut="control|S"> + <menu_item_call.on_click + function="Tools.ResyncAnimations" /> + </menu_item_call> + <menu_item_separator/> + <menu_item_call label="Landmark This Place" name="Create Landmark Here"> <menu_item_call.on_click |