Exemple #1
0
        public CategorizedAddGump(Mobile owner, CAGCategory category, int page) : base(GumpOffsetX, GumpOffsetY)
        {
            owner.CloseGump(typeof(WhoGump));

            m_Owner    = owner;
            m_Category = category;

            Initialize(page);
        }
Exemple #2
0
        public CAGCategory(CAGCategory parent, XmlTextReader xml)
        {
            m_Parent = parent;

            if (xml.MoveToAttribute("title"))
            {
                m_Title = xml.Value;
            }
            else
            {
                m_Title = "empty";
            }

            if (m_Title == "Docked")
            {
                m_Title = "Docked 2";
            }

            if (xml.IsEmptyElement)
            {
                m_Nodes = new CAGNode[0];
            }
            else
            {
                ArrayList nodes = new ArrayList();

                while (xml.Read() && xml.NodeType != XmlNodeType.EndElement)
                {
                    if (xml.NodeType == XmlNodeType.Element && xml.Name == "object")
                    {
                        nodes.Add(new CAGObject(this, xml));
                    }
                    else if (xml.NodeType == XmlNodeType.Element && xml.Name == "category")
                    {
                        if (!xml.IsEmptyElement)
                        {
                            nodes.Add(new CAGCategory(this, xml));
                        }
                    }
                    else
                    {
                        xml.Skip();
                    }
                }

                m_Nodes = (CAGNode[])nodes.ToArray(typeof(CAGNode));
            }
        }
Exemple #3
0
        public CAGObject(CAGCategory parent, XmlTextReader xml)
        {
            m_Parent = parent;

            if (xml.MoveToAttribute("type"))
            {
                m_Type = ScriptCompiler.FindTypeByFullName(xml.Value, false);
            }

            if (xml.MoveToAttribute("gfx"))
            {
                m_ItemID = XmlConvert.ToInt32(xml.Value);
            }

            if (xml.MoveToAttribute("hue"))
            {
                m_Hue = XmlConvert.ToInt32(xml.Value);
            }
        }
Exemple #4
0
        public static CAGCategory Load(string path)
        {
            if (File.Exists(path))
            {
                XmlTextReader xml = new XmlTextReader(path);

                xml.WhitespaceHandling = WhitespaceHandling.None;

                while (xml.Read())
                {
                    if (xml.Name == "category" && xml.NodeType == XmlNodeType.Element)
                    {
                        CAGCategory cat = new CAGCategory(null, xml);

                        xml.Close();

                        return(cat);
                    }
                }
            }

            return(new CAGCategory());
        }