Beispiel #1
0
        public void AddTypeButton(int x, int y, int buttonID, string text, ModelBodyType type)
        {
            bool isSelection = (m_OurType == type);

            AddButton(x, y - 1, isSelection ? 4006 : 4005, 4007, buttonID, GumpButtonType.Reply, 0);
            AddHtml(x + 35, y, 200, 20, Color(text, isSelection ? SelectedColor32 : LabelColor32), false, false);
        }
Beispiel #2
0
        public void AddTypeButton(int x, int y, int buttonID, string text, ModelBodyType type)
        {
            bool isSelection = (this.m_OurType == type);

            this.AddButton(x, y - 1, isSelection ? 4006 : 4005, 4007, buttonID, GumpButtonType.Reply, 0);
            this.AddHtml(x + 35, y, 200, 20, this.Color(text, isSelection ? SelectedColor32 : LabelColor32), false, false);
        }
Beispiel #3
0
        public void AddTypeButton(int x, int y, int buttonID, string text, ModelBodyType type)
        {
            var isSelection = m_OurType == type;

            AddButton(x, y - 1, isSelection ? 4006 : 4005, 4007, buttonID);
            AddHtml(x + 35, y, 200, 20, Color(text, isSelection ? SelectedColor32 : LabelColor32));
        }
Beispiel #4
0
        public static ArrayList LoadBodies()
        {
            ArrayList list = new ArrayList();

            string path = Core.FindDataFile("models/models.txt");

            if (File.Exists(path))
            {
                using (StreamReader ip = new StreamReader(path))
                {
                    string line;

                    while ((line = ip.ReadLine()) != null)
                    {
                        line = line.Trim();

                        if (line.Length == 0 || line.StartsWith("#"))
                        {
                            continue;
                        }

                        string[] split = line.Split('\t');

                        if (split.Length >= 9)
                        {
                            Body          body = Utility.ToInt32(split[0]);
                            ModelBodyType type = (ModelBodyType)Utility.ToInt32(split[1]);
                            string        name = split[8];

                            BodyEntry entry = new BodyEntry(body, type, name);

                            if (!list.Contains(entry))
                            {
                                list.Add(entry);
                            }
                        }
                    }
                }
            }

            return(list);
        }
Beispiel #5
0
        public SetBodyGump(PropertyInfo prop, Mobile mobile, object o, Stack stack, int page, ArrayList list, int ourPage, ArrayList ourList, ModelBodyType ourType)
            : base(20, 30)
        {
            this.m_Property = prop;
            this.m_Mobile   = mobile;
            this.m_Object   = o;
            this.m_Stack    = stack;
            this.m_Page     = page;
            this.m_List     = list;
            this.m_OurPage  = ourPage;
            this.m_OurList  = ourList;
            this.m_OurType  = ourType;

            this.AddPage(0);

            this.AddBackground(0, 0, 525, 328, 5054);

            this.AddImageTiled(10, 10, 505, 20, 0xA40);
            this.AddAlphaRegion(10, 10, 505, 20);

            this.AddImageTiled(10, 35, 505, 283, 0xA40);
            this.AddAlphaRegion(10, 35, 505, 283);

            this.AddTypeButton(10, 10, 1, "Monster", ModelBodyType.Monsters);
            this.AddTypeButton(130, 10, 2, "Animal", ModelBodyType.Animals);
            this.AddTypeButton(250, 10, 3, "Marine", ModelBodyType.Sea);
            this.AddTypeButton(370, 10, 4, "Human", ModelBodyType.Human);

            this.AddImage(480, 12, 0x25EA);
            this.AddImage(497, 12, 0x25E6);

            if (ourList == null)
            {
                this.AddLabel(15, 40, 0x480, "Choose a body type above.");
            }
            else if (ourList.Count == 0)
            {
                this.AddLabel(15, 40, 0x480, "The server must have UO:3D installed to use this feature.");
            }
            else
            {
                for (int i = 0, index = (ourPage * 12); i < 12 && index >= 0 && index < ourList.Count; ++i, ++index)
                {
                    InternalEntry entry  = (InternalEntry)ourList[index];
                    int           itemID = entry.ItemID;

                    Rectangle2D bounds = ItemBounds.Table[itemID & 0x3FFF];

                    int x = 15 + ((i % 4) * 125);
                    int y = 40 + ((i / 4) * 93);

                    this.AddItem(x + ((120 - bounds.Width) / 2) - bounds.X, y + ((69 - bounds.Height) / 2) - bounds.Y, itemID);
                    this.AddButton(x + 6, y + 66, 0x98D, 0x98D, 7 + index, GumpButtonType.Reply, 0);

                    x += 6;
                    y += 67;

                    this.AddHtml(x + 0, y - 1, 108, 21, this.Center(entry.DisplayName), false, false);
                    this.AddHtml(x + 0, y + 1, 108, 21, this.Center(entry.DisplayName), false, false);
                    this.AddHtml(x - 1, y + 0, 108, 21, this.Center(entry.DisplayName), false, false);
                    this.AddHtml(x + 1, y + 0, 108, 21, this.Center(entry.DisplayName), false, false);
                    this.AddHtml(x + 0, y + 0, 108, 21, this.Color(this.Center(entry.DisplayName), TextColor32), false, false);
                }

                if (ourPage > 0)
                {
                    this.AddButton(480, 12, 0x15E3, 0x15E7, 5, GumpButtonType.Reply, 0);
                }

                if ((ourPage + 1) * 12 < ourList.Count)
                {
                    this.AddButton(497, 12, 0x15E1, 0x15E5, 6, GumpButtonType.Reply, 0);
                }
            }
        }
Beispiel #6
0
        public SetBodyGump(
            PropertyInfo prop, Mobile mobile, object o, Stack <StackEntry> stack, int page, List <object> list,
            int ourPage = 0, List <InternalEntry> ourList = null, ModelBodyType ourType = ModelBodyType.Invalid
            )
            : base(20, 30)
        {
            m_Property = prop;
            m_Mobile   = mobile;
            m_Object   = o;
            m_Stack    = stack;
            m_Page     = page;
            m_List     = list;
            m_OurPage  = ourPage;
            m_OurList  = ourList;
            m_OurType  = ourType;

            AddPage(0);

            AddBackground(0, 0, 525, 328, 5054);

            AddImageTiled(10, 10, 505, 20, 0xA40);
            AddAlphaRegion(10, 10, 505, 20);

            AddImageTiled(10, 35, 505, 283, 0xA40);
            AddAlphaRegion(10, 35, 505, 283);

            AddTypeButton(10, 10, 1, "Monster", ModelBodyType.Monsters);
            AddTypeButton(130, 10, 2, "Animal", ModelBodyType.Animals);
            AddTypeButton(250, 10, 3, "Marine", ModelBodyType.Sea);
            AddTypeButton(370, 10, 4, "Human", ModelBodyType.Human);

            AddImage(480, 12, 0x25EA);
            AddImage(497, 12, 0x25E6);

            if (ourList == null)
            {
                AddLabel(15, 40, 0x480, "Choose a body type above.");
            }
            else if (ourList.Count == 0)
            {
                AddLabel(15, 40, 0x480, "The server must have UO:3D installed to use this feature.");
            }
            else
            {
                for (int i = 0, index = ourPage * 12; i < 12 && index >= 0 && index < ourList.Count; ++i, ++index)
                {
                    var entry  = ourList[index];
                    var itemID = entry.ItemID;

                    var bounds = ItemBounds.Table[itemID & 0x3FFF];

                    var x = 15 + i % 4 * 125;
                    var y = 40 + i / 4 * 93;

                    AddItem(x + (120 - bounds.Width) / 2 - bounds.X, y + (69 - bounds.Height) / 2 - bounds.Y, itemID);
                    AddButton(x + 6, y + 66, 0x98D, 0x98D, 7 + index);

                    x += 6;
                    y += 67;

                    AddHtml(x + 0, y - 1, 108, 21, Center(entry.DisplayName));
                    AddHtml(x + 0, y + 1, 108, 21, Center(entry.DisplayName));
                    AddHtml(x - 1, y + 0, 108, 21, Center(entry.DisplayName));
                    AddHtml(x + 1, y + 0, 108, 21, Center(entry.DisplayName));
                    AddHtml(x + 0, y + 0, 108, 21, Color(Center(entry.DisplayName), TextColor32));
                }

                if (ourPage > 0)
                {
                    AddButton(480, 12, 0x15E3, 0x15E7, 5);
                }

                if ((ourPage + 1) * 12 < ourList.Count)
                {
                    AddButton(497, 12, 0x15E1, 0x15E5, 6);
                }
            }
        }
        public SetBodyGump( PropertyInfo prop, Mobile mobile, object o, Stack stack, int page, ArrayList list, int ourPage, ArrayList ourList, ModelBodyType ourType )
            : base(20, 30)
        {
            m_Property = prop;
            m_Mobile = mobile;
            m_Object = o;
            m_Stack = stack;
            m_Page = page;
            m_List = list;
            m_OurPage = ourPage;
            m_OurList = ourList;
            m_OurType = ourType;

            AddPage( 0 );

            AddBackground(0, 0, 525, 328, 9270);

            AddImageTiled( 10, 10, 505, 20, 0xA40 );
            AddAlphaRegion( 10, 10, 505, 20 );

            AddImageTiled( 10, 35, 505, 283, 0xA40 );
            AddAlphaRegion( 10, 35, 505, 283 );

            AddTypeButton(  10, 10, 1, "Monster", ModelBodyType.Monsters );
            AddTypeButton( 130, 10, 2, "Animal", ModelBodyType.Animals );
            AddTypeButton( 250, 10, 3, "Marine", ModelBodyType.Sea );
            AddTypeButton( 370, 10, 4, "Human", ModelBodyType.Human );

            AddImage( 480, 12, 0x25EA );
            AddImage( 497, 12, 0x25E6 );

            if( ourList == null )
            {
                AddLabel( 15, 40, 0x480, "Choose a body type above." );
            }
            else if( ourList.Count == 0 )
            {
                AddLabel( 15, 40, 0x480, "The server must have UO:3D installed to use this feature." );
            }
            else
            {
                for( int i = 0, index = (ourPage * 12); i < 12 && index >= 0 && index < ourList.Count; ++i, ++index )
                {
                    InternalEntry entry = (InternalEntry)ourList[index];
                    int itemID = entry.ItemID;

                    Rectangle2D bounds = ItemBounds.Table[itemID & 0x3FFF];

                    int x = 15 + ((i % 4) * 125);
                    int y = 40 + ((i / 4) * 93);

                    AddItem( x + ((120 - bounds.Width) / 2) - bounds.X, y + ((69 - bounds.Height) / 2) - bounds.Y, itemID );
                    AddButton( x + 6, y + 66, 0x98D, 0x98D, 7 + index, GumpButtonType.Reply, 0 );

                    x += 6;
                    y += 67;

                    AddHtml( x + 0, y - 1, 108, 21, Center( entry.DisplayName ), false, false );
                    AddHtml( x + 0, y + 1, 108, 21, Center( entry.DisplayName ), false, false );
                    AddHtml( x - 1, y + 0, 108, 21, Center( entry.DisplayName ), false, false );
                    AddHtml( x + 1, y + 0, 108, 21, Center( entry.DisplayName ), false, false );
                    AddHtml( x + 0, y + 0, 108, 21, Color( Center( entry.DisplayName ), TextColor32 ), false, false );
                }

                if( ourPage > 0 )
                    AddButton( 480, 12, 0x15E3, 0x15E7, 5, GumpButtonType.Reply, 0 );

                if( (ourPage + 1) * 12 < ourList.Count )
                    AddButton( 497, 12, 0x15E1, 0x15E5, 6, GumpButtonType.Reply, 0 );
            }
        }
Beispiel #8
0
 public BodyEntry( Body body, ModelBodyType bodyType, string name )
 {
     m_Body = body;
     m_BodyType = bodyType;
     m_Name = name;
 }
 public BodyEntry(Body body, ModelBodyType bodyType, string name)
 {
     Body     = body;
     BodyType = bodyType;
     Name     = name;
 }
Beispiel #10
0
 public BodyEntry(Body body, ModelBodyType bodyType, string name)
 {
     m_Body     = body;
     m_BodyType = bodyType;
     m_Name     = name;
 }