/trunk
if not b then return true end |
if a.buffName and b.buffName then |
if a.timeLeft and b.timeLeft then return a.timeLeft < b.timeLeft end |
if a.timeLeft then return false end |
if b.timeLeft then return true end |
return a.buffName < b.buffName |
if a.timeLeft then return true end |
if b.timeLeft then return false end |
return a.buffName > b.buffName |
end |
if a.buffName then return true end |
if b.buffName then return false end |
debuff = 16, |
weapon = 2, |
} |
-- interger as id's for correct select order on AceConfig dialogs |
local SORT_TYPES = { |
['none'] = L.SortNone, |
['alpha'] = L.SortAlpha, |
['revert'] = L.SortRevert, |
['inc'] = L.SortInc, |
['dec'] = L.SortDec, |
['none'] = 1, |
['alpha'] = 2, |
['revert'] = 3, |
['inc'] = 4, |
['dec'] = 5, |
} |
local SORT_DESC = { |
[1] = L.SortNone, |
[2] = L.SortAlpha, |
[3] = L.SortRevert, |
[4] = L.SortInc, |
[5] = L.SortDec, |
} |
local HIDE_BLIZZ_BARS = true -- for testing |
local SUB_HELP_MSG = ' - |cFF33FF99%s|r: %s' |
Bison.version = format( L.Version, GetAddOnMetadata( 'Bison', 'Version') or 'unknown', RED_FONT_COLOR_CODE, 'WotLK', FONT_COLOR_CODE_CLOSE) |
function Bison:OnInitialize() |
self:ToggleDebugLog( true) |
self:ToggleDebugLog( false) |
self.db = LibStub( 'AceDB-3.0'):New( 'BisonDB', DEFAULTS, 'Default') |
self:InitConfig() |
end |
function Bison:GetSort( info) |
local bar = GetBar( info) |
return self.db.profile[bar] and self.db.profile[bar].sort |
return self.db.profile[bar] and SORT_TYPES[self.db.profile[bar].sort] |
end |
function Bison:SetSort( info, value) |
local bar = GetBar( info) |
if self.db.profile[bar] and value and SORT_TYPES[value] then |
self.db.profile[bar].sort = value |
self[bar]:Sort() |
self[bar]:SetAnchors() |
value = tonumber(value) |
if self.db.profile[bar] and value then |
for k,v in pairs(SORT_TYPES) do |
if v == value then |
self.db.profile[bar].sort = k |
self[bar]:Sort() |
self[bar]:SetAnchors() |
break |
end |
end |
end |
end |
function Bison:SortTypes() |
return SORT_TYPES |
return SORT_DESC |
end |
--[[--------------------------------------------------------------------------------- |