Instead of loading default avatar animations in both SLUtil and AvatarAnimations, load just in AvatarAnimations instead.

This lets us remove the dependency of OpenSim.Framework.dll on data/avataranimations.xml, which is not necessary for ROBUST.
This commit also takes care of the odd situation where animations are stored and used internally with uppercase names (e.g. "STAND")
but scripts refer to them with lowercase names (e.g. "sit").
This commit is contained in:
Justin Clark-Casey (justincc)
2012-03-21 23:57:39 +00:00
parent 54a8a5baba
commit 1a8769e6ef
10 changed files with 84 additions and 98 deletions

View File

@@ -27,8 +27,10 @@
using System;
using System.Collections.Generic;
using OpenSim.Framework;
using System.Reflection;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
using Animation = OpenSim.Framework.Animation;
@@ -37,7 +39,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
[Serializable]
public class AnimationSet
{
public static AvatarAnimations Animations = new AvatarAnimations();
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private OpenSim.Framework.Animation m_defaultAnimation = new OpenSim.Framework.Animation();
private List<OpenSim.Framework.Animation> m_animations = new List<OpenSim.Framework.Animation>();
@@ -132,9 +134,13 @@ namespace OpenSim.Region.Framework.Scenes.Animation
/// </summary>
public bool TrySetDefaultAnimation(string anim, int sequenceNum, UUID objectID)
{
if (Animations.AnimsUUID.ContainsKey(anim))
// m_log.DebugFormat(
// "[ANIMATION SET]: Setting default animation {0}, sequence number {1}, object id {2}",
// anim, sequenceNum, objectID);
if (AvatarAnimations.AnimsUUID.ContainsKey(anim))
{
return SetDefaultAnimation(Animations.AnimsUUID[anim], sequenceNum, objectID);
return SetDefaultAnimation(AvatarAnimations.AnimsUUID[anim], sequenceNum, objectID);
}
return false;
}