-Added in some pet spells.

-Pet CD Guessing is complete
-Bumped version to 1.0RC1
This commit is contained in:
Relintai 2016-05-06 16:08:08 +02:00
parent f72f0d9ea5
commit 51c96da543
7 changed files with 592 additions and 543 deletions

130
Vect.lua
View File

@ -1,11 +1,4 @@
--TODOS:
--Option to show pet cds on possible master (eg spell lock on all locks)
--document the db these will be needed:
--silence, gapcloser, defensive, potion, nuke, anticc, cc, stun, disarm, cdreset, shield, uncategorized
--db-> class, type, isPet
--"Globals" --"Globals"
local aceDB = LibStub("AceDB-3.0"); local aceDB = LibStub("AceDB-3.0");
local aceCDialog = LibStub("AceConfigDialog-3.0"); local aceCDialog = LibStub("AceConfigDialog-3.0");
@ -42,6 +35,7 @@ Vect.defaults = {
allCDebug = false, allCDebug = false,
selfCDRegister = false, selfCDRegister = false,
specdetection = false, specdetection = false,
petcdguessing = true,
target = { target = {
enabled = true, enabled = true,
size = 27, size = 27,
@ -92,78 +86,78 @@ Vect.defaults = {
drnumsize = 14, drnumsize = 14,
drnumposition = 1 drnumposition = 1
}, },
colors = { color = {
["gapcloser"] = { gapcloser = {
["a"] = 1, a = 1,
["b"] = 0, b = 0,
["g"] = 0.8117647058823529, g = 0.8117647058823529,
["r"] = 1, r = 1,
}, },
["anticc"] = { anticc = {
["a"] = 1, a = 1,
["b"] = 0.796078431372549, b = 0.796078431372549,
["g"] = 1, g = 1,
["r"] = 0, r = 0,
}, },
["disarm"] = { disarm = {
["a"] = 1, a = 1,
["b"] = 0.9647058823529412, b = 0.9647058823529412,
["g"] = 1, g = 1,
["r"] = 0, r = 0,
}, },
["defensive"] = { defensive = {
["a"] = 1, a = 1,
["b"] = 0.08627450980392157, b = 0.08627450980392157,
["g"] = 1, g = 1,
["r"] = 0.2, r = 0.2,
}, },
["nuke"] = { nuke = {
["a"] = 1, a = 1,
["b"] = 0, b = 0,
["g"] = 0, g = 0,
["r"] = 1, r = 1,
}, },
["shield"] = { shield = {
["a"] = 1, a = 1,
["b"] = 0.3333333333333333, b = 0.3333333333333333,
["g"] = 1, g = 1,
["r"] = 0.8901960784313725, r = 0.8901960784313725,
}, },
["potion"] = { potion = {
["a"] = 1, a = 1,
["b"] = 0.6313725490196078, b = 0.6313725490196078,
["g"] = 0.7372549019607844, g = 0.7372549019607844,
["r"] = 1, r = 1,
}, },
["cdreset"] = { cdreset = {
["a"] = 1, a = 1,
["b"] = 1, b = 1,
["g"] = 0, g = 0,
["r"] = 0.6274509803921569, r = 0.6274509803921569,
}, },
["silence"] = { silence = {
["a"] = 1, a = 1,
["b"] = 1, b = 1,
["g"] = 0.03529411764705882, g = 0.03529411764705882,
["r"] = 0.1882352941176471, r = 0.1882352941176471,
}, },
["stun"] = { stun = {
["a"] = 1, a = 1,
["b"] = 1, b = 1,
["g"] = 0.07450980392156863, g = 0.07450980392156863,
["r"] = 0.9137254901960784, r = 0.9137254901960784,
}, },
["uncategorized"] = { uncategorized = {
["a"] = 1, a = 1,
["b"] = 1, b = 1,
["g"] = 0.9058823529411765, g = 0.9058823529411765,
["r"] = 0.9607843137254902, r = 0.9607843137254902,
}, },
["cc"] = { cc = {
["a"] = 1, a = 1,
["b"] = 0.3686274509803922, b = 0.3686274509803922,
["g"] = 0.3568627450980392, g = 0.3568627450980392,
["r"] = 0.3764705882352941, r = 0.3764705882352941,
}, },
}, },
cdtypesortorder = { cdtypesortorder = {

View File

@ -6,7 +6,7 @@
## DefaultState: Enabled ## DefaultState: Enabled
## OptionalDeps: Ace3 ## OptionalDeps: Ace3
## SavedVariables: VectDB ## SavedVariables: VectDB
## Version: 0.9 ## Version: 1.0RC1
embeds.xml embeds.xml
data\global.lua data\global.lua

View File

@ -56,7 +56,9 @@ function Vect:AddCd(srcGUID, spellID)
if not Vect.cds[srcGUID] then if not Vect.cds[srcGUID] then
Vect.cds[srcGUID] = {} Vect.cds[srcGUID] = {}
Vect.cds[srcGUID]["spec"] = 1; Vect.cds[srcGUID]["spec"] = {};
Vect.cds[srcGUID]["spec"][1] = 1;
Vect.cds[srcGUID]["spec"][2] = "";
end end
local specchange = false; local specchange = false;
@ -66,9 +68,16 @@ function Vect:AddCd(srcGUID, spellID)
end end
end end
local spec = Vect.cds[srcGUID]["spec"]; local spec = Vect.cds[srcGUID]["spec"][1];
local class, isPet = Vect.spells[spellID][7], Vect.spells[spellID][9];
local cd, reset, spellCategory = Vect.spells[spellID][spec], Vect.spells[spellID][2], Vect.spells[spellID][8]; local cd, reset, spellCategory = Vect.spells[spellID][spec], Vect.spells[spellID][2], Vect.spells[spellID][8];
if db["petcdguessing"] then
if (Vect.cds[srcGUID]["spec"][2] == "") and class then
Vect.cds[srcGUID]["spec"][2] = class;
end
end
if specchange and (not cd) then if specchange and (not cd) then
if self.targets["target"] == srcGUID then if self.targets["target"] == srcGUID then
self:ReassignCds("target"); self:ReassignCds("target");
@ -94,6 +103,22 @@ function Vect:AddCd(srcGUID, spellID)
spellCategory spellCategory
} }
--add it to every class of the same type
if db["petcdguessing"] and isPet then
for k, v in pairs(Vect.cds) do
if (v["spec"][2] == class) then
Vect.cds[k][spellID] = {
currentTime,
endTime,
cd,
spellIcon,
spellID,
spellCategory
}
end
end
end
--self:Print(Vect.cds[srcGUID][spellID][1] .. " " .. Vect.cds[srcGUID][spellID][2] .. " " .. Vect.cds[srcGUID][spellID][3]); --self:Print(Vect.cds[srcGUID][spellID][1] .. " " .. Vect.cds[srcGUID][spellID][2] .. " " .. Vect.cds[srcGUID][spellID][3]);
if reset then if reset then
@ -103,11 +128,11 @@ function Vect:AddCd(srcGUID, spellID)
--self:Print(self.targets["target"]); --self:Print(self.targets["target"]);
--self:Print(s --self:Print(s
if self.targets["target"] == srcGUID then if self.targets["target"] == srcGUID or isPet then
self:ReassignCds("target"); self:ReassignCds("target");
end end
if self.targets["focus"] == srcGUID then if self.targets["focus"] == srcGUID or isPet then
self:ReassignCds("focus"); self:ReassignCds("focus");
end end
end end
@ -116,7 +141,7 @@ function Vect:DetectSpec(srcGUID, spellID)
local spec = Vect.spells[spellID][6]; local spec = Vect.spells[spellID][6];
if spec == 0 then return false end; if spec == 0 then return false end;
if Vect.cds[srcGUID]["spec"] == spec then return false end; if Vect.cds[srcGUID]["spec"][1] == spec then return false end;
--self:Print("spec found: " .. spec); --self:Print("spec found: " .. spec);
Vect:RemapSpecCDs(srcGUID, spec); Vect:RemapSpecCDs(srcGUID, spec);
return true; return true;

View File

@ -2,7 +2,7 @@
Vect = LibStub("AceAddon-3.0"):NewAddon("Vect", "AceConsole-3.0", "AceEvent-3.0") Vect = LibStub("AceAddon-3.0"):NewAddon("Vect", "AceConsole-3.0", "AceEvent-3.0")
Vect.appName = "Vect" Vect.appName = "Vect"
Vect.dbName = "VectDB" Vect.dbName = "VectDB"
Vect.version = "0.9" Vect.version = "1.0RC1"
function Vect:HideFrames() function Vect:HideFrames()
for i = 1, 23 do for i = 1, 23 do

View File

@ -118,6 +118,16 @@ function Vect:setCDTypeSortingEnable(v)
self:ReassignCds("focus"); self:ReassignCds("focus");
end end
function Vect:getPetCDGuessing()
local db = Vect.db.profile;
return db["petcdguessing"];
end
function Vect:setPetCDGuessing(v)
local db = Vect.db.profile;
db["petcdguessing"] = v;
end
--lock --lock
function Vect:isLocked() function Vect:isLocked()
return Vect.db.profile["locked"]; return Vect.db.profile["locked"];

View File

@ -414,9 +414,9 @@ function Vect:getGlobalOptions()
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:isSpecDetectionEnabled() end, get = function() return Vect:getPetCDGuessing() end,
set = function(_, v) set = function(_, v)
Vect:setSpecDetectionEnabledorDisabled(v); Vect:setPetCDGuessing(v);
end end
}, },
globalcdtypesortHeader = { globalcdtypesortHeader = {

File diff suppressed because it is too large Load Diff