mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 12:10:01 +00:00
castbar: reset delays on new spell casts
This commit is contained in:
@@ -5,6 +5,9 @@ if pfUI.expansion ~= "tbc" then return end
|
||||
-- [[ Constants ]]--
|
||||
CASTBAR_EVENT_CAST_DELAY = "UNIT_SPELLCAST_DELAYED"
|
||||
CASTBAR_EVENT_CHANNEL_DELAY = "UNIT_SPELLCAST_CHANNEL_UPDATE"
|
||||
CASTBAR_EVENT_CAST_START = "UNIT_SPELLCAST_START"
|
||||
CASTBAR_EVENT_CHANNEL_START = "UNIT_SPELLCAST_CHANNEL_START"
|
||||
|
||||
EVENTS_MINIMAP_ZONE_UPDATE = {"PLAYER_ENTERING_WORLD", "ZONE_CHANGED_NEW_AREA", "ZONE_CHANGED"}
|
||||
|
||||
MICRO_BUTTONS = {
|
||||
|
||||
@@ -5,6 +5,9 @@ if pfUI.expansion ~= "vanilla" then return end
|
||||
-- [[ Constants ]]--
|
||||
CASTBAR_EVENT_CAST_DELAY = "SPELLCAST_DELAYED"
|
||||
CASTBAR_EVENT_CHANNEL_DELAY = "SPELLCAST_CHANNEL_UPDATE"
|
||||
CASTBAR_EVENT_CAST_START = "SPELLCAST_START"
|
||||
CASTBAR_EVENT_CHANNEL_START = "SPELLCAST_CHANNEL_START"
|
||||
|
||||
EVENTS_MINIMAP_ZONE_UPDATE = {"PLAYER_ENTERING_WORLD", "MINIMAP_ZONE_CHANGED"}
|
||||
|
||||
MICRO_BUTTONS = {
|
||||
|
||||
@@ -159,6 +159,8 @@ pfUI:RegisterModule("castbar", "vanilla:tbc", function ()
|
||||
local playerarg = nil
|
||||
cb:RegisterEvent(CASTBAR_EVENT_CAST_DELAY)
|
||||
cb:RegisterEvent(CASTBAR_EVENT_CHANNEL_DELAY)
|
||||
cb:RegisterEvent(CASTBAR_EVENT_CAST_START)
|
||||
cb:RegisterEvent(CASTBAR_EVENT_CHANNEL_START)
|
||||
cb:SetScript("OnEvent", function()
|
||||
if this.unitstr and not UnitIsUnit(this.unitstr, "player") then return end
|
||||
playerarg = pfUI.client <= 11200 or arg1 == "player" and true or nil
|
||||
@@ -172,6 +174,8 @@ pfUI:RegisterModule("castbar", "vanilla:tbc", function ()
|
||||
local isChannel, _, _, _, startTime, endTime = UnitChannelInfo(this.unitstr or this.unitname)
|
||||
if not isChannel then return end
|
||||
this.delay = ( this.delay or 0 ) + this.bar:GetValue() - (endTime/1000 - GetTime())
|
||||
elseif playerarg then
|
||||
this.delay = 0
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user