Exemplo n.º 1
0
                /// <summary>
                /// Updates the <see cref="Control"/>. This is called for every <see cref="Control"/>, even if it is disabled or
                /// not visible.
                /// </summary>
                /// <param name="currentTime">The current time in milliseconds.</param>
                protected override void UpdateControl(TickCount currentTime)
                {
                    base.UpdateControl(currentTime);

                    if (!IsVisible)
                    {
                        return;
                    }

                    // Get the current item info
                    var currItemInfo = ItemsCollection.GetItemInfo(Slot);

                    // Check if the item info has changed and, if so, re-initialize the sprite
                    if (currItemInfo != _lastItemInfo)
                    {
                        ItemsCollection.PeerTradeForm.InitializeItemInfoSprite(_sprite, currItemInfo);
                        _lastItemInfo = currItemInfo;
                    }

                    // Update the sprite
                    if (_sprite.GrhData != null)
                    {
                        _sprite.Update(currentTime);
                    }
                }
Exemplo n.º 2
0
 /// <summary>
 /// Gets the item information for the item in this slot.
 /// </summary>
 /// <returns>The item information for the item in this slot, or null if the slot is empty.</returns>
 protected TItemInfo GetSlotItemInfo()
 {
     return(ItemsCollection.GetItemInfo(Slot));
 }