Lore archive · Warcraft Wiki, 2023 dump
API GameTooltip SetInventoryItem
Last wiki revision 2022-07-22
hasItem, hasCooldown, repairCost = Tooltip:SetInventoryItem("unit", invSlot {, nameOnly, hideUselessStats});
This function sets a tooltip widget to display information for the given unit's given inventory slot.
- Arguments
- unit : String - the unit whose inventory should be searched
- slot : Number - the inventory slot number to search
- nameOnly : Boolean - Only show following info: name, item level, equipment slot, item type, onUse/Proc/Azerite info, durability, race/class limitations
- hideUselessStats: Boolean - exclude useless (grey) stats. I.e. agility for a warrior.
- Returns
- hasItem : Boolean - is there an item at the given slot?
- hasCooldown : Boolean - unknown
- repairCost : Number - cost of repairing item
--See if the player has head gear and if it is broken function HasHeadGear local headSlot = getglobal("CharacterHeadSlot"); local hasItem, hasCooldown, repairCost = MyTooltip:SetInventoryItem("player", headSlot:GetID); if ((hasItem) and (repairCost) and (repairCost > 0)) then return true; else return false; end end
- Example
- Source
This information was obtained via a Google cached page of a Thottbot index of a now expired official US beta forum post by Angarth. It appears to still be correct.
repairCost info obtained from orginal blizzard lua files (PaperDolFrame.lua and MoneyFrame.lua)
Source
https://warcraft.wiki.gg/wiki/API_GameTooltip_SetInventoryItem · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.