ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   ability tooltips (https://www.esoui.com/forums/showthread.php?t=5237)

circonian 10/28/15 07:02 PM

ability tooltips
 
Is there any way to get ability tooltips for abilities, by abilityId, that your character does not have (without building them myself)? Like abilities from other classes.
I found these, but they only work for skills the character has (or can have).
Lua Code:
  1. SkillTooltip:SetProgressionAbility(progressionIndex, morph, rank)
  2. SkillTooltip:SetSkillAbility(skillType, lineIndex, abilityIndex)


This looks like it could be useful, but how is this used?
Lua Code:
  1. function ZO_Tooltip:LayoutAbility(abilityId, hideRank, overrideRank, pendingChampionPoints, addNewEffects)
I assumed it would be accessible from any of the tooltips, like SkillTooltip or AbilityTooltip, but its not. I also do not see a ZO_Tooltip:New() anywhere, so what has access to that function?

Ayantir 10/28/15 08:10 PM

If you want the tooltip for Keyboard mode, it's impossible, it is hardcoded.

ZO_Tooltip:LayoutAbility() is unused. Maybe now it's used for gamepad mode, but I don't think so, it was during my checks at 1.4 or 1.5

I wrote a lib (LibSkillsFactory) -- which I should update in order to create something similar. But didn't succeed to reproduce tooltip exactly same as the are.

Look a bit in superstar if you didn't tried yet..

circonian 10/28/15 08:12 PM

Actually I figured it out...partially:

Lua Code:
  1. if not MyAbilityTooltip then
  2.     --AbilityTooltipTopLevel
  3.     --ZO_Tooltip
  4.         MyAbilityTooltip = CreateControlFromVirtual("someUniqueName", ZO_Compass, "ZO_Tooltip")
  5.         local ZO_Dyeing_Gamepad_Tooltip_Styles = ZO_ShallowTableCopy(ZO_TOOLTIP_STYLES)
  6.         ZO_Tooltip:Initialize(MyAbilityTooltip, ZO_Dyeing_Gamepad_Tooltip_Styles, style)
  7.     end
  8.    
  9.     MyAbilityTooltip:ClearAnchors()
  10.     MyAbilityTooltip:SetOwner(self, TOPLEFT, 100, 100, TOPLEFT)
  11.    
  12.     InitializeTooltip(MyAbilityTooltip, GuiRoot, TOPLEFT, 100, 100, TOPLEFT)
  13.    
  14.         local upgradeSection = MyAbilityTooltip:AcquireSection(MyAbilityTooltip:GetStyle("abilityUpgradeSection"))
  15.         MyAbilityTooltip:AddSectionEvenIfEmpty(upgradeSection)
  16.     MyAbilityTooltip:LayoutAbility(abilityId, hideRank, overrideRank, pendingChampionPoints, addNewEffects)

But it takes up the whole screen and MyAbilityTooltip:SetDimensions(xx, yy) seems to have no effect. The styles are messing it up, going to try to write my own style table for it, to change dimensions & see if that works.

votan 10/29/15 12:16 AM

This is how I do it in Potion Maker:
Code:

    <Tooltip name="PotionMakerTooltip" inherits="ZO_ItemIconTooltip" mouseEnabled="true" movable="true" hidden="true">
      <ResizeToFitPadding width="48" height="57"/>
      <DimensionConstraints minX="416" maxX="416" />
    </Tooltip>

No issue with the size.

circonian 10/30/15 10:04 PM

Thank you both for the information.

@votan
Yeah if I use a normal tooltip it works just fine, no problem with size. I was trying to find a way to create an object that would allow me to directly use the function to set a tooltip by ability Id, which is what caused the sizing problem. Writing my own style table fixed the problem, but as Ayantir said we can't access all of the ability information so it was a pointless effort :(

@Ayantir
I looked at the lib, nice work btw, but I think I just can't get what I want. I was hoping to create tooltips for all of the effects you receive through EVENT_EFFECT_CHANGED. Some abilities actually fire multiple effects on you each with their own abilityId. I was trying to find a way to build tooltips for those, but the ability functions, like GetAbilityDescription(), don't return any descriptions for those effects even though they have their own abilityId.

I thought I might still be able to do it for debuffs, but apparently not. The abilityIds received when debuffed are not the same abilityIds as those in the skill lines (so you can't get any information about them). The debuffs must be counted as those special effects that have their own unique abilityId and I don't see any way to tell which "real" abilityId the effect came from to display the original tooltip.


All times are GMT -6. The time now is 10:43 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI