mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
locate default anims also by uuid, rename/chage a few things
This commit is contained in:
@@ -39,8 +39,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
|
||||
public static readonly string DefaultAnimationsPath = "data/avataranimations.xml";
|
||||
|
||||
public static Dictionary<string, UUID> AnimsUUID = new Dictionary<string, UUID>();
|
||||
public static Dictionary<UUID, string> AnimsNames = new Dictionary<UUID, string>();
|
||||
public static Dictionary<string, UUID> AnimsUUIDbyName = new Dictionary<string, UUID>();
|
||||
public static Dictionary<UUID, string> AnimsNamesbyUUID = new Dictionary<UUID, string>();
|
||||
public static Dictionary<UUID, string> AnimStateNames = new Dictionary<UUID, string>();
|
||||
|
||||
static DefaultAvatarAnimations()
|
||||
@@ -70,8 +70,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
UUID id = (UUID)nod.InnerText;
|
||||
string animState = (string)nod.Attributes["state"].Value;
|
||||
|
||||
AnimsUUID.Add(name, id);
|
||||
AnimsNames.Add(id, name);
|
||||
AnimsUUIDbyName.Add(name, id);
|
||||
AnimsNamesbyUUID.Add(id, name);
|
||||
if (animState != "")
|
||||
AnimStateNames.Add(id, animState);
|
||||
|
||||
@@ -93,13 +93,18 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[AVATAR ANIMATIONS]: Looking for default avatar animation with name {0}", name);
|
||||
|
||||
if (AnimsUUID.ContainsKey(name))
|
||||
UUID id;
|
||||
if (AnimsUUIDbyName.TryGetValue(name, out id))
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[AVATAR ANIMATIONS]: Found {0} {1} in GetDefaultAvatarAnimation()", AnimsUUID[name], name);
|
||||
|
||||
return AnimsUUID[name];
|
||||
return id;
|
||||
}
|
||||
if(UUID.TryParse(name, out id))
|
||||
{
|
||||
if(AnimsNamesbyUUID.ContainsKey(id))
|
||||
return id;
|
||||
}
|
||||
|
||||
return UUID.Zero;
|
||||
@@ -111,24 +116,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
/// </summary>
|
||||
public static string GetDefaultAnimationName(UUID uuid)
|
||||
{
|
||||
string ret = "unknown";
|
||||
if (AnimsUUID.ContainsValue(uuid))
|
||||
{
|
||||
foreach (KeyValuePair<string, UUID> kvp in AnimsUUID)
|
||||
{
|
||||
if (kvp.Value == uuid)
|
||||
{
|
||||
ret = kvp.Key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(AnimsNamesbyUUID.TryGetValue(uuid, out string ret))
|
||||
return ret;
|
||||
else
|
||||
{
|
||||
ret = uuid.ToString();
|
||||
}
|
||||
|
||||
return ret;
|
||||
return uuid.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user