Ejemplo n.º 1
0
            public override void Update(double totalMS, double frameMS)
            {
                if (_item != null && _item.IsDestroyed)
                {
                    _item = null;
                    _itemGump.Dispose();
                    _itemGump = null;
                }

                if (_item != _mobile.Equipment[(int)_layer])
                {
                    if (_itemGump != null)
                    {
                        _itemGump.Dispose();
                        _itemGump = null;
                    }

                    _item = _mobile.Equipment[(int)_layer];

                    if (_item != null)
                    {
                        Add(_itemGump = new ItemGumpFixed(_item, 18, 18)
                        {
                            X      = 0,
                            Y      = 0,
                            Width  = 18,
                            Height = 18,
                            HighlightOnMouseOver = false,
                            CanPickUp            = World.InGame && (World.Player == _mobile || _paperDollGump.CanLift),
                        });
                    }
                }


                base.Update(totalMS, frameMS);
            }
Ejemplo n.º 2
0
        public override void Update(double totalMS, double frameMS)
        {
            if (Item != null && Item.IsDisposed)
            {
                Item = null;
                _itemGump.Dispose();
                _itemGump = null;
            }

            if (Item != _mobile.Equipment[(int)_layer])
            {
                if (_itemGump != null)
                {
                    _itemGump.Dispose();
                    _itemGump = null;
                }

                Item = _mobile.Equipment[(int)_layer];

                if (Item != null)
                {
                    Add(_itemGump = new ItemGumpFixed(Item, 18, 18)
                    {
                        HighlightOnMouseOver = false,
                        ShowLabel            = true,
                    });

                    ArtTexture texture = (ArtTexture)_itemGump.Texture;
                    //int offsetX = (13 - texture.ImageRectangle.Width) >> 1;
                    //int offsetY = (14 - texture.ImageRectangle.Height) >> 1;
                    int tileX = 2;
                    int tileY = 3;
                    //tileX -= texture.ImageRectangle.X - offsetX;
                    //tileY -= texture.ImageRectangle.Y - offsetY;

                    int imgW = texture.ImageRectangle.Width;
                    int imgH = texture.ImageRectangle.Height;

                    if (imgW < 14)
                    {
                        tileX += 7 - (imgW >> 1);
                    }
                    else
                    {
                        tileX -= 2;

                        if (imgW > 18)
                        {
                            imgW = 18;
                        }
                    }

                    if (imgH < 14)
                    {
                        tileY += 7 - (imgH >> 1);
                    }
                    else
                    {
                        tileY -= 2;

                        if (imgH > 18)
                        {
                            imgH = 18;
                        }
                    }


                    _itemGump.X      = tileX;
                    _itemGump.Y      = tileY;
                    _itemGump.Width  = imgW;
                    _itemGump.Height = imgH;
                }
            }

            if (Item != null)
            {
                //    if (_canDrag && totalMS >= _pickupTime)
                //    {
                //        _canDrag = false;
                //        AttempPickUp();
                //    }

                //    if (_sendClickIfNotDClick && totalMS >= _singleClickTime)
                //    {
                //        if (!World.ClientFlags.TooltipsEnabled)
                //            GameActions.SingleClick(Item);
                //        GameActions.OpenPopupMenu(Item);
                //        _sendClickIfNotDClick = false;
                //    }

                //if (_sendClickIfNotDClick && totalMS >= _singleClickTime)
                //{
                //    _sendClickIfNotDClick = false;
                //    GameActions.SingleClick(Item);
                //}
            }

            base.Update(totalMS, frameMS);
        }