-Implemented types and colors.

-Implemented type based sorting.
-DRs now gets cleaned up in PLAYER_ENTER_WORLD.
This commit is contained in:
Relintai 2016-05-06 16:05:24 +02:00
parent 1475704a05
commit ca3296c6f6
6 changed files with 1151 additions and 542 deletions

113
Vect.lua
View File

@ -1,14 +1,13 @@
--TODOS:
--Way to show pet cds on the master -> currently looks impossible
--dr cleanup (PLAYER ENTER WORLD)
--Option to show pet cds on possible master (eg spell lock on all locks)
--interrupts first option (or last or don't care), or better -> rank system v
--3 option -> interrupt, stun, gap closers, strong nukes, the user can select which is first
--mana gem, fap
--support for rows
--Bug: have to check if dr is completed on adding it, also do the same with drs (reassign should update them too, because probably thats the cause for
--the comparer error, onupdate is called null out drs while its comparing)
--Message: ...nfig-3.0\AceConfigDialog-3.0\AceConfigDialog-3.0.lua:20: Cannot find a library instance of "AceGUI-3.0".
--Option to show pet cds on possible master (eg spell lock on all locks)
--document the db these will be needed:
--silence, gapcloser, defensive, potion, nuke, anticc, cc, stun, disarm, cdreset, shield, uncategorized
--db-> class, type, isPet
--"Globals"
local aceDB = LibStub("AceDB-3.0");
@ -52,7 +51,9 @@ Vect.defaults = {
xPos = 350,
yPos = 350,
growOrder = 2,
sortOrder = 5
sortOrder = 5,
colorframeenabled = true,
colorframesize = 4
},
focus = {
enabled = true,
@ -60,7 +61,9 @@ Vect.defaults = {
xPos = 380,
yPos = 380,
growOrder = 2,
sortOrder = 5
sortOrder = 5,
colorframeenabled = true,
colorframesize = 4
},
targetdr = {
enabled = true,
@ -91,6 +94,95 @@ Vect.defaults = {
sortOrder = 5,
drnumsize = 14,
drnumposition = 1
},
colors = {
["gapcloser"] = {
["a"] = 1,
["b"] = 0,
["g"] = 0.8117647058823529,
["r"] = 1,
},
["anticc"] = {
["a"] = 1,
["b"] = 0.796078431372549,
["g"] = 1,
["r"] = 0,
},
["disarm"] = {
["a"] = 1,
["b"] = 0.9647058823529412,
["g"] = 1,
["r"] = 0,
},
["defensive"] = {
["a"] = 1,
["b"] = 0.08627450980392157,
["g"] = 1,
["r"] = 0.2,
},
["nuke"] = {
["a"] = 1,
["b"] = 0,
["g"] = 0,
["r"] = 1,
},
["shield"] = {
["a"] = 1,
["b"] = 0.3333333333333333,
["g"] = 1,
["r"] = 0.8901960784313725,
},
["potion"] = {
["a"] = 1,
["b"] = 0.6313725490196078,
["g"] = 0.7372549019607844,
["r"] = 1,
},
["cdreset"] = {
["a"] = 1,
["b"] = 1,
["g"] = 0,
["r"] = 0.6274509803921569,
},
["silence"] = {
["a"] = 1,
["b"] = 1,
["g"] = 0.03529411764705882,
["r"] = 0.1882352941176471,
},
["stun"] = {
["a"] = 1,
["b"] = 1,
["g"] = 0.07450980392156863,
["r"] = 0.9137254901960784,
},
["uncategorized"] = {
["a"] = 1,
["b"] = 1,
["g"] = 0.9058823529411765,
["r"] = 0.9607843137254902,
},
["cc"] = {
["a"] = 1,
["b"] = 0.3686274509803922,
["g"] = 0.3568627450980392,
["r"] = 0.3764705882352941,
},
},
cdtypesortorder = {
enabled = true,
silence = 1,
gapcloser = 2,
defensive = 3,
potion = 4,
nuke = 5,
anticc = 6,
cc = 7,
stun = 8,
disarm = 9,
cdreset = 10,
shield = 11,
uncategorized = 12
}
}
}
@ -250,6 +342,7 @@ function Vect:PLAYER_ENTERING_WORLD()
end
end
end
Vect.drs = {}
end
function Vect:ZONE_CHANGED_NEW_AREA()

View File

@ -15,6 +15,8 @@ function Vect:ReassignCds(which)
for i = 1, 23 do
local frame = Vect.frames[which][i]["frame"];
frame:Hide();
local colorframe = Vect.frames[which][i]["colorframe"];
colorframe:Hide();
end
--check if frames are unlocked
if not db["locked"] then return end;
@ -22,6 +24,8 @@ function Vect:ReassignCds(which)
if not db["selfCDRegister"] and self.targets[which] == UnitGUID("player") then return end;
--check if we have cooldown for that unit
if not self.cds[self.targets[which]] then return end;
--update cds
Vect:UpdateCds(which);
--sort them
local tmp = Vect:SortCDs(which);
--let's fill them up
@ -33,6 +37,15 @@ function Vect:ReassignCds(which)
local CoolDown = Vect.frames[which][i]["cooldown"];
CoolDown:SetCooldown(v["currentTime"], v["cd"]);
frame:Show();
if (db[which]["colorframeenabled"]) then
local colorframe = Vect.frames[which][i]["colorframe"];
--self:Print(v["spellID"] .. " cat: " .. v["spellCategory"]);
colorframe:SetBackdropColor(db["color"][v["spellCategory"]]["r"],
db["color"][v["spellCategory"]]["g"],
db["color"][v["spellCategory"]]["b"],
db["color"][v["spellCategory"]]["a"]);
colorframe:Show();
end
i = i + 1;
end
end
@ -54,7 +67,7 @@ function Vect:AddCd(srcGUID, spellID)
end
local spec = Vect.cds[srcGUID]["spec"];
local cd, reset = Vect.spells[spellID][spec], Vect.spells[spellID][2];
local cd, reset, spellCategory = Vect.spells[spellID][spec], Vect.spells[spellID][2], Vect.spells[spellID][8];
if specchange and (not cd) then
if self.targets["target"] == srcGUID then
@ -77,7 +90,8 @@ function Vect:AddCd(srcGUID, spellID)
endTime,
cd,
spellIcon,
spellID
spellID,
spellCategory
}
--self:Print(Vect.cds[srcGUID][spellID][1] .. " " .. Vect.cds[srcGUID][spellID][2] .. " " .. Vect.cds[srcGUID][spellID][3]);
@ -146,7 +160,8 @@ function Vect:SortCDs(which)
endTime = v[2],
cd = v[3],
spellIcon = v[4],
spellID = v[5]
spellID = v[5],
spellCategory = v[6]
};
--self:Print(v[1] .. v[2] .. v[3] .. v[4] .. v[5])
@ -157,6 +172,7 @@ function Vect:SortCDs(which)
if not tmp then return end;
if not db["cdtypesortorder"]["enabled"] then
if db[which]["sortOrder"] == "1" then --["1"] = "Ascending (CD left)",
table.sort(tmp, function(a, b) return Vect:ComparerAscendingCDLeft(a, b) end);
elseif db[which]["sortOrder"] == "2" then --["2"] = "Descending (CD left)",
@ -169,8 +185,23 @@ function Vect:SortCDs(which)
table.sort(tmp, function(a, b) return Vect:ComparerRecentFirst(a, b) end);
elseif db[which]["sortOrder"] == "6" then --["6"] = "Recent Last",
table.sort(tmp, function(a, b) return Vect:ComparerRecentLast(a, b) end);
end --["7"] = "No order"
else
if db[which]["sortOrder"] == "1" then --["1"] = "Ascending (CD left)",
table.sort(tmp, function(a, b) return Vect:ComparerAscendingCDLeftT(a, b) end);
elseif db[which]["sortOrder"] == "2" then --["2"] = "Descending (CD left)",
table.sort(tmp, function(a, b) return Vect:ComparerDescendingCDLeftT(a, b) end);
elseif db[which]["sortOrder"] == "3" then --["3"] = "Ascending (CD total)",
table.sort(tmp, function(a, b) return Vect:ComparerAscendingCDTotalT(a, b) end);
elseif db[which]["sortOrder"] == "4" then --["4"] = "Descending (CD total)",
table.sort(tmp, function(a, b) return Vect:ComparerDescendingCDTotalT(a, b) end);
elseif db[which]["sortOrder"] == "5" then --["5"] = "Recent first",
table.sort(tmp, function(a, b) return Vect:ComparerRecentFirstT(a, b) end);
elseif db[which]["sortOrder"] == "6" then --["6"] = "Recent Last",
table.sort(tmp, function(a, b) return Vect:ComparerRecentLastT(a, b) end);
end --["7"] = "No order"
end
--["7"] = "No order"
return tmp;
end
@ -191,10 +222,24 @@ function Vect:CreateFrames(which)
CoolDown:SetAllPoints()
CoolDown:SetCooldown(GetTime(), 50);
frame:Hide();
local colorframe = CreateFrame("Frame", nil, UIParent, nil);
colorframe:SetFrameStrata("BACKGROUND");
colorframe:SetWidth(150);
colorframe:SetHeight(150);
colorframe:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background",
--edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
edgeFile = nil,
tile = true, tileSize = 16, edgeSize = 0,
--insets = { left = 4, right = 4, top = 4, bottom = 4 }});
insets = nil});
colorframe:Hide();
Vect.frames[which][i] = {}
Vect.frames[which][i]["frame"] = frame;
Vect.frames[which][i]["texture"] = text;
Vect.frames[which][i]["cooldown"] = CoolDown;
Vect.frames[which][i]["colorframe"] = colorframe;
end
end
@ -204,6 +249,7 @@ function Vect:MoveTimersStop(which)
local y = db[which]["yPos"];
local size = db[which]["size"];
local growOrder = db[which]["growOrder"];
local cdbacksize = db[which]["colorframesize"];
for i = 1, 23 do
local frame = Vect.frames[which][i]["frame"];
@ -214,15 +260,37 @@ function Vect:MoveTimersStop(which)
local text = Vect.frames[which][i]["texture"];
text:SetAllPoints(frame);
frame.texture = text;
local colorframe = Vect.frames[which][i]["colorframe"];
colorframe:ClearAllPoints();
colorframe:SetFrameStrata("BACKGROUND");
colorframe:SetBackdropColor(1, 1, 1, 1);
--set them based on the grow type
if growOrder == "1" then --Up
frame:SetPoint("BOTTOMLEFT", x, y + ((i - 1) * size));
colorframe:SetWidth(size + (2 * cdbacksize));
colorframe:SetHeight(size);
colorframe:SetPoint("BOTTOMLEFT", x - cdbacksize, y + ((i - 1) * size));
elseif growOrder == "2" then --Right
frame:SetPoint("BOTTOMLEFT", x + ((i - 1) * size), y);
colorframe:SetWidth(size);
colorframe:SetHeight(size + (2 * cdbacksize));
colorframe:SetPoint("BOTTOMLEFT", x + ((i - 1) * size), y - cdbacksize);
elseif growOrder == "3" then --Down
frame:SetPoint("BOTTOMLEFT", x, y - ((i - 1) * size));
colorframe:SetWidth(size + (2 * cdbacksize));
colorframe:SetHeight(size);
colorframe:SetPoint("BOTTOMLEFT", x - cdbacksize, (y - ((i - 1) * size)));
else --Left
frame:SetPoint("BOTTOMLEFT", x - ((i - 1) * size), y);
colorframe:SetWidth(size);
colorframe:SetHeight(size + (2 * cdbacksize));
colorframe:SetPoint("BOTTOMLEFT", x - ((i - 1) * size), y - cdbacksize);
end
local CoolDown = Vect.frames[which][i]["cooldown"];
CoolDown:SetAllPoints();
@ -231,19 +299,27 @@ function Vect:MoveTimersStop(which)
end
function Vect:VOnTimerUpdate(which)
--check if we have cooldown for that unit
if not self.cds[self.targets[which]] then return end
local t = GetTime();
--let's check if one of the cooldowns finished
for k, v in pairs(self.cds[self.targets[which]]) do
if not (k == "spec") then
if v[2] <= t then
self.cds[self.targets[which]][v[5]] = nil;
if (Vect:UpdateCds(which)) then
--we have to update both, because if somebody is targeted and focused since sorting is
--implemented it triggers only one update, probably it had bugs before too, but got unnoticed
self:ReassignCds("target");
self:ReassignCds("focus");
end
end
end
end
function Vect:UpdateCds(which)
--check if we have cooldown for that unit
if not self.cds[self.targets[which]] then return end
local t = GetTime();
local found = false;
--let's check if one of the cooldowns finished
for k, v in pairs(self.cds[self.targets[which]]) do
if not (k == "spec") then
if v[2] <= t then
self.cds[self.targets[which]][v[5]] = nil;
found = true;
end
end
end
return found;
end

View File

@ -52,6 +52,8 @@ function Vect:SetPartEnabledOrDisabled(which, enable)
for i = 1, 23 do
local frame = Vect.frames[which][i]["frame"];
frame:Hide();
local colorframe = Vect.fremes[which][i]["colorframe"];
colorframe:Hide();
end
else
self:ReassignCds(which);
@ -84,6 +86,38 @@ function Vect:setSpecDetectionEnabledorDisabled(enable)
--self:ReassignCds(which);
end
function Vect:getColorFrameEnabled(which)
local db = Vect.db.profile;
return db[which]["colorframeenabled"];
end
function Vect:setColorFrameEnabled(which, enable)
local db = Vect.db.profile;
db[which]["colorframeenabled"] = enable;
--hide all those frames
if not enable then
for i = 1, 23 do
local colorframe = Vect.frames[which][i]["colorframe"];
colorframe:Hide();
end
else
self:ReassignCds(which);
end
end
function Vect:getCDTypeSortingEnable()
local db = Vect.db.profile;
return db["cdtypesortorder"]["enabled"];
end
function Vect:setCDTypeSortingEnable(v)
local db = Vect.db.profile;
db["cdtypesortorder"]["enabled"] = v;
self:ReassignCds("target");
self:ReassignCds("focus");
end
--lock
function Vect:isLocked()
return Vect.db.profile["locked"];
@ -219,10 +253,27 @@ end
function Vect:setDRNumSize(which, size)
local db = Vect.db.profile;
db[which]["drnumsize"] = size;
db[which]["size"] = size;
Vect:MoveDRTimersStop(which)
end
function Vect:getColorFrameSize(which)
local db = Vect.db.profile;
return db[which]["colorframesize"];
end
function Vect:setColorFrameSize(which, size)
local db = Vect.db.profile;
db[which]["colorframesize"] = size;
Vect:MoveTimersStop(which);
Vect:ReassignCds(which);
if not db["locked"] then
Vect:ShowMovableFrames();
end
end
--Grow Order
function Vect:getGrowOrder(which)
local db = Vect.db.profile;
@ -253,6 +304,18 @@ function Vect:setSortOrder(which, v)
Vect:ReassignCds(which);
end
function Vect:getTypeSortOrder(which)
local db = Vect.db.profile;
return db["cdtypesortorder"][which];
end
function Vect:setTypeSortOrder(which, v)
local db = Vect.db.profile;
db["cdtypesortorder"][which] = v;
Vect:ReassignCds("target");
Vect:ReassignCds("focus");
end
--Num Position functions
function Vect:getDRNumPosition(which)
local db = Vect.db.profile;
@ -265,6 +328,34 @@ function Vect:setDRNumPosition(which, v)
Vect:MoveDRTimersStop(which);
end
--Color options
function Vect:getColor(part)
local db = Vect.db.profile;
if not db["color"] then db["color"] = {} end
if not db["color"][part] then
db["color"][part] = {};
db["color"][part]["r"] = 1;
db["color"][part]["g"] = 0;
db["color"][part]["b"] = 0;
db["color"][part]["a"] = 1;
end
return db["color"][part]["r"], db["color"][part]["g"], db["color"][part]["b"], db["color"][part]["a"];
end
function Vect:setColor(part, r, g, b, a)
local db = Vect.db.profile;
if not db["color"][part] then db["color"][part] = {} end
db["color"][part]["r"] = r;
db["color"][part]["g"] = g;
db["color"][part]["b"] = b;
db["color"][part]["a"] = a;
end
--Debug settings
function Vect:getDebugLevel()
local db = Vect.db.profile;

View File

@ -29,9 +29,9 @@ function Vect:GetVectOptions()
type = "group", name = "DRs", desc = "DR frame's settings.", childGroups = "tab",order = 3,
args = Vect:getDROptions();
},
selfdr = {
type = "group", name = "Self DRs", desc = "Self DR frame's settings.", childGroups = "tab",order = 4,
args = Vect:getSelfDROptions()
coloroptions = {
type = "group", name = "Global", desc = "Global settings.", childGroups = "tab",order = 4,
args = Vect:getGlobalOptions()
},
debugoptions = {
type = "group", name = "Debug", desc = "Debug settings.", childGroups = "tab", order = 5,
@ -61,7 +61,6 @@ function Vect:getTargetandFocusOptions()
set = function(_, v)
Vect:setFrameSize("target", v);
end
},
targetGrowSelect = {
type = "select", style = "dropdown", name = "targetGrow",
@ -94,18 +93,32 @@ function Vect:getTargetandFocusOptions()
Vect:setSortOrder("target", v);
end
},
targetcolortoggle = {
type = "toggle", name = "Colors", desc = "Enable/Disable showing the target's cooldown's colors.", order = 15,
get = function() return Vect:getColorFrameEnabled("target") end,
set = function(_, v)
Vect:setColorFrameEnabled("target", v);
end
},
targetcolorrange = {
type = "range", name = "Target's Color size", order = 16, min = 1, max = 30, step = 1,
get = function() return Vect:getColorFrameSize("target") end,
set = function(_, v)
Vect:setColorFrameSize("target", v);
end
},
focusHeader = {
type = "header", name = "Focus's settings", order = 15
type = "header", name = "Focus's settings", order = 17
},
focustoggle = {
type = "toggle", name = "Focus", desc = "Enable/Disable showing the focus's cooldowns", order = 16,
type = "toggle", name = "Focus", desc = "Enable/Disable showing the focus's cooldowns", order = 18,
get = function() return Vect:isPartEnabled("focus") end,
set = function(_, v)
Vect:SetPartEnabledOrDisabled("focus", v);
end
},
focusRange = {
type = "range", name = "Focus's size", order = 17, min = 10, max = 150, step = 1,
type = "range", name = "Focus's size", order = 19, min = 10, max = 150, step = 1,
get = function() return Vect:getFrameSize("focus") end,
set = function(_, v)
Vect:setFrameSize("focus", v);
@ -113,7 +126,7 @@ function Vect:getTargetandFocusOptions()
},
focusGrowSelect = {
type = "select", style = "dropdown", name = "focusGrow",
desc = "Change which way the focus's cooldowns will grow", order = 18,
desc = "Change which way the focus's cooldowns will grow", order = 20,
values = {
["1"] = "Up",
["2"] = "Right",
@ -127,7 +140,7 @@ function Vect:getTargetandFocusOptions()
},
focusSortSelect = {
type = "select", style = "dropdown", name = "focusSortOrder",
desc = "Change the focus's cooldowns's sort order", order = 19,
desc = "Change the focus's cooldowns's sort order", order = 21,
values = {
["1"] = "Ascending (CD left)",
["2"] = "Descending (CD left)",
@ -142,16 +155,20 @@ function Vect:getTargetandFocusOptions()
Vect:setSortOrder("focus", v);
end
},
globalHeader = {
type = "header", name = "Global settings", order = 20
},
specdetectiontoggle = {
type = "toggle", name = "Spec Detection", desc = "Enable/Disable Spec Detection", order = 21,
get = function() return Vect:isSpecDetectionEnabled() end,
focuscolortoggle = {
type = "toggle", name = "Colors", desc = "Enable/Disable showing the target's cooldown's colors.", order = 22,
get = function() return Vect:getColorFrameEnabled("focus") end,
set = function(_, v)
Vect:setSpecDetectionEnabledorDisabled(v);
Vect:setColorFrameEnabled("focus", v);
end
}
},
focuscolorrange = {
type = "range", name = "Focus's Color size", order = 23, min = 1, max = 30, step = 1,
get = function() return Vect:getColorFrameSize("focus") end,
set = function(_, v)
Vect:setColorFrameSize("focus", v);
end
},
}
return args;
end
@ -160,7 +177,7 @@ end
function Vect:getDROptions()
local args = {
targetdrHeader = {
type = "header", name = "Target's DR settings", order = 10
type = "header", name = "Target's settings", order = 10
},
targetdrtoggle = {
type = "toggle", name = "Enabled", desc = "Enable/Disable showing the target's DRs.", order = 11,
@ -304,22 +321,18 @@ function Vect:getDROptions()
Vect:setDRNumPosition("focusdr", v);
end
},
}
return args;
end
--order 40-50
function Vect:getSelfDROptions()
local args = {
selfdrHeader = {
type = "header", name = "Self's settings", order = 24
},
selfdrtoggle = {
type = "toggle", name = "Enabled", desc = "Enable/Disable showing the your DRs.", order = 11,
type = "toggle", name = "Enabled", desc = "Enable/Disable showing the your DRs.", order = 25,
get = function() return Vect:isPartEnabled("selfdr") end,
set = function(_, v)
Vect:SetDRPartEnabledOrDisabled("selfdr", v);
end
},
selfdrrange = {
type = "range", name = "Self's DRs size", order = 12, min = 10, max = 150, step = 1,
type = "range", name = "Self's DRs size", order = 26, min = 10, max = 150, step = 1,
get = function() return Vect:getFrameSize("selfdr") end,
set = function(_, v)
Vect:setFrameSize("selfdr", v);
@ -327,7 +340,7 @@ function Vect:getSelfDROptions()
},
selfdrGrowSelect = {
type = "select", style = "dropdown", name = "selfDRGrow",
desc = "Change which way the your DRs will grow", order = 13,
desc = "Change which way the your DRs will grow", order = 27,
values = {
["1"] = "Up",
["2"] = "Right",
@ -341,7 +354,7 @@ function Vect:getSelfDROptions()
},
selfdrSortSelect = {
type = "select", style = "dropdown", name = "selfDRSortOrder",
desc = "Change the your DR's sort order", order = 14,
desc = "Change the your DR's sort order", order = 28,
values = {
["1"] = "Ascending (CD left)",
["2"] = "Descending (CD left)",
@ -358,7 +371,7 @@ function Vect:getSelfDROptions()
},
selfdrnumsizerange = {
type = "range", name = "Number's size", desc = "Your DR's Number's size. Set it to 0 to disable it!",
order = 15, min = 1, max = 30, step = 1,
order = 29, min = 1, max = 30, step = 1,
get = function() return Vect:getDRNumSize("selfdr") end,
set = function(_, v)
Vect:setDRNumSize("selfdr", v);
@ -367,7 +380,7 @@ function Vect:getSelfDROptions()
},
selfdrnumposselect = {
type = "select", style = "dropdown", name = "selfDRNumPos",
desc = "Change your DR's number's position.", order = 16,
desc = "Change your DR's number's position.", order = 30,
values = {
["1"] = "Up",
["2"] = "Right",
@ -384,6 +397,215 @@ function Vect:getSelfDROptions()
return args;
end
--order 40-50
function Vect:getGlobalOptions()
local args = {
globalHeader = {
type = "header", name = "Global CD settings", order = 10
},
specdetectiontoggle = {
type = "toggle", name = "Spec Detection", desc = "Enable/Disable Spec Detection", order = 11,
get = function() return Vect:isSpecDetectionEnabled() end,
set = function(_, v)
Vect:setSpecDetectionEnabledorDisabled(v);
end
},
petcdguessingtoggle = {
type = "toggle", name = "Pet CD Guessing",
desc = "Enable/Disable Pet Cd Guessing, this will show pet cds on all possible masters, since there is no reasonable way of determining who's pet it is from combatlog events and GUIDs, this will be really inaccurate if there are 2-3 lock for example.",
order = 12,
get = function() return Vect:isSpecDetectionEnabled() end,
set = function(_, v)
Vect:setSpecDetectionEnabledorDisabled(v);
end
},
globalcdtypesortHeader = {
type = "header", name = "Global CD Type sorting", order = 13
},
cdtypesortordertoggle = {
type = "toggle", name = "Enabled", desc = "Enable/Disable CD Type Sort Order", order = 15,
get = function() return Vect:getCDTypeSortingEnable() end,
set = function(_, v)
Vect:setCDTypeSortingEnable(v);
end
},
silencerange = {
type = "range", name = "Silence's Type Order", order = 17, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("silence") end,
set = function(_, v)
Vect:setTypeSortOrder("silence", v);
end
},
gapcloserrange = {
type = "range", name = "Gapcloser's Type Order", order = 18, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("gapcloser") end,
set = function(_, v)
Vect:setTypeSortOrder("gapcloser", v);
end
},
defensiverange = {
type = "range", name = "Defensive's Type Order", order = 19, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("defensive") end,
set = function(_, v)
Vect:setTypeSortOrder("defensive", v);
end
},
potionrange = {
type = "range", name = "Potion's Type Order", order = 20, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("potion") end,
set = function(_, v)
Vect:setTypeSortOrder("potion", v);
end
},
nukerange = {
type = "range", name = "Nuke's Type Order", order = 21, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("nuke") end,
set = function(_, v)
Vect:setTypeSortOrder("nuke", v);
end
},
anticcrange = {
type = "range", name = "Anticc's Type Order", order = 22, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("anticc") end,
set = function(_, v)
Vect:setTypeSortOrder("anticc", v);
end
},
ccrange = {
type = "range", name = "Cc's Type Order", order = 23, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("cc") end,
set = function(_, v)
Vect:setTypeSortOrder("cc", v);
end
},
stunrange = {
type = "range", name = "Stun's Type Order", order = 24, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("stun") end,
set = function(_, v)
Vect:setTypeSortOrder("stun", v);
end
},
disarmrange = {
type = "range", name = "Disarm's Type Order", order = 25, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("disarm") end,
set = function(_, v)
Vect:setTypeSortOrder("disarm", v);
end
},
cdresetrange = {
type = "range", name = "Cdreset's Type Order", order = 26, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("cdreset") end,
set = function(_, v)
Vect:setTypeSortOrder("cdreset", v);
end
},
shieldrange = {
type = "range", name = "shield's Type Order", order = 27, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("shield") end,
set = function(_, v)
Vect:setTypeSortOrder("shield", v);
end
},
uncategorizedrange = {
type = "range", name = "Uncategorized's Type Order", order = 28, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("uncategorized") end,
set = function(_, v)
Vect:setTypeSortOrder("uncategorized", v);
end
},
--50+
globalcolorHeader = {
type = "header", name = "CD Color settings", order = 51
},
silencecolorsel = {
type = "color", name = "Silence's color", hasAlpha = true, order = 52,
get = function() return Vect:getColor("silence") end,
set = function(_, r, g, b, a)
Vect:setColor("silence", r, g, b, a);
end
},
gapclosercolorsel = {
type = "color", name = "Gapcloser's color", hasAlpha = true, order = 53,
get = function() return Vect:getColor("gapcloser") end,
set = function(_, r, g, b, a)
Vect:setColor("gapcloser", r, g, b, a);
end
},
defensivecolorsel = {
type = "color", name = "Defensive's color", hasAlpha = true, order = 54,
get = function() return Vect:getColor("defensive") end,
set = function(_, r, g, b, a)
Vect:setColor("defensive", r, g, b, a);
end
},
potioncolorsel = {
type = "color", name = "Potion's color", hasAlpha = true, order = 55,
get = function() return Vect:getColor("potion") end,
set = function(_, r, g, b, a)
Vect:setColor("potion", r, g, b, a);
end
},
nukecolorsel = {
type = "color", name = "Nuke's color", hasAlpha = true, order = 56,
get = function() return Vect:getColor("nuke") end,
set = function(_, r, g, b, a)
Vect:setColor("nuke", r, g, b, a);
end
},
anticccolorsel = {
type = "color", name = "Anticc's color", hasAlpha = true, order = 57,
get = function() return Vect:getColor("anticc") end,
set = function(_, r, g, b, a)
Vect:setColor("anticc", r, g, b, a);
end
},
cccolorsel = {
type = "color", name = "Cc's color", hasAlpha = true, order = 58,
get = function() return Vect:getColor("cc") end,
set = function(_, r, g, b, a)
Vect:setColor("cc", r, g, b, a);
end
},
stuncolorsel = {
type = "color", name = "Stun's color", hasAlpha = true, order = 59,
get = function() return Vect:getColor("stun") end,
set = function(_, r, g, b, a)
Vect:setColor("stun", r, g, b, a);
end
},
disarmcolorsel = {
type = "color", name = "Disarm's color", hasAlpha = true, order = 60,
get = function() return Vect:getColor("disarm") end,
set = function(_, r, g, b, a)
Vect:setColor("disarm", r, g, b, a);
end
},
cdresetcolorsel = {
type = "color", name = "Cdreset's color", hasAlpha = true, order = 61,
get = function() return Vect:getColor("cdreset") end,
set = function(_, r, g, b, a)
Vect:setColor("cdreset", r, g, b, a);
end
},
shieldcolorsel = {
type = "color", name = "Shield's color", hasAlpha = true, order = 62,
get = function() return Vect:getColor("shield") end,
set = function(_, r, g, b, a)
Vect:setColor("shield", r, g, b, a);
end
},
uncategorizedcolorsel = {
type = "color", name = "Uncategorized's color", hasAlpha = true, order = 63,
get = function() return Vect:getColor("uncategorized") end,
set = function(_, r, g, b, a)
Vect:setColor("uncategorized", r, g, b, a);
end
},
}
return args;
end
--order 50+
function Vect:getDebugOptions()
local args = {
@ -429,3 +651,24 @@ function Vect:getDebugOptions()
}
return args;
end
function Vect:GetTypeSortDropdown(num)
local arr = {
type = "select", style = "dropdown", name = "selfDRSortOrder",
desc = "Change the your DR's sort order", order = 28,
values = {
["1"] = "Ascending (CD left)",
["2"] = "Descending (CD left)",
["3"] = "Ascending (CD total)",
["4"] = "Descending (CD total)",
["5"] = "Recent first",
["6"] = "Recent Last",
["7"] = "No order"
},
get = function() return Vect:getSortOrder("selfdr") end,
set = function(_, v)
Vect:setSortOrder("selfdr", v);
end
}
return arr;
end

View File

@ -1,13 +1,6 @@
-- table.sort(tmp, function(a, b) if db.growUp then return self:C_RemainingComparer(a, b) else return self:C_ReversalRemainingComparer(a, b) end end)
--function Aesa:C_RemainingComparer(a, b)
-- return b.remaining < a.remaining
--end
--["1"] = "Ascending (CD left)",
function Vect:ComparerAscendingCDLeft(a, b)
local time = GetTime();
if a.endTime < b.endTime then
return true;
else
@ -17,7 +10,6 @@ end
--["2"] = "Descending (CD left)",
function Vect:ComparerDescendingCDLeft(a, b)
local time = GetTime();
if a.endTime < b.endTime then
return false;
else
@ -60,3 +52,107 @@ function Vect:ComparerRecentLast(a, b)
return false;
end
end
--CD Type sorters
--["1"] = "Ascending (CD left)",
function Vect:ComparerAscendingCDLeftT(a, b)
local db = Vect.db.profile;
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)",
function Vect:ComparerDescendingCDLeftT(a, b)
local db = Vect.db.profile;
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)",
function Vect:ComparerAscendingCDTotalT(a, b)
local db = Vect.db.profile;
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)",
function Vect:ComparerDescendingCDTotalT(a, b)
local db = Vect.db.profile;
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",
function Vect:ComparerRecentFirstT(a, b)
local db = Vect.db.profile;
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",
function Vect:ComparerRecentLastT(a, b)
local db = Vect.db.profile;
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

File diff suppressed because it is too large Load Diff