Thread Tools Display Modes
05/12/15, 06:52 PM   #1
blakbird
 
blakbird's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 30
Better Glyph Tooltip

I saw this thread on reddit about glyphs and how the amount added by the glyph isn't always what it says. I always wondered why it didn't enchant the full amount on some pieces until I saw that post. That made me think of making an addon that does this:



It would require adding an image next to the first "Adds..." line and adding another line below it that says the same thing, but the number would be 40% of the one in the first line and that line would have the other image. The "Can only be applied...." line and everything below it would need to be dropped a little as well.

Votan has showed me how to move around things within a window, but I don't know how to add images or a whole new line that would print a number based on a number in another line. If anyone is interested in teaming up with me to do this, that would be awesome.
  Reply With Quote
05/12/15, 08:52 PM   #2
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
Looks nice.

The images are probably the hardest part of that. Here's a few approaches:

1) don't use images and just indicate large/small piece. Would be easiest and could be used as intermediate step (do this, then add images).

2) Use the icons as inline textures. I'm not real familiar on that format, though, so not sure of size limitations and all. If it works you wouldn't have to move controls around really (which could get messy).

3) Add to the tooltip as a single image. That'd be easier than managing 8, but you would have to mess with the tooltip a bit more directly than the tooltip build functions.

The other thing to keep in mind is infused pieces will get more. Not that you do want to display (since it's dependent on item quality), but it's something to keep in mind.
  Reply With Quote
05/13/15, 12:09 AM   #3
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Some things are doable, others may tricky or impossible.
For example:
Changing the tooltip text to add some images: easy.
Doing math within format string: not working.
This is a PoC:
Lua Code:
  1. SafeAddString(SI_ITEM_FORMAT_STR_DERIVED_STAT, "Adds |cffffff<<1>>|r <<2>>. |t25:25:esoui/art/mainmenu/menubar_inventory_down.dds|t\nAdds |cffffff40%|r of it. |t25:25:esoui/art/vendor/vendor_tabicon_fence_down.dds|t", 2)
Or you blank this line and add the information at the bottom. But beware. If you are showing something wrong, the players will blame you for everything.
And, by changing culture variant text, you have to do multi-language support.

The alignment will be a problem. You can not do text with dynamic length (the values) with in-line images and when say: "The images of the second line are aligned to the images of the first line". There is no markup to do this.

As Sasky said: You could change the text to give the hint about small and large pieces and when add a line at the bottom, which shows what small and large pieces are.

With "you" I mean a coder could do this for you
  Reply With Quote
05/13/15, 02:42 AM   #4
blakbird
 
blakbird's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 30
Thanks for helping me again, votan!!!


I changed up the text a little and added my own images to it and have this:

Lua Code:
  1. local function Addon_Loaded(eventCode, addOnName)
  2.     if (addOnName == "BetterGlyphTooltip") then
  3.  
  4.         SafeAddString(SI_ITEM_FORMAT_STR_DERIVED_STAT, "Adds |cffffff<<1>>|r <<2>>. |t100:25:BetterGlyphTooltip/Assets/Head3.dds|t\nAdds |cffffff40% of <<1>>|r <<2>>. |t100:25:BetterGlyphTooltip/Assets/feet.dds|t", 2)
  5.        
  6.     end
  7. end
  8.  
  9. EVENT_MANAGER:RegisterForEvent("BetterGlyphTooltip", EVENT_ADD_ON_LOADED, Addon_Loaded)

Right now, anything with that type of enchantment shows that text and those images. I only want this in the tooltip if the item is an armor glyph.

I am trying to figure out a way to get it to depend on this:

Lua Code:
  1. if GetItemLinkItemType(itemLink) == ITEMTYPE_GLYPH_ARMOR then

Is that possible?

Last edited by blakbird : 05/13/15 at 02:45 AM.
  Reply With Quote
05/13/15, 04:11 AM   #5
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by blakbird View Post
I am trying to figure out a way to get it to depend on this:

Lua Code:
  1. if GetItemLinkItemType(itemLink) == ITEMTYPE_GLYPH_ARMOR then

Is that possible?
I would say: yes.
One has to hook :SetBagItem and :SetLinkItem and exchange the string dynamically. Details must be worked out. But I am at work. So you have to wait a few hours
  Reply With Quote
05/13/15, 04:56 AM   #6
blakbird
 
blakbird's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 30
I didn't realize it would be so involved to have this only show up on armor glyph tooltips. I don't expect you to do all this for me. Only spend your time helping me with this if it interests you.

Is it possible to extract the number from the <<1>> outside of the format string and apply the math to it, then put that new number into the format string?

I need to get to bed. It's almost 4AM here. As always, thanks for the help, votan!
  Reply With Quote
05/13/15, 05:58 AM   #7
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,962
Just an idea about the value that you want to extract and apply "math" to it:
Without checking the source code this could have been done in garkin's addon "CritPercent" http://www.esoui.com/downloads/info951-CritPercent.html

Maybe you find your answers there
  Reply With Quote
05/13/15, 07:02 AM   #8
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by Baertram View Post
Just an idea about the value that you want to extract and apply "math" to it:
Without checking the source code this could have been done in garkin's addon "CritPercent" http://www.esoui.com/downloads/info951-CritPercent.html

Maybe you find your answers there
Yep, you are right, Baertram. If one has to hook and write code anyway, one could call additional functions and do the math.
And Garkin's code is hooking the functions I was talking about and more. Good stuff. Not suprising, it's Garkin
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » Better Glyph Tooltip

Thread Tools
Display Modes

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