Thread Tools Display Modes
05/21/14, 07:55 PM   #1
DuckTyped
Join Date: May 2014
Posts: 3
Anyone figured out the PopupTooltip?

I already know how to hook into the ItemToolTip.SetBagItem, however....

I'm trying to append information to the popuptooltips and I can't figure it out, I've tried all of the following and gotten no results:

Code:
	local f = PopupTooltip.SetBagItem
	PopupTooltip.SetWornItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end

	local f = PopupTooltip.SetLootItem
	PopupTooltip.SetLootItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end

	local f = PopupTooltip.SetSmithingMaterialItem
	PopupTooltip.SetSmithingMaterialItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end

	local f = PopupTooltip.SetStoreItem
	PopupTooltip.SetStoreItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end

	local f = PopupTooltip.SetTradeItem
	PopupTooltip.SetTradeItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end
Is this even possible?
  Reply With Quote
05/21/14, 08:37 PM   #2
Wobin
 
Wobin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 78
Originally Posted by DuckTyped View Post
I already know how to hook into the ItemToolTip.SetBagItem, however....

I'm trying to append information to the popuptooltips and I can't figure it out, I've tried all of the following and gotten no results:

Code:
	local f = PopupTooltip.SetBagItem
	PopupTooltip.SetWornItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end

	local f = PopupTooltip.SetLootItem
	PopupTooltip.SetLootItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end

	local f = PopupTooltip.SetSmithingMaterialItem
	PopupTooltip.SetSmithingMaterialItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end

	local f = PopupTooltip.SetStoreItem
	PopupTooltip.SetStoreItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end

	local f = PopupTooltip.SetTradeItem
	PopupTooltip.SetTradeItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end
Is this even possible?
Aside from the custom hooking which is generally unnecessary with tooltip additions, you realise you're overwriting 'f' each time...? Or is this just sample code?
  Reply With Quote
05/21/14, 08:41 PM   #3
DuckTyped
Join Date: May 2014
Posts: 3
Yes, I understand i'm overwriting f every time.

Is there another way to grab the information about the currently displayed item in a PopupTooltip and then append whatever I want to it?
  Reply With Quote
05/21/14, 08:43 PM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by DuckTyped View Post
I already know how to hook into the ItemToolTip.SetBagItem, however....

I'm trying to append information to the popuptooltips and I can't figure it out, I've tried all of the following and gotten no results:

Code:
	local f = PopupTooltip.SetBagItem
	PopupTooltip.SetWornItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end

	local f = PopupTooltip.SetLootItem
	PopupTooltip.SetLootItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end

	local f = PopupTooltip.SetSmithingMaterialItem
	PopupTooltip.SetSmithingMaterialItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end

	local f = PopupTooltip.SetStoreItem
	PopupTooltip.SetStoreItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end

	local f = PopupTooltip.SetTradeItem
	PopupTooltip.SetTradeItem = function(control, info1, info2, ...)
		f(control, info1, info2, ...)
		PH_AddToolTipInfo(control, info1, info2)
	end
Is this even possible?
I'm really not sure what are you trying to do, but hooks above works for me (btw you have typo in the first one - SetBagItem/SetWornItem).

Somewhere in code I have seen function ZO_PopupTooltip_SetLink(link), so I have tried also this hook:
Lua Code:
  1. local SetLink = PopupTooltip.SetLink
  2. PopupTooltip.SetLink = function(...)
  3.    SetLink(...)
  4.    local self, link = ...
  5.    self:AddLine("test")
  6. end
  7.  
  8. ZO_PopupTooltip_SetLink(GetItemLink(1,1))

EDIT:
Originally Posted by DuckTyped
Is there another way to grab the information about the currently displayed item in a PopupTooltip and then append whatever I want to it?
You can get item link of currently displayed item here:
Lua Code:
  1. local itemLink = PopupTooltip.lastLink

Last edited by Garkin : 05/21/14 at 08:47 PM.
  Reply With Quote
05/21/14, 08:52 PM   #5
DuckTyped
Join Date: May 2014
Posts: 3
Wow, I cannot believe I missed that. That's exactly what I wanted, thanks.
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » Anyone figured out the PopupTooltip?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off