Release Candidate 3
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
## Interface: 90207
|
||||
## Interface: 100002
|
||||
## Title: Lib: LibDFramework-1.0
|
||||
## Notes: Base Framework for many Addons
|
||||
|
||||
|
||||
+6
-1
@@ -22,7 +22,11 @@ do
|
||||
["MONK"] = {0.0, 1.00, 0.59},
|
||||
["DEMONHUNTER"] = {0.64, 0.19, 0.79},
|
||||
["EVOKER"] = {0.20, 0.58, 0.50},
|
||||
|
||||
|
||||
["dark1"] = {0.1215, 0.1176, 0.1294},
|
||||
["dark2"] = {0.2215, 0.2176, 0.2294},
|
||||
["dark3"] = {0.3215, 0.3176, 0.3294},
|
||||
|
||||
["aliceblue"] = {0.941176, 0.972549, 1, 1},
|
||||
["antiquewhite"] = {0.980392, 0.921569, 0.843137, 1},
|
||||
["aqua"] = {0, 1, 1, 1},
|
||||
@@ -67,6 +71,7 @@ do
|
||||
["dimgrey"] = {0.411765, 0.411765, 0.411765, 1},
|
||||
["dodgerblue"] = {0.117647, 0.564706, 1, 1},
|
||||
["firebrick"] = {0.698039, 0.133333, 0.133333, 1},
|
||||
["firebrickdark"] = {0.258039, 0.033333, 0.033333, 1},
|
||||
["floralwhite"] = {1, 0.980392, 0.941176, 1},
|
||||
["forestgreen"] = {0.133333, 0.545098, 0.133333, 1},
|
||||
["fuchsia"] = {1, 0, 1, 1},
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
local dversion = 393
|
||||
local dversion = 395
|
||||
local major, minor = "DetailsFramework-1.0", dversion
|
||||
local DF, oldminor = LibStub:NewLibrary(major, minor)
|
||||
|
||||
|
||||
+48
-2
@@ -7625,6 +7625,9 @@ detailsFramework.CastFrameFunctions = {
|
||||
{"UNIT_SPELLCAST_CHANNEL_START"},
|
||||
{"UNIT_SPELLCAST_CHANNEL_UPDATE"},
|
||||
{"UNIT_SPELLCAST_CHANNEL_STOP"},
|
||||
{(IS_WOW_PROJECT_MAINLINE) and "UNIT_SPELLCAST_EMPOWER_START"},
|
||||
{(IS_WOW_PROJECT_MAINLINE) and "UNIT_SPELLCAST_EMPOWER_UPDATE"},
|
||||
{(IS_WOW_PROJECT_MAINLINE) and "UNIT_SPELLCAST_EMPOWER_STOP"},
|
||||
{(IS_WOW_PROJECT_MAINLINE) and "UNIT_SPELLCAST_INTERRUPTIBLE"},
|
||||
{(IS_WOW_PROJECT_MAINLINE) and "UNIT_SPELLCAST_NOT_INTERRUPTIBLE"},
|
||||
{"PLAYER_ENTERING_WORLD"},
|
||||
@@ -7644,6 +7647,8 @@ detailsFramework.CastFrameFunctions = {
|
||||
CanLazyTick = true, --if true, it'll execute the lazy tick function, it ticks in a much slower pace comparece with the regular tick
|
||||
LazyUpdateCooldown = 0.2, --amount of time to wait for the next lazy update, this updates non critical things like the cast timer
|
||||
|
||||
ShowEmpoweredDuration = true, --full hold time for empowered spells
|
||||
|
||||
FillOnInterrupt = true,
|
||||
HideSparkOnInterrupt = true,
|
||||
|
||||
@@ -8228,12 +8233,40 @@ detailsFramework.CastFrameFunctions = {
|
||||
end,
|
||||
|
||||
UpdateChannelInfo = function(self, unit, ...)
|
||||
local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID = UnitChannelInfo (unit)
|
||||
local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID, _, numStages = UnitChannelInfo (unit)
|
||||
|
||||
--is valid?
|
||||
if (not self:IsValid (unit, name, isTradeSkill, true)) then
|
||||
return
|
||||
end
|
||||
|
||||
--empowered?
|
||||
self.empStages = {}
|
||||
if numStages and numStages > 0 then
|
||||
self.holdAtMaxTime = GetUnitEmpowerHoldAtMaxTime(unit)
|
||||
self.empowered = true
|
||||
|
||||
local lastStageEndTime = 0
|
||||
for i = 1, numStages do
|
||||
self.empStages[i] = {
|
||||
start = lastStageEndTime,
|
||||
finish = lastStageEndTime - GetUnitEmpowerStageDuration(unit, i - 1) / 1000,
|
||||
}
|
||||
lastStageEndTime = self.empStages[i].finish
|
||||
|
||||
if startTime / 1000 + lastStageEndTime <= GetTime() then
|
||||
self.curStage = i
|
||||
end
|
||||
end
|
||||
|
||||
if (self.Settings.ShowEmpoweredDuration) then
|
||||
endTime = endTime + self.holdAtMaxTime
|
||||
end
|
||||
else
|
||||
self.holdAtMaxTime = 0
|
||||
self.empowered = false
|
||||
self.curStage = 0
|
||||
end
|
||||
|
||||
--setup cast
|
||||
self.casting = nil
|
||||
@@ -8250,6 +8283,7 @@ detailsFramework.CastFrameFunctions = {
|
||||
self.spellEndTime = endTime / 1000
|
||||
self.value = self.spellEndTime - GetTime()
|
||||
self.maxValue = self.spellEndTime - self.spellStartTime
|
||||
self.numStages = numStages
|
||||
|
||||
self:SetMinMaxValues(0, self.maxValue)
|
||||
self:SetValue(self.value)
|
||||
@@ -8366,6 +8400,18 @@ detailsFramework.CastFrameFunctions = {
|
||||
self:UpdateCastColor()
|
||||
end
|
||||
end,
|
||||
|
||||
UNIT_SPELLCAST_EMPOWER_START = function(self, unit, ...)
|
||||
self:UNIT_SPELLCAST_CHANNEL_START(unit, ...)
|
||||
end,
|
||||
|
||||
UNIT_SPELLCAST_EMPOWER_UPDATE = function(self, unit, ...)
|
||||
self:UNIT_SPELLCAST_CHANNEL_UPDATE(unit, ...)
|
||||
end,
|
||||
|
||||
UNIT_SPELLCAST_EMPOWER_STOP = function(self, unit, ...)
|
||||
self:UNIT_SPELLCAST_CHANNEL_STOP(unit, ...)
|
||||
end,
|
||||
|
||||
UNIT_SPELLCAST_FAILED = function(self, unit, ...)
|
||||
local unitID, castID, spellID = ...
|
||||
@@ -8431,7 +8477,7 @@ detailsFramework.CastFrameFunctions = {
|
||||
end,
|
||||
|
||||
UNIT_SPELLCAST_CHANNEL_UPDATE = function(self, unit, ...)
|
||||
local name, text, texture, startTime, endTime, isTradeSkill = UnitChannelInfo (unit)
|
||||
local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID, _, numStages = UnitChannelInfo (unit)
|
||||
|
||||
if (not self:IsValid (unit, name, isTradeSkill)) then
|
||||
return
|
||||
|
||||
@@ -394,19 +394,22 @@ local playerHasPetOfNpcId = function(npcId)
|
||||
end
|
||||
|
||||
local addCooldownToTable = function(cooldowns, cooldownsHash, cooldownSpellId, timeNow)
|
||||
local timeLeft, charges, startTimeOffset, duration, auraDuration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(cooldownSpellId)
|
||||
|
||||
cooldowns[#cooldowns+1] = cooldownSpellId
|
||||
local timeLeft, charges, startTimeOffset, duration = openRaidLib.CooldownManager.GetPlayerCooldownStatus(cooldownSpellId)
|
||||
cooldowns[#cooldowns+1] = timeLeft
|
||||
cooldowns[#cooldowns+1] = charges
|
||||
cooldowns[#cooldowns+1] = startTimeOffset
|
||||
cooldowns[#cooldowns+1] = duration
|
||||
cooldownsHash[cooldownSpellId] = {timeLeft, charges, startTimeOffset, duration, timeNow}
|
||||
cooldowns[#cooldowns+1] = auraDuration
|
||||
|
||||
cooldownsHash[cooldownSpellId] = {timeLeft, charges, startTimeOffset, duration, timeNow, auraDuration}
|
||||
end
|
||||
|
||||
local canAddCooldown = function(cooldownInfo)
|
||||
local needPetNpcId = cooldownInfo.pet
|
||||
if (needPetNpcId) then
|
||||
if (not playerHasPetOfNpcId(needPetNpcId)) then
|
||||
local petNpcIdNeeded = cooldownInfo.pet
|
||||
if (petNpcIdNeeded) then
|
||||
if (not playerHasPetOfNpcId(petNpcIdNeeded)) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -418,7 +421,7 @@ local getSpellListAsHashTableFromSpellBook = function()
|
||||
|
||||
--this line might not be compatible with classic
|
||||
local specId, specName, _, specIconTexture = GetSpecializationInfo(GetSpecialization())
|
||||
local classNameLoc, className, classId = UnitClass("player")
|
||||
--local classNameLoc, className, classId = UnitClass("player") --not in use
|
||||
local locPlayerRace, playerRace, playerRaceId = UnitRace("player")
|
||||
|
||||
--get racials from the general tab
|
||||
@@ -430,8 +433,8 @@ local getSpellListAsHashTableFromSpellBook = function()
|
||||
if (spellId and LIB_OPEN_RAID_COOLDOWNS_INFO[spellId] and LIB_OPEN_RAID_COOLDOWNS_INFO[spellId].raceid == playerRaceId) then
|
||||
spellId = C_SpellBook.GetOverrideSpell(spellId)
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
local isPassive = IsPassiveSpell(entryOffset, "player")
|
||||
if (spellName and not isPassive) then
|
||||
local bIsPassive = IsPassiveSpell(spellId, "player")
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[spellId] = true
|
||||
end
|
||||
end
|
||||
@@ -449,8 +452,8 @@ local getSpellListAsHashTableFromSpellBook = function()
|
||||
if (spellType == "SPELL") then
|
||||
spellId = C_SpellBook.GetOverrideSpell(spellId)
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
local isPassive = IsPassiveSpell(entryOffset, "player")
|
||||
if (spellName and not isPassive) then
|
||||
local bIsPassive = IsPassiveSpell(spellId, "player")
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[spellId] = true
|
||||
end
|
||||
end
|
||||
@@ -469,14 +472,34 @@ local getSpellListAsHashTableFromSpellBook = function()
|
||||
if (spellType == "SPELL") then
|
||||
spellId = C_SpellBook.GetOverrideSpell(spellId)
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
local isPassive = IsPassiveSpell(entryOffset, "player")
|
||||
if (spellName and not isPassive) then
|
||||
local bIsPassive = IsPassiveSpell(spellId, "player")
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[spellId] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local getNumPetSpells = function()
|
||||
--'HasPetSpells' contradicts the name and return the amount of pet spells available instead of a boolean
|
||||
return HasPetSpells()
|
||||
end
|
||||
|
||||
--get pet spells from the pet spellbook
|
||||
local numPetSpells = getNumPetSpells()
|
||||
if (numPetSpells) then
|
||||
for i = 1, numPetSpells do
|
||||
local spellName, _, unmaskedSpellId = GetSpellBookItemName(i, "pet")
|
||||
if (unmaskedSpellId) then
|
||||
unmaskedSpellId = C_SpellBook.GetOverrideSpell(unmaskedSpellId)
|
||||
local bIsPassive = IsPassiveSpell(unmaskedSpellId, "pet")
|
||||
if (spellName and not bIsPassive) then
|
||||
completeListOfSpells[unmaskedSpellId] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return completeListOfSpells
|
||||
end
|
||||
|
||||
@@ -525,14 +548,14 @@ function openRaidLib.CooldownManager.GetPlayerCooldownList()
|
||||
|
||||
--check if the player has a talent which makes this cooldown unavailable
|
||||
local ignoredByTalentId = cooldownInfo.ignoredIfTalent
|
||||
local isIgnoredByTalentId = false
|
||||
local bIsIgnoredByTalentId = false
|
||||
if (ignoredByTalentId) then
|
||||
if (talentsHash[ignoredByTalentId]) then
|
||||
isIgnoredByTalentId = true
|
||||
bIsIgnoredByTalentId = true
|
||||
end
|
||||
end
|
||||
|
||||
if (not isIgnoredByTalentId) then
|
||||
if (not bIsIgnoredByTalentId) then
|
||||
if (talentId) then
|
||||
--check if the player has the talent selected
|
||||
if (talentsHash[talentId]) then
|
||||
@@ -557,10 +580,10 @@ function openRaidLib.CooldownManager.GetPlayerCooldownList()
|
||||
end
|
||||
|
||||
--aura frame handles only UNIT_AURA events to grab the duration of the buff placed by the aura
|
||||
local IS_NEW_UNIT_AURA_AVAILABLE = C_UnitAuras and C_UnitAuras.GetAuraDataBySlot and true
|
||||
local bIsNewUnitAuraAvailable = C_UnitAuras and C_UnitAuras.GetAuraDataBySlot and true
|
||||
|
||||
local auraSpellID
|
||||
local foundAuraDuration
|
||||
local auraDurationTime
|
||||
|
||||
local handleBuffAura = function(aura)
|
||||
local auraInfo = C_UnitAuras.GetAuraDataByAuraInstanceID("player", aura.auraInstanceID)
|
||||
@@ -568,7 +591,7 @@ local handleBuffAura = function(aura)
|
||||
local spellId = auraInfo.spellId
|
||||
if (auraSpellID == spellId) then
|
||||
auraSpellID = nil
|
||||
foundAuraDuration = auraInfo.duration
|
||||
auraDurationTime = auraInfo.duration
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -580,21 +603,20 @@ local getAuraDuration = function(spellId)
|
||||
local customBuffDuration = LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellId].durationSpellId
|
||||
--spellId = customBuffDuration or spellId --can't replace the spellId by customBuffDurationSpellId has it wount be found in LIB_OPEN_RAID_PLAYERCOOLDOWNS
|
||||
|
||||
if (IS_NEW_UNIT_AURA_AVAILABLE) then
|
||||
local batchCount = nil
|
||||
local usePackedAura = true
|
||||
if (bIsNewUnitAuraAvailable) then
|
||||
local bBatchCount = false
|
||||
local bUsePackedAura = true
|
||||
auraSpellID = customBuffDuration or spellId
|
||||
foundAuraDuration = 0 --reset duration
|
||||
auraDurationTime = 0 --reset duration
|
||||
|
||||
AuraUtil.ForEachAura("player", "HELPFUL", batchCount, handleBuffAura, usePackedAura) --check auras to find a buff for the spellId
|
||||
AuraUtil.ForEachAura("player", "HELPFUL", bBatchCount, handleBuffAura, bUsePackedAura) --check auras to find a buff for the spellId
|
||||
|
||||
if (foundAuraDuration == 0) then --if the buff wasn't found, attempt to get the duration from the file
|
||||
local spellName = GetSpellInfo(spellId)
|
||||
if (auraDurationTime == 0) then --if the buff wasn't found, attempt to get the duration from the file
|
||||
return LIB_OPEN_RAID_PLAYERCOOLDOWNS[spellId].duration or 0
|
||||
end
|
||||
return foundAuraDuration
|
||||
return auraDurationTime
|
||||
else
|
||||
|
||||
--this is classic
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t
|
||||
end
|
||||
|
||||
local major = "LibOpenRaid-1.0"
|
||||
local CONST_LIB_VERSION = 72
|
||||
local CONST_LIB_VERSION = 76
|
||||
LIB_OPEN_RAID_CAN_LOAD = false
|
||||
|
||||
local unpack = table.unpack or _G.unpack
|
||||
@@ -121,8 +121,8 @@ local unpack = table.unpack or _G.unpack
|
||||
local CONST_SPECIALIZATION_VERSION_CLASSIC = 0
|
||||
local CONST_SPECIALIZATION_VERSION_MODERN = 1
|
||||
|
||||
local CONST_COOLDOWN_CHECK_INTERVAL = CONST_TWO_SECONDS
|
||||
local CONST_COOLDOWN_TIMELEFT_HAS_CHANGED = CONST_TWO_SECONDS
|
||||
local CONST_COOLDOWN_CHECK_INTERVAL = CONST_ONE_SECOND
|
||||
local CONST_COOLDOWN_TIMELEFT_HAS_CHANGED = CONST_ONE_SECOND
|
||||
|
||||
local CONST_COOLDOWN_INDEX_TIMELEFT = 1
|
||||
local CONST_COOLDOWN_INDEX_CHARGES = 2
|
||||
@@ -497,17 +497,17 @@ end
|
||||
local payload = tickerObject.payload
|
||||
local callback = tickerObject.callback
|
||||
|
||||
local result, errortext = xpcall(callback, geterrorhandler(), unpack(payload))
|
||||
if (not result) then
|
||||
sendChatMessage("openRaidLib: error on scheduler:", tickerObject.scheduleName, tickerObject.stack)
|
||||
end
|
||||
|
||||
if (tickerObject.isUnique) then
|
||||
local namespace = tickerObject.namespace
|
||||
local scheduleName = tickerObject.scheduleName
|
||||
openRaidLib.Schedules.CancelUniqueTimer(namespace, scheduleName)
|
||||
end
|
||||
|
||||
local result, errortext = xpcall(callback, geterrorhandler(), unpack(payload))
|
||||
if (not result) then
|
||||
sendChatMessage("openRaidLib: error on scheduler:", tickerObject.scheduleName, tickerObject.stack)
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
@@ -395,6 +395,8 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
|
||||
[384318] = {cooldown = 90, duration = 0, specs = {71, 72, 73}, talent = false, charges = 1, class = "WARRIOR", type = 1}, --Thunderous Roar
|
||||
[46968] = {cooldown = 40, duration = 0, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 8}, --Shockwave
|
||||
[23920] = {cooldown = 25, duration = 5, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 5}, --Shockwave
|
||||
[107570] = {cooldown = 30, duration = 4, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 8}, --Storm Bolt
|
||||
[23920] = {cooldown = 25, duration = 0, specs = {}, talent = false, charges = 1, class = "WARRIOR", type = 5}, --Spell Refleciton
|
||||
|
||||
--warlock
|
||||
-- 265 - Affliction
|
||||
@@ -404,7 +406,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
|
||||
[113858] = {cooldown = 120, duration = 20, specs = {267}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Dark Soul: Instability
|
||||
[113860] = {cooldown = 120, duration = 20, specs = {265}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Dark Soul: Misery
|
||||
[267171] = {cooldown = 60, duration = 0, specs = {266}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Demonic Strength
|
||||
[333889] = {cooldown = 180, duration = 15, specs = {265, 266, 267}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Fel Domination
|
||||
[333889] = {cooldown = 180, duration = 15, specs = {265, 266, 267}, talent = false, charges = 1, class = "WARLOCK", type = 5}, --Fel Domination
|
||||
[111898] = {cooldown = 120, duration = 15, specs = {266}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Grimoire: Felguard
|
||||
[5484] = {cooldown = 40, duration = 20, specs = {265, 266, 267}, talent = false, charges = 1, class = "WARLOCK", type = 8}, --Howl of Terror
|
||||
[267217] = {cooldown = 180, duration = 20, specs = {266}, talent = false, charges = 1, class = "WARLOCK", type = 1}, --Nether Portal
|
||||
@@ -434,12 +436,10 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
|
||||
[192249] = {cooldown = 150, duration = 30, specs = {262}, talent = false, charges = 1, class = "SHAMAN", type = 1}, --Storm Elemental
|
||||
[8143] = {cooldown = 60, duration = 10, specs = {262, 263, 264}, talent = false, charges = 1, class = "SHAMAN", type = 5}, --Tremor Totem
|
||||
[192077] = {cooldown = 120, duration = 15, specs = {262, 263, 264}, talent = false, charges = 1, class = "SHAMAN", type = 5}, --Wind Rush Totem
|
||||
--[198838] = {cooldown = 60, duration = 15, specs = {264}, talent = false, charges = 1, class = "SHAMAN", type = 4}, --Earthen Wall Totem
|
||||
[51485] = {cooldown = 60, duration = 20, specs = {262, 263, 264}, talent = false, charges = 1, class = "SHAMAN", type = 8}, --Earthgrab Totem
|
||||
--[383017] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "SHAMAN", type = 4}, --Stoneskin Totem
|
||||
[198838] = {cooldown = 60, duration = 15, specs = {264}, talent = false, charges = 1, class = "SHAMAN", type = 4}, --Earthen Wall Totem
|
||||
[51485] = {cooldown = 60, duration = 20, specs = {262, 263, 264}, talent = false, charges = 1, class = "SHAMAN", type = 8}, --Earthgrab Totem
|
||||
[383017] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "SHAMAN", type = 4}, --Stoneskin Totem
|
||||
[51514] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "SHAMAN", type = 8}, --Hex
|
||||
[108968] = {cooldown = 5*60, duration = 0, specs = {}, talent = false, charges = 1, class = "PRIEST", type = 3}, --Void Shift
|
||||
|
||||
|
||||
--monk
|
||||
-- 268 - Brewmaster
|
||||
@@ -488,6 +488,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
|
||||
[288613] = {cooldown = 180, duration = 15, specs = {254}, talent = false, charges = 1, class = "HUNTER", type = 1}, --Trueshot
|
||||
[264735] = {cooldown = 180, duration = 0, specs = {253, 254, 255}, talent = false, charges = 1, class = "HUNTER", type = 2}, --Survival of the Fittest
|
||||
[187698] = {cooldown = 30, duration = 0, specs = {}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Tar Trap
|
||||
[392060] = {cooldown = 60, duration = 3, specs = {}, talent = false, charges = 1, class = "HUNTER", type = 8}, --Wailing Arrow
|
||||
|
||||
--druid
|
||||
-- 102 - Balance
|
||||
@@ -588,6 +589,9 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
|
||||
[113724] = {cooldown = 45, duration = 10, specs = {62, 63, 64}, talent = false, charges = 1, class = "MAGE", type = 8}, --Ring of Frost
|
||||
[31661] = {cooldown = 45, duration = 0, specs = {}, talent = false, charges = 1, class = "MAGE", type = 8}, --Dragon's Breath
|
||||
|
||||
-- This needs more work to actually function
|
||||
--[342245] = {cooldown = 60, duration = 0, specs = {}, talent = false, charges = 1, class = "MAGE", type = 2}, --Alter Time
|
||||
|
||||
--priest
|
||||
-- 256 - Discipline
|
||||
-- 257 - Holy
|
||||
@@ -616,6 +620,10 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = {
|
||||
[64901] = {cooldown = 300, duration = 6, specs = {257}, talent = false, charges = 1, class = "PRIEST", type = 4}, --Symbol of Hope
|
||||
[15286] = {cooldown = 120, duration = 15, specs = {258}, talent = false, charges = 1, class = "PRIEST", type = 4}, --Vampiric Embrace
|
||||
[228260] = {cooldown = 90, duration = 15, specs = {258}, talent = false, charges = 1, class = "PRIEST", type = 1}, --Void Eruption
|
||||
[32375] = {cooldown = 45, duration= 0, specs = {}, talent = false, charges = 1, class = "PRIEST", type = 7}, --Mass Dispell
|
||||
[586] = {cooldown = 30, duration= 0, specs = {}, talent = false, charges = 1, class = "PRIEST", type = 2}, --Fade
|
||||
[108968] = {cooldown = 5*60,duration = 0, specs = {}, talent = false, charges = 1, class = "PRIEST", type = 3}, --Void Shift
|
||||
|
||||
|
||||
--rogue
|
||||
-- 259 - Assasination
|
||||
@@ -787,6 +795,5 @@ LIB_OPEN_RAID_SPELL_DEFAULT_IDS = {
|
||||
--187827 vengeance need to test these spellIds
|
||||
--191427 havoc
|
||||
}
|
||||
--need to add mass dispell (32375)
|
||||
|
||||
LIB_OPEN_RAID_DATABASE_LOADED = true
|
||||
|
||||
+186
-82
@@ -1,3 +1,6 @@
|
||||
--parei (20/11) declarando o header, precisa agora modificar a config do header quando atualizar
|
||||
--fazer uma função para alterar a config header.columns para adicionar ou remover attributos
|
||||
|
||||
--próximo: ao criar uma janela AllInOne, precisa criar uma nova instancia no Details!
|
||||
--na tabela de configuração precisa dizer que é uma all in one e o details vai chamar esse arquivo pra atualizar
|
||||
|
||||
@@ -12,6 +15,37 @@
|
||||
local LibWindow = LibStub("LibWindow-1.1")
|
||||
local df = DetailsFramework
|
||||
local detailsFramework = DetailsFramework
|
||||
local Details = Details
|
||||
local addonName, DetailsPrivite = ...
|
||||
|
||||
local defaultWindowSettings = {
|
||||
isOpened = true,
|
||||
|
||||
libwindow = {},
|
||||
width = 350,
|
||||
height = 150,
|
||||
|
||||
titlebar = {
|
||||
--done here: all options can be retrived from details! settings
|
||||
},
|
||||
|
||||
header = {
|
||||
show_name = true, --false | on for debug
|
||||
show_icon = true,
|
||||
auto_size = true, --false | on for debug
|
||||
columns = { --damage, dps, percent
|
||||
{1, 1},
|
||||
{1, 2},
|
||||
{1, 1, "%"}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
--namespace
|
||||
DetailsPrivite.AllInOneWindow = {}
|
||||
local attributeCodes = {
|
||||
|
||||
}
|
||||
|
||||
local textureCoords = {
|
||||
show_mainmenu = {0/256, 32/256, 0, 1},
|
||||
@@ -233,7 +267,13 @@
|
||||
end,
|
||||
}
|
||||
|
||||
local titleBarMixin = {
|
||||
local headerMixin = {
|
||||
Constructor = function(header)
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
local titleBarMixin = { --~titlebar
|
||||
--run when the title bar is created
|
||||
Constructor = function(titleBar)
|
||||
titleBar:EnableMouse(false)
|
||||
@@ -244,6 +284,12 @@
|
||||
--create the elapsed time string
|
||||
titleBar:CreateCombatTimeString()
|
||||
titleBar:SetCombatTimeText("02:36") --debug
|
||||
|
||||
--create titlebar texture
|
||||
titleBar:CreateTexture()
|
||||
|
||||
--create header
|
||||
titleBar:CreateHeader()
|
||||
end,
|
||||
|
||||
GetSettings = function(titleBar)
|
||||
@@ -287,6 +333,43 @@
|
||||
|
||||
end,
|
||||
|
||||
SetTexture = function(titleBar, texturePath, textureCoord, vertexColor, maskTexture)
|
||||
if (texturePath) then
|
||||
titleBar.BackgroundTexture:SetTexture(texturePath)
|
||||
|
||||
if (maskTexture) then
|
||||
titleBar.BackgroundTexture:SetMask(maskTexture)
|
||||
else
|
||||
titleBar.BackgroundTexture:SetMask("")
|
||||
end
|
||||
|
||||
if (vertexColor) then
|
||||
local r, g, b, a = detailsFramework:ParseColors(vertexColor)
|
||||
titleBar.BackgroundTexture:SetVertexColor(r, g, b, a)
|
||||
else
|
||||
titleBar.BackgroundTexture:SetVertexColor(1, 1, 1, 1)
|
||||
end
|
||||
|
||||
if (textureCoord) then
|
||||
titleBar.BackgroundTexture:SetTexCoord(unpack(textureCoord))
|
||||
else
|
||||
titleBar.BackgroundTexture:SetTexCoord(0, 1, 0, 1)
|
||||
end
|
||||
else
|
||||
titleBar.BackgroundTexture:SetTexture("")
|
||||
end
|
||||
end,
|
||||
|
||||
CreateTexture = function(titleBar)
|
||||
local texture = titleBar:CreateTexture("$parentBackgroundTexture", "border")
|
||||
titleBar.BackgroundTexture = texture
|
||||
return texture
|
||||
end,
|
||||
|
||||
GetTexture = function(titleBar)
|
||||
return titleBar.BackgroundTexture
|
||||
end,
|
||||
|
||||
CreateCombatTimeString = function(titleBar)
|
||||
local combatTimeString = titleBar:CreateFontString("$parentCombatTime", "overlay", "GameFontNormal")
|
||||
titleBar.CombatTime = combatTimeString
|
||||
@@ -312,34 +395,37 @@
|
||||
end,
|
||||
|
||||
Refresh = function(titleBar)
|
||||
local config = titleBar:GetSettings()
|
||||
local settings = titleBar:GetSettings()
|
||||
|
||||
--height
|
||||
local height = config.titlebar.height
|
||||
titleBar:SetHeight(height)
|
||||
--title bar is always shown
|
||||
settings.titlebar_shown = true
|
||||
|
||||
--titlebar_shown = false,
|
||||
--titlebar_height = 16,
|
||||
--titlebar_texture = "Details Serenity",
|
||||
--titlebar_texture_color = {.2, .2, .2, 0.8},
|
||||
|
||||
if (settings.titlebar_shown) then
|
||||
titleBar:Show()
|
||||
--height
|
||||
local height = settings.titlebar_height
|
||||
titleBar:SetHeight(height)
|
||||
|
||||
titleBar:SetTexture(settings.titlebar_texture, nil, settings.titlebar_texture_color)
|
||||
|
||||
local header = titleBar:GetHeader()
|
||||
|
||||
else
|
||||
titleBar:Hide()
|
||||
end
|
||||
|
||||
|
||||
|
||||
local timerShown = settings.timer_show
|
||||
|
||||
local timerShown = config.timer_show
|
||||
|
||||
local menuSupportFrame = titleBar:GetMenuSupportFrame()
|
||||
menuSupportFrame:Update()
|
||||
|
||||
--[=[
|
||||
--height = 20,
|
||||
timer_show = true,
|
||||
timer_ignore_openworld = true,
|
||||
timer_only_encounters = false,
|
||||
|
||||
text_size = 10,
|
||||
text_font = "Friz Quadrata TT",
|
||||
text_outline = "NONE",
|
||||
text_shadow = {
|
||||
enabled = false,
|
||||
color = {1, 1, 1, 1},
|
||||
x_offset = 1,
|
||||
y_offset = -1,
|
||||
},
|
||||
--]=]
|
||||
|
||||
end,
|
||||
|
||||
GetMenuSupportFrame = function(titleBar)
|
||||
@@ -355,6 +441,34 @@
|
||||
return menuSupportFrame
|
||||
end,
|
||||
|
||||
CreateHeader = function(titleBar)
|
||||
local defaultHeaderTable = {
|
||||
{text = "", width = 20}, --spec icon
|
||||
{text = "Actor Name", width = 60, attribute = {name = true}},
|
||||
|
||||
{text = "Damage Done", width = 60, attribute = {1, 1}},
|
||||
{text = "DPS", width = 50, attribute = {1, 2}},
|
||||
{text = "Damage %", width = 50, attribute = {percent = true}},
|
||||
|
||||
{text = "Healing Done", width = 60, attribute = {1, 1}},
|
||||
{text = "HPS", width = 50, attribute = {1, 2}},
|
||||
{text = "Healing %", width = 50, attribute = {percent = true}},
|
||||
}
|
||||
|
||||
local defaultHeaderOptions = {
|
||||
padding = 2,
|
||||
}
|
||||
|
||||
local headerFrame = DetailsFramework:CreateHeader(titleBar, defaultHeaderTable, defaultHeaderOptions)
|
||||
titleBar.Header = headerFrame
|
||||
detailsFramework:Mixin(headerFrame, headerMixin)
|
||||
headerFrame:Constructor()
|
||||
return headerFrame
|
||||
end,
|
||||
|
||||
GetHeader = function(titleBar)
|
||||
return titleBar.Header
|
||||
end,
|
||||
}
|
||||
|
||||
local AllInOneWindowMixin = {
|
||||
@@ -428,50 +542,6 @@
|
||||
--override
|
||||
titleBarMixin.SetSetting = AllInOneWindowMixin.SetSetting
|
||||
|
||||
local defaultWindowSettings = {
|
||||
isOpened = true,
|
||||
|
||||
libwindow = {},
|
||||
width = 350, --
|
||||
height = 150, --
|
||||
|
||||
titlebar = {
|
||||
--done here: all options can be retrived from details! settings
|
||||
menu_buttons = {},
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
--create only the frame for a new window ~newwindow ñewwindow
|
||||
function Details.AllInOneWindow.CreateFrame(settingId)
|
||||
--create the new window
|
||||
local newWindowFrame = CreateFrame("frame", "DetailsNewWindow" .. settingId, UIParent, "BackdropTemplate")
|
||||
newWindowFrame.id = settingId
|
||||
df:Mixin(newWindowFrame, AllInOneWindowMixin)
|
||||
|
||||
newWindowFrame:SetPoint("center", UIParent, "center", -400, 0)
|
||||
|
||||
--create the title bar
|
||||
newWindowFrame:CreateTitleBar()
|
||||
|
||||
--creare header
|
||||
|
||||
|
||||
|
||||
--create scroll bar
|
||||
|
||||
|
||||
|
||||
--create resizers
|
||||
|
||||
|
||||
|
||||
--add the frame to the frame pool
|
||||
local frameId = Details.AllInOneWindow.AddFrame(newWindowFrame)
|
||||
return newWindowFrame
|
||||
end
|
||||
|
||||
--[=[
|
||||
lib window need to be on the AllInOneWindow:Update() so it can register the new libwindow table on profile change
|
||||
--register on libwindow
|
||||
@@ -497,30 +567,58 @@
|
||||
combatTimeString:SetPoint("left", titleBar, "left", 2, 0)
|
||||
--]=]
|
||||
|
||||
--create only the frame for a new window ~newwindow ñewwindow
|
||||
function Details.AllInOneWindow.CreateFrame(settingId)
|
||||
--create the new window
|
||||
local newFrame = CreateFrame("frame", "DetailsNewWindow" .. settingId, UIParent, "BackdropTemplate")
|
||||
newFrame.id = settingId
|
||||
df:Mixin(newFrame, AllInOneWindowMixin)
|
||||
|
||||
newFrame:SetPoint("center", UIParent, "center", -400, 0)
|
||||
|
||||
--create the title bar
|
||||
newFrame:CreateTitleBar()
|
||||
|
||||
|
||||
|
||||
--create scroll bar
|
||||
|
||||
|
||||
|
||||
--create resizers
|
||||
|
||||
|
||||
|
||||
--add the frame to the frame pool
|
||||
local frameId = Details.AllInOneWindow.AddFrame(newFrame)
|
||||
return newFrame
|
||||
end
|
||||
|
||||
--Entry Point to create a new window, must pass here at least once
|
||||
--create the settings for a new window plus the frames
|
||||
function Details:CreateNewAllInOneWindow()
|
||||
--get profile settings
|
||||
local profileSettings = Details:GetSettingsForAll_AllInOneWindows()
|
||||
|
||||
--get what is the ID if a new window is added
|
||||
local nextSettingId = Details.AllInOneWindow.GetNextSettingID()
|
||||
|
||||
function Details.AllInOneWindow.CreateNew()
|
||||
local newSettings = {}
|
||||
--copy the settings prototype
|
||||
local windowSettings = df.table.deploy({}, defaultWindowSettings)
|
||||
df.table.deploy(newSettings, defaultWindowSettings)
|
||||
--copy the settings from a skin
|
||||
local skinTable = Details:GetSkin("Minimalistic")
|
||||
df.table.deploy(newSettings, skinTable.instance_cprops)
|
||||
|
||||
--add the new settings table into the profile where the new window settings are stored
|
||||
local settingId = Details.AllInOneWindow.AddSetting(windowSettings)
|
||||
local settingId = Details.AllInOneWindow.AddSetting(newSettings)
|
||||
|
||||
--create window body
|
||||
local windowFrame = Details.AllInOneWindow.CreateFrame(settingId)
|
||||
--reload all windows
|
||||
Details.AllInOneWindow.ReloadAll()
|
||||
|
||||
return windowFrame
|
||||
return settingId
|
||||
end
|
||||
|
||||
--assuming this will run when the profile is loaded
|
||||
|
||||
--assuming there will be only one All In One Window
|
||||
|
||||
--used when a profile finished loading
|
||||
--CURRENT THE ONLY ENTRY POINT
|
||||
--entry point for loading a window on profile change, on Initialization or when a new window is created
|
||||
--at the moment of details! creation, there's zero settings available
|
||||
function Details.AllInOneWindow.ReloadAll()
|
||||
--get the amount of settings
|
||||
local numSettings = Details.AllInOneWindow.GetNumSettings()
|
||||
@@ -539,6 +637,12 @@
|
||||
end
|
||||
frameIndex = frameIndex + 1
|
||||
windowFrame:SetSettingID(settingId)
|
||||
|
||||
--libwindow
|
||||
LibWindow.RegisterConfig(windowFrame, windowSetting.libwindow)
|
||||
LibWindow.RestorePosition(windowFrame)
|
||||
LibWindow.MakeDraggable(windowFrame)
|
||||
|
||||
--setup the frame using the settings
|
||||
windowFrame:Refresh()
|
||||
end
|
||||
|
||||
+78
-64
@@ -3,50 +3,55 @@
|
||||
local Details = _G.Details
|
||||
local DF = _G.DetailsFramework
|
||||
local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0", true)
|
||||
local addonName, Details222 = ...
|
||||
|
||||
--namespace
|
||||
Details.CooldownTracking = {
|
||||
Details222.CooldownTracking = {
|
||||
cooldownPanels = {},
|
||||
}
|
||||
|
||||
--return truen if the cooldown tracker is enabled
|
||||
function Details.CooldownTracking.IsEnabled()
|
||||
function Details222.CooldownTracking.IsEnabled()
|
||||
return Details.ocd_tracker.enabled
|
||||
end
|
||||
|
||||
--return a hash table with all cooldown panels created [filterName] = Frame
|
||||
function Details.CooldownTracking.GetAllPanels()
|
||||
return Details.CooldownTracking.cooldownPanels
|
||||
function Details222.CooldownTracking.GetAllPanels()
|
||||
return Details222.CooldownTracking.cooldownPanels
|
||||
end
|
||||
|
||||
--enable the cooldown tracker
|
||||
function Details.CooldownTracking.EnableTracker()
|
||||
function Details222.CooldownTracking.EnableTracker()
|
||||
if (not Details.ocd_tracker.show_options) then
|
||||
return
|
||||
end
|
||||
|
||||
Details.ocd_tracker.enabled = true
|
||||
|
||||
--register callbacks with the openRaidLib
|
||||
openRaidLib.RegisterCallback(Details.CooldownTracking, "CooldownListUpdate", "OnReceiveUnitFullCooldownList")
|
||||
openRaidLib.RegisterCallback(Details.CooldownTracking, "CooldownUpdate", "OnReceiveSingleCooldownUpdate")
|
||||
openRaidLib.RegisterCallback(Details.CooldownTracking, "CooldownListWipe", "OnCooldownListWipe")
|
||||
openRaidLib.RegisterCallback(Details.CooldownTracking, "CooldownAdded", "OnCooldownAdded")
|
||||
openRaidLib.RegisterCallback(Details.CooldownTracking, "CooldownRemoved", "OnCooldownRemoved")
|
||||
openRaidLib.RegisterCallback(Details222.CooldownTracking, "CooldownListUpdate", "OnReceiveUnitFullCooldownList")
|
||||
openRaidLib.RegisterCallback(Details222.CooldownTracking, "CooldownUpdate", "OnReceiveSingleCooldownUpdate")
|
||||
openRaidLib.RegisterCallback(Details222.CooldownTracking, "CooldownListWipe", "OnCooldownListWipe")
|
||||
openRaidLib.RegisterCallback(Details222.CooldownTracking, "CooldownAdded", "OnCooldownAdded")
|
||||
openRaidLib.RegisterCallback(Details222.CooldownTracking, "CooldownRemoved", "OnCooldownRemoved")
|
||||
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end
|
||||
|
||||
--disable the cooldown tracker
|
||||
function Details.CooldownTracking.DisableTracker()
|
||||
function Details222.CooldownTracking.DisableTracker()
|
||||
Details.ocd_tracker.enabled = false
|
||||
|
||||
--hide the panel
|
||||
local allPanels = Details.CooldownTracking.GetAllPanels()
|
||||
local allPanels = Details222.CooldownTracking.GetAllPanels()
|
||||
for filterName, frameObject in pairs(allPanels) do
|
||||
frameObject:Hide()
|
||||
end
|
||||
|
||||
--unregister callbacks
|
||||
openRaidLib.UnregisterCallback(Details.CooldownTracking, "CooldownListUpdate", "OnReceiveUnitFullCooldownList")
|
||||
openRaidLib.UnregisterCallback(Details.CooldownTracking, "CooldownUpdate", "OnReceiveSingleCooldownUpdate")
|
||||
openRaidLib.UnregisterCallback(Details.CooldownTracking, "CooldownListWipe", "OnCooldownListWipe")
|
||||
openRaidLib.UnregisterCallback(Details222.CooldownTracking, "CooldownListUpdate", "OnReceiveUnitFullCooldownList")
|
||||
openRaidLib.UnregisterCallback(Details222.CooldownTracking, "CooldownUpdate", "OnReceiveSingleCooldownUpdate")
|
||||
openRaidLib.UnregisterCallback(Details222.CooldownTracking, "CooldownListWipe", "OnCooldownListWipe")
|
||||
end
|
||||
|
||||
|
||||
@@ -55,9 +60,9 @@ end
|
||||
--@unitId: which unit got updated
|
||||
--@unitCooldows: a table with [spellId] = cooldownInfo
|
||||
--@allUnitsCooldowns: a table containing all units [unitName] = {[spellId] = cooldownInfo}
|
||||
function Details.CooldownTracking.OnReceiveUnitFullCooldownList(unitId, unitCooldows, allUnitsCooldowns)
|
||||
function Details222.CooldownTracking.OnReceiveUnitFullCooldownList(unitId, unitCooldows, allUnitsCooldowns)
|
||||
--print("|cFFFFFF00received full cooldown list|r from:", unitId)
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end
|
||||
|
||||
--callback on the event 'CooldownUpdate', this is triggered when a player uses a cooldown or a cooldown got updated (time left reduced, etc)
|
||||
@@ -66,12 +71,12 @@ end
|
||||
--@cooldownInfo: cooldown information table to be passed with other functions
|
||||
--@unitCooldows: a table with [spellId] = cooldownInfo
|
||||
--@allUnitsCooldowns: a table containing all units [unitName] = {[spellId] = cooldownInfo}
|
||||
function Details.CooldownTracking.OnReceiveSingleCooldownUpdate(unitId, spellId, cooldownInfo, unitCooldows, allUnitsCooldowns)
|
||||
function Details222.CooldownTracking.OnReceiveSingleCooldownUpdate(unitId, spellId, cooldownInfo, unitCooldows, allUnitsCooldowns)
|
||||
--TODO: make a function inside lib open raid to get the filters the cooldown is in
|
||||
--I dont known which panel will be used
|
||||
--need to get the filter name which that spell belong
|
||||
--and then check if that filter is enabled
|
||||
local allPanels = Details.CooldownTracking.GetAllPanels()
|
||||
local allPanels = Details222.CooldownTracking.GetAllPanels()
|
||||
|
||||
local screenPanel = allPanels["main"] --this should be replaced with the cooldown panel
|
||||
local gotUpdated = false
|
||||
@@ -92,33 +97,33 @@ end
|
||||
end
|
||||
|
||||
if (not gotUpdated) then
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end
|
||||
end
|
||||
|
||||
--when the list of cooldowns got wiped, usually happens when the player left a group
|
||||
--@allUnitsCooldowns: a table containing all units [unitName] = {[spellId] = cooldownInfo}
|
||||
function Details.CooldownTracking.OnCooldownListWipe(allUnitsCooldowns)
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
function Details222.CooldownTracking.OnCooldownListWipe(allUnitsCooldowns)
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end
|
||||
|
||||
--when a cooldown has been added to an unit
|
||||
function Details.CooldownTracking.OnCooldownAdded(unitId, spellId, cooldownInfo, unitCooldows, allUnitsCooldowns)
|
||||
function Details222.CooldownTracking.OnCooldownAdded(unitId, spellId, cooldownInfo, unitCooldows, allUnitsCooldowns)
|
||||
--here could update the cooldown of the unit, but I'm too lazy so it update all units
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end
|
||||
|
||||
--when a cooldown has been removed from an unit
|
||||
function Details.CooldownTracking.OnCooldownRemoved(unitId, spellId, unitCooldows, allUnitsCooldowns)
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
function Details222.CooldownTracking.OnCooldownRemoved(unitId, spellId, unitCooldows, allUnitsCooldowns)
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end
|
||||
|
||||
|
||||
--Frames
|
||||
--hide all bars created
|
||||
function Details.CooldownTracking.HideAllBars(filterName)
|
||||
function Details222.CooldownTracking.HideAllBars(filterName)
|
||||
filterName = filterName or "main"
|
||||
local allPanels = Details.CooldownTracking.GetAllPanels()
|
||||
local allPanels = Details222.CooldownTracking.GetAllPanels()
|
||||
for _, bar in ipairs(allPanels[filterName].bars) do
|
||||
bar:ClearAllPoints()
|
||||
bar:Hide()
|
||||
@@ -131,7 +136,7 @@ end
|
||||
end
|
||||
|
||||
--get a cooldown frame
|
||||
function Details.CooldownTracking.GetOrCreateNewCooldownFrame(screenPanel, frameId)
|
||||
function Details222.CooldownTracking.GetOrCreateNewCooldownFrame(screenPanel, frameId)
|
||||
local cooldownFrame = screenPanel.bars[frameId]
|
||||
if (cooldownFrame) then
|
||||
return cooldownFrame
|
||||
@@ -157,12 +162,12 @@ end
|
||||
if (eventFrame.scheduleRosterUpdate) then
|
||||
return
|
||||
end
|
||||
eventFrame.scheduleRosterUpdate = C_Timer.NewTimer(1, Details.CooldownTracking.RefreshCooldownFrames)
|
||||
eventFrame.scheduleRosterUpdate = C_Timer.NewTimer(1, Details222.CooldownTracking.RefreshCooldownFrames)
|
||||
end
|
||||
end)
|
||||
|
||||
--create the screen panel, goes into the UIParent and show cooldowns
|
||||
function Details.CooldownTracking.CreateScreenFrame(filterName)
|
||||
function Details222.CooldownTracking.CreateScreenFrame(filterName)
|
||||
filterName = filterName or "main"
|
||||
local frameName = "DetailsOnlineCDTrackerScreenPanel" .. filterName
|
||||
local cooldownPanel = CreateFrame("frame", frameName, UIParent, "BackdropTemplate")
|
||||
@@ -184,7 +189,7 @@ end
|
||||
cooldownPanel.playerCache = {}
|
||||
cooldownPanel.statusBarFrameIndex = 1
|
||||
|
||||
local allPanels = Details.CooldownTracking.GetAllPanels()
|
||||
local allPanels = Details222.CooldownTracking.GetAllPanels()
|
||||
allPanels[filterName] = cooldownPanel
|
||||
|
||||
return cooldownPanel
|
||||
@@ -192,7 +197,7 @@ end
|
||||
|
||||
|
||||
|
||||
function Details.CooldownTracking.SetupCooldownFrame(cooldownFrame)
|
||||
function Details222.CooldownTracking.SetupCooldownFrame(cooldownFrame)
|
||||
local spellIcon = GetSpellTexture(cooldownFrame.spellId)
|
||||
if (spellIcon) then
|
||||
cooldownFrame:SetIcon(spellIcon, .1, .9, .1, .9)
|
||||
@@ -204,16 +209,16 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
function Details.CooldownTracking.ProcessUnitCooldowns(unitId, unitCooldowns, cooldownsOrganized)
|
||||
function Details222.CooldownTracking.ProcessUnitCooldowns(unitId, unitCooldowns, cooldownsOrganized)
|
||||
if (unitCooldowns) then
|
||||
local unitInfo = openRaidLib.GetUnitInfo(unitId)
|
||||
local filterName = false
|
||||
if (unitInfo) then
|
||||
local allPanels = Details.CooldownTracking.GetAllPanels()
|
||||
local allPanels = Details222.CooldownTracking.GetAllPanels()
|
||||
local screenPanel = allPanels[filterName or "main"]
|
||||
for spellId, cooldownInfo in pairs(unitCooldowns) do
|
||||
--get a bar
|
||||
local cooldownFrame = Details.CooldownTracking.GetOrCreateNewCooldownFrame(screenPanel, screenPanel.statusBarFrameIndex)
|
||||
local cooldownFrame = Details222.CooldownTracking.GetOrCreateNewCooldownFrame(screenPanel, screenPanel.statusBarFrameIndex)
|
||||
cooldownFrame.cooldownInfo = cooldownInfo
|
||||
local isReady, normalizedPercent, timeLeft, charges, minValue, maxValue, currentValue = openRaidLib.GetCooldownStatusFromCooldownInfo(cooldownInfo)
|
||||
|
||||
@@ -222,7 +227,7 @@ end
|
||||
cooldownFrame.unitName = unitInfo.nameFull
|
||||
|
||||
--setup the cooldown in the bar
|
||||
Details.CooldownTracking.SetupCooldownFrame(cooldownFrame)
|
||||
Details222.CooldownTracking.SetupCooldownFrame(cooldownFrame)
|
||||
--add the cooldown into the organized by class table
|
||||
tinsert(cooldownsOrganized[unitInfo.classId], cooldownFrame)
|
||||
--iterate to the next cooldown frame
|
||||
@@ -237,12 +242,12 @@ end
|
||||
end
|
||||
|
||||
--update cooldown frames based on the amount of players in the group or raid
|
||||
function Details.CooldownTracking.RefreshCooldownFrames(filterName)
|
||||
local allPanels = Details.CooldownTracking.GetAllPanels()
|
||||
function Details222.CooldownTracking.RefreshCooldownFrames(filterName)
|
||||
local allPanels = Details222.CooldownTracking.GetAllPanels()
|
||||
local screenPanel = allPanels[filterName or "main"]
|
||||
|
||||
if (not screenPanel) then
|
||||
screenPanel = Details.CooldownTracking.CreateScreenFrame()
|
||||
screenPanel = Details222.CooldownTracking.CreateScreenFrame()
|
||||
end
|
||||
|
||||
if (Details.ocd_tracker.framme_locked) then
|
||||
@@ -251,7 +256,7 @@ end
|
||||
screenPanel:EnableMouse(true)
|
||||
end
|
||||
|
||||
Details.CooldownTracking.HideAllBars()
|
||||
Details222.CooldownTracking.HideAllBars()
|
||||
screenPanel.scheduleRosterUpdate = nil
|
||||
wipe(screenPanel.playerCache)
|
||||
screenPanel.statusBarFrameIndex = 1
|
||||
@@ -289,24 +294,24 @@ end
|
||||
for i = 1, numGroupMembers do
|
||||
local unitId = "raid"..i
|
||||
local unitCooldowns = openRaidLib.GetUnitCooldowns(unitId, filter)
|
||||
Details.CooldownTracking.ProcessUnitCooldowns(unitId, unitCooldowns, cooldownsOrganized)
|
||||
Details222.CooldownTracking.ProcessUnitCooldowns(unitId, unitCooldowns, cooldownsOrganized)
|
||||
end
|
||||
|
||||
elseif (IsInGroup()) then
|
||||
for i = 1, numGroupMembers - 1 do
|
||||
local unitId = "party"..i
|
||||
local unitCooldowns = openRaidLib.GetUnitCooldowns(unitId, filter)
|
||||
Details.CooldownTracking.ProcessUnitCooldowns(unitId, unitCooldowns, cooldownsOrganized)
|
||||
Details222.CooldownTracking.ProcessUnitCooldowns(unitId, unitCooldowns, cooldownsOrganized)
|
||||
end
|
||||
|
||||
--player
|
||||
local unitCooldowns = openRaidLib.GetUnitCooldowns("player", filter)
|
||||
Details.CooldownTracking.ProcessUnitCooldowns("player", unitCooldowns, cooldownsOrganized)
|
||||
Details222.CooldownTracking.ProcessUnitCooldowns("player", unitCooldowns, cooldownsOrganized)
|
||||
|
||||
else
|
||||
--player
|
||||
local unitCooldowns = openRaidLib.GetUnitCooldowns("player", filter)
|
||||
Details.CooldownTracking.ProcessUnitCooldowns("player", unitCooldowns, cooldownsOrganized)
|
||||
Details222.CooldownTracking.ProcessUnitCooldowns("player", unitCooldowns, cooldownsOrganized)
|
||||
end
|
||||
|
||||
for classId = 1, 13 do --13 classes
|
||||
@@ -364,6 +369,9 @@ end
|
||||
|
||||
--initialize the cooldown options window and embed it to Details! options panel
|
||||
function Details:InitializeCDTrackerWindow()
|
||||
if (not Details.ocd_tracker.show_options) then
|
||||
return
|
||||
end
|
||||
local DetailsCDTrackerWindow = CreateFrame("frame", "DetailsCDTrackerWindow", UIParent, "BackdropTemplate")
|
||||
DetailsCDTrackerWindow:SetSize(700, 480)
|
||||
DetailsCDTrackerWindow.Frame = DetailsCDTrackerWindow
|
||||
@@ -375,18 +383,21 @@ end
|
||||
_G.DetailsPluginContainerWindow.EmbedPlugin(DetailsCDTrackerWindow, DetailsCDTrackerWindow, true)
|
||||
|
||||
function DetailsCDTrackerWindow.RefreshWindow()
|
||||
Details.OpenCDTrackerWindow()
|
||||
Details222.CooldownTracking.OpenCDTrackerWindow()
|
||||
end
|
||||
|
||||
--check if is enabled at startup
|
||||
if (Details.CooldownTracking.IsEnabled()) then
|
||||
Details.CooldownTracking.EnableTracker()
|
||||
if (Details222.CooldownTracking.IsEnabled()) then
|
||||
Details222.CooldownTracking.EnableTracker()
|
||||
end
|
||||
|
||||
DetailsCDTrackerWindow:Hide()
|
||||
end
|
||||
|
||||
function Details.OpenCDTrackerWindow()
|
||||
function Details222.CooldownTracking.OpenCDTrackerWindow()
|
||||
if (not Details.ocd_tracker.show_options) then
|
||||
return
|
||||
end
|
||||
|
||||
--check if the window exists, if not create it
|
||||
if (not _G.DetailsCDTrackerWindow or not _G.DetailsCDTrackerWindow.Initialized) then
|
||||
@@ -408,9 +419,12 @@ end
|
||||
get = function() return Details.ocd_tracker.enabled end,
|
||||
set = function(self, fixedparam, value)
|
||||
if (value) then
|
||||
Details.CooldownTracking.EnableTracker()
|
||||
if (not Details.ocd_tracker.show_options) then
|
||||
return
|
||||
end
|
||||
Details222.CooldownTracking.EnableTracker()
|
||||
else
|
||||
Details.CooldownTracking.DisableTracker()
|
||||
Details222.CooldownTracking.DisableTracker()
|
||||
end
|
||||
end,
|
||||
name = "Enable Experimental Cooldown Tracker",
|
||||
@@ -422,7 +436,7 @@ end
|
||||
get = function() return Details.ocd_tracker.show_conditions.only_in_group end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.ocd_tracker.show_conditions.only_in_group = value
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end,
|
||||
name = "Only in Group",
|
||||
desc = "Only in Group",
|
||||
@@ -433,7 +447,7 @@ end
|
||||
get = function() return Details.ocd_tracker.show_conditions.only_inside_instance end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.ocd_tracker.show_conditions.only_inside_instance = value
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end,
|
||||
name = "Only Inside Instances",
|
||||
desc = "Only Inside Instances",
|
||||
@@ -443,7 +457,7 @@ end
|
||||
get = function() return Details.ocd_tracker.framme_locked end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.ocd_tracker.framme_locked = value
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end,
|
||||
name = "Lock Frame",
|
||||
desc = "Lock Frame",
|
||||
@@ -456,7 +470,7 @@ end
|
||||
get = function() return Details.ocd_tracker.filters["defensive-raid"] end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.ocd_tracker.filters["defensive-raid"] = value
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end,
|
||||
name = "Defensive: Raid",
|
||||
desc = "Exanple: druid tranquility.",
|
||||
@@ -467,7 +481,7 @@ end
|
||||
get = function() return Details.ocd_tracker.filters["defensive-target"] end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.ocd_tracker.filters["defensive-target"] = value
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end,
|
||||
name = "Defensive: Target",
|
||||
desc = "Exanple: priest pain suppression.",
|
||||
@@ -478,7 +492,7 @@ end
|
||||
get = function() return Details.ocd_tracker.filters["defensive-personal"] end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.ocd_tracker.filters["defensive-personal"] = value
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end,
|
||||
name = "Defensive: Personal",
|
||||
desc = "Exanple: mage ice block.",
|
||||
@@ -489,7 +503,7 @@ end
|
||||
get = function() return Details.ocd_tracker.filters["ofensive"] end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.ocd_tracker.filters["ofensive"] = value
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end,
|
||||
name = "Offensive Cooldowns",
|
||||
desc = "Exanple: priest power infusion.",
|
||||
@@ -500,7 +514,7 @@ end
|
||||
get = function() return Details.ocd_tracker.filters["utility"] end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.ocd_tracker.filters["utility"] = value
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end,
|
||||
name = "Utility Cooldowns",
|
||||
desc = "Exanple: druid roar.",
|
||||
@@ -511,7 +525,7 @@ end
|
||||
get = function() return Details.ocd_tracker.filters["interrupt"] end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.ocd_tracker.filters["interrupt"] = value
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end,
|
||||
name = "Interrupt Cooldowns",
|
||||
desc = "Exanple: rogue kick.",
|
||||
@@ -524,7 +538,7 @@ end
|
||||
get = function() return Details.ocd_tracker.width end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.ocd_tracker.width = value
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end,
|
||||
min = 10,
|
||||
max = 200,
|
||||
@@ -538,7 +552,7 @@ end
|
||||
get = function() return Details.ocd_tracker.height end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.ocd_tracker.height = value
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end,
|
||||
min = 10,
|
||||
max = 200,
|
||||
@@ -552,7 +566,7 @@ end
|
||||
get = function() return Details.ocd_tracker.lines_per_column end,
|
||||
set = function(self, fixedparam, value)
|
||||
Details.ocd_tracker.lines_per_column = floor(value)
|
||||
Details.CooldownTracking.RefreshCooldownFrames()
|
||||
Details222.CooldownTracking.RefreshCooldownFrames()
|
||||
end,
|
||||
min = 1,
|
||||
max = 30,
|
||||
|
||||
@@ -2446,8 +2446,6 @@ if (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE) then
|
||||
scrollFrame:Refresh()
|
||||
end
|
||||
|
||||
--open raid lib callbacks
|
||||
--openRaidLib.RegisterCallback(Details.CooldownTracking, "CooldownListUpdate", "OnReceiveUnitFullCooldownList")
|
||||
function f.OnKeystoneUpdate(unitId, keystoneInfo, allKeystonesInfo)
|
||||
if (f:IsShown()) then
|
||||
f.RefreshData()
|
||||
|
||||
Reference in New Issue
Block a user