View Single Post
08-27-22, 09:01 AM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by SDPhantom View Post
show the tooltip when it's done processing the cursor.
Code:
local function onReceive(self)
	GameTooltip:Show()
	local infoType, arg1, arg2 = GetCursorInfo()
	if infoType=="item" then
	local itemName, _, _, _, _, _, _, _, _, itemTexture = GetItemInfo(arg2)		
	db.profile["Bars"][frm:GetID()][i].item = itemName	
	ClearCursor()	
	end	
end
Lua Code:
  1. local function onReceive(self)
  2.     local infoType, arg1, arg2 = GetCursorInfo()
  3.     if infoType=="item" then
  4.         print(infoType, arg1, arg2)
  5.         local itemName, _, _, _, _, _, _, _, _, itemTexture = GetItemInfo(arg2)
  6.         db.profile["Bars"][frm:GetID()][i].item = itemName
  7.         ClearCursor()
  8.  
  9.         tooltip:GetScript("OnEnter")(tooltip, false);-- Calls your OnEnter handler above
  10.     end
  11. end
Note: See https://wowpedia.fandom.com/wiki/UIHANDLER_OnEnter for OnEnter handler args.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote