ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   My first attempt at modifying a tooltip (https://www.esoui.com/forums/showthread.php?t=7677)

nightstrike2 03/17/18 05:34 PM

My first attempt at modifying a tooltip
 
I'm getting the hang of writing these addons, but now I'm going to embark on a new path of trying to modify the item tooltips that pop up. Right now, I run with CraftStore (Rhyno's version), MM, and Master Recipe List, all of which modify these tooltips. It's very difficult to extract from their code bases, however, how to do this simply.

What I'd like to do specifically is modify the tooltips of achievement furnishings. Before you get the achievement, the tooltip text tells you in red what you need to do to be able to purchase it. After you get the achievement, the text is gone. I'd like to make an addon that, after you get the achievement, puts text in there (maybe in green) telling you what you did to be able to buy it.

Can I get some pointers on how to start this?

Dolgubon 03/17/18 08:37 PM

Try using ItemTooltip:AddLine. You can check the esoui source code if you need examples

nightstrike2 03/18/18 05:40 PM

Thanks for the pointer. I seem to be on the right track with this:

Lua Code:
  1. local f = ItemTooltip["SetStoreItem"]
  2. ItemTooltip["SetStoreItem"] = function(self, index)
  3.     f(self, index)
  4.     local types = { GetStoreEntryTypeInfo(index) }
  5.     for i = 1, #types do
  6.         if (types[i] == ITEMFILTERTYPE_FURNISHING) then
  7.             self:AddLine("xxx")
  8.             break
  9.         end
  10.     end
  11. end

But now somehow I need to know whether the achievement text is already there. I used GetStoreItemLink on the entry and dumped it out to chat, and discovered that the item link itself doesn't contain the red achievement text in it. So, it gets added somewhere else. Do you know what adds that text, and how it gets added?

nightstrike2 03/22/18 04:25 PM

Anybody have some ideas here?

Baertram 03/24/18 04:34 PM

I'd check the esoui source code online at github and search the code for achievement or tooltip at the file which shows the tooltip.
https://github.com/esoui/esoui/tree/master/esoui

e.g. if you are in the inventory and hover the mouse above an item it should be some tooltip in the inventory, so check the ingame/inventory folder for files about tooltips etc.
https://github.com/esoui/esoui/tree/...game/inventory

Or just use the search at the top to search for wordings, function names etc. you know of being used in the consense. Maybe just check the itemtooltip files and check which functions are able to add lines -> scan for those in the total code.

Maybe it's the achievementtooltips file:
https://github.com/esoui/esoui/blob/...nttooltips.lua

Or this file here:
https://github.com/esoui/esoui/blob/...ltipstyles.lua

Check for e.g.
ZO_TOOLTIP_STYLES =
...
achievementDescriptionIncomplete

It could be the red line? Search for the usage of ZO_TOOLTIP_STYLES[achievementDescriptionIncomplete] this text/part and maybe you'll find where it get's added.

nightstrike2 03/24/18 08:50 PM

Quote:

Originally Posted by Baertram (Post 34219)
I'd check the esoui source code online at github and search the code for achievement or tooltip at the file which shows the tooltip.
https://github.com/esoui/esoui/tree/master/esoui

e.g. if you are in the inventory and hover the mouse above an item it should be some tooltip in the inventory, so check the ingame/inventory folder for files about tooltips etc.
https://github.com/esoui/esoui/tree/...game/inventory

It appears while in the store. Perhaps https://github.com/esoui/esoui/tree/...w_keyboard.lua?

Quote:

Or just use the search at the top to search for wordings, function names etc. you know of being used in the consense. Maybe just check the itemtooltip files and check which functions are able to add lines -> scan for those in the total code.

Maybe it's the achievementtooltips file:
https://github.com/esoui/esoui/blob/...nttooltips.lua
I think that's for displaying tooltips in the Journal/Achievement window

Quote:

Or this file here:
https://github.com/esoui/esoui/blob/...ltipstyles.lua

Check for e.g.
ZO_TOOLTIP_STYLES =
...
achievementDescriptionIncomplete

It could be the red line? Search for the usage of ZO_TOOLTIP_STYLES[achievementDescriptionIncomplete] this text/part and maybe you'll find where it get's added.
That's also for use in the Journal/Achievement window.

Is there a way to scan the live code in memory while in the game for the text that appears in the tooltip, to see what variable holds it or how it's getting generated? The text has to live somewhere.

Baertram 03/25/18 07:21 AM

Store (crown store) stuff is not accessible vua addons.

You are able to use zgoo /mouse to check for controls you host the mouse over (zgoo addon).
That way you get the name of controls and their nparent. This can be searched for in the src online and you'll find the xml file where the control is defined, it the usage in lua code.

You need to find the addition of the tooltip then. Try esoui/ingame/guildstore files maybe if you search for controls happening in the guild stores.

nightstrike2 03/25/18 03:01 PM

Specifically, I was looking at items in the achievement furnishing store. That's not the crown store, so are those accessible via addons?

I have zgoo installed, but I don't quite understand its output. I'll keep poking around.

Baertram 03/26/18 12:31 PM

zgoo /mouse is showing you a list of funcitons and variables available for the control below the mouse.
So if you find something like GetParent() it's the funcito getparent() which will show you the parent control of the control below your mouse.

You can expand the + in front of some tables to see the contents or click the : of the funciton (e.g. GetParent()) to get the parent control and show it's functions and variables.

This way you are able to find out the state of variables, funciton names and via the function GetName() the name of the control below the mouse.

If you searhc for this name or a part of the name (e.g. if the name is ZOFurnitureAchievementStoreRow1Column2 the name of the control you might be searching for would be ZOFurnitureAchievementStore).


All times are GMT -6. The time now is 07:05 AM.

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