Thread Tools Display Modes
07/17/14, 11:41 AM   #1
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Colored Addon Titles

Two questions I thought I'd find answered somewhere, but haven't.

1. Has it been pointed out to ZOS that they should sort addon titles (in addon enabling page) stripped from markup? I hate it when Guild Search Store (blue) precedes BestFriends (purple) because of the color. They're also cutting the string length disrespecting markup, so if you have an icon with long filename, they break it in the middle, and you get white rectangle instead.

2. If they're not going to fix it, do you think it's possible to establish a convention that would make specially titled addons sort correctly by a few initial characters at least? The trick would be to (ab)use the |c escape - put a sorting key to it instead of hexcolor (the parser doesn't care) - and place it before the desired color. Like this:
Code:
Title: |cBestFr|c9966ffBestFriends (example)
  Reply With Quote
07/17/14, 12:30 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
If it is enough to have sorted ingame addons list:
Lua Code:
  1. ZO_PreHook(ZO_AddOnManager, "SortScrollList",
  2.    function(self)
  3.       local scrollData = ZO_ScrollList_GetDataList(self.list)
  4.  
  5.       local function SortEntries(entry1, entry2)
  6.          local value1 = (entry1.data.addOnName):gsub("|c%w%w%w%w%w%w", ""):gsub("|r", ""):lower()
  7.          local value2 = (entry2.data.addOnName):gsub("|c%w%w%w%w%w%w", ""):gsub("|r", ""):lower()
  8.  
  9.          if value1 == value2 then
  10.             return (entry1.data.addOnFileName):lower() < (entry2.data.addOnFileName):lower()
  11.          else
  12.             return value1 < value2
  13.          end
  14.       end
  15.       table.sort(scrollData, SortEntries)
  16.  
  17.       return true
  18.    end)
Warning: Spoiler
  Reply With Quote
10/13/14, 06:26 PM   #3
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Addon manager on PTS 1.5.0 removes color codes for sorting purposes:

EsoUI\Common\ZO_AddOnManager\ZO_AddOnManager.lua, line 413:
Lua Code:
  1. local addOnSortName = title:gsub("|c%x%x%x%x%x%x", "")
  Reply With Quote
10/14/14, 04:32 AM   #4
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Nice, glad I abandoned the hacky idea in 2. Btw, does it remove |texture tags, too?
  Reply With Quote
10/14/14, 05:40 AM   #5
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by merlight View Post
Nice, glad I abandoned the hacky idea in 2. Btw, does it remove |texture tags, too?
No, it removes only color start tag |c??????, nothing else.
  Reply With Quote
10/14/14, 08:31 AM   #6
ZOS_ChipHilseberg
ZOS Staff!
Premium Member
Yes this person is from ZeniMax!
Join Date: Oct 2014
Posts: 551
Is texture markup commonly used in add-on titles? I could push to add some code for this release to strip that off the front as well if you all think it would be worthwhile.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Colored Addon Titles


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