Skip to content

Commit

Permalink
Updated ChannelingTicks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wetxius committed May 11, 2019
1 parent ee3d08d commit 666e99e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 23 deletions.
25 changes: 19 additions & 6 deletions ShestakUI/Config/Filters/ChannelingTicks.lua
Expand Up @@ -21,16 +21,29 @@ T.CastBarTicks = {
[SpellName(740)] = 4, -- Tranquility
-- Mage
[SpellName(5143)] = 5, -- Arcane Missiles
[SpellName(12051)] = 4, -- Evocation
[SpellName(205021)] = 5, -- Ray of Frost
-- Monk
[SpellName(115175)] = 9, -- Soothing Mist
[SpellName(117952)] = 6, -- Crackling Jade Lightning
[SpellName(113656)] = 4, -- Fists of Fury
[SpellName(115175)] = 8, -- Soothing Mist
[SpellName(117952)] = 4, -- Crackling Jade Lightning
-- Priest
[SpellName(15407)] = 4, -- Mind Flay
[SpellName(48045)] = 4, -- Mind Sear
[SpellName(47540)] = 3, -- Penance
[SpellName(64843)] = 4, -- Divine Hymn
-- Warlock
[SpellName(198590)] = 6, -- Drain Soul
[SpellName(755)] = 6, -- Health Funnel
}
[SpellName(755)] = 5, -- Health Funnel
[SpellName(198590)] = 5, -- Drain Soul
[SpellName(234153)] = 5, -- Drain Life
}

local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("PLAYER_TALENT_UPDATE")
f:SetScript("OnEvent", function()
if T.class ~= "PRIEST" then return end

-- Penance
local penanceTicks = IsPlayerSpell(193134) and 4 or 3
T.CastBarTicks[SpellName(47540)] = penanceTicks
end)
32 changes: 15 additions & 17 deletions ShestakUI/Core/Functions.lua
Expand Up @@ -1129,24 +1129,24 @@ end

local ticks = {}

local setBarTicks = function(Castbar, ticknum)
local setBarTicks = function(Castbar, numTicks)
for _, v in pairs(ticks) do
v:Hide()
end
if ticknum and ticknum > 0 then
local delta = Castbar:GetWidth() / ticknum
for k = 1, ticknum do
if not ticks[k] then
ticks[k] = Castbar:CreateTexture(nil, "OVERLAY")
ticks[k]:SetTexture(C.media.texture)
ticks[k]:SetVertexColor(unpack(C.media.border_color))
ticks[k]:SetWidth(1)
ticks[k]:SetHeight(Castbar:GetHeight())
ticks[k]:SetDrawLayer("OVERLAY", 7)
if numTicks and numTicks > 0 then
local delta = Castbar:GetWidth() / numTicks
for i = 1, numTicks do
if not ticks[i] then
ticks[i] = Castbar:CreateTexture(nil, "OVERLAY")
ticks[i]:SetTexture(C.media.texture)
ticks[i]:SetVertexColor(unpack(C.media.border_color))
ticks[i]:SetWidth(1)
ticks[i]:SetHeight(Castbar:GetHeight())
ticks[i]:SetDrawLayer("OVERLAY", 7)
end
ticks[k]:ClearAllPoints()
ticks[k]:SetPoint("CENTER", Castbar, "RIGHT", -delta * k, 0)
ticks[k]:Show()
ticks[i]:ClearAllPoints()
ticks[i]:SetPoint("CENTER", Castbar, "RIGHT", -delta * i, 0)
ticks[i]:Show()
end
end
end
Expand Down Expand Up @@ -1235,8 +1235,6 @@ T.PostCastStart = function(Castbar, unit)
end
end

local channelingTicks = T.CastBarTicks

T.PostChannelStart = function(Castbar, unit)
Castbar.channeling = true
if unit == "vehicle" then unit = "player" end
Expand All @@ -1250,7 +1248,7 @@ T.PostChannelStart = function(Castbar, unit)

if unit == "player" and C.unitframe.castbar_ticks == true then
local spell = UnitChannelInfo(unit)
Castbar.channelingTicks = channelingTicks[spell] or 0
Castbar.channelingTicks = T.CastBarTicks[spell] or 0
setBarTicks(Castbar, Castbar.channelingTicks)
end

Expand Down

0 comments on commit 666e99e

Please sign in to comment.