WoW:API GameTooltip SetInventoryItem: Difference between revisions

m
no edit summary
No edit summary
 
mNo edit summary
Line 1: Line 1:
<center>'''Title''' ''-Documentation by [[user:Fitz|fitz]]-''</center>
<center>'''Title''' ''-Documentation by [[user:Fitz|fitz]] and [[user:Goatus|Goatus]] -''</center>


<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->


  hasItem, hasCooldown = SetInventoryItem("unit", slot {, nameOnly});
  hasItem, hasCooldown, repairCost =  
  Tooltip:SetInventoryItem("unit", slot {, nameOnly});


<!-- Describe the purpose of the function, though exhausting detail can be saved for a later section -->
<!-- Describe the purpose of the function, though exhausting detail can be saved for a later section -->
Line 27: Line 28:
:;hasItem : Boolean - is there an item at the given slot?
:;hasItem : Boolean - is there an item at the given slot?
:;hasCooldown : Boolean - unknown
:;hasCooldown : Boolean - unknown
:;repairCost : Number - cost of repairing item


----
----
Line 33: Line 35:
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->


  -- See if the player has head gear
  -- See if the player has head gear and if it is broken
  local headSlot = getglobal("CharacterHeadSlot");
 
local hasItem, hasCooldown = MyTooltip:SetInventoryItem("player", headSlot:GetID());
  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
 


----
----
Line 41: Line 53:


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.
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)


----
----
Anonymous user