From 7554af993ff6461b66f9db5c3fb7c28d340c6286 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Mon, 4 Jun 2007 12:05:18 +0000 Subject: * Loading animations from XML file now --- OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs b/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs index adf49f2..f4c50a7 100644 --- a/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs +++ b/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Text; using libsecondlife; +using System.Xml; namespace OpenSim.world { @@ -18,6 +19,21 @@ namespace OpenSim.world public void LoadAnims() { OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Avatar.cs:LoadAnims() - Loading avatar animations"); + XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"); + XmlDocument doc = new XmlDocument(); + doc.Load(reader); + + foreach (XmlNode nod in doc.FirstChild.ChildNodes) + { + if (nod.Attributes["name"] != null) + { + AnimsLLUUID.Add(nod.Attributes["name"], nod.Value); + } + } + + reader.Close(); + + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)"); foreach (KeyValuePair kp in OpenSim.world.Avatar.Animations.AnimsLLUUID) { -- cgit v1.1