From a01b415d6c3fa2ee650b23b7d78432a2eac5a2a7 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 11 May 2008 21:27:12 +0000 Subject: 0001199: [PATCH] Add support for default animations From Melanie... Thanks Melanie! . --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 466b20a..c74cac3 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1156,6 +1156,63 @@ namespace OpenSim.Region.Environment.Scenes } } } + public void AddAnimation(string name) + { + if(m_isChildAgent) + return; + + // Don't let this animation become the movement animation + if(m_animations.Count < 1) + SetMovementAnimation(Animations.AnimsLLUUID["STAND"]); + + LLUUID animID=m_controllingClient.GetDefaultAnimation(name); + if(animID == LLUUID.Zero) + return; + + if (!m_animations.Contains(animID)) + { + m_animations.Add(animID); + m_animationSeqs.Add(m_controllingClient.NextAnimationSequenceNumber); + SendAnimPack(); + } + } + + public void RemoveAnimation(string name) + { + if(m_isChildAgent) + return; + + LLUUID animID=m_controllingClient.GetDefaultAnimation(name); + if(animID == LLUUID.Zero) + return; + + if (m_animations.Contains(animID)) + { + if (m_animations[0] == animID) + { + SetMovementAnimation(Animations.AnimsLLUUID["STAND"]); + } + else + { + // What a HACK!! Anim list really needs to be an object! + int idx; + + for(idx=0;idx < m_animations.Count;idx++) + { + if(m_animations[idx] == animID) + { + int seq=m_animationSeqs[idx]; + + m_animations.Remove(animID); + m_animationSeqs.Remove(seq); + SendAnimPack(); + break; + } + } + } + } + } + public void HandleStartAnim(IClientAPI remoteClient, LLUUID animID) { -- cgit v1.1