View Single Post
11/06/15, 01:03 PM   #3
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
In addition to Ayantir:
GAMEPAD_TOOLTIPS seems to be the official global name.
:AddLine accepts a dynamic list of styles. A "style" is a table which contains style-values. /zgoo ZO_TOOLTIP_STYLES to see which values are supported. The style-value defined first wins => The priority goes from left to right.
Lua Code:
  1. -- ....
  2. local mystyle = { fontSize = 34, fontColorField = GAMEPAD_TOOLTIP_COLOR_GENERAL_COLOR_1, }
  3. local function AddInfo_Gamepad(tooltip, itemLink)
  4.     if itemLink then
  5.         tooltip:AddLine("Whatever text you want to add", mystyle, tooltip:GetStyle("bodySection"))
  6.     end
  7. end
  8.  
  9. -- ...
  10.  
  11. local function TooltipHook_Gamepad(tooltipControl, method, linkFunc)
  12.     local origMethod = tooltipControl[method]
  13.  
  14.     tooltipControl[method] = function(self, ...)
  15.         origMethod(self, ...)
  16.         AddInfo_Gamepad(self, linkFunc(...))
  17.     end
  18. end
  19.  
  20. -- This helper function is just there in case the position of the item-link will change
  21. local function ReturnItemLink(itemLink)
  22.     return itemLink
  23. end
  24.  
  25. local function HookBagTips()
  26. -- ...
  27.  
  28.     TooltipHook_Gamepad(GAMEPAD_TOOLTIPS:GetTooltip(GAMEPAD_LEFT_TOOLTIP), "LayoutItem", ReturnItemLink)
  29.     TooltipHook_Gamepad(GAMEPAD_TOOLTIPS:GetTooltip(GAMEPAD_RIGHT_TOOLTIP), "LayoutItem", ReturnItemLink)
  30.     TooltipHook_Gamepad(GAMEPAD_TOOLTIPS:GetTooltip(GAMEPAD_MOVABLE_TOOLTIP), "LayoutItem", ReturnItemLink)
  31. end
  32. --...
The first parameter of :LayoutItem is an item-link. You have to adapt the TooltipHook_Gamepad to your needs. It's just an example to start with.

Last edited by votan : 11/06/15 at 01:48 PM.
  Reply With Quote