castbar: add pushback counter to channel bar

This commit is contained in:
shagu
2018-11-10 13:41:58 +01:00
parent 3db0f569b9
commit 156d858a2e
3 changed files with 12 additions and 4 deletions
+2 -1
View File
@@ -9,7 +9,8 @@ pfUI.module.autoshift = true
pfUI.module.itemclick = true pfUI.module.itemclick = true
-- [[ Constants ]]-- -- [[ Constants ]]--
CASTBAR_DELAY_EVENT = "UNIT_SPELLCAST_DELAYED" -- UNIT_SPELLCAST_CHANNEL_UPDATE ? CASTBAR_EVENT_CAST_DELAY = "UNIT_SPELLCAST_DELAYED"
CASTBAR_EVENT_CHANNEL_DELAY = "UNIT_SPELLCAST_CHANNEL_UPDATE"
NAMEPLATE_OBJECTORDER = { "border", "glow", "_", "_", "name", "level", NAMEPLATE_OBJECTORDER = { "border", "glow", "_", "_", "name", "level",
"levelicon", "raidicon" } "levelicon", "raidicon" }
+2 -1
View File
@@ -4,7 +4,8 @@ setfenv(1, pfUI:GetEnvironment())
if pfUI.client > 11200 then return end if pfUI.client > 11200 then return end
-- [[ Constants ]]-- -- [[ Constants ]]--
CASTBAR_DELAY_EVENT = "SPELLCAST_DELAYED" -- SPELLCAST_CHANNEL_UPDATE ? CASTBAR_EVENT_CAST_DELAY = "SPELLCAST_DELAYED"
CASTBAR_EVENT_CHANNEL_DELAY = "SPELLCAST_CHANNEL_UPDATE"
NAMEPLATE_OBJECTORDER = { "border", "glow", "name", "level", "levelicon", NAMEPLATE_OBJECTORDER = { "border", "glow", "name", "level", "levelicon",
"raidicon" } "raidicon" }
+8 -2
View File
@@ -121,10 +121,16 @@ pfUI:RegisterModule("castbar", function ()
end) end)
-- register for spell delay -- register for spell delay
cb:RegisterEvent(CASTBAR_DELAY_EVENT) cb:RegisterEvent(CASTBAR_EVENT_CAST_DELAY)
cb:RegisterEvent(CASTBAR_EVENT_CHANNEL_DELAY)
cb:SetScript("OnEvent", function() cb:SetScript("OnEvent", function()
if not UnitIsUnit(this.unitstr, "player") then return end if not UnitIsUnit(this.unitstr, "player") then return end
this.delay = ( this.delay or 0 ) + arg1/1000
if event == CASTBAR_EVENT_CAST_DELAY then
this.delay = ( this.delay or 0 ) + arg1/1000
elseif event == CASTBAR_EVENT_CHANNEL_DELAY then
this.delay = ( this.delay or 0 ) + this.bar:GetValue() - arg1/1000
end
end) end)
cb:SetAlpha(0) cb:SetAlpha(0)