Skip to content

Commit

Permalink
Add CastbarTicks Option, and CastbarTicks for Era/SoD
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl-HeinzSchneider committed Dec 3, 2023
1 parent db0409a commit 16e3300
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
18 changes: 16 additions & 2 deletions Mixin/Castbar.mixin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function DragonFlightUICastbarMixin:OnLoad(unit)
self.showCastbar = true;
self:SetCastTimeTextShown(true)
self.showTradeSkills = true
self.showTicks = false
end

function DragonFlightUICastbarMixin:OnShow()
Expand Down Expand Up @@ -168,8 +169,9 @@ function DragonFlightUICastbarMixin:OnEvent(event, ...)
end
end

local tickCount = self.tickTable[name]
if tickCount then
-- local tickCount = self.tickTable[name]
local tickCount = self:GetTickCount(name, spellID)
if tickCount and tickCount > 0 then
local tickDelta = self:GetWidth() / tickCount

for i = 1, tickCount - 1 do
Expand Down Expand Up @@ -540,3 +542,15 @@ function DragonFlightUICastbarMixin:AddTickTable(data)
self.tickTable = {}
end
end

function DragonFlightUICastbarMixin:GetTickCount(spell, spellID)
-- local tickCount = self.tickTable[name]

if not self.showTicks then return 0 end

return self.tickTable[spellID] or self.tickTable[spell] or 0
end

function DragonFlightUICastbarMixin:SetShowTicks(showTicks)
self.showTicks = showTicks
end
36 changes: 33 additions & 3 deletions Modules/Castbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ local defaults = {
castTimeEnabled = true,
castTimeMaxEnabled = true,
compactLayout = true,
showIcon = false
showIcon = false,
showTicks = false
}
}

Expand Down Expand Up @@ -144,7 +145,9 @@ local options = {
castTimeMaxEnabled = {type = 'toggle', name = 'Show cast time max text', order = 105.2},
castTimeSpacer = {type = 'description', name = '', order = 105.3},
compactLayout = {type = 'toggle', name = 'Compact Layout', order = 106.1},
showIcon = {type = 'toggle', name = 'Show Icon', order = 106.2}
showIcon = {type = 'toggle', name = 'Show Icon', order = 106.2},
showTicks = {type = 'toggle', name = 'Show Ticks', order = 107.1}

}
}

Expand Down Expand Up @@ -179,6 +182,7 @@ function Module:ApplySettings()
Module.Castbar:SetCastTimeTextShown(db.castTimeEnabled)
Module.Castbar:SetCastTimeTextMaxShown(db.castTimeMaxEnabled)
Module.Castbar:SetCompactLayout(db.compactLayout)
Module.Castbar:SetShowTicks(db.showTicks)
Module.Castbar:SetIconShown(db.showIcon)
Module.Castbar.Icon:SetSize(db.sizeY, db.sizeY)
end
Expand Down Expand Up @@ -227,9 +231,35 @@ Module.ChannelTicks = DF.Wrath and {
[GetSpellInfo(740)] = 4, -- tranquility
[GetSpellInfo(16914)] = 10, -- hurricane
-- mage
[5143] = 3, -- arcane missiles rank 1
[5144] = 4, -- arcane missiles rank 2
[GetSpellInfo(5145)] = 5, -- arcane missiles
[GetSpellInfo(10)] = 8 -- blizzard
} or DF.Era and {}
} or DF.Era and {
-- wl
[GetSpellInfo(5740)] = 4, -- rain of fire
[GetSpellInfo(5138)] = 5, -- drain mana
[GetSpellInfo(689)] = 5, -- drain life
[GetSpellInfo(1120)] = 5, -- drain soul
[GetSpellInfo(755)] = 10, -- health funnel
[GetSpellInfo(1949)] = 15, -- hellfire
-- priest
[GetSpellInfo(15407)] = 3, -- mind flay
[GetSpellInfo(402174)] = 2, -- penance
[GetSpellInfo(413259)] = 2, -- mind sear
-- hunter
[GetSpellInfo(1510)] = 6, -- volley
-- druid
[GetSpellInfo(740)] = 4, -- tranquility
[GetSpellInfo(16914)] = 10, -- hurricane
-- mage
[5143] = 3, -- arcane missiles rank 1
[5144] = 4, -- arcane missiles rank 2
[GetSpellInfo(5145)] = 5, -- arcane missiles
[GetSpellInfo(10)] = 8, -- blizzard,
[GetSpellInfo(401417)] = 3, -- regeneration
[GetSpellInfo(412510)] = 3 -- mass regeneration
}

function Module.AddNewCastbar()
local castbar = CreateFrame('StatusBar', 'DragonflightUIPlayerCastbar', CastingBarFrame,
Expand Down

0 comments on commit 16e3300

Please sign in to comment.