Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions modules/GCD.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function GCD:OnEnable()
--self:RegisterEvent("UNIT_SPELLCAST_SENT","CheckGCD")
self:RegisterEvent("UNIT_SPELLCAST_START","CheckGCD")
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED","CheckGCD")
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED", "CLEUHandler")
if not gcdbar then
gcdbar = CreateFrame("Frame", "Quartz3GCDBar", UIParent, "BackdropTemplate")
gcdbar:SetFrameStrata("HIGH")
Expand Down Expand Up @@ -113,6 +114,21 @@ function GCD:CheckGCD(event, unit, guid, spell)
end
end

function GCD:CLEUHandler()
local playerGUID = UnitGUID("player")
local timestamp, event, hideCaster, sGUID, sName, sFlags, sRaidFlags, dGUID, dName, dFlags, dRaidFlags, spellId, spellName = CombatLogGetCurrentEventInfo()

if playerGUID == sGUID and event == "SPELL_CAST_SUCCESS" and spellName == "Shoot" then
local start = GetTime()
local dur = UnitRangedDamage("player")
if dur and dur > 0 then
starttime = start
duration = dur
gcdbar:Show()
end
end
end

function GCD:ApplySettings()
db = self.db.profile
if gcdbar and self:IsEnabled() then
Expand Down