aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs
blob: f4c50a724a66a5637c32c4322a5ce82946a3f9d5 (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"], 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);
            }
        }
    }
}