2016-05-06 15:40:26 +02:00
|
|
|
|
|
|
|
--["1"] = "Ascending (CD left)",
|
2016-05-08 16:23:04 +02:00
|
|
|
function Rekt:ComparerAscendingCDLeft(a, b)
|
2016-05-06 15:40:26 +02:00
|
|
|
if a.endTime < b.endTime then
|
|
|
|
return true;
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--["2"] = "Descending (CD left)",
|
2016-05-08 16:23:04 +02:00
|
|
|
function Rekt:ComparerDescendingCDLeft(a, b)
|
2016-05-06 15:40:26 +02:00
|
|
|
if a.endTime < b.endTime then
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return true;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--["3"] = "Ascending (CD total)",
|
2016-05-08 16:23:04 +02:00
|
|
|
function Rekt:ComparerAscendingCDTotal(a, b)
|
2016-05-06 15:40:26 +02:00
|
|
|
if a.cd < b.cd then
|
|
|
|
return true;
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--["4"] = "Descending (CD total)",
|
2016-05-08 16:23:04 +02:00
|
|
|
function Rekt:ComparerDescendingCDTotal(a, b)
|
2016-05-06 15:40:26 +02:00
|
|
|
if a.cd < b.cd then
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return true;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--["5"] = "Recent first",
|
2016-05-08 16:23:04 +02:00
|
|
|
function Rekt:ComparerRecentFirst(a, b)
|
2016-05-06 15:40:26 +02:00
|
|
|
if a.currentTime < b.currentTime then
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return true;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--["6"] = "Recent Last",
|
2016-05-08 16:23:04 +02:00
|
|
|
function Rekt:ComparerRecentLast(a, b)
|
2016-05-06 15:40:26 +02:00
|
|
|
if a.currentTime < b.currentTime then
|
|
|
|
return true;
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
end
|
|
|
|
end
|
2016-05-06 16:05:24 +02:00
|
|
|
|
|
|
|
--CD Type sorters
|
|
|
|
|
|
|
|
--["1"] = "Ascending (CD left)",
|
2016-05-08 16:23:04 +02:00
|
|
|
function Rekt:ComparerAscendingCDLeftT(a, b)
|
|
|
|
local db = Rekt.db.profile;
|
2016-05-06 16:05:24 +02:00
|
|
|
|
|
|
|
if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then
|
|
|
|
return true;
|
|
|
|
elseif (db["cdtypesortorder"][a.spellCategory] > db["cdtypesortorder"][b.spellCategory]) then
|
|
|
|
return false
|
|
|
|
else -- they are ==
|
|
|
|
if a.endTime < b.endTime then
|
|
|
|
return true;
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--["2"] = "Descending (CD left)",
|
2016-05-08 16:23:04 +02:00
|
|
|
function Rekt:ComparerDescendingCDLeftT(a, b)
|
|
|
|
local db = Rekt.db.profile;
|
2016-05-06 16:05:24 +02:00
|
|
|
|
|
|
|
if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then
|
|
|
|
return true;
|
|
|
|
elseif (db["cdtypesortorder"][a.spellCategory] > db["cdtypesortorder"][b.spellCategory]) then
|
|
|
|
return false
|
|
|
|
else -- they are ==
|
|
|
|
if a.endTime < b.endTime then
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return true;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--["3"] = "Ascending (CD total)",
|
2016-05-08 16:23:04 +02:00
|
|
|
function Rekt:ComparerAscendingCDTotalT(a, b)
|
|
|
|
local db = Rekt.db.profile;
|
2016-05-06 16:05:24 +02:00
|
|
|
|
|
|
|
if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then
|
|
|
|
return true;
|
|
|
|
elseif (db["cdtypesortorder"][a.spellCategory] > db["cdtypesortorder"][b.spellCategory]) then
|
|
|
|
return false
|
|
|
|
else -- they are ==
|
|
|
|
if a.cd < b.cd then
|
|
|
|
return true;
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--["4"] = "Descending (CD total)",
|
2016-05-08 16:23:04 +02:00
|
|
|
function Rekt:ComparerDescendingCDTotalT(a, b)
|
|
|
|
local db = Rekt.db.profile;
|
2016-05-06 16:05:24 +02:00
|
|
|
|
|
|
|
if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then
|
|
|
|
return true;
|
|
|
|
elseif (db["cdtypesortorder"][a.spellCategory] > db["cdtypesortorder"][b.spellCategory]) then
|
|
|
|
return false
|
|
|
|
else -- they are ==
|
|
|
|
if a.cd < b.cd then
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return true;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--["5"] = "Recent first",
|
2016-05-08 16:23:04 +02:00
|
|
|
function Rekt:ComparerRecentFirstT(a, b)
|
|
|
|
local db = Rekt.db.profile;
|
2016-05-06 16:05:24 +02:00
|
|
|
|
|
|
|
if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then
|
|
|
|
return true;
|
|
|
|
elseif (db["cdtypesortorder"][a.spellCategory] > db["cdtypesortorder"][b.spellCategory]) then
|
|
|
|
return false
|
|
|
|
else -- they are ==
|
|
|
|
if a.currentTime < b.currentTime then
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return true;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--["6"] = "Recent Last",
|
2016-05-08 16:23:04 +02:00
|
|
|
function Rekt:ComparerRecentLastT(a, b)
|
|
|
|
local db = Rekt.db.profile;
|
2016-05-06 16:05:24 +02:00
|
|
|
|
|
|
|
if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then
|
|
|
|
return true;
|
|
|
|
elseif (db["cdtypesortorder"][a.spellCategory] > db["cdtypesortorder"][b.spellCategory]) then
|
|
|
|
return false
|
|
|
|
else -- they are ==
|
|
|
|
if a.currentTime < b.currentTime then
|
|
|
|
return true;
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|