Hello there, still me with this.. !@?#£ gamepad UI.
So, in keyboard we got this :
- ItemTooltip (+ ComparativeTooltip1 / ComparativeTooltip2)
= Tooltips that comes from hovering an item in bags (bag, worn, bank, etc)
- InformationTooltip
= Base tooltip used almost everywhere to display simple text, map tooltips, etc.
- AbilityTooltip
= Used to display skill tooltips such as one in the K panel or in the ability bar
- GameTooltip
= Almost unused, very few code behind it
- PopupTooltip
= Used by LinkHandlers. they got the property to hide themselves when clicking back on the link, but they also got object properties of other tooltips (like itemtooltip).
- SkillTooltip
= Used to display skill effect other than abilities : ex : AvA passives given by map domination, keep & resources bonuses, champions skills & passives.
- KeepUpgradeTooltip
= AvA Keep Tooltips
Each tooltip got its own methods, properties to help devs to build custom tooltips.
In gamepad, we got ... something else.
There is not really tooltip, but "Information panels" even if the code, there called tooltips.
Data is same, but displayed differently. User move with his joystick between pins and info is displayed.
Ex of panels :
Core tooltips :
Consider almost all
core InformationTooltip as not displayed.
All thoses little help tooltips are simply.. not displayed fo console users. Some of them are displayed. Map is the best exemple. I found also some info on the C panel, the buffs tooltip is displayed, but that's all.
So How to write a "panel" Gamepad Tooltip ?
ZO_ScrollTooltip_Gamepad is the base. But it's a bit.. empty in functions.
To find list of available tooltips objects, you'll need to find the tooltip object (the CT_TOOLTIP) with the inheritance of ZO_ScrollTooltip_Gamepad and .. virtual is not our friend. there is a lot of potential object and findig them seems obviously hard.
I found 2 tooltips. one by /zgoo a lot, and 1 in the code iself. It was : ZO_MapLocationTooltip_Gamepad
so.. how to do ? For map pins ok, but what about other stuff ?
So, We'll use
ZO_GamepadTooltip &
ZO_Tooltip
ZO_GamepadTooltip got a nice method :GetTooltip() intended to rewrite the object and append or delete info ? maybe, to check.
ZO_GamepadTooltip:GetTooltip() seems to accept 1 parameter which is :
- GAMEPAD_LEFT_TOOLTIP = Tooltip displayed at the right of the screen
- GAMEPAD_RIGHT_TOOLTIP = Tooltip displayed at the left of the screen
- GAMEPAD_MOVABLE_TOOLTIP = Moveable tooltip (didn't found anyone for now)
- GAMEPAD_LEFT_DIALOG_TOOLTIP = Still unknown
- GAMEPAD_QUAD3_TOOLTIP = Still unknown
Do this and you'll get your object in a variable ?
Then, how to modify the tooltip itself ?
You'll need to use one of the methods of ZO_Tooltip :
http://wiki.esoui.com/API#ingame.5Ctooltip
But.. there is no AddLine or LayoutString or LayoutLine.. ?! How to do ?
To get our :AddLine(), you'll need
To work on the trolly object ZO_MapLocationTooltip_Gamepad or get the name of the ****** object (good luck).
Lua Code:
local myTooltip = ZO_MapLocationTooltip_Gamepad
myTooltip:LayoutIconStringLine(myTooltip.tooltip, icon:nilable, textToAdd, styleDefinedIn_ZO_TOOLTIP_STYLES)
ex :
Lua Code:
--tooltip creator
local pinTooltipCreator = {}
pinTooltipCreator.tooltip = 1 --TOOLTIP_MODE.INFORMATION
pinTooltipCreator.creator = function(pin)
-- some code
if IsInGamepadPreferredMode() and ZO_MapLocationTooltip_Gamepad
INFORMATION_TOOLTIP:LayoutIconStringLine(INFORMATION_TOOLTIP.tooltip, icon, text, arrayStyle)
else
INFORMATION_TOOLTIP:AddLine(text, arrayStyle)
end
end
local function OnGamepadPreferredModeChanged()
if IsInGamepadPreferredMode() then
INFORMATION_TOOLTIP = ZO_MapLocationTooltip_Gamepad
else
INFORMATION_TOOLTIP = InformationTooltip
end
end
local function OnAddonLoaded()
--LibMapPin
LMP:AddPinType(pinTypeString, pinTypeAddCallback, pinTypeOnResizeCallback, pinLayoutData, pinTooltipCreator)
OnGamepadPreferredModeChanged()
EVENT_MANAGER:RegisterForEvent(ADDON_NAME, EVENT_GAMEPAD_PREFERRED_MODE_CHANGED, OnGamepadPreferredModeChanged)
end
Or
Still untested , Don't succeed to make it work.
Get the Style of the Tooltip : For now I didn't found how to get the style of a tooltip. I can guess it, but not get it..
Acquire the tooltip (don't work)
Lua Code:
-- local myTooltip = ZO_GamepadTooltip:GetTooltip(GAMEPAD_LEFT_TOOLTIP)
Acquire the section
Lua Code:
local headerSection = self:AcquireSection(self:GetStyle("myStyle"))
Add line.
Lua Code:
headerSection:AddLine(myText, self:GetStyle("myStyle"))
The list of styles is defined in ZO_TOOLTIP_STYLES (/zgoo ZO_TOOLTIP_STYLES)
well maybe it's a lot of things untested or not really good to do, but it's a start, if you got any tips, come on.