Beispiel #1
0
 public ItemPropDefinition(Item tl, Item ctlg)
 {
     SelectItem    = Mannequin.GetProperty(tl);
     EquipmentItem = Mannequin.GetProperty(ctlg);
 }
Beispiel #2
0
        public MannequinStatsGump(Mannequin mann, Item item, int page)
            : base(100, 100)
        {
            _Mannequin = mann;
            _Item      = item;

            AddPage(0);

            AddBackground(0, 0, 604, 820, 0x6DB);
            AddAlphaRegion(5, 5, 594, 810);
            AddHtmlLocalized(10, 10, 584, 18, 1114513, "#1159279", 0x43F7, false, false); // <DIV ALIGN=CENTER>~1_TOKEN~</DIV>

            List <ValuedProperty>     lm;
            List <ItemPropDefinition> CompareItem = null;
            List <Item> list;

            if (_Item != null)
            {
                Item sameItem = null;

                for (var index = 0; index < _Mannequin.Items.Count; index++)
                {
                    var x = _Mannequin.Items[index];

                    if (_Mannequin.LayerValidation(x, item))
                    {
                        sameItem = x;
                        break;
                    }
                }

                _SameItem = sameItem;

                if (_SameItem != null)
                {
                    CompareItem = new List <ItemPropDefinition>
                    {
                        new ItemPropDefinition(_Item, _SameItem)
                    };

                    list = new List <Item>();

                    for (var index = 0; index < _Mannequin.Items.Count; index++)
                    {
                        var x = _Mannequin.Items[index];

                        if (x != _SameItem)
                        {
                            list.Add(x);
                        }
                    }

                    list.Add(_Item);
                }
                else
                {
                    list = new List <Item>();

                    for (var index = 0; index < _Mannequin.Items.Count; index++)
                    {
                        var mannequinItem = _Mannequin.Items[index];

                        list.Add(mannequinItem);
                    }

                    list.Add(_Item);
                }
            }
            else
            {
                list = _Mannequin.Items;
            }

            lm = Mannequin.GetProperty(list);

            AddHtmlLocalized(479, 10, 75, 18, 1114514, "#1158215", 0x42FF, false, false); // <DIV ALIGN=RIGHT>~1_TOKEN~</DIV>

            if (page > 0)
            {
                AddButton(554, 10, 0x15E3, 0x15E7, 1000, GumpButtonType.Reply, 0); // Next Page Button
            }
            else
            {
                AddButton(554, 10, 0x15E1, 0x15E5, 1001, GumpButtonType.Reply, 0); // Previous Page Button
            }

            int y = 0;

            LabelDefinition[] pages = page > 0 ? Page2 : Page1;

            for (var index = 0; index < pages.ToList().Count; index++)
            {
                var x = pages.ToList()[index];

                y += 28;

                if (lm.Any(l => l.Catalog == x.Catalog))
                {
                    AddHtmlLocalized(10, y, 150, 18, x.TitleLabel, 0x6A05, false, false);
                    AddImageTiled(10, y + 18, 584, 5, 0x6DC);

                    y += 32;

                    List <ValuedProperty> cataloglist =
                        lm.Where(i => i.Catalog == x.Catalog).OrderBy(ii => ii.Order).ToList();

                    int columncount = x.ColumnLeftCount == 0 ? (int)Math.Ceiling(cataloglist.Count / (decimal)2) : x.ColumnLeftCount;

                    for (int i = 0; i < cataloglist.Count; i++)
                    {
                        int label = cataloglist[i].LabelNumber;

                        if (i < columncount)
                        {
                            AddHtmlLocalized(45, y, 200, 18, label, 0x560A, false, false);
                            AddSpriteImage(10, y - 5, 0x9D3B, cataloglist[i].SpriteW, cataloglist[i].SpriteH, 30, 30);
                            AddTooltip(cataloglist[i].Description);

                            if (cataloglist[i].LabelNumber == 1159280) // Medable Armor
                            {
                                if (cataloglist[i].Matches(list))
                                {
                                    AddHtmlLocalized(195, y, 100, 18, 1046362, 0x42FF, false, false); // Yes
                                }
                                else
                                {
                                    AddHtmlLocalized(195, y, 100, 18, 1046363, 0x42FF, false, false); // No
                                }
                            }
                            else
                            {
                                AddHtml(195, y, 100, 18, Color(cataloglist[i].Value, GetItemValue(CompareItem, label), cataloglist[i].Cap), false, false);
                            }
                        }
                        else
                        {
                            if (i == columncount)
                            {
                                y -= i * 30;
                            }

                            AddHtmlLocalized(342, y, 200, 18, label, 0x560A, false, false);
                            AddSpriteImage(307, y - 5, 0x9D3B, cataloglist[i].SpriteW, cataloglist[i].SpriteH, 30, 30);
                            AddTooltip(cataloglist[i].Description);

                            if (!cataloglist[i].IsBoolen)
                            {
                                AddHtml(492, y, 100, 18, Color(cataloglist[i].Value, GetItemValue(CompareItem, label), cataloglist[i].Cap), false, false);
                            }
                        }

                        y += 30;
                    }

                    y += 3;
                }
            }
        }
Beispiel #3
0
 public bool CheckMagicalItem(Item item)
 {
     return(Mannequin.GetProperty(item).Any(x => x.Value != 0));
 }