This is driving me crazy. How can I check if an item actually is usable?
IsUsableItem() is not what I'm looking for. This is what I use in my OnTooltipSetItem script:
Lua Code:
...
elseif MerchantFrame:IsVisible() then CLICK_STRING = G.CLICK.SELL;
elseif IsEquippedItem(self:GetItem()) then CLICK_STRING = G.CLICK.REPLACE;
elseif IsEquippableItem(self:GetItem()) then CLICK_STRING = G.CLICK.EQUIP;
elseif IsUsableItem(self:GetItem()) then CLICK_STRING = G.CLICK.USE;
...
CLICK_STRING is added to the tooltip depending on the outcome of this check.
However, the last line adds to pretty much any item that isn't currently locked out.
This means even grey, non-usable items will get the "Use" string added to it.
How can I check explicitly for items that have a Use effect?
Edit: For anyone else asking this question, the answer is here:
Originally Posted by SDPhantom
I remember using GetItemSpell() to poke around and see what spells different items triggered. As far as I remember, it only returns spell name and rank if there is one attached to said item.
|