aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-04-26 19:57:52 -0700
committerMcCabe Maxsted2009-04-26 20:42:31 -0700
commit972749c04c98685ee9645afb294a478db0858998 (patch)
treed049cc38ba37a8a80bc48a1f1f93946d612a67ef /linden/indra
parentFixed space in changelog (diff)
downloadmeta-impy-972749c04c98685ee9645afb294a478db0858998.zip
meta-impy-972749c04c98685ee9645afb294a478db0858998.tar.gz
meta-impy-972749c04c98685ee9645afb294a478db0858998.tar.bz2
meta-impy-972749c04c98685ee9645afb294a478db0858998.tar.xz
Backported fix from 1.23 for stop animations only being local (VWR-2850)
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/newview/llagent.cpp51
-rw-r--r--linden/indra/newview/llagent.h1
-rw-r--r--linden/indra/newview/llviewermenu.cpp7
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml4
4 files changed, 45 insertions, 18 deletions
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index d268397..21de6a3 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -5750,18 +5750,13 @@ bool LLAgent::teleportCore(bool is_local)
5750 return false; 5750 return false;
5751 } 5751 }
5752 5752
5753 // Stop all animation before actual teleporting 5753 // Cease sitting on the current object, if any.
5754 LLVOAvatar* avatarp = gAgent.getAvatarObject(); 5754 LLVOAvatar* avatarp = gAgent.getAvatarObject();
5755 if (avatarp) 5755 if (avatarp)
5756 { 5756 avatarp->getOffObject();
5757 for ( LLVOAvatar::AnimIterator anim_it= avatarp->mPlayingAnimations.begin() 5757
5758 ; anim_it != avatarp->mPlayingAnimations.end() 5758 // Stop all animations before actual teleporting
5759 ; anim_it++) 5759 stopCurrentAnimations();
5760 {
5761 avatarp->stopMotion(anim_it->first);
5762 }
5763 avatarp->processAnimationStateChanges();
5764 }
5765 5760
5766 // Don't call LLFirstUse::useTeleport because we don't know 5761 // Don't call LLFirstUse::useTeleport because we don't know
5767 // yet if the teleport will succeed. Look in 5762 // yet if the teleport will succeed. Look in
@@ -5940,6 +5935,42 @@ void LLAgent::setTeleportState(ETeleportState state)
5940 } 5935 }
5941} 5936}
5942 5937
5938void LLAgent::stopCurrentAnimations()
5939{
5940 // This function stops all current overriding animations on this
5941 // avatar, propagating this change back to the server.
5942
5943 LLVOAvatar* avatarp = gAgent.getAvatarObject();
5944 if (avatarp)
5945 {
5946 for ( LLVOAvatar::AnimIterator anim_it =
5947 avatarp->mPlayingAnimations.begin();
5948 anim_it != avatarp->mPlayingAnimations.end();
5949 anim_it++)
5950 {
5951 if (anim_it->first ==
5952 ANIM_AGENT_SIT_GROUND_CONSTRAINED)
5953 {
5954 // don't cancel a ground-sit anim, as viewers
5955 // use this animation's status in
5956 // determining whether we're sitting. ick.
5957 }
5958 else
5959 {
5960 // stop this animation locally
5961 avatarp->stopMotion(anim_it->first, TRUE);
5962 // ...and tell the server to tell everyone.
5963 sendAnimationRequest(anim_it->first, ANIM_REQUEST_STOP);
5964 }
5965 }
5966
5967 // re-assert at least the default standing animation, because
5968 // viewers get confused by avs with no associated anims.
5969 sendAnimationRequest(ANIM_AGENT_STAND,
5970 ANIM_REQUEST_START);
5971 }
5972}
5973
5943void LLAgent::fidget() 5974void LLAgent::fidget()
5944{ 5975{
5945 if (!getAFK()) 5976 if (!getAFK())
diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h
index 97f9aed..1c836b1 100644
--- a/linden/indra/newview/llagent.h
+++ b/linden/indra/newview/llagent.h
@@ -372,6 +372,7 @@ public:
372 BOOL canFly(); 372 BOOL canFly();
373 373
374 // Animation functions 374 // Animation functions
375 void stopCurrentAnimations();
375 void requestStopMotion( LLMotion* motion ); 376 void requestStopMotion( LLMotion* motion );
376 void onAnimStop(const LLUUID& id); 377 void onAnimStop(const LLUUID& id);
377 378
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index 486e4f1..9e0b6a0 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -4227,12 +4227,7 @@ class LLToolsStopAllAnimations : public view_listener_t
4227{ 4227{
4228 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4228 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4229 { 4229 {
4230 LLVOAvatar* avatarp = gAgent.getAvatarObject(); 4230 gAgent.stopCurrentAnimations();
4231 if (avatarp)
4232 {
4233 avatarp->deactivateAllMotions();
4234 avatarp->startDefaultMotions();
4235 }
4236 return true; 4231 return true;
4237 } 4232 }
4238}; 4233};
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
index 4758116..7ef3419 100644
--- a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
@@ -509,8 +509,8 @@
509 <menu_item_call name="Set Busy" label="Set Busy"> 509 <menu_item_call name="Set Busy" label="Set Busy">
510 <on_click function="World.SetBusy" userdata="" /> 510 <on_click function="World.SetBusy" userdata="" />
511 </menu_item_call> 511 </menu_item_call>
512 <menu_item_call name="Stop All Animations" enabled="false" 512 <menu_item_call name="Stop Animating My Avatar" enabled="false"
513 label="Stop All Animations"> 513 label="Stop Animating My Avatar">
514 <on_click function="Tools.StopAllAnimations" userdata="" /> 514 <on_click function="Tools.StopAllAnimations" userdata="" />
515 </menu_item_call> 515 </menu_item_call>
516 <menu_item_call name="Release Keys" enabled="false" label="Release Keys"> 516 <menu_item_call name="Release Keys" enabled="false" label="Release Keys">