aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs
blob: 8fa9c420b89360aa1e3936f194f37d79d0cf8611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using System.Xml;

namespace OpenSim.world
{
    public class AvatarAnimations
    {

        public Dictionary<string, LLUUID> AnimsLLUUID = new Dictionary<string, LLUUID>();
        public Dictionary<LLUUID, string> AnimsNames = new Dictionary<LLUUID, string>();
        
        public AvatarAnimations()
        {
        }

        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"].ToString(), new LLUUID(nod.Value));
                }
            }

            reader.Close();

            OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)");

            foreach (KeyValuePair<string, LLUUID> kp in OpenSim.world.Avatar.Animations.AnimsLLUUID)
            {
                AnimsNames.Add(kp.Value, kp.Key);
            }
        }
    }
}