aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs
blob: 2947b96583f4eef4c4e1334214d5f57619971c50 (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
45
46
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.Verbose("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.DocumentElement.ChildNodes)
            {
               
                if ( nod.Attributes["name"] != null)
                {
                    AnimsLLUUID.Add(nod.Attributes["name"].Value, nod.InnerText);
                }
                
            }

            reader.Close();

            OpenSim.Framework.Console.MainConsole.Instance.Verbose("Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)");

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