Funky note that you should add the type = "data source" field to your ldb object else it will fail to load on various display plugins, tekkub stated its required on wiki.
I added a little bit of code to be able to sort the list by Name (Ascending and Descending). In StatBlock_Memory.lua:
1. Add the following two functions under mySort:
<<code>>local function mySort(x,y)
return x.mem > y.mem
end
local function mySortName(x,y) Vux
return x.addon < y.addon
end
local function mySortNameDescending(x,y) Vux
return x.addon > y.addon
end<</code>>
-----
2. And in function Mem.obj.OnTooltipShow(tooltip):
<<code>>table.sort(memTbl, mySort) Comment this out
if( IsShiftKeyDown() ) then Vux
table.sort(memTbl, mySortName)
elseif ( IsControlKeyDown() ) then
table.sort(memTbl, mySortNameDescending)
else
table.sort(memTbl, mySort)
end<</code>>
-----
- Hold Shift and then mouseover the icon and the tooltip will be name sorted in alphabetical order.
- Hold Control and the tooltip will be sorted in backwards alphabetical order.
- And of course, don't hold either button and it's sorted by total memory usage (as normal) :)
Any chance you might be able to add this to the next version?
Anyway, just thought there might be others out there who might have wanted this feature as well :)
- #2
merah Sun, 08 Feb 2009 13:14:51Funky note that you should add the type = "data source" field to your ldb object else it will fail to load on various display plugins, tekkub stated its required on wiki.
- #1
Paul2200 Thu, 27 Nov 2008 04:55:21I added a little bit of code to be able to sort the list by Name (Ascending and Descending). In StatBlock_Memory.lua:
1. Add the following two functions under mySort:
<<code>>local function mySort(x,y) return x.mem > y.mem endlocal function mySortName(x,y)
Vux return x.addon < y.addon endlocal function mySortNameDescending(x,y)
Vux return x.addon > y.addon end<</code>>-----2. And in function Mem.obj.OnTooltipShow(tooltip):
<<code>>table.sort(memTbl, mySort)Comment this outif( IsShiftKeyDown() ) then
Vux table.sort(memTbl, mySortName) elseif ( IsControlKeyDown() ) then table.sort(memTbl, mySortNameDescending) else table.sort(memTbl, mySort) end<</code>>------ Hold Shift and then mouseover the icon and the tooltip will be name sorted in alphabetical order.
- Hold Control and the tooltip will be sorted in backwards alphabetical order.
- And of course, don't hold either button and it's sorted by total memory usage (as normal) :)
Any chance you might be able to add this to the next version?
Anyway, just thought there might be others out there who might have wanted this feature as well :)
- Vux of US-Dragonblight