Download
(4 Kb)
Download
Updated: 05/30/19 08:47 AM
Pictures
File Info
Compatibility:
Elsweyr (5.0.5)
Wrathstone (4.3)
Updated:05/30/19 08:47 AM
Created:03/05/19 11:22 AM
Monthly downloads:25
Total downloads:3,258
Favorites:6
MD5:
Custom Quality Colors
Version: 1.12
by: DonRomano [More]
Custom Quality Colors is a tool for changing colors used to display the quality of items.
To change the colors go to Settings->Addons->Custom Quality Colors.
New colors will be used on all the list and tooltips throughout the UI.

This addon depends on LibStub and LibAddonMenu-2.0 - please, make sure you have them installed.

The addon was requested (well, sort of) by Shadowshire - thank you!
Tooltips hookup methods are based on functions used in Enchanted Quality addon written by Rhyono & votan.
v. 1.12
- Fixed an issue causing conflict with Tamriel Trade Center tooltips

v. 1.11
- API Bump for "Elsweyr

v.1.10
- custom quality color scheme is now used an all tooltips (great thanks to Kyoma for showing me the right example)
- tooltips hookup methods are based on functions used in Enchanted Quality addon written by Rhyono, votan

v. 1.0
- Initial release (thanks to Shadowshire for the idea)
Optional Files (0)


Post A Reply Comment Options
Unread 05/28/21, 04:03 AM  
boltyr

Forum posts: 0
File comments: 2
Uploads: 0
Originally Posted by Berun
I realize the last post is almost a year old, but I thought I'd mention that the addon is working fine for me. I did edit CustomQualityColors.txt to update the API Version to the lastest (100034) and removed LibStub from the DependsOn line. With those changes and a current LibAddonMenu-2.0, this addon works.
Did you change just that? I tried changing what you mentioned (API Version number and removing LibStud from DependsOn) but the addon isn't working for me.

---------------------------------
Edit:

For anyone that might stumble into this in the future, you also need to change the 2nd line of CQCSettings.lua FROM local LAM = LibStud("LibAddonMenu-2.0") TO local LAM = LibAddonMenu2
Last edited by boltyr : 05/28/21 at 04:13 AM.
Report comment to moderator  
Reply With Quote
Unread 05/04/21, 11:07 AM  
Berun

Forum posts: 0
File comments: 7
Uploads: 0
I realize the last post is almost a year old, but I thought I'd mention that the addon is working fine for me. I did edit CustomQualityColors.txt to update the API Version to the lastest (100034) and removed LibStub from the DependsOn line. With those changes and a current LibAddonMenu-2.0, this addon works.
Report comment to moderator  
Reply With Quote
Unread 05/28/20, 02:10 AM  
BnJbirds

Forum posts: 0
File comments: 1
Uploads: 0
Update?

As I am color blind, I cant see the difference between the purple and blue items. I had this add on and it was working perfectly till the Greymoor update.
Is there plans to update or is anyone working on something similar?
Report comment to moderator  
Reply With Quote
Unread 05/31/19, 02:05 AM  
DonRomano
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 22
Uploads: 3
Originally Posted by Farloc
Yep! Working in all places that I can see. Thanks a million.
Let's hope it stays that way!
Report comment to moderator  
Reply With Quote
Unread 05/30/19, 06:11 PM  
Farloc

Forum posts: 0
File comments: 5
Uploads: 0
Originally Posted by DonRomano
It proved to be a little more difficult than I thought but I think I've finally found a solution.

It turned out that CQC needs to register tooltip hooks BEFORE TTC does so I had to move the call to HookTooltips function to main file level. It's not pretty but it should work.

Please, let me know if version 1.12 works properly.
Yep! Working in all places that I can see. Thanks a million.
Report comment to moderator  
Reply With Quote
Unread 05/30/19, 08:56 AM  
DonRomano
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 22
Uploads: 3
It proved to be a little more difficult than I thought but I think I've finally found a solution.

It turned out that CQC needs to register tooltip hooks BEFORE TTC does so I had to move the call to HookTooltips function to main file level. It's not pretty but it should work.

Please, let me know if version 1.12 works properly.
Report comment to moderator  
Reply With Quote
Unread 05/29/19, 04:01 AM  
DonRomano
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 22
Uploads: 3
Originally Posted by Farloc
There are no obvious debug messages. I had to add quite a few to TTC to figure out where the failure point was. From what I can tell. TTC fails during the item look up step. (TamrielTradeCentre.ItemLookUpTable[itemName]) What didn't make sense is the input seemed the same. With some string formatting it looks like the string coloring is also transferred with the string so the TTC lookup fails. (colorHex|Text) I was able to get around this by using zo_strformat instead of SafeAddString.

Replaced: SafeAddString(SI_TOOLTIP_ITEM_NAME, CustomQualityColors.GetItemQualityC(item_quality):Colorize(CustomQualityColors.OriginalTooltipName), 2)

with: zo_strformat(SI_TOOLTIP_ITEM_NAME, CustomQualityColors.GetItemQualityC(item_quality):Colorize(CustomQualityColors.OriginalTooltipName))


Edit: And I realized after I typed a reply you came to a similar conclusion. Thanks for digging into it!
Thank you for debugging this. Your findings and the message from Akopian Atrebates (thanks!) confirm that the root cause of the problem are the changes I make to the SI_TOOLTIP_ITEM_NAME string. I hope that delaying my hookup function will solve this problem.

Later in the day I'll prepare a new version of the addon and we'll see

Thanks!
Report comment to moderator  
Reply With Quote
Unread 05/29/19, 03:40 AM  
Farloc

Forum posts: 0
File comments: 5
Uploads: 0
Originally Posted by DonRomano

The quest reward and inventory may use different tooltip screens so it's quite possible that one of them is working just fine and the other runs into problems. CQC works by hijacking the tooltip display functions (there are a few of them) and simply changes the color of the item string a moment before it is displayed.

I looked briefly at the code and it turns out that both TTC and CQC hijack the same function responsible for displaying item tooltip. TTC uses it to insert its information and CQC just changes the color of the item string. Both addons call the base function so it should work no matter which addon hooks to the function as the first one.

It looks like TTC hookup is working because as you've noticed there is an empty section divider and the first thing TTC does is inserting it into tooltip. But then for some reason TTC hookup function doesn't find "PriceInfo". In TTC there's a long function called "GetPriceInfo" with a lot of ifs and I suspect one of the conditions is not met and the function returns nil.

I will try to reproduce the problem and debug it.

In the meantime could you do a little debugging? I can see that TTC has some debug messages that need to be turned on. To do it you have to change "TamrielTradeCentre.IsDebug = false" to true in "TamrielTradeCentreInit.lua". It's right at the beginning of the file. Could you do it and see if there are any debug messages that will help us find the source of the problem?
There are no obvious debug messages. I had to add quite a few to TTC to figure out where the failure point was. From what I can tell. TTC fails during the item look up step. (TamrielTradeCentre.ItemLookUpTable[itemName]) What didn't make sense is the input seemed the same. With some string formatting it looks like the string coloring is also transferred with the string so the TTC lookup fails. (colorHex|Text) I was able to get around this by using zo_strformat instead of SafeAddString.

Replaced: SafeAddString(SI_TOOLTIP_ITEM_NAME, CustomQualityColors.GetItemQualityC(item_quality):Colorize(CustomQualityColors.OriginalTooltipName), 2)

with: zo_strformat(SI_TOOLTIP_ITEM_NAME, CustomQualityColors.GetItemQualityC(item_quality):Colorize(CustomQualityColors.OriginalTooltipName))


Edit: And I realized after I typed a reply you came to a similar conclusion. Thanks for digging into it!
Last edited by Farloc : 05/31/19 at 02:40 AM.
Report comment to moderator  
Reply With Quote
Unread 05/29/19, 01:19 AM  
Akopian Atrebates

Forum posts: 9
File comments: 230
Uploads: 0
I remember having a similar problem with a previous addon "Enchanted Quality" that would add the quality of the enchantment of an item to its name in the tooltip. So Legendary Powered Lightning Staff would be displayed for a Powered Lightning staff that had a yellow enchantment. As an alternative it would colorize the name of the enchantment to indicate the quality of the enchantment visually. The renaming in the tooltip would also cause problems with TTC finding the name of the item, and some other addons too. So I turned that part of the naming addon off and went with the colorized description of the enchantment in the description of the item stats. It worked well after that.

Originally Posted by DonRomano
Originally Posted by DonRomano
I looked briefly at the code and it turns out that both TTC and CQC hijack the same function responsible for displaying item tooltip. TTC uses it to insert its information and CQC just changes the color of the item string. Both addons call the base function so it should work no matter which addon hooks to the function as the first one.
Well, sometimes all you need to do is to write it all down

I suspect I've found the source of the problem. To change the color, CQC changes a system string SI_TOOLTIP_ITEM_NAME using function called Colorize. TTC uses the same string (SI_TOOLTIP_ITEM_NAME) to find the name of the item and then checks if the item is in the TCC database. But if the SI_TOOLTIP_ITEM_NAME string is changed TTC will not find the item - simple. So if TTC hooks up before CQC everything should work just fine. I'll have to call my hookup functions a little later and it should solve the problem. Let me prepare a new version of the addon...
Report comment to moderator  
Reply With Quote
Unread 05/29/19, 12:44 AM  
DonRomano
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 22
Uploads: 3
Originally Posted by DonRomano
I looked briefly at the code and it turns out that both TTC and CQC hijack the same function responsible for displaying item tooltip. TTC uses it to insert its information and CQC just changes the color of the item string. Both addons call the base function so it should work no matter which addon hooks to the function as the first one.
Well, sometimes all you need to do is to write it all down

I suspect I've found the source of the problem. To change the color, CQC changes a system string SI_TOOLTIP_ITEM_NAME using function called Colorize. TTC uses the same string (SI_TOOLTIP_ITEM_NAME) to find the name of the item and then checks if the item is in the TCC database. But if the SI_TOOLTIP_ITEM_NAME string is changed TTC will not find the item - simple. So if TTC hooks up before CQC everything should work just fine. I'll have to call my hookup functions a little later and it should solve the problem. Let me prepare a new version of the addon...
Report comment to moderator  
Reply With Quote
Unread 05/29/19, 12:15 AM  
DonRomano
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 22
Uploads: 3
Originally Posted by Farloc
From what I can tell all of them. What is odd, I assumed it was TTC broken but noticed looking at an item in a quest reward screen it showed the TTC tooltip but lost the tooltip once it got into the inventory. Unsure if there is something specific to the inventory. I can do some additional experimentation and see which specific hook is failing and see if that helps. -- Does Custom Quality Colors affect items before it gets to the inventory?

It should be noted that this was working fine before Elsweyr dropped but there has been a huge migration of addons to separate themselves from their libraries. Unsure if Lua has defined scoping.


By the way... Thanks so much for making this. I am color blind and being able to change the colors helps immensely!!
The quest reward and inventory may use different tooltip screens so it's quite possible that one of them is working just fine and the other runs into problems. CQC works by hijacking the tooltip display functions (there are a few of them) and simply changes the color of the item string a moment before it is displayed.

I looked briefly at the code and it turns out that both TTC and CQC hijack the same function responsible for displaying item tooltip. TTC uses it to insert its information and CQC just changes the color of the item string. Both addons call the base function so it should work no matter which addon hooks to the function as the first one.

It looks like TTC hookup is working because as you've noticed there is an empty section divider and the first thing TTC does is inserting it into tooltip. But then for some reason TTC hookup function doesn't find "PriceInfo". In TTC there's a long function called "GetPriceInfo" with a lot of ifs and I suspect one of the conditions is not met and the function returns nil.

I will try to reproduce the problem and debug it.

In the meantime could you do a little debugging? I can see that TTC has some debug messages that need to be turned on. To do it you have to change "TamrielTradeCentre.IsDebug = false" to true in "TamrielTradeCentreInit.lua". It's right at the beginning of the file. Could you do it and see if there are any debug messages that will help us find the source of the problem?
Last edited by DonRomano : 05/29/19 at 12:24 AM.
Report comment to moderator  
Reply With Quote
Unread 05/28/19, 08:45 PM  
Farloc

Forum posts: 0
File comments: 5
Uploads: 0
Originally Posted by DonRomano
Hello Farloc,

Thank you for the info and for narrowing it down to one function! I'll try to take a closer look and see what's going on.
One more question: when the TTC tooltips are broken - are they missing on all of the items or is it that just only some of them lack the TTC tooltip?
From what I can tell all of them. What is odd, I assumed it was TTC broken but noticed looking at an item in a quest reward screen it showed the TTC tooltip but lost the tooltip once it got into the inventory. Unsure if there is something specific to the inventory. I can do some additional experimentation and see which specific hook is failing and see if that helps. -- Does Custom Quality Colors affect items before it gets to the inventory?

It should be noted that this was working fine before Elsweyr dropped but there has been a huge migration of addons to separate themselves from their libraries. Unsure if Lua has defined scoping.


By the way... Thanks so much for making this. I am color blind and being able to change the colors helps immensely!!
Last edited by Farloc : 05/28/19 at 09:20 PM.
Report comment to moderator  
Reply With Quote
Unread 05/28/19, 01:48 AM  
DonRomano
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 22
Uploads: 3
Hello Farloc,

Thank you for the info and for narrowing it down to one function! I'll try to take a closer look and see what's going on.
One more question: when the TTC tooltips are broken - are they missing on all of the items or is it that just only some of them lack the TTC tooltip?
Report comment to moderator  
Reply With Quote
Unread 05/28/19, 01:32 AM  
Farloc

Forum posts: 0
File comments: 5
Uploads: 0
Good evening!

I am running into a conflict between Custom Quality Colors and TTC. I am unsure where it could possible be coming from. With a binary search turning off addons it was narrowed to Custom Quality Colors.

I commented out ```CustomQualityColors.HookTooltips()``` in OnAddOnLoaded and it looks to be working without issues.

Working TCC with Custom Colors disabled - https://pasteboard.co/IgKTJnh.jpg
Blank Tooltip section with Custom Colors enabled - https://pasteboard.co/IgKUicK.jpg
Last edited by Farloc : 05/28/19 at 01:33 AM.
Report comment to moderator  
Reply With Quote
Unread 05/25/19, 02:46 AM  
Shadowshire

Forum posts: 1
File comments: 402
Uploads: 0
Exclamation Re: compatibility with other add-ons

Originally Posted by Marazota
so usefull addon but non compatible with any other addons with tooltips
sad
must disable it for now
Frankly, you must have found a compatibility problem with one or more specific add-ons which the game client loads when you log-in to play a character.
  • You should disable all add-ons which modify item tooltips, reload the UI, and check whether the error(s) that you found before exist in the unmodified gameware UI. Then re-enable Custom Quality Colors, reload the UI again, and check for problems.
  • Then, one by one: (1) re-enable one of the other add-ons and check whether a compatibility issue occurs after you enable it; if it does then you have found a party to the conflict. (2) Disable the add-on which you re-enabled, then repeat the previous step, until all add-ons have been checked in relation to Custom Quality Colors.
I have been using Custom Quality Colors with numerous add-ons which modify tooltips. So far, I have not found any compatibility problem(s) that are caused by Custom Quality Colors. The add-on Master Recipe List sometimes has compatibility problems with other add-ons which modify furnishing "recipe" tooltips, for example, but it is difficult to determine which add-on is "at fault" when I find a conflict between it and another add-on(s).
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: