View Single Post
08-20-22, 05:57 PM   #3
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
GetCursorInfo() says what's on the cursor. You can call that when your button receives something:
Lua Code:
  1. local f = CreateFrame("ItemButton","RdD",UIParent)
  2. f:SetPoint("CENTER",-200,0)
  3.  
  4. local function onReceive(self)
  5.   local cursorType, cursorID, cursorLink = GetCursorInfo()
  6.   if cursorType=="item" then
  7.     local _,_,_,_,icon = GetItemInfoInstant(cursorID)
  8.     self.icon:SetTexture(icon)
  9.     ClearCursor()
  10.   end
  11. end
  12.  
  13. f:SetScript("OnReceiveDrag",onReceive)
  14. f:SetScript("OnClick",onReceive)
  Reply With Quote