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" )
						nodes.Add( new CAGCategory( this, xml ) );
					else
						xml.Skip();
				}*/

				m_Nodes = (CAGNode[])nodes.ToArray( typeof( CAGNode ) );
			}
		}
Beispiel #2
0
        public static CAGCategory Load(string path)
        {
            if (File.Exists(path))
            {
                XmlTextReader xml = new XmlTextReader(path)
                {
                    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());
        }
Beispiel #3
0
        public CategorizedAddGump(Mobile owner, CAGCategory category, int page) : base(GumpOffsetX, GumpOffsetY)
        {
            owner.CloseGump(typeof(WhoGump));

            m_Owner    = owner;
            m_Category = category;

            Initialize(page);
        }
		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 );
		}
Beispiel #5
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));
            }
        }
Beispiel #6
0
        public CAGCategory(CAGCategory parent, XmlTextReader xml)
        {
            Parent = parent;

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

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

            if (xml.IsEmptyElement)
            {
                Nodes = Array.Empty <CAGNode>();
            }
            else
            {
                List <CAGNode> nodes = new List <CAGNode>();

                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();
                    }
                }

                Nodes = nodes.ToArray();
            }
        }
Beispiel #7
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);
            }
        }
Beispiel #8
0
        public CAGObject(CAGCategory parent, XmlTextReader xml)
        {
            Parent = parent;

            if (xml.MoveToAttribute("type"))
            {
                Type = AssemblyHandler.FindFirstTypeForName(xml.Value, false);
            }

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

            if (xml.MoveToAttribute("hue"))
            {
                Hue = XmlConvert.ToInt32(xml.Value);
            }
        }
		public CategorizedAddGump( Mobile owner, CAGCategory category, int page ) : base( GumpOffsetX, GumpOffsetY )
		{
			owner.CloseGump( typeof( WhoGump ) );

			m_Owner = owner;
			m_Category = category;

			Initialize( page );
		}
		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();
		}