Skip to content
Open
Show file tree
Hide file tree
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
59 changes: 55 additions & 4 deletions Bars/Abstract/Bar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1070,10 +1070,57 @@ function BarMixin:UpdateFragmentedPowerDisplay(layoutName, data, maxPower)

if resource == Enum.PowerType.ComboPoints then
local current = UnitPower("player", resource)
-- Reuse cached maxPower to avoid redundant API call
local maxCP = maxPower

local overchargedCpColor = addonTable:GetOverrideResourceColor("OVERCHARGED_COMBO_POINTS") or color
local baseCPColor = self:GetBarColor(resource) or color
local overchargedCpColor = addonTable:GetOverrideResourceColor("OVERCHARGED_COMBO_POINTS") or baseCPColor

-- ---------------------------------------------------------------
-- FERAL FINISHER HIGHLIGHT
-- Detect Feral spec (103) and Berserk/Incarnation aura state to
-- decide which CP slots should use the finisher highlight color.
-- ---------------------------------------------------------------
local isFeral = false
local spec = C_SpecializationInfo.GetSpecialization()
if spec then
local specID = C_SpecializationInfo.GetSpecializationInfo(spec)
isFeral = specID == 103
end

local feralFinisherColor = addonTable:GetOverrideResourceColor("FERAL_FINISHER_COMBO_POINTS") or baseCPColor

-- Normal rotation: CP4+CP5 highlighted.
-- Berserk / Incarnation active: only CP5 highlighted.
-- Berserk/Incarnation auras are fully secret in Midnight: both GetPlayerAuraBySpellID
-- and COMBAT_LOG_EVENT_UNFILTERED are blocked for these buffs.
-- Durations are fixed in Midnight 12.0 (no talents extend them):
-- Berserk: 15 seconds
-- Incarnation: Avatar of Ashamane: 20 seconds
-- We detect the cast via UNIT_SPELLCAST_SUCCEEDED on a dedicated frame to avoid
-- conflicting with the bar's existing OnEvent handler.
if isFeral and not self._feralCooldownHooked then
self._feralCooldownExpiry = 0
self._feralCooldownHooked = true

local tracker = CreateFrame("Frame")
tracker:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
tracker:SetScript("OnEvent", function(_, event, unit, _, spellID)
if event == "UNIT_SPELLCAST_SUCCEEDED" and unit == "player" then
if spellID == 106951 then
self._feralCooldownExpiry = GetTime() + 15 -- Berserk: 15s
elseif spellID == 102543 then
self._feralCooldownExpiry = GetTime() + 20 -- Incarnation: 20s
end
end
end)
end

local finisherStartIndex = 4
if isFeral and GetTime() < (self._feralCooldownExpiry or 0) then
finisherStartIndex = 5
end
-- ---------------------------------------------------------------

local charged = GetUnitChargedPowerPoints("player") or {}
local chargedLookup = {}
for _, index in ipairs(charged) do
Expand Down Expand Up @@ -1112,19 +1159,23 @@ function BarMixin:UpdateFragmentedPowerDisplay(layoutName, data, maxPower)
cpFrame:SetMinMaxValues(0, 1)

if chargedLookup[idx] then
-- Overcharged takes full precedence, unchanged
cpFrame:SetValue(1, data.smoothProgress and Enum.StatusBarInterpolation.ExponentialEaseOut or nil)
if idx <= current then
cpFrame:SetStatusBarColor(overchargedCpColor.r, overchargedCpColor.g, overchargedCpColor.b, overchargedCpColor.a or 1)
else
cpFrame:SetStatusBarColor(overchargedCpColor.r * 0.5, overchargedCpColor.g * 0.5, overchargedCpColor.b * 0.5, overchargedCpColor.a or 1)
end
else
local useFeralFinisherColor = isFeral and idx >= finisherStartIndex
local baseColor = useFeralFinisherColor and feralFinisherColor or baseCPColor

if idx <= current then
cpFrame:SetValue(1, data.smoothProgress and Enum.StatusBarInterpolation.ExponentialEaseOut or nil)
cpFrame:SetStatusBarColor(color.r, color.g, color.b, color.a or 1)
cpFrame:SetStatusBarColor(baseColor.r, baseColor.g, baseColor.b, baseColor.a or 1)
else
cpFrame:SetValue(0, data.smoothProgress and Enum.StatusBarInterpolation.ExponentialEaseOut or nil)
cpFrame:SetStatusBarColor(color.r * 0.5, color.g * 0.5, color.b * 0.5, color.a or 1)
cpFrame:SetStatusBarColor(baseColor.r * 0.5, baseColor.g * 0.5, baseColor.b * 0.5, baseColor.a or 1)
end
end
cpText:SetFormattedText("")
Expand Down
2 changes: 2 additions & 0 deletions Helpers/Color.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ function addonTable:GetResourceColor(resource)
color = { r = 0.878, g = 0.176, b = 0.180 }
elseif resource == "OVERCHARGED_COMBO_POINTS" then
color = { r = 0.169, g = 0.733, b = 0.992 }
elseif resource == "FERAL_FINISHER_COMBO_POINTS" then
color = { r = 1.0, g = 0.5, b = 0.0 }
elseif resource == Enum.PowerType.Chi then
color = { r = 0.024, g = 0.741, b = 0.784 }
elseif resource == "MAELSTROM_WEAPON" then
Expand Down
1 change: 1 addition & 0 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ local baseLocale = {
["UNHOLY_RUNE"] = COMBAT_TEXT_RUNE_UNHOLY,
["COMBO_POINTS"] = COMBO_POINTS,
["OVERCHARGED_COMBO_POINTS"] = "Overcharged Combo Points",
["FERAL_FINISHER_COMBO_POINTS"] = "Feral Finisher Combo Points",
["SOUL_SHARDS"] = SOUL_SHARDS,
["HOLY_POWER"] = HOLY_POWER,
["CHI"] = CHI,
Expand Down
1 change: 1 addition & 0 deletions Locales/koKR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ local baseLocale = {
["UNHOLY_RUNE"] = "부정 룬",
["COMBO_POINTS"] = "연계 점수",
["OVERCHARGED_COMBO_POINTS"] = "과충전 연계 점수",
["FERAL_FINISHER_COMBO_POINTS"] = "야성 마무리 연계 점수",
["SOUL_SHARDS"] = "영혼의 조각",
["HOLY_POWER"] = "신성한 힘",
["CHI"] = "기",
Expand Down
1 change: 1 addition & 0 deletions Locales/ptBR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ local baseLocale = {
["UNHOLY_RUNE"] = COMBAT_TEXT_RUNE_UNHOLY,
["COMBO_POINTS"] = COMBO_POINTS,
["OVERCHARGED_COMBO_POINTS"] = "Pontos de Combo Sobrecarregados",
["FERAL_FINISHER_COMBO_POINTS"] = "Pontos de Combo Feral Finalizadores",
["SOUL_SHARDS"] = SOUL_SHARDS,
["HOLY_POWER"] = HOLY_POWER,
["CHI"] = CHI,
Expand Down
1 change: 1 addition & 0 deletions Locales/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ local baseLocale = {
["UNHOLY_RUNE"] = COMBAT_TEXT_RUNE_UNHOLY,
["COMBO_POINTS"] = COMBO_POINTS,
["OVERCHARGED_COMBO_POINTS"] = "Перегруженные комбо очки",
["FERAL_FINISHER_COMBO_POINTS"] = "Завершающие комбо (Ферал)",
["SOUL_SHARDS"] = SOUL_SHARDS,
["HOLY_POWER"] = HOLY_POWER,
["CHI"] = CHI,
Expand Down
1 change: 1 addition & 0 deletions Locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ local baseLocale = {
["UNHOLY_RUNE"] = COMBAT_TEXT_RUNE_UNHOLY,
["COMBO_POINTS"] = COMBO_POINTS,
["OVERCHARGED_COMBO_POINTS"] = "超荷充能连击点数",
["FERAL_FINISHER_COMBO_POINTS"] = "野性终结连击点",
["SOUL_SHARDS"] = SOUL_SHARDS,
["HOLY_POWER"] = HOLY_POWER,
["CHI"] = CHI,
Expand Down
4 changes: 4 additions & 0 deletions Settings/HealthAndPowerColorSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ local PowerData = {
label = L["OVERCHARGED_COMBO_POINTS"],
key = "OVERCHARGED_COMBO_POINTS",
},
{
label = L["FERAL_FINISHER_COMBO_POINTS"],
key = "FERAL_FINISHER_COMBO_POINTS",
},
{
label = L["SOUL_SHARDS"],
key = Enum.PowerType.SoulShards,
Expand Down