Thread Tools Display Modes
12-23-06, 01:09 PM   #1
Zeksie
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 24
Custom sort func for SecureHeaders

Would be useful to have ability to set a custom sorting function for the party and raid headers. Useful for named lists, or abitrary class selections that would benefit from class order for example.

So, in the configureChildren function in SecureTemplates.lua, something like this:

Code:
	local sortMethod = self:GetAttribute("sortMethod") or "INDEX"; --sort by ID by default
	local sortDir = self:GetAttribute("sortDir") or "ASC"; --sort ascending by default
        local customSort = self:GetAttribute("sortFunc")

        if (type(customSort) == "function") then
                table.sort(sortingTable, customSort)
        elseif ( sortMethod == "NAME" ) then
		table.sort(sortingTable);
	end
  Reply With Quote
01-08-07, 07:08 PM   #2
Flickerstreak
A Deviate Faerie Dragon
Join Date: Dec 2006
Posts: 19
That one will never happen, because you could write a custom sort function that sorts raid units by health deficit, which is exactly what they want to expressly prohibit. The best you might get would be a selection of pre-defined (static) sort orders. By class, by level, by group, that's about all you could come up with.

Remember it's perfectly OK to re-arrange unit frames out of combat. So, you can create whatever kind of fancy sorting technique you want and perform the sort before combat starts - it just won't work when in combat. With the right coding, you can even set up a finite set of such sorts and then switch between them with a button press or keybind once combat begins... but again they all would need to be set up while out of combat. Pays to be prepared I guess.
  Reply With Quote

WoWInterface » Developer Discussions » Wish List » Custom sort func for SecureHeaders


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