Exemple #1
0
        public GBuyGump_InventoryItem(GBuyGump owner, BuyInfo si, int y, bool seperate)
            : base(32, y, 195, 0)
        {
            this.m_Owner = owner;
            this.m_yBase = y;
            this.m_Info  = si;
            IFont font = (IFont)Engine.GetUniFont(3);
            IHue  hue  = Hues.Load(648);

            this.m_Image       = new GItemArt(0, 0, si.ItemID, si.Hue);
            this.m_Description = (GLabel) new GWrappedLabel(string.Format("{0} at {1} gp", (object)si.Name, (object)si.Price), font, hue, 58, 0, 105);
            this.m_Available   = new GLabel(si.Amount.ToString(), font, hue, 195, 0);
            this.m_Height      = this.m_Image.Image.yMax - this.m_Image.Image.yMin + 1;
            int num1 = this.m_Description.Image.yMax - this.m_Description.Image.yMin + 1;

            if (num1 > this.m_Height)
            {
                this.m_Height = num1;
            }
            int num2 = this.m_Available.Image.yMax - this.m_Available.Image.yMin + 1;

            if (num2 > this.m_Height)
            {
                this.m_Height = num2;
            }
            this.m_Image.X       += (56 - (this.m_Image.Image.xMax - this.m_Image.Image.xMin + 1)) / 2;
            this.m_Image.Y       += (this.m_Height - (this.m_Image.Image.yMax - this.m_Image.Image.yMin + 1)) / 2;
            this.m_Image.X       -= this.m_Image.Image.xMin;
            this.m_Image.Y       -= this.m_Image.Image.yMin;
            this.m_Description.X -= this.m_Description.Image.xMin;
            this.m_Description.Y += (this.m_Height - (this.m_Description.Image.yMax - this.m_Description.Image.yMin + 1)) / 2;
            this.m_Description.Y -= this.m_Description.Image.yMin;
            this.m_Available.X   -= this.m_Available.Image.xMax + 1;
            this.m_Available.Y   += (this.m_Height - (this.m_Available.Image.yMax - this.m_Available.Image.yMin + 1)) / 2;
            this.m_Available.Y   -= this.m_Available.Image.yMin;
            this.m_Children.Add((Gump)this.m_Image);
            this.m_Children.Add((Gump)this.m_Description);
            this.m_Children.Add((Gump)this.m_Available);
            this.m_xAvailable = si.Amount;
            if (seperate)
            {
                this.m_Separator = new GImage[11];
                this.m_Children.Add((Gump)(this.m_Separator[0] = new GImage(57, 0, this.m_Height)));
                for (int index = 0; index < 9; ++index)
                {
                    this.m_Children.Add((Gump)(this.m_Separator[index + 1] = new GImage(58, 30 + index * 16, this.m_Height)));
                }
                this.m_Children.Add((Gump)(this.m_Separator[10] = new GImage(59, 165, this.m_Height)));
            }
            else
            {
                this.m_Separator = new GImage[0];
            }
            if (!Engine.ServerFeatures.AOS)
            {
                return;
            }
            this.Tooltip = (ITooltip) new ItemTooltip(si.Item);
        }
 public GBuyGump_AmountButton(GBuyGump owner, BuyInfo info, int offset, int gumpID, int x)
     : base(gumpID, x, 0)
 {
     this.m_Owner         = owner;
     this.m_Info          = info;
     this.m_InitialOffset = offset;
     this.m_Offset        = (double)offset;
     this.m_Last          = -1234.56;
 }
Exemple #3
0
 public void Clear()
 {
     for (int index = 0; index < this.m_Info.Length; ++index)
     {
         BuyInfo buyInfo = this.m_Info[index];
         if (buyInfo.ToBuy > 0)
         {
             buyInfo.ToBuy = 0;
             buyInfo.InventoryGump.Available = buyInfo.Amount;
             Gumps.Destroy((Gump)buyInfo.OfferedGump);
             buyInfo.OfferedGump = (GBuyGump_OfferedItem)null;
         }
     }
 }
Exemple #4
0
        public GBuyGump(int serial, BuyInfo[] info)
            : base(2160, 15, 15)
        {
            this.m_GUID   = string.Format("GBuyGump-{0}", (object)serial);
            this.m_Serial = serial;
            this.m_Info   = info;
            Engine.GetUniFont(3);
            Hues.Load(648);
            Array.Sort <BuyInfo>(info);
            int y = 66;

            for (int index = 0; index < info.Length; ++index)
            {
                bool    seperate = index != info.Length - 1;
                BuyInfo si       = info[index];
                GBuyGump_InventoryItem gumpInventoryItem = new GBuyGump_InventoryItem(this, si, y, seperate);
                this.m_Children.Add((Gump)gumpInventoryItem);
                si.InventoryGump = gumpInventoryItem;
                y += gumpInventoryItem.Height;
                if (seperate)
                {
                    y += 16;
                }
            }
            if (y > 230)
            {
                GVSlider gvSlider = new GVSlider(2088, 237, 81, 34, 92, 0.0, 0.0, (double)(y - 230), 1.0);
                gvSlider.OnValueChange = new OnValueChange(this.Slider_OnValueChange);
                this.m_Children.Add((Gump)gvSlider);
                this.m_Children.Add((Gump) new GHotspot(237, 66, 34, 122, (Gump)gvSlider));
            }
            this.m_NonRestrictivePicking = true;
            this.m_OfferMenu             = new GBuyGump_OfferMenu(this);
            this.m_Children.Add((Gump)this.m_OfferMenu);
            this.m_X = (Engine.ScreenWidth - (this.m_OfferMenu.X + this.m_OfferMenu.Width)) / 2;
            this.m_Y = (Engine.ScreenHeight - (this.m_OfferMenu.Y + this.m_OfferMenu.Height)) / 2;
        }
Exemple #5
0
        int IComparable.CompareTo(object x)
        {
            if (x == null)
            {
                return(1);
            }
            BuyInfo buyInfo = x as BuyInfo;

            if (buyInfo == null)
            {
                throw new ArgumentException();
            }
            int num = Map.GetQuality(this.m_Item.ID).CompareTo(Map.GetQuality(buyInfo.m_Item.ID));

            if (num == 0)
            {
                num = this.m_Item.ID.CompareTo(buyInfo.m_Item.ID);
                if (num == 0)
                {
                    num = this.m_Item.Serial.CompareTo(buyInfo.m_Item.Serial);
                }
            }
            return(num);
        }