-As I now use a different name, I have renamed the addon.

-Fixed a slight error, Hunter's cdreset array contained some other stuff that shouldn't have been there.
-Found an error in Warrior's recklessness cds, TODO.
This commit is contained in:
Relintai 2016-05-06 16:17:32 +02:00
parent a926f1f7d7
commit b6d9f5eda9
9 changed files with 478 additions and 477 deletions

View File

@ -6,18 +6,18 @@ local aceConfig = LibStub("AceConfig-3.0");
local libSharedMedia = LibStub("LibSharedMedia-3.0"); local libSharedMedia = LibStub("LibSharedMedia-3.0");
local libDRData = LibStub('DRData-1.0'); local libDRData = LibStub('DRData-1.0');
Vect.MovableFrames = nil Rect.MovableFrames = nil
Vect.targets = { Rect.targets = {
["target"] = nil, ["target"] = nil,
["focus"] = nil, ["focus"] = nil,
["self"] = nil ["self"] = nil
} }
Vect.cds = {} Rect.cds = {}
Vect.drs = {} Rect.drs = {}
Vect.frames = { Rect.frames = {
["target"] = {}, ["target"] = {},
["focus"] = {}, ["focus"] = {},
["targetdr"] = {}, ["targetdr"] = {},
@ -25,7 +25,7 @@ Vect.frames = {
["selfdr"] = {} ["selfdr"] = {}
} }
Vect.defaults = { Rect.defaults = {
profile = { profile = {
enabled = true, enabled = true,
locked = true, locked = true,
@ -178,25 +178,25 @@ Vect.defaults = {
} }
} }
function Vect:Reset() function Rect:Reset()
Vect.cds = {} Rect.cds = {}
Vect.drs = {} Rect.drs = {}
Vect.target = {unitGUID = -1, timers = {}} Rect.target = {unitGUID = -1, timers = {}}
Vect.focus = {unitGUID = -1, timers = {}} Rect.focus = {unitGUID = -1, timers = {}}
Vect:HideSelfDRFrames(); Rect:HideSelfDRFrames();
end end
function Vect:OnInitialize() function Rect:OnInitialize()
self.db = aceDB:New("VectDB", self.defaults); self.db = aceDB:New("RectDB", self.defaults);
self.db.RegisterCallback(self, "OnProfileChanged", function() self:ApplySettings() end); self.db.RegisterCallback(self, "OnProfileChanged", function() self:ApplySettings() end);
self.db.RegisterCallback(self, "OnProfileCopied", function() self:ApplySettings() end); self.db.RegisterCallback(self, "OnProfileCopied", function() self:ApplySettings() end);
self.db.RegisterCallback(self, "OnProfileReset", function() self:ApplySettings() end); self.db.RegisterCallback(self, "OnProfileReset", function() self:ApplySettings() end);
aceConfig:RegisterOptionsTable("Vect", self:GetVectOptions()); aceConfig:RegisterOptionsTable("Rect", self:GetRectOptions());
aceCDialog:AddToBlizOptions("Vect"); aceCDialog:AddToBlizOptions("Rect");
self:RegisterChatCommand("vect", "ChatCommand"); self:RegisterChatCommand("Rect", "ChatCommand");
end end
function Vect:OnEnable() function Rect:OnEnable()
self:Reset() self:Reset()
self:RegisterEvent("PLAYER_ENTERING_WORLD") self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("ZONE_CHANGED_NEW_AREA") self:RegisterEvent("ZONE_CHANGED_NEW_AREA")
@ -213,7 +213,7 @@ function Vect:OnEnable()
end end
function Vect:OnDisable() function Rect:OnDisable()
self:UnregisterEvent("PLAYER_ENTERING_WORLD") self:UnregisterEvent("PLAYER_ENTERING_WORLD")
self:UnregisterEvent("ZONE_CHANGED_NEW_AREA") self:UnregisterEvent("ZONE_CHANGED_NEW_AREA")
self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
@ -223,11 +223,11 @@ function Vect:OnDisable()
end end
function Vect:ChatCommand(input) function Rect:ChatCommand(input)
if not input or input:trim() == "" then if not input or input:trim() == "" then
aceCDialog:Open("Vect"); aceCDialog:Open("Rect");
else else
LibStub("AceConfigCmd-3.0").HandleCommand(Vect, "vect", "Vect", input); LibStub("AceConfigCmd-3.0").HandleCommand(Rect, "Rect", "Rect", input);
end end
end end
@ -236,10 +236,10 @@ local COMBATLOG_OBJECT_REACTION_HOSTILE = COMBATLOG_OBJECT_REACTION_HOSTILE
local COMBATLOG_OBJECT_CONTROL_PLAYER = COMBATLOG_OBJECT_CONTROL_PLAYER local COMBATLOG_OBJECT_CONTROL_PLAYER = COMBATLOG_OBJECT_CONTROL_PLAYER
function Vect:COMBAT_LOG_EVENT_UNFILTERED(_, timestamp, eventType, srcGUID, srcName, srcFlags, function Rect:COMBAT_LOG_EVENT_UNFILTERED(_, timestamp, eventType, srcGUID, srcName, srcFlags,
dstGUID, dstName, dstFlags, spellID, spellName, spellSchool, dstGUID, dstName, dstFlags, spellID, spellName, spellSchool,
detail1, detail2, detail3) detail1, detail2, detail3)
local db = Vect.db.profile; local db = Rect.db.profile;
if not db["enabled"] then return end; if not db["enabled"] then return end;
@ -263,8 +263,8 @@ function Vect:COMBAT_LOG_EVENT_UNFILTERED(_, timestamp, eventType, srcGUID, srcN
self:Print("id: " .. spellID .. " spellName: " .. spellName); self:Print("id: " .. spellID .. " spellName: " .. spellName);
end end
if Vect.spells[spellID] then if Rect.spells[spellID] then
Vect:AddCd(srcGUID, spellID); Rect:AddCd(srcGUID, spellID);
end end
end end
@ -278,7 +278,7 @@ function Vect:COMBAT_LOG_EVENT_UNFILTERED(_, timestamp, eventType, srcGUID, srcN
end end
local drCat = libDRData:GetSpellCategory(spellID); local drCat = libDRData:GetSpellCategory(spellID);
Vect:DRDebuffGained(spellID, dstGUID, isPlayer); Rect:DRDebuffGained(spellID, dstGUID, isPlayer);
end end
-- Enemy had a debuff refreshed before it faded, so fade + gain it quickly -- Enemy had a debuff refreshed before it faded, so fade + gain it quickly
@ -290,8 +290,8 @@ function Vect:COMBAT_LOG_EVENT_UNFILTERED(_, timestamp, eventType, srcGUID, srcN
return return
end end
Vect:DRDebuffFaded(spellID, dstGUID, isPlayer); Rect:DRDebuffFaded(spellID, dstGUID, isPlayer);
Vect:DRDebuffGained(spellID, dstGUID, isPlayer); Rect:DRDebuffGained(spellID, dstGUID, isPlayer);
end end
-- Buff or debuff faded from an enemy -- Buff or debuff faded from an enemy
@ -303,42 +303,42 @@ function Vect:COMBAT_LOG_EVENT_UNFILTERED(_, timestamp, eventType, srcGUID, srcN
return return
end end
Vect:DRDebuffFaded(spellID, dstGUID, isPlayer); Rect:DRDebuffFaded(spellID, dstGUID, isPlayer);
end end
end end
end end
function Vect:PLAYER_TARGET_CHANGED() function Rect:PLAYER_TARGET_CHANGED()
local unitGUID = UnitGUID("target"); local unitGUID = UnitGUID("target");
self.targets["target"] = unitGUID; self.targets["target"] = unitGUID;
self:ReassignCds("target"); self:ReassignCds("target");
self:ReassignDRs("targetdr"); self:ReassignDRs("targetdr");
end end
function Vect:PLAYER_FOCUS_CHANGED() function Rect:PLAYER_FOCUS_CHANGED()
local unitGUID = UnitGUID("focus"); local unitGUID = UnitGUID("focus");
self.targets["focus"] = unitGUID; self.targets["focus"] = unitGUID;
self:ReassignCds("focus"); self:ReassignCds("focus");
self:ReassignDRs("focusdr"); self:ReassignDRs("focusdr");
end end
function Vect:PLAYER_ENTERING_WORLD() function Rect:PLAYER_ENTERING_WORLD()
--DB cleanup --DB cleanup
local t = GetTime(); local t = GetTime();
for k, v in pairs(Vect.cds) do for k, v in pairs(Rect.cds) do
for i, j in pairs(v) do for i, j in pairs(v) do
if not (i == "spec") then if not (i == "spec") then
if j[2] < t then if j[2] < t then
--self:Print(Vect.cds[k][i][4]); --self:Print(Rect.cds[k][i][4]);
Vect.cds[k][i] = nil; Rect.cds[k][i] = nil;
end end
end end
end end
end end
Vect.drs = {} Rect.drs = {}
end end
function Vect:ZONE_CHANGED_NEW_AREA() function Rect:ZONE_CHANGED_NEW_AREA()
local type = select(2, IsInInstance()) local type = select(2, IsInInstance())
-- If we are entering an arena -- If we are entering an arena
if (type == "arena") then if (type == "arena") then
@ -346,17 +346,17 @@ function Vect:ZONE_CHANGED_NEW_AREA()
end end
end end
function Vect:ApplySettings() function Rect:ApplySettings()
local db = Vect.db.profile; local db = Rect.db.profile;
Vect:MoveTimersStop("target"); Rect:MoveTimersStop("target");
Vect:MoveTimersStop("focus"); Rect:MoveTimersStop("focus");
Vect:ReassignCds("target"); Rect:ReassignCds("target");
Vect:ReassignCds("focus"); Rect:ReassignCds("focus");
Vect:MoveDRTimersStop("targetdr"); Rect:MoveDRTimersStop("targetdr");
Vect:MoveDRTimersStop("focusdr"); Rect:MoveDRTimersStop("focusdr");
Vect:MoveDRTimersStop("selfdr"); Rect:MoveDRTimersStop("selfdr");
Vect:ReassignDRs("targetdr"); Rect:ReassignDRs("targetdr");
Vect:ReassignDRs("focusdr"); Rect:ReassignDRs("focusdr");
Vect:ReassignDRs("selfdr"); Rect:ReassignDRs("selfdr");
if not db["locked"] then self:ShowMovableFrames() end; if not db["locked"] then self:ShowMovableFrames() end;
end end

View File

@ -1,12 +1,12 @@
## Interface: 30300 ## Interface: 30300
## Author: Verot (AVeroth) ## Author: Relintai
## Name: Vect ## Name: Rect
## Title: Vect ## Title: Rect
## Notes: Verot's Enemy Cooldown Tracker. ## Notes: Relintai's Enemy Cooldown Tracker.
## DefaultState: Enabled ## DefaultState: Enabled
## OptionalDeps: Ace3 ## OptionalDeps: Ace3
## SavedVariables: VectDB ## SavedVariables: RectDB
## Version: 1.0RC1 ## Version: 1.01
embeds.xml embeds.xml
data\global.lua data\global.lua
@ -16,4 +16,4 @@ data\options.lua
data\sorters.lua data\sorters.lua
data\drs.lua data\drs.lua
data\cooldowns.lua data\cooldowns.lua
Vect.lua Rect.lua

View File

@ -7,15 +7,15 @@ local libSharedMedia = LibStub("LibSharedMedia-3.0");
local libDRData = LibStub('DRData-1.0'); local libDRData = LibStub('DRData-1.0');
--gets called when a cd is finished, reassigns the cds to frames. --gets called when a cd is finished, reassigns the cds to frames.
function Vect:ReassignCds(which) function Rect:ReassignCds(which)
local db = Vect.db.profile; local db = Rect.db.profile;
--bail out early, if frames are disabled --bail out early, if frames are disabled
if not db[which]["enabled"] or not db["enabled"] then return end; if not db[which]["enabled"] or not db["enabled"] then return end;
--first hide all --first hide all
for i = 1, 23 do for i = 1, 23 do
local frame = Vect.frames[which][i]["frame"]; local frame = Rect.frames[which][i]["frame"];
frame:Hide(); frame:Hide();
local colorframe = Vect.frames[which][i]["colorframe"]; local colorframe = Rect.frames[which][i]["colorframe"];
colorframe:Hide(); colorframe:Hide();
end end
--check if frames are unlocked --check if frames are unlocked
@ -25,20 +25,20 @@ function Vect:ReassignCds(which)
--check if we have cooldown for that unit --check if we have cooldown for that unit
if not self.cds[self.targets[which]] then return end; if not self.cds[self.targets[which]] then return end;
--update cds --update cds
Vect:UpdateCds(which); Rect:UpdateCds(which);
--sort them --sort them
local tmp = Vect:SortCDs(which); local tmp = Rect:SortCDs(which);
--let's fill them up --let's fill them up
local i = 1; local i = 1;
for k, v in ipairs(tmp) do for k, v in ipairs(tmp) do
local frame = Vect.frames[which][i]["frame"]; local frame = Rect.frames[which][i]["frame"];
local text = Vect.frames[which][i]["texture"]; local text = Rect.frames[which][i]["texture"];
text:SetTexture(v["spellIcon"]); text:SetTexture(v["spellIcon"]);
local CoolDown = Vect.frames[which][i]["cooldown"]; local CoolDown = Rect.frames[which][i]["cooldown"];
CoolDown:SetCooldown(v["currentTime"], v["cd"]); CoolDown:SetCooldown(v["currentTime"], v["cd"]);
frame:Show(); frame:Show();
if (db[which]["colorframeenabled"]) then if (db[which]["colorframeenabled"]) then
local colorframe = Vect.frames[which][i]["colorframe"]; local colorframe = Rect.frames[which][i]["colorframe"];
--self:Print(v["spellID"] .. " cat: " .. v["spellCategory"]); --self:Print(v["spellID"] .. " cat: " .. v["spellCategory"]);
colorframe:SetBackdropColor(db["color"][v["spellCategory"]]["r"], colorframe:SetBackdropColor(db["color"][v["spellCategory"]]["r"],
db["color"][v["spellCategory"]]["g"], db["color"][v["spellCategory"]]["g"],
@ -50,31 +50,31 @@ function Vect:ReassignCds(which)
end end
end end
function Vect:AddCd(srcGUID, spellID) function Rect:AddCd(srcGUID, spellID)
local db = Vect.db.profile; local db = Rect.db.profile;
if not db["enabled"] then return end; if not db["enabled"] then return end;
if not Vect.cds[srcGUID] then if not Rect.cds[srcGUID] then
Vect.cds[srcGUID] = {} Rect.cds[srcGUID] = {}
Vect.cds[srcGUID]["spec"] = {}; Rect.cds[srcGUID]["spec"] = {};
Vect.cds[srcGUID]["spec"][1] = 1; Rect.cds[srcGUID]["spec"][1] = 1;
Vect.cds[srcGUID]["spec"][2] = ""; Rect.cds[srcGUID]["spec"][2] = "";
end end
local specchange = false; local specchange = false;
if db["specdetection"] then if db["specdetection"] then
if Vect:DetectSpec(srcGUID, spellID) then if Rect:DetectSpec(srcGUID, spellID) then
specchange = true; specchange = true;
end end
end end
local spec = Vect.cds[srcGUID]["spec"][1]; local spec = Rect.cds[srcGUID]["spec"][1];
local class, isPet = Vect.spells[spellID][7], Vect.spells[spellID][9]; local class, isPet = Rect.spells[spellID][7], Rect.spells[spellID][9];
local cd, reset, spellCategory = Vect.spells[spellID][spec], Vect.spells[spellID][2], Vect.spells[spellID][8]; local cd, reset, spellCategory = Rect.spells[spellID][spec], Rect.spells[spellID][2], Rect.spells[spellID][8];
if db["petcdguessing"] then if db["petcdguessing"] then
if (Vect.cds[srcGUID]["spec"][2] == "") and class then if (Rect.cds[srcGUID]["spec"][2] == "") and class then
Vect.cds[srcGUID]["spec"][2] = class; Rect.cds[srcGUID]["spec"][2] = class;
end end
end end
@ -94,7 +94,7 @@ function Vect:AddCd(srcGUID, spellID)
local spellName, spellRank, spellIcon = GetSpellInfo(spellID); local spellName, spellRank, spellIcon = GetSpellInfo(spellID);
local currentTime = GetTime(); local currentTime = GetTime();
local endTime = currentTime + cd; local endTime = currentTime + cd;
Vect.cds[srcGUID][spellID] = { Rect.cds[srcGUID][spellID] = {
currentTime, currentTime,
endTime, endTime,
cd, cd,
@ -105,9 +105,9 @@ function Vect:AddCd(srcGUID, spellID)
--add it to every class of the same type --add it to every class of the same type
if db["petcdguessing"] and isPet then if db["petcdguessing"] and isPet then
for k, v in pairs(Vect.cds) do for k, v in pairs(Rect.cds) do
if (v["spec"][2] == class) then if (v["spec"][2] == class) then
Vect.cds[k][spellID] = { Rect.cds[k][spellID] = {
currentTime, currentTime,
endTime, endTime,
cd, cd,
@ -119,10 +119,10 @@ function Vect:AddCd(srcGUID, spellID)
end end
end end
--self:Print(Vect.cds[srcGUID][spellID][1] .. " " .. Vect.cds[srcGUID][spellID][2] .. " " .. Vect.cds[srcGUID][spellID][3]); --self:Print(Rect.cds[srcGUID][spellID][1] .. " " .. Rect.cds[srcGUID][spellID][2] .. " " .. Rect.cds[srcGUID][spellID][3]);
if reset then if reset then
Vect:CdRemoval(srcGUID, reset); Rect:CdRemoval(srcGUID, reset);
end end
--self:Print(self.targets["target"]); --self:Print(self.targets["target"]);
@ -137,28 +137,28 @@ function Vect:AddCd(srcGUID, spellID)
end end
end end
function Vect:DetectSpec(srcGUID, spellID) function Rect:DetectSpec(srcGUID, spellID)
local spec = Vect.spells[spellID][6]; local spec = Rect.spells[spellID][6];
if spec == 0 then return false end; if spec == 0 then return false end;
if Vect.cds[srcGUID]["spec"][1] == spec then return false end; if Rect.cds[srcGUID]["spec"][1] == spec then return false end;
--self:Print("spec found: " .. spec); --self:Print("spec found: " .. spec);
Vect:RemapSpecCDs(srcGUID, spec); Rect:RemapSpecCDs(srcGUID, spec);
return true; return true;
end end
function Vect:RemapSpecCDs(srcGUID, spec) function Rect:RemapSpecCDs(srcGUID, spec)
if not self.cds[srcGUID] then return end if not self.cds[srcGUID] then return end
for k, v in pairs(self.cds[srcGUID]) do for k, v in pairs(self.cds[srcGUID]) do
if not (k == "spec") then if not (k == "spec") then
local cd = Vect.spells[v[5]][spec]; local cd = Rect.spells[v[5]][spec];
v[3] = cd; v[3] = cd;
v[2] = v[1] + cd; v[2] = v[1] + cd;
end end
end end
end end
function Vect:CdRemoval(srcGUID, resetArray) function Rect:CdRemoval(srcGUID, resetArray)
if not self.cds[srcGUID] then return end if not self.cds[srcGUID] then return end
for k, v in pairs(self.cds[srcGUID]) do for k, v in pairs(self.cds[srcGUID]) do
if not (k == "spec") then if not (k == "spec") then
@ -172,8 +172,8 @@ function Vect:CdRemoval(srcGUID, resetArray)
end end
end end
function Vect:SortCDs(which) function Rect:SortCDs(which)
local db = Vect.db.profile; local db = Rect.db.profile;
local tmp = {}; local tmp = {};
--make the tmp table --make the tmp table
@ -199,38 +199,38 @@ function Vect:SortCDs(which)
if not db["cdtypesortorder"]["enabled"] then if not db["cdtypesortorder"]["enabled"] then
if db[which]["sortOrder"] == "1" then --["1"] = "Ascending (CD left)", if db[which]["sortOrder"] == "1" then --["1"] = "Ascending (CD left)",
table.sort(tmp, function(a, b) return Vect:ComparerAscendingCDLeft(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerAscendingCDLeft(a, b) end);
elseif db[which]["sortOrder"] == "2" then --["2"] = "Descending (CD left)", elseif db[which]["sortOrder"] == "2" then --["2"] = "Descending (CD left)",
table.sort(tmp, function(a, b) return Vect:ComparerDescendingCDLeft(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerDescendingCDLeft(a, b) end);
elseif db[which]["sortOrder"] == "3" then --["3"] = "Ascending (CD total)", elseif db[which]["sortOrder"] == "3" then --["3"] = "Ascending (CD total)",
table.sort(tmp, function(a, b) return Vect:ComparerAscendingCDTotal(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerAscendingCDTotal(a, b) end);
elseif db[which]["sortOrder"] == "4" then --["4"] = "Descending (CD total)", elseif db[which]["sortOrder"] == "4" then --["4"] = "Descending (CD total)",
table.sort(tmp, function(a, b) return Vect:ComparerDescendingCDTotal(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerDescendingCDTotal(a, b) end);
elseif db[which]["sortOrder"] == "5" then --["5"] = "Recent first", elseif db[which]["sortOrder"] == "5" then --["5"] = "Recent first",
table.sort(tmp, function(a, b) return Vect:ComparerRecentFirst(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerRecentFirst(a, b) end);
elseif db[which]["sortOrder"] == "6" then --["6"] = "Recent Last", elseif db[which]["sortOrder"] == "6" then --["6"] = "Recent Last",
table.sort(tmp, function(a, b) return Vect:ComparerRecentLast(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerRecentLast(a, b) end);
end --["7"] = "No order" end --["7"] = "No order"
else else
if db[which]["sortOrder"] == "1" then --["1"] = "Ascending (CD left)", if db[which]["sortOrder"] == "1" then --["1"] = "Ascending (CD left)",
table.sort(tmp, function(a, b) return Vect:ComparerAscendingCDLeftT(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerAscendingCDLeftT(a, b) end);
elseif db[which]["sortOrder"] == "2" then --["2"] = "Descending (CD left)", elseif db[which]["sortOrder"] == "2" then --["2"] = "Descending (CD left)",
table.sort(tmp, function(a, b) return Vect:ComparerDescendingCDLeftT(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerDescendingCDLeftT(a, b) end);
elseif db[which]["sortOrder"] == "3" then --["3"] = "Ascending (CD total)", elseif db[which]["sortOrder"] == "3" then --["3"] = "Ascending (CD total)",
table.sort(tmp, function(a, b) return Vect:ComparerAscendingCDTotalT(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerAscendingCDTotalT(a, b) end);
elseif db[which]["sortOrder"] == "4" then --["4"] = "Descending (CD total)", elseif db[which]["sortOrder"] == "4" then --["4"] = "Descending (CD total)",
table.sort(tmp, function(a, b) return Vect:ComparerDescendingCDTotalT(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerDescendingCDTotalT(a, b) end);
elseif db[which]["sortOrder"] == "5" then --["5"] = "Recent first", elseif db[which]["sortOrder"] == "5" then --["5"] = "Recent first",
table.sort(tmp, function(a, b) return Vect:ComparerRecentFirstT(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerRecentFirstT(a, b) end);
elseif db[which]["sortOrder"] == "6" then --["6"] = "Recent Last", elseif db[which]["sortOrder"] == "6" then --["6"] = "Recent Last",
table.sort(tmp, function(a, b) return Vect:ComparerRecentLastT(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerRecentLastT(a, b) end);
end --["7"] = "No order" end --["7"] = "No order"
end end
return tmp; return tmp;
end end
function Vect:CreateFrames(which) function Rect:CreateFrames(which)
for i = 1, 23 do for i = 1, 23 do
local frame = CreateFrame("Frame", nil, UIParent, nil); local frame = CreateFrame("Frame", nil, UIParent, nil);
frame:SetFrameStrata("MEDIUM"); frame:SetFrameStrata("MEDIUM");
@ -243,7 +243,7 @@ function Vect:CreateFrames(which)
text:SetTexture("Interface\\Icons\\Spell_Arcane_Blink") text:SetTexture("Interface\\Icons\\Spell_Arcane_Blink")
text:SetAllPoints(frame); text:SetAllPoints(frame);
frame.texture = text; frame.texture = text;
local CoolDown = CreateFrame("Cooldown", "VectCoolDown" .. i, frame); local CoolDown = CreateFrame("Cooldown", "RectCoolDown" .. i, frame);
CoolDown:SetAllPoints() CoolDown:SetAllPoints()
CoolDown:SetCooldown(GetTime(), 50); CoolDown:SetCooldown(GetTime(), 50);
frame:Hide(); frame:Hide();
@ -260,16 +260,16 @@ function Vect:CreateFrames(which)
insets = nil}); insets = nil});
colorframe:Hide(); colorframe:Hide();
Vect.frames[which][i] = {} Rect.frames[which][i] = {}
Vect.frames[which][i]["frame"] = frame; Rect.frames[which][i]["frame"] = frame;
Vect.frames[which][i]["texture"] = text; Rect.frames[which][i]["texture"] = text;
Vect.frames[which][i]["cooldown"] = CoolDown; Rect.frames[which][i]["cooldown"] = CoolDown;
Vect.frames[which][i]["colorframe"] = colorframe; Rect.frames[which][i]["colorframe"] = colorframe;
end end
end end
function Vect:MoveTimersStop(which) function Rect:MoveTimersStop(which)
local db = Vect.db.profile; local db = Rect.db.profile;
local x = db[which]["xPos"]; local x = db[which]["xPos"];
local y = db[which]["yPos"]; local y = db[which]["yPos"];
local size = db[which]["size"]; local size = db[which]["size"];
@ -277,16 +277,16 @@ function Vect:MoveTimersStop(which)
local cdbacksize = db[which]["colorframesize"]; local cdbacksize = db[which]["colorframesize"];
for i = 1, 23 do for i = 1, 23 do
local frame = Vect.frames[which][i]["frame"]; local frame = Rect.frames[which][i]["frame"];
frame:ClearAllPoints(); frame:ClearAllPoints();
frame:SetFrameStrata("MEDIUM"); frame:SetFrameStrata("MEDIUM");
frame:SetWidth(size); frame:SetWidth(size);
frame:SetHeight(size); frame:SetHeight(size);
local text = Vect.frames[which][i]["texture"]; local text = Rect.frames[which][i]["texture"];
text:SetAllPoints(frame); text:SetAllPoints(frame);
frame.texture = text; frame.texture = text;
local colorframe = Vect.frames[which][i]["colorframe"]; local colorframe = Rect.frames[which][i]["colorframe"];
colorframe:ClearAllPoints(); colorframe:ClearAllPoints();
colorframe:SetFrameStrata("BACKGROUND"); colorframe:SetFrameStrata("BACKGROUND");
colorframe:SetBackdropColor(1, 1, 1, 1); colorframe:SetBackdropColor(1, 1, 1, 1);
@ -317,14 +317,14 @@ function Vect:MoveTimersStop(which)
colorframe:SetHeight(size + (2 * cdbacksize)); colorframe:SetHeight(size + (2 * cdbacksize));
colorframe:SetPoint("BOTTOMLEFT", x - ((i - 1) * size), y - cdbacksize); colorframe:SetPoint("BOTTOMLEFT", x - ((i - 1) * size), y - cdbacksize);
end end
local CoolDown = Vect.frames[which][i]["cooldown"]; local CoolDown = Rect.frames[which][i]["cooldown"];
CoolDown:SetAllPoints(); CoolDown:SetAllPoints();
--frame:Show(); --frame:Show();
end end
end end
function Vect:VOnTimerUpdate(which) function Rect:VOnTimerUpdate(which)
if (Vect:UpdateCds(which)) then if (Rect:UpdateCds(which)) then
--we have to update both, because if somebody is targeted and focused since sorting is --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 --implemented it triggers only one update, probably it had bugs before too, but got unnoticed
self:ReassignCds("target"); self:ReassignCds("target");
@ -332,7 +332,7 @@ function Vect:VOnTimerUpdate(which)
end end
end end
function Vect:UpdateCds(which) function Rect:UpdateCds(which)
--check if we have cooldown for that unit --check if we have cooldown for that unit
if not self.cds[self.targets[which]] then return end if not self.cds[self.targets[which]] then return end
local t = GetTime(); local t = GetTime();

View File

@ -7,26 +7,26 @@ local libSharedMedia = LibStub("LibSharedMedia-3.0");
local libDRData = LibStub('DRData-1.0'); local libDRData = LibStub('DRData-1.0');
--DR db functions --DR db functions
function Vect:DRDebuffGained(spellID, dstGUID, isPlayer) function Rect:DRDebuffGained(spellID, dstGUID, isPlayer)
local db = Vect.db.profile; local db = Rect.db.profile;
if not db["enabled"] then return end; if not db["enabled"] then return end;
if not Vect.drs[dstGUID] then if not Rect.drs[dstGUID] then
Vect.drs[dstGUID] = {} Rect.drs[dstGUID] = {}
end end
local drCat = libDRData:GetSpellCategory(spellID); local drCat = libDRData:GetSpellCategory(spellID);
local spellName, spellRank, spellIcon = GetSpellInfo(spellID); local spellName, spellRank, spellIcon = GetSpellInfo(spellID);
Vect:UpdateDRs(dstGUID); Rect:UpdateDRs(dstGUID);
if not Vect.drs[dstGUID][drCat] then if not Rect.drs[dstGUID][drCat] then
local cd = 18; local cd = 18;
local currentTime = GetTime(); local currentTime = GetTime();
local endTime = currentTime + cd; local endTime = currentTime + cd;
local diminished = 1; local diminished = 1;
local isDiminishingStarted = false; local isDiminishingStarted = false;
Vect.drs[dstGUID][drCat] = { Rect.drs[dstGUID][drCat] = {
currentTime, currentTime,
endTime, endTime,
cd, cd,
@ -40,20 +40,20 @@ function Vect:DRDebuffGained(spellID, dstGUID, isPlayer)
local cd = 18; local cd = 18;
local currentTime = GetTime(); local currentTime = GetTime();
local endTime = currentTime + cd; local endTime = currentTime + cd;
Vect.drs[dstGUID][drCat][1] = currentTime; Rect.drs[dstGUID][drCat][1] = currentTime;
Vect.drs[dstGUID][drCat][2] = currentTime + cd; Rect.drs[dstGUID][drCat][2] = currentTime + cd;
Vect.drs[dstGUID][drCat][4] = spellIcon; Rect.drs[dstGUID][drCat][4] = spellIcon;
Vect.drs[dstGUID][drCat][5] = spellID; Rect.drs[dstGUID][drCat][5] = spellID;
Vect.drs[dstGUID][drCat][6] = Vect.drs[dstGUID][drCat][6] + 1; Rect.drs[dstGUID][drCat][6] = Rect.drs[dstGUID][drCat][6] + 1;
Vect.drs[dstGUID][drCat][7] = false; Rect.drs[dstGUID][drCat][7] = false;
--reset it back to 1, x > 3 means, the server updated the dr in less than 18 sec. --reset it back to 1, x > 3 means, the server updated the dr in less than 18 sec.
if Vect.drs[dstGUID][drCat][6] > 3 then if Rect.drs[dstGUID][drCat][6] > 3 then
Vect.drs[dstGUID][drCat][6] = 1; Rect.drs[dstGUID][drCat][6] = 1;
end end
end end
--self:Print(Vect.cds[srcGUID][spellID][1] .. " " .. Vect.cds[srcGUID][spellID][2] .. " " .. Vect.cds[srcGUID][spellID][3]); --self:Print(Rect.cds[srcGUID][spellID][1] .. " " .. Rect.cds[srcGUID][spellID][2] .. " " .. Rect.cds[srcGUID][spellID][3]);
if self.targets["target"] == dstGUID then if self.targets["target"] == dstGUID then
self:ReassignDRs("targetdr"); self:ReassignDRs("targetdr");
@ -68,27 +68,27 @@ function Vect:DRDebuffGained(spellID, dstGUID, isPlayer)
end end
end end
function Vect:DRDebuffFaded(spellID, dstGUID, isPlayer) function Rect:DRDebuffFaded(spellID, dstGUID, isPlayer)
local db = Vect.db.profile; local db = Rect.db.profile;
if not db["enabled"] then return end; if not db["enabled"] then return end;
if not Vect.drs[dstGUID] then if not Rect.drs[dstGUID] then
Vect.drs[dstGUID] = {} Rect.drs[dstGUID] = {}
end end
local drCat = libDRData:GetSpellCategory(spellID); local drCat = libDRData:GetSpellCategory(spellID);
local spellName, spellRank, spellIcon = GetSpellInfo(spellID); local spellName, spellRank, spellIcon = GetSpellInfo(spellID);
Vect:UpdateDRs(dstGUID); Rect:UpdateDRs(dstGUID);
if not Vect.drs[dstGUID][drCat] then if not Rect.drs[dstGUID][drCat] then
--means we didn't see it applied --means we didn't see it applied
local cd = 18; local cd = 18;
local currentTime = GetTime(); local currentTime = GetTime();
local endTime = currentTime + cd; local endTime = currentTime + cd;
local diminished = 1; local diminished = 1;
local isDiminishingStarted = true; local isDiminishingStarted = true;
Vect.drs[dstGUID][drCat] = { Rect.drs[dstGUID][drCat] = {
currentTime, currentTime,
endTime, endTime,
cd, cd,
@ -102,12 +102,12 @@ function Vect:DRDebuffFaded(spellID, dstGUID, isPlayer)
local cd = 18; local cd = 18;
local currentTime = GetTime(); local currentTime = GetTime();
local endTime = currentTime + cd; local endTime = currentTime + cd;
Vect.drs[dstGUID][drCat][1] = currentTime; Rect.drs[dstGUID][drCat][1] = currentTime;
Vect.drs[dstGUID][drCat][2] = endTime; Rect.drs[dstGUID][drCat][2] = endTime;
Vect.drs[dstGUID][drCat][7] = true; Rect.drs[dstGUID][drCat][7] = true;
end end
--self:Print(Vect.cds[srcGUID][spellID][1] .. " " .. Vect.cds[srcGUID][spellID][2] .. " " .. Vect.cds[srcGUID][spellID][3]); --self:Print(Rect.cds[srcGUID][spellID][1] .. " " .. Rect.cds[srcGUID][spellID][2] .. " " .. Rect.cds[srcGUID][spellID][3]);
if self.targets["target"] == dstGUID then if self.targets["target"] == dstGUID then
self:ReassignDRs("targetdr"); self:ReassignDRs("targetdr");
@ -122,13 +122,13 @@ function Vect:DRDebuffFaded(spellID, dstGUID, isPlayer)
end end
end end
function Vect:ReassignDRs(which) function Rect:ReassignDRs(which)
local db = Vect.db.profile; local db = Rect.db.profile;
--bail out early, if frames are disabled --bail out early, if frames are disabled
if not db[which]["enabled"] or not db["enabled"] then return end; if not db[which]["enabled"] or not db["enabled"] then return end;
--first hide all --first hide all
for i = 1, 18 do for i = 1, 18 do
local frame = Vect.frames[which][i]["frame"]; local frame = Rect.frames[which][i]["frame"];
frame:Hide(); frame:Hide();
end end
--check if frames are unlocked --check if frames are unlocked
@ -145,18 +145,18 @@ function Vect:ReassignDRs(which)
if not self.drs[self.targets[whichs]] then return end; if not self.drs[self.targets[whichs]] then return end;
--update then --update then
Vect:UpdateDRs(self.targets[whichs]); Rect:UpdateDRs(self.targets[whichs]);
--sort them --sort them
local tmp = Vect:SortDRs(whichs); local tmp = Rect:SortDRs(whichs);
--let's fill them up --let's fill them up
local i = 1; local i = 1;
for k, v in ipairs(tmp) do for k, v in ipairs(tmp) do
--self:Print(v["spellID"]); --self:Print(v["spellID"]);
local frame = Vect.frames[which][i]["frame"]; local frame = Rect.frames[which][i]["frame"];
local text = Vect.frames[which][i]["texture"]; local text = Rect.frames[which][i]["texture"];
text:SetTexture(v["spellIcon"]); text:SetTexture(v["spellIcon"]);
local CoolDown = Vect.frames[which][i]["cooldown"]; local CoolDown = Rect.frames[which][i]["cooldown"];
local t = Vect.frames[which][i]["text"]; local t = Rect.frames[which][i]["text"];
if v["isDiminishingStarted"] then if v["isDiminishingStarted"] then
CoolDown:SetCooldown(v["currentTime"], v["cd"]); CoolDown:SetCooldown(v["currentTime"], v["cd"]);
else else
@ -173,8 +173,8 @@ function Vect:ReassignDRs(which)
end end
end end
function Vect:SortDRs(which) function Rect:SortDRs(which)
local db = Vect.db.profile; local db = Rect.db.profile;
local tmp = {}; local tmp = {};
--make the tmp table --make the tmp table
@ -200,23 +200,23 @@ function Vect:SortDRs(which)
if which == "self" then which = "selfdr" end if which == "self" then which = "selfdr" end
if db[which]["sortOrder"] == "1" then --["1"] = "Ascending (CD left)", if db[which]["sortOrder"] == "1" then --["1"] = "Ascending (CD left)",
table.sort(tmp, function(a, b) return Vect:ComparerAscendingCDLeft(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerAscendingCDLeft(a, b) end);
elseif db[which]["sortOrder"] == "2" then --["2"] = "Descending (CD left)", elseif db[which]["sortOrder"] == "2" then --["2"] = "Descending (CD left)",
table.sort(tmp, function(a, b) return Vect:ComparerDescendingCDLeft(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerDescendingCDLeft(a, b) end);
elseif db[which]["sortOrder"] == "3" then --["3"] = "Ascending (CD total)", elseif db[which]["sortOrder"] == "3" then --["3"] = "Ascending (CD total)",
table.sort(tmp, function(a, b) return Vect:ComparerAscendingCDTotal(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerAscendingCDTotal(a, b) end);
elseif db[which]["sortOrder"] == "4" then --["4"] = "Descending (CD total)", elseif db[which]["sortOrder"] == "4" then --["4"] = "Descending (CD total)",
table.sort(tmp, function(a, b) return Vect:ComparerDescendingCDTotal(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerDescendingCDTotal(a, b) end);
elseif db[which]["sortOrder"] == "5" then --["5"] = "Recent first", elseif db[which]["sortOrder"] == "5" then --["5"] = "Recent first",
table.sort(tmp, function(a, b) return Vect:ComparerRecentFirst(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerRecentFirst(a, b) end);
elseif db[which]["sortOrder"] == "6" then --["6"] = "Recent Last", elseif db[which]["sortOrder"] == "6" then --["6"] = "Recent Last",
table.sort(tmp, function(a, b) return Vect:ComparerRecentLast(a, b) end); table.sort(tmp, function(a, b) return Rect:ComparerRecentLast(a, b) end);
end end
--["7"] = "No order" --["7"] = "No order"
return tmp; return tmp;
end end
function Vect:CreateDRFrames(which) function Rect:CreateDRFrames(which)
for i = 1, 18 do for i = 1, 18 do
local frame = CreateFrame("Frame", nil, UIParent, nil); local frame = CreateFrame("Frame", nil, UIParent, nil);
frame:SetFrameStrata("MEDIUM"); frame:SetFrameStrata("MEDIUM");
@ -239,7 +239,7 @@ function Vect:CreateDRFrames(which)
text:SetTexture("Interface\\Icons\\Spell_Arcane_Blink") text:SetTexture("Interface\\Icons\\Spell_Arcane_Blink")
text:SetAllPoints(frame); text:SetAllPoints(frame);
frame.texture = text; frame.texture = text;
local CoolDown = CreateFrame("Cooldown", "VectCoolDown" .. i, frame); local CoolDown = CreateFrame("Cooldown", "RectCoolDown" .. i, frame);
CoolDown:SetAllPoints() CoolDown:SetAllPoints()
CoolDown:SetCooldown(GetTime(), 50); CoolDown:SetCooldown(GetTime(), 50);
local t = frame:CreateFontString(nil, "OVERLAY"); local t = frame:CreateFontString(nil, "OVERLAY");
@ -247,16 +247,16 @@ function Vect:CreateDRFrames(which)
t:SetPoint("CENTER", frame, "CENTER", 0, 0); t:SetPoint("CENTER", frame, "CENTER", 0, 0);
t:SetFont("Fonts\\FRIZQT__.TTF", 11, "OUTLINE, MONOCHROME") t:SetFont("Fonts\\FRIZQT__.TTF", 11, "OUTLINE, MONOCHROME")
--frame:Hide(); --frame:Hide();
Vect.frames[which][i] = {} Rect.frames[which][i] = {}
Vect.frames[which][i]["frame"] = frame; Rect.frames[which][i]["frame"] = frame;
Vect.frames[which][i]["texture"] = text; Rect.frames[which][i]["texture"] = text;
Vect.frames[which][i]["cooldown"] = CoolDown; Rect.frames[which][i]["cooldown"] = CoolDown;
Vect.frames[which][i]["text"] = t; Rect.frames[which][i]["text"] = t;
end end
end end
function Vect:MoveDRTimersStop(which) function Rect:MoveDRTimersStop(which)
local db = Vect.db.profile; local db = Rect.db.profile;
local x = db[which]["xPos"]; local x = db[which]["xPos"];
local y = db[which]["yPos"]; local y = db[which]["yPos"];
local size = db[which]["size"]; local size = db[which]["size"];
@ -265,12 +265,12 @@ function Vect:MoveDRTimersStop(which)
local drNumPos = db[which]["drnumposition"]; local drNumPos = db[which]["drnumposition"];
for i = 1, 18 do for i = 1, 18 do
local frame = Vect.frames[which][i]["frame"]; local frame = Rect.frames[which][i]["frame"];
frame:ClearAllPoints(); frame:ClearAllPoints();
frame:SetFrameStrata("MEDIUM"); frame:SetFrameStrata("MEDIUM");
frame:SetWidth(size); frame:SetWidth(size);
frame:SetHeight(size); frame:SetHeight(size);
local text = Vect.frames[which][i]["texture"]; local text = Rect.frames[which][i]["texture"];
text:SetAllPoints(frame); text:SetAllPoints(frame);
frame.texture = text; frame.texture = text;
--set them based on the grow type --set them based on the grow type
@ -284,7 +284,7 @@ function Vect:MoveDRTimersStop(which)
frame:SetPoint("BOTTOMLEFT", x - ((i - 1) * size), y); frame:SetPoint("BOTTOMLEFT", x - ((i - 1) * size), y);
end end
local t = Vect.frames[which][i]["text"]; local t = Rect.frames[which][i]["text"];
t:ClearAllPoints(); t:ClearAllPoints();
--check if we need numbers --check if we need numbers
@ -308,14 +308,14 @@ function Vect:MoveDRTimersStop(which)
t:SetPoint("CENTER", frame, "CENTER", xOSet, yOSet); t:SetPoint("CENTER", frame, "CENTER", xOSet, yOSet);
end end
local CoolDown = Vect.frames[which][i]["cooldown"]; local CoolDown = Rect.frames[which][i]["cooldown"];
CoolDown:SetAllPoints(); CoolDown:SetAllPoints();
--frame:Show(); --frame:Show();
end end
end end
function Vect:VOnDRTimerUpdate(which) function Rect:VOnDRTimerUpdate(which)
if Vect:UpdateDRs(self.targets[which]) then if Rect:UpdateDRs(self.targets[which]) then
--we have to update every three, because if somebody is targeted and focused since sorting is --we have to update every three, 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 --implemented it triggers only one update, probably it had bugs before too, but got unnoticed
self:ReassignDRs("targetdr"); self:ReassignDRs("targetdr");
@ -324,7 +324,7 @@ function Vect:VOnDRTimerUpdate(which)
end end
end end
function Vect:UpdateDRs(unitGUID) function Rect:UpdateDRs(unitGUID)
if not unitGUID then return end; if not unitGUID then return end;
--check if we have dr for that unit --check if we have dr for that unit
if not self.drs[unitGUID] then return end if not self.drs[unitGUID] then return end
@ -340,11 +340,11 @@ function Vect:UpdateDRs(unitGUID)
return found; return found;
end end
function Vect:HideSelfDRFrames() function Rect:HideSelfDRFrames()
if not Vect.frames["selfdr"][1] then return end; if not Rect.frames["selfdr"][1] then return end;
for i = 1, 18 do for i = 1, 18 do
local frame = Vect.frames["selfdr"][i]["frame"]; local frame = Rect.frames["selfdr"][i]["frame"];
frame:Hide(); frame:Hide();
end end
end end

View File

@ -1,10 +1,10 @@
Vect = LibStub("AceAddon-3.0"):NewAddon("Vect", "AceConsole-3.0", "AceEvent-3.0") Rect = LibStub("AceAddon-3.0"):NewAddon("Rect", "AceConsole-3.0", "AceEvent-3.0")
Vect.appName = "Vect" Rect.appName = "Rect"
Vect.dbName = "VectDB" Rect.dbName = "RectDB"
Vect.version = "1.0RC1" Rect.version = "1.0RC1"
function Vect:HideFrames() function Rect:HideFrames()
for i = 1, 23 do for i = 1, 23 do
local frame = self.frames["target"][i]["frame"]; local frame = self.frames["target"][i]["frame"];
frame:Hide(); frame:Hide();

View File

@ -8,15 +8,15 @@ local libDRData = LibStub('DRData-1.0');
--Utility Functions for the options --Utility Functions for the options
function Vect:VectDisable() function Rect:RectDisable()
self:Reset(); self:Reset();
self:ApplySettings(); self:ApplySettings();
--hide the frames --hide the frames
Vect:HideFrames(); Rect:HideFrames();
--self:Disable(); --self:Disable();
end end
function Vect:VectEnable() function Rect:RectEnable()
--self:Enable(); --self:Enable();
self:Reset(); self:Reset();
self:ApplySettings(); self:ApplySettings();
@ -24,35 +24,35 @@ end
--enable --enable
function Vect:isEnabled() function Rect:isEnabled()
local db = Vect.db.profile; local db = Rect.db.profile;
return db["enabled"]; return db["enabled"];
end end
function Vect:setEnabledOrDisabled(enable) function Rect:setEnabledOrDisabled(enable)
local db = Vect.db.profile; local db = Rect.db.profile;
db["enabled"] = enable; db["enabled"] = enable;
if enable then if enable then
Vect:VectEnable() Rect:RectEnable()
else else
Vect:VectDisable() Rect:RectDisable()
end end
end end
function Vect:isPartEnabled(which) function Rect:isPartEnabled(which)
local db = Vect.db.profile; local db = Rect.db.profile;
return db[which]["enabled"]; return db[which]["enabled"];
end end
function Vect:SetPartEnabledOrDisabled(which, enable) function Rect:SetPartEnabledOrDisabled(which, enable)
local db = Vect.db.profile; local db = Rect.db.profile;
db[which]["enabled"] = enable; db[which]["enabled"] = enable;
--hide all those frames --hide all those frames
if not enable then if not enable then
for i = 1, 23 do for i = 1, 23 do
local frame = Vect.frames[which][i]["frame"]; local frame = Rect.frames[which][i]["frame"];
frame:Hide(); frame:Hide();
local colorframe = Vect.fremes[which][i]["colorframe"]; local colorframe = Rect.fremes[which][i]["colorframe"];
colorframe:Hide(); colorframe:Hide();
end end
else else
@ -60,13 +60,13 @@ function Vect:SetPartEnabledOrDisabled(which, enable)
end end
end end
function Vect:SetDRPartEnabledOrDisabled(which, enable) function Rect:SetDRPartEnabledOrDisabled(which, enable)
local db = Vect.db.profile; local db = Rect.db.profile;
db[which]["enabled"] = enable; db[which]["enabled"] = enable;
--hide all those frames --hide all those frames
if not enable then if not enable then
for i = 1, 18 do for i = 1, 18 do
local frame = Vect.frames[which][i]["frame"]; local frame = Rect.frames[which][i]["frame"];
frame:Hide(); frame:Hide();
end end
else else
@ -74,30 +74,30 @@ function Vect:SetDRPartEnabledOrDisabled(which, enable)
end end
end end
function Vect:isSpecDetectionEnabled() function Rect:isSpecDetectionEnabled()
local db = Vect.db.profile; local db = Rect.db.profile;
return db["specdetection"]; return db["specdetection"];
end end
function Vect:setSpecDetectionEnabledorDisabled(enable) function Rect:setSpecDetectionEnabledorDisabled(enable)
local db = Vect.db.profile; local db = Rect.db.profile;
db["specdetection"] = enable; db["specdetection"] = enable;
--call the remapcooldowns, and then update --call the remapcooldowns, and then update
--self:ReassignCds(which); --self:ReassignCds(which);
end end
function Vect:getColorFrameEnabled(which) function Rect:getColorFrameEnabled(which)
local db = Vect.db.profile; local db = Rect.db.profile;
return db[which]["colorframeenabled"]; return db[which]["colorframeenabled"];
end end
function Vect:setColorFrameEnabled(which, enable) function Rect:setColorFrameEnabled(which, enable)
local db = Vect.db.profile; local db = Rect.db.profile;
db[which]["colorframeenabled"] = enable; db[which]["colorframeenabled"] = enable;
--hide all those frames --hide all those frames
if not enable then if not enable then
for i = 1, 23 do for i = 1, 23 do
local colorframe = Vect.frames[which][i]["colorframe"]; local colorframe = Rect.frames[which][i]["colorframe"];
colorframe:Hide(); colorframe:Hide();
end end
else else
@ -105,35 +105,35 @@ function Vect:setColorFrameEnabled(which, enable)
end end
end end
function Vect:getCDTypeSortingEnable() function Rect:getCDTypeSortingEnable()
local db = Vect.db.profile; local db = Rect.db.profile;
return db["cdtypesortorder"]["enabled"]; return db["cdtypesortorder"]["enabled"];
end end
function Vect:setCDTypeSortingEnable(v) function Rect:setCDTypeSortingEnable(v)
local db = Vect.db.profile; local db = Rect.db.profile;
db["cdtypesortorder"]["enabled"] = v; db["cdtypesortorder"]["enabled"] = v;
self:ReassignCds("target"); self:ReassignCds("target");
self:ReassignCds("focus"); self:ReassignCds("focus");
end end
function Vect:getPetCDGuessing() function Rect:getPetCDGuessing()
local db = Vect.db.profile; local db = Rect.db.profile;
return db["petcdguessing"]; return db["petcdguessing"];
end end
function Vect:setPetCDGuessing(v) function Rect:setPetCDGuessing(v)
local db = Vect.db.profile; local db = Rect.db.profile;
db["petcdguessing"] = v; db["petcdguessing"] = v;
end end
--lock --lock
function Vect:isLocked() function Rect:isLocked()
return Vect.db.profile["locked"]; return Rect.db.profile["locked"];
end end
function Vect:LockFrames() function Rect:LockFrames()
self:MoveTimersStop("target"); self:MoveTimersStop("target");
self:MoveTimersStop("focus"); self:MoveTimersStop("focus");
self:HideMovableFrames() self:HideMovableFrames()
@ -141,28 +141,28 @@ function Vect:LockFrames()
self:ReassignCds("focus"); self:ReassignCds("focus");
end end
function Vect:UnlockFrames() function Rect:UnlockFrames()
--this will hide the frames --this will hide the frames
self:ReassignCds("target"); self:ReassignCds("target");
self:ReassignCds("focus"); self:ReassignCds("focus");
Vect:ShowMovableFrames(); Rect:ShowMovableFrames();
end end
function Vect:HideMovableFrames() function Rect:HideMovableFrames()
if not Vect.MovableFrames then return end; if not Rect.MovableFrames then return end;
--Hide them --Hide them
for k, v in pairs(Vect.MovableFrames) do for k, v in pairs(Rect.MovableFrames) do
v["frame"]:EnableMouse(false); v["frame"]:EnableMouse(false);
v["frame"]:SetMovable(false); v["frame"]:SetMovable(false);
v["frame"]:Hide(); v["frame"]:Hide();
end end
end end
function Vect:ShowMovableFrames() function Rect:ShowMovableFrames()
local db = Vect.db.profile; local db = Rect.db.profile;
--Create them if they doesn't exists --Create them if they doesn't exists
if not Vect.MovableFrames then if not Rect.MovableFrames then
Vect.MovableFrames = {} Rect.MovableFrames = {}
for i = 1, 5 do for i = 1, 5 do
local frame = CreateFrame("Frame", nil, UIParent, nil); local frame = CreateFrame("Frame", nil, UIParent, nil);
frame:SetFrameStrata("BACKGROUND"); frame:SetFrameStrata("BACKGROUND");
@ -207,15 +207,15 @@ function Vect:ShowMovableFrames()
frame.DragID = which; frame.DragID = which;
Vect.MovableFrames[i] = {} Rect.MovableFrames[i] = {}
Vect.MovableFrames[i]["frame"] = frame; Rect.MovableFrames[i]["frame"] = frame;
Vect.MovableFrames[i]["texture"] = text; Rect.MovableFrames[i]["texture"] = text;
Vect.MovableFrames[i]["text"] = t; Rect.MovableFrames[i]["text"] = t;
end end
end end
--Show, resize them --Show, resize them
for k, v in pairs(Vect.MovableFrames) do for k, v in pairs(Rect.MovableFrames) do
v["frame"]:EnableMouse(true) v["frame"]:EnableMouse(true)
v["frame"]:SetMovable(true) v["frame"]:SetMovable(true)
v["frame"]:RegisterForDrag("LeftButton") v["frame"]:RegisterForDrag("LeftButton")
@ -226,121 +226,121 @@ function Vect:ShowMovableFrames()
end end
end end
function Vect:MovableFrameDragStart() function Rect:MovableFrameDragStart()
this:StartMoving(); this:StartMoving();
end end
function Vect:MovableFrameDragStop() function Rect:MovableFrameDragStop()
local db = Vect.db.profile; local db = Rect.db.profile;
db[this.DragID]["xPos"] = this:GetLeft(); db[this.DragID]["xPos"] = this:GetLeft();
db[this.DragID]["yPos"] = this:GetBottom(); db[this.DragID]["yPos"] = this:GetBottom();
--Vect:Print(this:GetLeft() .. " " .. this:GetBottom()); --Rect:Print(this:GetLeft() .. " " .. this:GetBottom());
this:StopMovingOrSizing(); this:StopMovingOrSizing();
end end
--size Functions --size Functions
function Vect:getFrameSize(which) function Rect:getFrameSize(which)
local db = Vect.db.profile; local db = Rect.db.profile;
return db[which]["size"]; return db[which]["size"];
end end
function Vect:setFrameSize(which, size) function Rect:setFrameSize(which, size)
local db = Vect.db.profile; local db = Rect.db.profile;
db[which]["size"] = size; db[which]["size"] = size;
Vect:MoveTimersStop(which) Rect:MoveTimersStop(which)
if not db["locked"] then if not db["locked"] then
Vect:ShowMovableFrames(); Rect:ShowMovableFrames();
end end
end end
function Vect:getDRNumSize(which) function Rect:getDRNumSize(which)
local db = Vect.db.profile; local db = Rect.db.profile;
return db[which]["drnumsize"]; return db[which]["drnumsize"];
end end
function Vect:setDRNumSize(which, size) function Rect:setDRNumSize(which, size)
local db = Vect.db.profile; local db = Rect.db.profile;
db[which]["size"] = size; db[which]["size"] = size;
Vect:MoveDRTimersStop(which) Rect:MoveDRTimersStop(which)
end end
function Vect:getColorFrameSize(which) function Rect:getColorFrameSize(which)
local db = Vect.db.profile; local db = Rect.db.profile;
return db[which]["colorframesize"]; return db[which]["colorframesize"];
end end
function Vect:setColorFrameSize(which, size) function Rect:setColorFrameSize(which, size)
local db = Vect.db.profile; local db = Rect.db.profile;
db[which]["colorframesize"] = size; db[which]["colorframesize"] = size;
Vect:MoveTimersStop(which); Rect:MoveTimersStop(which);
Vect:ReassignCds(which); Rect:ReassignCds(which);
if not db["locked"] then if not db["locked"] then
Vect:ShowMovableFrames(); Rect:ShowMovableFrames();
end end
end end
--Grow Order --Grow Order
function Vect:getGrowOrder(which) function Rect:getGrowOrder(which)
local db = Vect.db.profile; local db = Rect.db.profile;
return db[which]["growOrder"]; return db[which]["growOrder"];
end end
function Vect:setGrowOrder(which, v) function Rect:setGrowOrder(which, v)
local db = Vect.db.profile; local db = Rect.db.profile;
db[which]["growOrder"] = v; db[which]["growOrder"] = v;
Vect:MoveTimersStop(which) Rect:MoveTimersStop(which)
end end
function Vect:setDRGrowOrder(which, v) function Rect:setDRGrowOrder(which, v)
local db = Vect.db.profile; local db = Rect.db.profile;
db[which]["growOrder"] = v; db[which]["growOrder"] = v;
Vect:MoveDRTimersStop(which) Rect:MoveDRTimersStop(which)
end end
--Sort Order --Sort Order
function Vect:getSortOrder(which) function Rect:getSortOrder(which)
local db = Vect.db.profile; local db = Rect.db.profile;
return db[which]["sortOrder"]; return db[which]["sortOrder"];
end end
function Vect:setSortOrder(which, v) function Rect:setSortOrder(which, v)
local db = Vect.db.profile; local db = Rect.db.profile;
db[which]["sortOrder"] = v; db[which]["sortOrder"] = v;
Vect:ReassignCds(which); Rect:ReassignCds(which);
end end
function Vect:getTypeSortOrder(which) function Rect:getTypeSortOrder(which)
local db = Vect.db.profile; local db = Rect.db.profile;
return db["cdtypesortorder"][which]; return db["cdtypesortorder"][which];
end end
function Vect:setTypeSortOrder(which, v) function Rect:setTypeSortOrder(which, v)
local db = Vect.db.profile; local db = Rect.db.profile;
db["cdtypesortorder"][which] = v; db["cdtypesortorder"][which] = v;
Vect:ReassignCds("target"); Rect:ReassignCds("target");
Vect:ReassignCds("focus"); Rect:ReassignCds("focus");
end end
--Num Position functions --Num Position functions
function Vect:getDRNumPosition(which) function Rect:getDRNumPosition(which)
local db = Vect.db.profile; local db = Rect.db.profile;
return db[which]["drnumposition"]; return db[which]["drnumposition"];
end end
function Vect:setDRNumPosition(which, v) function Rect:setDRNumPosition(which, v)
local db = Vect.db.profile; local db = Rect.db.profile;
db[which]["drnumposition"] = v; db[which]["drnumposition"] = v;
Vect:MoveDRTimersStop(which); Rect:MoveDRTimersStop(which);
end end
--Color options --Color options
function Vect:getColor(part) function Rect:getColor(part)
local db = Vect.db.profile; local db = Rect.db.profile;
if not db["color"] then db["color"] = {} end if not db["color"] then db["color"] = {} end
@ -355,8 +355,8 @@ function Vect:getColor(part)
return db["color"][part]["r"], db["color"][part]["g"], db["color"][part]["b"], db["color"][part]["a"]; return db["color"][part]["r"], db["color"][part]["g"], db["color"][part]["b"], db["color"][part]["a"];
end end
function Vect:setColor(part, r, g, b, a) function Rect:setColor(part, r, g, b, a)
local db = Vect.db.profile; local db = Rect.db.profile;
if not db["color"][part] then db["color"][part] = {} end if not db["color"][part] then db["color"][part] = {} end
@ -367,54 +367,54 @@ function Vect:setColor(part, r, g, b, a)
end end
--Debug settings --Debug settings
function Vect:getDebugLevel() function Rect:getDebugLevel()
local db = Vect.db.profile; local db = Rect.db.profile;
return db["debugLevel"]; return db["debugLevel"];
end end
function Vect:setDebugLevel(v) function Rect:setDebugLevel(v)
local db = Vect.db.profile; local db = Rect.db.profile;
db["debugLevel"] = v; db["debugLevel"] = v;
end end
function Vect:getSpellCastDebug() function Rect:getSpellCastDebug()
local db = Vect.db.profile; local db = Rect.db.profile;
return db["spellCastDebug"]; return db["spellCastDebug"];
end end
function Vect:setSpellCastDebug(v) function Rect:setSpellCastDebug(v)
local db = Vect.db.profile; local db = Rect.db.profile;
db["spellCastDebug"] = v; db["spellCastDebug"] = v;
end end
function Vect:getSpellAuraDebug() function Rect:getSpellAuraDebug()
local db = Vect.db.profile; local db = Rect.db.profile;
return db["spellAuraDebug"]; return db["spellAuraDebug"];
end end
function Vect:setSpellAuraDebug(v) function Rect:setSpellAuraDebug(v)
local db = Vect.db.profile; local db = Rect.db.profile;
db["spellAuraDebug"] = v; db["spellAuraDebug"] = v;
end end
function Vect:getAllCDebug() function Rect:getAllCDebug()
local db = Vect.db.profile; local db = Rect.db.profile;
return db["allCDebug"]; return db["allCDebug"];
end end
function Vect:setAllCDebug(v) function Rect:setAllCDebug(v)
local db = Vect.db.profile; local db = Rect.db.profile;
db["allCDebug"] = v; db["allCDebug"] = v;
end end
function Vect:getSelfCDRegister() function Rect:getSelfCDRegister()
local db = Vect.db.profile; local db = Rect.db.profile;
return db["selfCDRegister"]; return db["selfCDRegister"];
end end
function Vect:setSelfCDRegister(v) function Rect:setSelfCDRegister(v)
local db = Vect.db.profile; local db = Rect.db.profile;
db["selfCDRegister"] = v; db["selfCDRegister"] = v;
Vect:ReassignCds("target"); Rect:ReassignCds("target");
Vect:ReassignCds("focus"); Rect:ReassignCds("focus");
end end

View File

@ -1,41 +1,41 @@
local aceDBOptions = LibStub("AceDBOptions-3.0") local aceDBOptions = LibStub("AceDBOptions-3.0")
function Vect:GetVectOptions() function Rect:GetRectOptions()
local db = self.db.profile; local db = self.db.profile;
local options = { local options = {
type = "group", name = "Vect", childGroups = "tab", type = "group", name = "Rect", childGroups = "tab",
args = { args = {
enabled = { enabled = {
type = "toggle", name = "Enabled", desc = "Enable/Disable the addon", order = 0, type = "toggle", name = "Enabled", desc = "Enable/Disable the addon", order = 0,
get = function() return Vect:isEnabled() end, get = function() return Rect:isEnabled() end,
set = function(_, v) set = function(_, v)
Vect:setEnabledOrDisabled(v); Rect:setEnabledOrDisabled(v);
end end
}, },
lock = { lock = {
type = "toggle", name = "Lock", desc = "Uncheck to move the frames", order = 1, type = "toggle", name = "Lock", desc = "Uncheck to move the frames", order = 1,
get = function() return Vect:isLocked() end, get = function() return Rect:isLocked() end,
set = function(_, v) set = function(_, v)
db.locked = v; db.locked = v;
if v then Vect:LockFrames() else Vect:UnlockFrames() end; if v then Rect:LockFrames() else Rect:UnlockFrames() end;
end end
}, },
targetandfocus = { targetandfocus = {
type = "group", name = "CDs", desc = "Cooldown frame's settings.", childGroups = "tab", order = 2, type = "group", name = "CDs", desc = "Cooldown frame's settings.", childGroups = "tab", order = 2,
args = Vect:getTargetandFocusOptions(); args = Rect:getTargetandFocusOptions();
}, },
droptions = { droptions = {
type = "group", name = "DRs", desc = "DR frame's settings.", childGroups = "tab",order = 3, type = "group", name = "DRs", desc = "DR frame's settings.", childGroups = "tab",order = 3,
args = Vect:getDROptions(); args = Rect:getDROptions();
}, },
coloroptions = { coloroptions = {
type = "group", name = "Global", desc = "Global settings.", childGroups = "tab",order = 4, type = "group", name = "Global", desc = "Global settings.", childGroups = "tab",order = 4,
args = Vect:getGlobalOptions() args = Rect:getGlobalOptions()
}, },
debugoptions = { debugoptions = {
type = "group", name = "Debug", desc = "Debug settings.", childGroups = "tab", order = 5, type = "group", name = "Debug", desc = "Debug settings.", childGroups = "tab", order = 5,
args = Vect:getDebugOptions(); args = Rect:getDebugOptions();
}, },
profileoptions = aceDBOptions:GetOptionsTable(self.db) profileoptions = aceDBOptions:GetOptionsTable(self.db)
} }
@ -43,23 +43,23 @@ function Vect:GetVectOptions()
return options; return options;
end end
--order 10-20 --order 10-20
function Vect:getTargetandFocusOptions() function Rect:getTargetandFocusOptions()
local args = { local args = {
targetHeader = { targetHeader = {
type = "header", name = "Target's settings", order = 10 type = "header", name = "Target's settings", order = 10
}, },
targettoggle = { targettoggle = {
type = "toggle", name = "Target", desc = "Enable/Disable showing the target's cooldowns", order = 11, type = "toggle", name = "Target", desc = "Enable/Disable showing the target's cooldowns", order = 11,
get = function() return Vect:isPartEnabled("target") end, get = function() return Rect:isPartEnabled("target") end,
set = function(_, v) set = function(_, v)
Vect:SetPartEnabledOrDisabled("target", v); Rect:SetPartEnabledOrDisabled("target", v);
end end
}, },
targetrange = { targetrange = {
type = "range", name = "Target's size", order = 12, min = 10, max = 150, step = 1, type = "range", name = "Target's size", order = 12, min = 10, max = 150, step = 1,
get = function() return Vect:getFrameSize("target") end, get = function() return Rect:getFrameSize("target") end,
set = function(_, v) set = function(_, v)
Vect:setFrameSize("target", v); Rect:setFrameSize("target", v);
end end
}, },
targetGrowSelect = { targetGrowSelect = {
@ -71,9 +71,9 @@ function Vect:getTargetandFocusOptions()
["3"] = "Down", ["3"] = "Down",
["4"] = "Left" ["4"] = "Left"
}, },
get = function() return Vect:getGrowOrder("target") end, get = function() return Rect:getGrowOrder("target") end,
set = function(_, v) set = function(_, v)
Vect:setGrowOrder("target", v); Rect:setGrowOrder("target", v);
end end
}, },
targetSortSelect = { targetSortSelect = {
@ -88,23 +88,23 @@ function Vect:getTargetandFocusOptions()
["6"] = "Recent Last", ["6"] = "Recent Last",
["7"] = "No order" ["7"] = "No order"
}, },
get = function() return Vect:getSortOrder("target") end, get = function() return Rect:getSortOrder("target") end,
set = function(_, v) set = function(_, v)
Vect:setSortOrder("target", v); Rect:setSortOrder("target", v);
end end
}, },
targetcolortoggle = { targetcolortoggle = {
type = "toggle", name = "Colors", desc = "Enable/Disable showing the target's cooldown's colors.", order = 15, type = "toggle", name = "Colors", desc = "Enable/Disable showing the target's cooldown's colors.", order = 15,
get = function() return Vect:getColorFrameEnabled("target") end, get = function() return Rect:getColorFrameEnabled("target") end,
set = function(_, v) set = function(_, v)
Vect:setColorFrameEnabled("target", v); Rect:setColorFrameEnabled("target", v);
end end
}, },
targetcolorrange = { targetcolorrange = {
type = "range", name = "Target's Color size", order = 16, min = 1, max = 30, step = 1, type = "range", name = "Target's Color size", order = 16, min = 1, max = 30, step = 1,
get = function() return Vect:getColorFrameSize("target") end, get = function() return Rect:getColorFrameSize("target") end,
set = function(_, v) set = function(_, v)
Vect:setColorFrameSize("target", v); Rect:setColorFrameSize("target", v);
end end
}, },
focusHeader = { focusHeader = {
@ -112,16 +112,16 @@ function Vect:getTargetandFocusOptions()
}, },
focustoggle = { focustoggle = {
type = "toggle", name = "Focus", desc = "Enable/Disable showing the focus's cooldowns", order = 18, type = "toggle", name = "Focus", desc = "Enable/Disable showing the focus's cooldowns", order = 18,
get = function() return Vect:isPartEnabled("focus") end, get = function() return Rect:isPartEnabled("focus") end,
set = function(_, v) set = function(_, v)
Vect:SetPartEnabledOrDisabled("focus", v); Rect:SetPartEnabledOrDisabled("focus", v);
end end
}, },
focusRange = { focusRange = {
type = "range", name = "Focus's size", order = 19, 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, get = function() return Rect:getFrameSize("focus") end,
set = function(_, v) set = function(_, v)
Vect:setFrameSize("focus", v); Rect:setFrameSize("focus", v);
end end
}, },
focusGrowSelect = { focusGrowSelect = {
@ -133,9 +133,9 @@ function Vect:getTargetandFocusOptions()
["3"] = "Down", ["3"] = "Down",
["4"] = "Left" ["4"] = "Left"
}, },
get = function() return Vect:getGrowOrder("focus") end, get = function() return Rect:getGrowOrder("focus") end,
set = function(_, v) set = function(_, v)
Vect:setGrowOrder("focus", v); Rect:setGrowOrder("focus", v);
end end
}, },
focusSortSelect = { focusSortSelect = {
@ -150,23 +150,23 @@ function Vect:getTargetandFocusOptions()
["6"] = "Recent Last", ["6"] = "Recent Last",
["7"] = "No order" ["7"] = "No order"
}, },
get = function() return Vect:getSortOrder("focus") end, get = function() return Rect:getSortOrder("focus") end,
set = function(_, v) set = function(_, v)
Vect:setSortOrder("focus", v); Rect:setSortOrder("focus", v);
end end
}, },
focuscolortoggle = { focuscolortoggle = {
type = "toggle", name = "Colors", desc = "Enable/Disable showing the target's cooldown's colors.", order = 22, type = "toggle", name = "Colors", desc = "Enable/Disable showing the target's cooldown's colors.", order = 22,
get = function() return Vect:getColorFrameEnabled("focus") end, get = function() return Rect:getColorFrameEnabled("focus") end,
set = function(_, v) set = function(_, v)
Vect:setColorFrameEnabled("focus", v); Rect:setColorFrameEnabled("focus", v);
end end
}, },
focuscolorrange = { focuscolorrange = {
type = "range", name = "Focus's Color size", order = 23, min = 1, max = 30, step = 1, type = "range", name = "Focus's Color size", order = 23, min = 1, max = 30, step = 1,
get = function() return Vect:getColorFrameSize("focus") end, get = function() return Rect:getColorFrameSize("focus") end,
set = function(_, v) set = function(_, v)
Vect:setColorFrameSize("focus", v); Rect:setColorFrameSize("focus", v);
end end
}, },
} }
@ -174,23 +174,23 @@ function Vect:getTargetandFocusOptions()
end end
--order 20-40 --order 20-40
function Vect:getDROptions() function Rect:getDROptions()
local args = { local args = {
targetdrHeader = { targetdrHeader = {
type = "header", name = "Target's settings", order = 10 type = "header", name = "Target's settings", order = 10
}, },
targetdrtoggle = { targetdrtoggle = {
type = "toggle", name = "Enabled", desc = "Enable/Disable showing the target's DRs.", order = 11, type = "toggle", name = "Enabled", desc = "Enable/Disable showing the target's DRs.", order = 11,
get = function() return Vect:isPartEnabled("targetdr") end, get = function() return Rect:isPartEnabled("targetdr") end,
set = function(_, v) set = function(_, v)
Vect:SetDRPartEnabledOrDisabled("targetdr", v); Rect:SetDRPartEnabledOrDisabled("targetdr", v);
end end
}, },
targetdrrange = { targetdrrange = {
type = "range", name = "Target's DRs size", order = 12, min = 10, max = 150, step = 1, type = "range", name = "Target's DRs size", order = 12, min = 10, max = 150, step = 1,
get = function() return Vect:getFrameSize("targetdr") end, get = function() return Rect:getFrameSize("targetdr") end,
set = function(_, v) set = function(_, v)
Vect:setFrameSize("targetdr", v); Rect:setFrameSize("targetdr", v);
end end
}, },
@ -203,9 +203,9 @@ function Vect:getDROptions()
["3"] = "Down", ["3"] = "Down",
["4"] = "Left" ["4"] = "Left"
}, },
get = function() return Vect:getGrowOrder("targetdr") end, get = function() return Rect:getGrowOrder("targetdr") end,
set = function(_, v) set = function(_, v)
Vect:setDRGrowOrder("targetdr", v); Rect:setDRGrowOrder("targetdr", v);
end end
}, },
targetdrSortSelect = { targetdrSortSelect = {
@ -220,17 +220,17 @@ function Vect:getDROptions()
["6"] = "Recent Last", ["6"] = "Recent Last",
["7"] = "No order" ["7"] = "No order"
}, },
get = function() return Vect:getSortOrder("targetdr") end, get = function() return Rect:getSortOrder("targetdr") end,
set = function(_, v) set = function(_, v)
Vect:setSortOrder("targetdr", v); Rect:setSortOrder("targetdr", v);
end end
}, },
targetdrnumsizerange = { targetdrnumsizerange = {
type = "range", name = "Number's size", desc = "Target's DR's Number's size. Set it to 0 to disable it!", type = "range", name = "Number's size", desc = "Target's DR's Number's size. Set it to 0 to disable it!",
order = 15, min = 1, max = 30, step = 1, order = 15, min = 1, max = 30, step = 1,
get = function() return Vect:getDRNumSize("targetdr") end, get = function() return Rect:getDRNumSize("targetdr") end,
set = function(_, v) set = function(_, v)
Vect:setDRNumSize("targetdr", v); Rect:setDRNumSize("targetdr", v);
end end
}, },
@ -244,9 +244,9 @@ function Vect:getDROptions()
["4"] = "Left", ["4"] = "Left",
["5"] = "Middle" ["5"] = "Middle"
}, },
get = function() return Vect:getDRNumPosition("targetdr") end, get = function() return Rect:getDRNumPosition("targetdr") end,
set = function(_, v) set = function(_, v)
Vect:setDRNumPosition("targetdr", v); Rect:setDRNumPosition("targetdr", v);
end end
}, },
focusdrHeader = { focusdrHeader = {
@ -254,16 +254,16 @@ function Vect:getDROptions()
}, },
focusdrtoggle = { focusdrtoggle = {
type = "toggle", name = "Enabled", desc = "Enable/Disable showing the focus's DRs.", order = 18, type = "toggle", name = "Enabled", desc = "Enable/Disable showing the focus's DRs.", order = 18,
get = function() return Vect:isPartEnabled("focusdr") end, get = function() return Rect:isPartEnabled("focusdr") end,
set = function(_, v) set = function(_, v)
Vect:SetDRPartEnabledOrDisabled("focusdr", v); Rect:SetDRPartEnabledOrDisabled("focusdr", v);
end end
}, },
focusdrRange = { focusdrRange = {
type = "range", name = "Focus's size", order = 19, 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("focusdr") end, get = function() return Rect:getFrameSize("focusdr") end,
set = function(_, v) set = function(_, v)
Vect:setFrameSize("focusdr", v); Rect:setFrameSize("focusdr", v);
end end
}, },
focusdrGrowSelect = { focusdrGrowSelect = {
@ -275,9 +275,9 @@ function Vect:getDROptions()
["3"] = "Down", ["3"] = "Down",
["4"] = "Left" ["4"] = "Left"
}, },
get = function() return Vect:getGrowOrder("focusdr") end, get = function() return Rect:getGrowOrder("focusdr") end,
set = function(_, v) set = function(_, v)
Vect:setDRGrowOrder("focusdr", v); Rect:setDRGrowOrder("focusdr", v);
end end
}, },
focusdrSortSelect = { focusdrSortSelect = {
@ -292,17 +292,17 @@ function Vect:getDROptions()
["6"] = "Recent Last", ["6"] = "Recent Last",
["7"] = "No order" ["7"] = "No order"
}, },
get = function() return Vect:getSortOrder("focusdr") end, get = function() return Rect:getSortOrder("focusdr") end,
set = function(_, v) set = function(_, v)
Vect:setSortOrder("focusdr", v); Rect:setSortOrder("focusdr", v);
end end
}, },
focusdrnumsizerange = { focusdrnumsizerange = {
type = "range", name = "Number's size", desc = "Focus's DR's Number's size. Set it to 0 to disable it!", type = "range", name = "Number's size", desc = "Focus's DR's Number's size. Set it to 0 to disable it!",
order = 22, min = 1, max = 30, step = 1, order = 22, min = 1, max = 30, step = 1,
get = function() return Vect:getDRNumSize("focusdr") end, get = function() return Rect:getDRNumSize("focusdr") end,
set = function(_, v) set = function(_, v)
Vect:setDRNumSize("focusdr", v); Rect:setDRNumSize("focusdr", v);
end end
}, },
@ -316,9 +316,9 @@ function Vect:getDROptions()
["4"] = "Left", ["4"] = "Left",
["5"] = "Middle" ["5"] = "Middle"
}, },
get = function() return Vect:getDRNumPosition("focusdr") end, get = function() return Rect:getDRNumPosition("focusdr") end,
set = function(_, v) set = function(_, v)
Vect:setDRNumPosition("focusdr", v); Rect:setDRNumPosition("focusdr", v);
end end
}, },
selfdrHeader = { selfdrHeader = {
@ -326,16 +326,16 @@ function Vect:getDROptions()
}, },
selfdrtoggle = { selfdrtoggle = {
type = "toggle", name = "Enabled", desc = "Enable/Disable showing the your DRs.", order = 25, type = "toggle", name = "Enabled", desc = "Enable/Disable showing the your DRs.", order = 25,
get = function() return Vect:isPartEnabled("selfdr") end, get = function() return Rect:isPartEnabled("selfdr") end,
set = function(_, v) set = function(_, v)
Vect:SetDRPartEnabledOrDisabled("selfdr", v); Rect:SetDRPartEnabledOrDisabled("selfdr", v);
end end
}, },
selfdrrange = { selfdrrange = {
type = "range", name = "Self's DRs size", order = 26, 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, get = function() return Rect:getFrameSize("selfdr") end,
set = function(_, v) set = function(_, v)
Vect:setFrameSize("selfdr", v); Rect:setFrameSize("selfdr", v);
end end
}, },
selfdrGrowSelect = { selfdrGrowSelect = {
@ -347,9 +347,9 @@ function Vect:getDROptions()
["3"] = "Down", ["3"] = "Down",
["4"] = "Left" ["4"] = "Left"
}, },
get = function() return Vect:getGrowOrder("selfdr") end, get = function() return Rect:getGrowOrder("selfdr") end,
set = function(_, v) set = function(_, v)
Vect:setDRGrowOrder("selfdr", v); Rect:setDRGrowOrder("selfdr", v);
end end
}, },
selfdrSortSelect = { selfdrSortSelect = {
@ -364,17 +364,17 @@ function Vect:getDROptions()
["6"] = "Recent Last", ["6"] = "Recent Last",
["7"] = "No order" ["7"] = "No order"
}, },
get = function() return Vect:getSortOrder("selfdr") end, get = function() return Rect:getSortOrder("selfdr") end,
set = function(_, v) set = function(_, v)
Vect:setSortOrder("selfdr", v); Rect:setSortOrder("selfdr", v);
end end
}, },
selfdrnumsizerange = { selfdrnumsizerange = {
type = "range", name = "Number's size", desc = "Your DR's Number's size. Set it to 0 to disable it!", type = "range", name = "Number's size", desc = "Your DR's Number's size. Set it to 0 to disable it!",
order = 29, min = 1, max = 30, step = 1, order = 29, min = 1, max = 30, step = 1,
get = function() return Vect:getDRNumSize("selfdr") end, get = function() return Rect:getDRNumSize("selfdr") end,
set = function(_, v) set = function(_, v)
Vect:setDRNumSize("selfdr", v); Rect:setDRNumSize("selfdr", v);
end end
}, },
@ -388,9 +388,9 @@ function Vect:getDROptions()
["4"] = "Left", ["4"] = "Left",
["5"] = "Middle" ["5"] = "Middle"
}, },
get = function() return Vect:getDRNumPosition("selfdr") end, get = function() return Rect:getDRNumPosition("selfdr") end,
set = function(_, v) set = function(_, v)
Vect:setDRNumPosition("selfdr", v); Rect:setDRNumPosition("selfdr", v);
end end
}, },
} }
@ -398,25 +398,25 @@ function Vect:getDROptions()
end end
--order 40-50 --order 40-50
function Vect:getGlobalOptions() function Rect:getGlobalOptions()
local args = { local args = {
globalHeader = { globalHeader = {
type = "header", name = "Global CD settings", order = 10 type = "header", name = "Global CD settings", order = 10
}, },
specdetectiontoggle = { specdetectiontoggle = {
type = "toggle", name = "Spec Detection", desc = "Enable/Disable Spec Detection", order = 11, type = "toggle", name = "Spec Detection", desc = "Enable/Disable Spec Detection", order = 11,
get = function() return Vect:isSpecDetectionEnabled() end, get = function() return Rect:isSpecDetectionEnabled() end,
set = function(_, v) set = function(_, v)
Vect:setSpecDetectionEnabledorDisabled(v); Rect:setSpecDetectionEnabledorDisabled(v);
end end
}, },
petcdguessingtoggle = { petcdguessingtoggle = {
type = "toggle", name = "Pet CD Guessing", 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.", 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, order = 12,
get = function() return Vect:getPetCDGuessing() end, get = function() return Rect:getPetCDGuessing() end,
set = function(_, v) set = function(_, v)
Vect:setPetCDGuessing(v); Rect:setPetCDGuessing(v);
end end
}, },
globalcdtypesortHeader = { globalcdtypesortHeader = {
@ -424,93 +424,93 @@ function Vect:getGlobalOptions()
}, },
cdtypesortordertoggle = { cdtypesortordertoggle = {
type = "toggle", name = "Enabled", desc = "Enable/Disable CD Type Sort Order, It works like this: you set silence to 1, then cc to 2 and anticc to 2, then silences will go first, then cc and anticc as secound, they are organized within groups based on how you set them in the CDs settings tab.", order = 15, type = "toggle", name = "Enabled", desc = "Enable/Disable CD Type Sort Order, It works like this: you set silence to 1, then cc to 2 and anticc to 2, then silences will go first, then cc and anticc as secound, they are organized within groups based on how you set them in the CDs settings tab.", order = 15,
get = function() return Vect:getCDTypeSortingEnable() end, get = function() return Rect:getCDTypeSortingEnable() end,
set = function(_, v) set = function(_, v)
Vect:setCDTypeSortingEnable(v); Rect:setCDTypeSortingEnable(v);
end end
}, },
silencerange = { silencerange = {
type = "range", name = "Silence's Type Order", order = 17, min = 1, max = 15, step = 1, type = "range", name = "Silence's Type Order", order = 17, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("silence") end, get = function() return Rect:getTypeSortOrder("silence") end,
set = function(_, v) set = function(_, v)
Vect:setTypeSortOrder("silence", v); Rect:setTypeSortOrder("silence", v);
end end
}, },
gapcloserrange = { gapcloserrange = {
type = "range", name = "Gapcloser's Type Order", order = 18, min = 1, max = 15, step = 1, type = "range", name = "Gapcloser's Type Order", order = 18, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("gapcloser") end, get = function() return Rect:getTypeSortOrder("gapcloser") end,
set = function(_, v) set = function(_, v)
Vect:setTypeSortOrder("gapcloser", v); Rect:setTypeSortOrder("gapcloser", v);
end end
}, },
defensiverange = { defensiverange = {
type = "range", name = "Defensive's Type Order", order = 19, min = 1, max = 15, step = 1, type = "range", name = "Defensive's Type Order", order = 19, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("defensive") end, get = function() return Rect:getTypeSortOrder("defensive") end,
set = function(_, v) set = function(_, v)
Vect:setTypeSortOrder("defensive", v); Rect:setTypeSortOrder("defensive", v);
end end
}, },
potionrange = { potionrange = {
type = "range", name = "Potion's Type Order", order = 20, min = 1, max = 15, step = 1, type = "range", name = "Potion's Type Order", order = 20, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("potion") end, get = function() return Rect:getTypeSortOrder("potion") end,
set = function(_, v) set = function(_, v)
Vect:setTypeSortOrder("potion", v); Rect:setTypeSortOrder("potion", v);
end end
}, },
nukerange = { nukerange = {
type = "range", name = "Nuke's Type Order", order = 21, min = 1, max = 15, step = 1, type = "range", name = "Nuke's Type Order", order = 21, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("nuke") end, get = function() return Rect:getTypeSortOrder("nuke") end,
set = function(_, v) set = function(_, v)
Vect:setTypeSortOrder("nuke", v); Rect:setTypeSortOrder("nuke", v);
end end
}, },
anticcrange = { anticcrange = {
type = "range", name = "Anticc's Type Order", order = 22, min = 1, max = 15, step = 1, type = "range", name = "Anticc's Type Order", order = 22, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("anticc") end, get = function() return Rect:getTypeSortOrder("anticc") end,
set = function(_, v) set = function(_, v)
Vect:setTypeSortOrder("anticc", v); Rect:setTypeSortOrder("anticc", v);
end end
}, },
ccrange = { ccrange = {
type = "range", name = "Cc's Type Order", order = 23, min = 1, max = 15, step = 1, type = "range", name = "Cc's Type Order", order = 23, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("cc") end, get = function() return Rect:getTypeSortOrder("cc") end,
set = function(_, v) set = function(_, v)
Vect:setTypeSortOrder("cc", v); Rect:setTypeSortOrder("cc", v);
end end
}, },
stunrange = { stunrange = {
type = "range", name = "Stun's Type Order", order = 24, min = 1, max = 15, step = 1, type = "range", name = "Stun's Type Order", order = 24, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("stun") end, get = function() return Rect:getTypeSortOrder("stun") end,
set = function(_, v) set = function(_, v)
Vect:setTypeSortOrder("stun", v); Rect:setTypeSortOrder("stun", v);
end end
}, },
disarmrange = { disarmrange = {
type = "range", name = "Disarm's Type Order", order = 25, min = 1, max = 15, step = 1, type = "range", name = "Disarm's Type Order", order = 25, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("disarm") end, get = function() return Rect:getTypeSortOrder("disarm") end,
set = function(_, v) set = function(_, v)
Vect:setTypeSortOrder("disarm", v); Rect:setTypeSortOrder("disarm", v);
end end
}, },
cdresetrange = { cdresetrange = {
type = "range", name = "Cdreset's Type Order", order = 26, min = 1, max = 15, step = 1, type = "range", name = "Cdreset's Type Order", order = 26, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("cdreset") end, get = function() return Rect:getTypeSortOrder("cdreset") end,
set = function(_, v) set = function(_, v)
Vect:setTypeSortOrder("cdreset", v); Rect:setTypeSortOrder("cdreset", v);
end end
}, },
shieldrange = { shieldrange = {
type = "range", name = "shield's Type Order", order = 27, min = 1, max = 15, step = 1, type = "range", name = "shield's Type Order", order = 27, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("shield") end, get = function() return Rect:getTypeSortOrder("shield") end,
set = function(_, v) set = function(_, v)
Vect:setTypeSortOrder("shield", v); Rect:setTypeSortOrder("shield", v);
end end
}, },
uncategorizedrange = { uncategorizedrange = {
type = "range", name = "Uncategorized's Type Order", order = 28, min = 1, max = 15, step = 1, type = "range", name = "Uncategorized's Type Order", order = 28, min = 1, max = 15, step = 1,
get = function() return Vect:getTypeSortOrder("uncategorized") end, get = function() return Rect:getTypeSortOrder("uncategorized") end,
set = function(_, v) set = function(_, v)
Vect:setTypeSortOrder("uncategorized", v); Rect:setTypeSortOrder("uncategorized", v);
end end
}, },
@ -520,86 +520,86 @@ function Vect:getGlobalOptions()
}, },
silencecolorsel = { silencecolorsel = {
type = "color", name = "Silence's color", hasAlpha = true, order = 52, type = "color", name = "Silence's color", hasAlpha = true, order = 52,
get = function() return Vect:getColor("silence") end, get = function() return Rect:getColor("silence") end,
set = function(_, r, g, b, a) set = function(_, r, g, b, a)
Vect:setColor("silence", r, g, b, a); Rect:setColor("silence", r, g, b, a);
end end
}, },
gapclosercolorsel = { gapclosercolorsel = {
type = "color", name = "Gapcloser's color", hasAlpha = true, order = 53, type = "color", name = "Gapcloser's color", hasAlpha = true, order = 53,
get = function() return Vect:getColor("gapcloser") end, get = function() return Rect:getColor("gapcloser") end,
set = function(_, r, g, b, a) set = function(_, r, g, b, a)
Vect:setColor("gapcloser", r, g, b, a); Rect:setColor("gapcloser", r, g, b, a);
end end
}, },
defensivecolorsel = { defensivecolorsel = {
type = "color", name = "Defensive's color", hasAlpha = true, order = 54, type = "color", name = "Defensive's color", hasAlpha = true, order = 54,
get = function() return Vect:getColor("defensive") end, get = function() return Rect:getColor("defensive") end,
set = function(_, r, g, b, a) set = function(_, r, g, b, a)
Vect:setColor("defensive", r, g, b, a); Rect:setColor("defensive", r, g, b, a);
end end
}, },
potioncolorsel = { potioncolorsel = {
type = "color", name = "Potion's color", hasAlpha = true, order = 55, type = "color", name = "Potion's color", hasAlpha = true, order = 55,
get = function() return Vect:getColor("potion") end, get = function() return Rect:getColor("potion") end,
set = function(_, r, g, b, a) set = function(_, r, g, b, a)
Vect:setColor("potion", r, g, b, a); Rect:setColor("potion", r, g, b, a);
end end
}, },
nukecolorsel = { nukecolorsel = {
type = "color", name = "Nuke's color", hasAlpha = true, order = 56, type = "color", name = "Nuke's color", hasAlpha = true, order = 56,
get = function() return Vect:getColor("nuke") end, get = function() return Rect:getColor("nuke") end,
set = function(_, r, g, b, a) set = function(_, r, g, b, a)
Vect:setColor("nuke", r, g, b, a); Rect:setColor("nuke", r, g, b, a);
end end
}, },
anticccolorsel = { anticccolorsel = {
type = "color", name = "Anticc's color", hasAlpha = true, order = 57, type = "color", name = "Anticc's color", hasAlpha = true, order = 57,
get = function() return Vect:getColor("anticc") end, get = function() return Rect:getColor("anticc") end,
set = function(_, r, g, b, a) set = function(_, r, g, b, a)
Vect:setColor("anticc", r, g, b, a); Rect:setColor("anticc", r, g, b, a);
end end
}, },
cccolorsel = { cccolorsel = {
type = "color", name = "Cc's color", hasAlpha = true, order = 58, type = "color", name = "Cc's color", hasAlpha = true, order = 58,
get = function() return Vect:getColor("cc") end, get = function() return Rect:getColor("cc") end,
set = function(_, r, g, b, a) set = function(_, r, g, b, a)
Vect:setColor("cc", r, g, b, a); Rect:setColor("cc", r, g, b, a);
end end
}, },
stuncolorsel = { stuncolorsel = {
type = "color", name = "Stun's color", hasAlpha = true, order = 59, type = "color", name = "Stun's color", hasAlpha = true, order = 59,
get = function() return Vect:getColor("stun") end, get = function() return Rect:getColor("stun") end,
set = function(_, r, g, b, a) set = function(_, r, g, b, a)
Vect:setColor("stun", r, g, b, a); Rect:setColor("stun", r, g, b, a);
end end
}, },
disarmcolorsel = { disarmcolorsel = {
type = "color", name = "Disarm's color", hasAlpha = true, order = 60, type = "color", name = "Disarm's color", hasAlpha = true, order = 60,
get = function() return Vect:getColor("disarm") end, get = function() return Rect:getColor("disarm") end,
set = function(_, r, g, b, a) set = function(_, r, g, b, a)
Vect:setColor("disarm", r, g, b, a); Rect:setColor("disarm", r, g, b, a);
end end
}, },
cdresetcolorsel = { cdresetcolorsel = {
type = "color", name = "Cdreset's color", hasAlpha = true, order = 61, type = "color", name = "Cdreset's color", hasAlpha = true, order = 61,
get = function() return Vect:getColor("cdreset") end, get = function() return Rect:getColor("cdreset") end,
set = function(_, r, g, b, a) set = function(_, r, g, b, a)
Vect:setColor("cdreset", r, g, b, a); Rect:setColor("cdreset", r, g, b, a);
end end
}, },
shieldcolorsel = { shieldcolorsel = {
type = "color", name = "Shield's color", hasAlpha = true, order = 62, type = "color", name = "Shield's color", hasAlpha = true, order = 62,
get = function() return Vect:getColor("shield") end, get = function() return Rect:getColor("shield") end,
set = function(_, r, g, b, a) set = function(_, r, g, b, a)
Vect:setColor("shield", r, g, b, a); Rect:setColor("shield", r, g, b, a);
end end
}, },
uncategorizedcolorsel = { uncategorizedcolorsel = {
type = "color", name = "Uncategorized's color", hasAlpha = true, order = 63, type = "color", name = "Uncategorized's color", hasAlpha = true, order = 63,
get = function() return Vect:getColor("uncategorized") end, get = function() return Rect:getColor("uncategorized") end,
set = function(_, r, g, b, a) set = function(_, r, g, b, a)
Vect:setColor("uncategorized", r, g, b, a); Rect:setColor("uncategorized", r, g, b, a);
end end
}, },
} }
@ -607,34 +607,34 @@ function Vect:getGlobalOptions()
end end
--order 50+ --order 50+
function Vect:getDebugOptions() function Rect:getDebugOptions()
local args = { local args = {
spellcast = { spellcast = {
type = "toggle", name = "SpellCast", desc = "Enable/Disable writing out SPELL_CAST_SUCCESS events.", order = 50, type = "toggle", name = "SpellCast", desc = "Enable/Disable writing out SPELL_CAST_SUCCESS events.", order = 50,
get = function() return Vect:getSpellCastDebug() end, get = function() return Rect:getSpellCastDebug() end,
set = function(_, v) set = function(_, v)
Vect:setSpellCastDebug(v); Rect:setSpellCastDebug(v);
end end
}, },
spellAura = { spellAura = {
type = "toggle", name = "SpellAura", desc = "Enable/Disablewriting out SPLL_AURA_* events", order = 51, type = "toggle", name = "SpellAura", desc = "Enable/Disablewriting out SPLL_AURA_* events", order = 51,
get = function() return Vect:getSpellAuraDebug() end, get = function() return Rect:getSpellAuraDebug() end,
set = function(_, v) set = function(_, v)
Vect:setSpellAuraDebug(v); Rect:setSpellAuraDebug(v);
end end
}, },
allLog = { allLog = {
type = "toggle", name = "Uber debug", desc = "Enable/Disable writing out all combatlog events", order = 52, type = "toggle", name = "Uber debug", desc = "Enable/Disable writing out all combatlog events", order = 52,
get = function() return Vect:getAllCDebug() end, get = function() return Rect:getAllCDebug() end,
set = function(_, v) set = function(_, v)
Vect:setAllCDebug(v); Rect:setAllCDebug(v);
end end
}, },
selfcd = { selfcd = {
type = "toggle", name = "Self CDs", desc = "Enable/Disable registering self CDs", order = 53, type = "toggle", name = "Self CDs", desc = "Enable/Disable registering self CDs", order = 53,
get = function() return Vect:getSelfCDRegister() end, get = function() return Rect:getSelfCDRegister() end,
set = function(_, v) set = function(_, v)
Vect:setSelfCDRegister(v); Rect:setSelfCDRegister(v);
end end
}, },
debugselect = { debugselect = {
@ -643,16 +643,16 @@ function Vect:getDebugOptions()
values = { values = {
["0"] = "No Messages", ["0"] = "No Messages",
}, },
get = function() return Vect:getDebugLevel() end, get = function() return Rect:getDebugLevel() end,
set = function(_, v) set = function(_, v)
Vect:setDebugLevel(v); Rect:setDebugLevel(v);
end end
}, },
} }
return args; return args;
end end
function Vect:GetTypeSortDropdown(num) function Rect:GetTypeSortDropdown(num)
local arr = { local arr = {
type = "select", style = "dropdown", name = "selfDRSortOrder", type = "select", style = "dropdown", name = "selfDRSortOrder",
desc = "Change the your DR's sort order", order = 28, desc = "Change the your DR's sort order", order = 28,
@ -665,9 +665,9 @@ function Vect:GetTypeSortDropdown(num)
["6"] = "Recent Last", ["6"] = "Recent Last",
["7"] = "No order" ["7"] = "No order"
}, },
get = function() return Vect:getSortOrder("selfdr") end, get = function() return Rect:getSortOrder("selfdr") end,
set = function(_, v) set = function(_, v)
Vect:setSortOrder("selfdr", v); Rect:setSortOrder("selfdr", v);
end end
} }
return arr; return arr;

View File

@ -1,6 +1,6 @@
--["1"] = "Ascending (CD left)", --["1"] = "Ascending (CD left)",
function Vect:ComparerAscendingCDLeft(a, b) function Rect:ComparerAscendingCDLeft(a, b)
if a.endTime < b.endTime then if a.endTime < b.endTime then
return true; return true;
else else
@ -9,7 +9,7 @@ function Vect:ComparerAscendingCDLeft(a, b)
end end
--["2"] = "Descending (CD left)", --["2"] = "Descending (CD left)",
function Vect:ComparerDescendingCDLeft(a, b) function Rect:ComparerDescendingCDLeft(a, b)
if a.endTime < b.endTime then if a.endTime < b.endTime then
return false; return false;
else else
@ -18,7 +18,7 @@ function Vect:ComparerDescendingCDLeft(a, b)
end end
--["3"] = "Ascending (CD total)", --["3"] = "Ascending (CD total)",
function Vect:ComparerAscendingCDTotal(a, b) function Rect:ComparerAscendingCDTotal(a, b)
if a.cd < b.cd then if a.cd < b.cd then
return true; return true;
else else
@ -27,7 +27,7 @@ function Vect:ComparerAscendingCDTotal(a, b)
end end
--["4"] = "Descending (CD total)", --["4"] = "Descending (CD total)",
function Vect:ComparerDescendingCDTotal(a, b) function Rect:ComparerDescendingCDTotal(a, b)
if a.cd < b.cd then if a.cd < b.cd then
return false; return false;
else else
@ -36,7 +36,7 @@ function Vect:ComparerDescendingCDTotal(a, b)
end end
--["5"] = "Recent first", --["5"] = "Recent first",
function Vect:ComparerRecentFirst(a, b) function Rect:ComparerRecentFirst(a, b)
if a.currentTime < b.currentTime then if a.currentTime < b.currentTime then
return false; return false;
else else
@ -45,7 +45,7 @@ function Vect:ComparerRecentFirst(a, b)
end end
--["6"] = "Recent Last", --["6"] = "Recent Last",
function Vect:ComparerRecentLast(a, b) function Rect:ComparerRecentLast(a, b)
if a.currentTime < b.currentTime then if a.currentTime < b.currentTime then
return true; return true;
else else
@ -56,8 +56,8 @@ end
--CD Type sorters --CD Type sorters
--["1"] = "Ascending (CD left)", --["1"] = "Ascending (CD left)",
function Vect:ComparerAscendingCDLeftT(a, b) function Rect:ComparerAscendingCDLeftT(a, b)
local db = Vect.db.profile; local db = Rect.db.profile;
if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then
return true; return true;
@ -73,8 +73,8 @@ function Vect:ComparerAscendingCDLeftT(a, b)
end end
--["2"] = "Descending (CD left)", --["2"] = "Descending (CD left)",
function Vect:ComparerDescendingCDLeftT(a, b) function Rect:ComparerDescendingCDLeftT(a, b)
local db = Vect.db.profile; local db = Rect.db.profile;
if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then
return true; return true;
@ -90,8 +90,8 @@ function Vect:ComparerDescendingCDLeftT(a, b)
end end
--["3"] = "Ascending (CD total)", --["3"] = "Ascending (CD total)",
function Vect:ComparerAscendingCDTotalT(a, b) function Rect:ComparerAscendingCDTotalT(a, b)
local db = Vect.db.profile; local db = Rect.db.profile;
if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then
return true; return true;
@ -107,8 +107,8 @@ function Vect:ComparerAscendingCDTotalT(a, b)
end end
--["4"] = "Descending (CD total)", --["4"] = "Descending (CD total)",
function Vect:ComparerDescendingCDTotalT(a, b) function Rect:ComparerDescendingCDTotalT(a, b)
local db = Vect.db.profile; local db = Rect.db.profile;
if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then
return true; return true;
@ -124,8 +124,8 @@ function Vect:ComparerDescendingCDTotalT(a, b)
end end
--["5"] = "Recent first", --["5"] = "Recent first",
function Vect:ComparerRecentFirstT(a, b) function Rect:ComparerRecentFirstT(a, b)
local db = Vect.db.profile; local db = Rect.db.profile;
if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then
return true; return true;
@ -141,8 +141,8 @@ function Vect:ComparerRecentFirstT(a, b)
end end
--["6"] = "Recent Last", --["6"] = "Recent Last",
function Vect:ComparerRecentLastT(a, b) function Rect:ComparerRecentLastT(a, b)
local db = Vect.db.profile; local db = Rect.db.profile;
if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then if (db["cdtypesortorder"][a.spellCategory] < db["cdtypesortorder"][b.spellCategory]) then
return true; return true;

View File

@ -4,8 +4,7 @@
--spellid -> the spell's id --spellid -> the spell's id
--cd -> base cooldown for the spell, this will be used until the spec is detected (if its on, else this will be used) --cd -> base cooldown for the spell, this will be used until the spec is detected (if its on, else this will be used)
-- NOTE: cds are in seconds, and if the tooltip shows like 2.1M then you convert it like this: 2.1 * 60 = 126, -- NOTE: cds are in seconds, and if the tooltip shows like 2.1M then you convert it like this: 2.1 * 60 = 126
-- and not like (2 * 60) = 120 sec + (0.1 * 10) = 130 sec
--reset -> lua array, when the spell is cast these will be removed from the caster's spells (check Cold Snap or Preparation for an example) --reset -> lua array, when the spell is cast these will be removed from the caster's spells (check Cold Snap or Preparation for an example)
--spec1cd, spec2cd, spec3cd ->cds on different specs, its in talent tree order e.g. Mage spec1 = Arcane, spec2 = Fire, spec3 = Arcane --spec1cd, spec2cd, spec3cd ->cds on different specs, its in talent tree order e.g. Mage spec1 = Arcane, spec2 = Fire, spec3 = Arcane
--spec -> the addon detects the spec based on this, 0 to ignore, 3 switch to spec 1, 4 switch to spec2, 5 switch to spec 5 --spec -> the addon detects the spec based on this, 0 to ignore, 3 switch to spec 1, 4 switch to spec2, 5 switch to spec 5
@ -14,7 +13,9 @@
-- values: silence,gapcloser,defensive,potion,nuke,anticc,cc,stun,disarm,cdreset,shield,uncategorized -- values: silence,gapcloser,defensive,potion,nuke,anticc,cc,stun,disarm,cdreset,shield,uncategorized
--ispetspell -> if its a pet spell true, else false --ispetspell -> if its a pet spell true, else false
Vect.spells = { --TODO recklessness value!
Rect.spells = {
--Trinkets --Trinkets
[42292] = {120, nil, 120, 120, 120, 0, "", "anticc", false}, --PvP Trinket [42292] = {120, nil, 120, 120, 120, 0, "", "anticc", false}, --PvP Trinket
--Other Stuff --Other Stuff
@ -164,7 +165,7 @@ Vect.spells = {
63670,63671,63672,19263,781,13813,14316,14317, 63670,63671,63672,19263,781,13813,14316,14317,
27025,49066,49067,60192,1499,14310,14311,13809, 27025,49066,49067,60192,1499,14310,14311,13809,
13795,14302,14303,14304,14305,27023,49055,49056, 13795,14302,14303,14304,14305,27023,49055,49056,
19503,34600,19386,24132,24133,27068,49011,49012, "Hunter", "cdreset", false}, 180, 180, 180, 4, "", "cdreset", false}, --Readiness 19503,34600,19386,24132,24133,27068,49011,49012}, 180, 180, 180, 4, "Hunter", "cdreset", false}, --Readiness
[34490] = {20, nil, 20, 20, 20, 4, "Hunter", "silence", false}, --Silencing Shot [34490] = {20, nil, 20, 20, 20, 4, "Hunter", "silence", false}, --Silencing Shot
--Detection --Detection
[53209] = {0, nil, 0, 0, 0, 4, "Hunter", "", false}, --Chimera Shot [53209] = {0, nil, 0, 0, 0, 4, "Hunter", "", false}, --Chimera Shot