/// <summary> /// Gets the tooltip for a sack. Summarizes the items within the sack /// </summary> /// <param name="button">button the mouse is over. Corresponds to a sack</param> /// <returns>string to be displayed in the tooltip</returns> private string GetSackToolTip(BagButtonBase button) { // Get the list of items and return them as a string int bagID = button.ButtonNumber; SackCollection sack; if (bagID == 0) { if (this.Player == null) { sack = null; } else { sack = this.Player.EquipmentSack; } } else if (bagID == 1) { sack = this.transferStash.Sack; } else if (bagID == 2) { sack = this.stash.Sack; } else { sack = this.relicVaultStash.Sack; } if (sack == null || sack.IsEmpty) { return(null); } // skip the item being dragged Item[] excluded = null; if (this.DragInfo.IsActive) { excluded = new Item[] { this.DragInfo.Item }; } var html = ItemHtmlHelper.GetSackToolTip(sack, excluded); return(html); }
/// <summary> /// Gets the tooltip for the sack contents. /// </summary> /// <param name="button">Button number of the sack</param> /// <returns>string listing the sack's contents.</returns> private string GetSackToolTip(BagButtonBase button) { // Get the list of items and return them as a string SackCollection sack = this.Player.GetSack(button.ButtonNumber + this.BagPanelOffset); if (sack == null) { return(null); } // skip the item being dragged Item[] excluded = null; if (this.DragInfo.IsActive) { excluded = new Item[] { this.DragInfo.Item }; } var html = ItemHtmlHelper.GetSackToolTip(sack, excluded); return(html); }