diff --git a/Bars/Abstract/Bar.lua b/Bars/Abstract/Bar.lua index 246eb5d..50fd697 100755 --- a/Bars/Abstract/Bar.lua +++ b/Bars/Abstract/Bar.lua @@ -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 @@ -1112,6 +1159,7 @@ 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) @@ -1119,12 +1167,15 @@ function BarMixin:UpdateFragmentedPowerDisplay(layoutName, data, maxPower) 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("") diff --git a/Helpers/Color.lua b/Helpers/Color.lua index e8ab47c..e4e6541 100644 --- a/Helpers/Color.lua +++ b/Helpers/Color.lua @@ -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 diff --git a/Locales/enUS.lua b/Locales/enUS.lua index 06be81c..2157017 100644 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -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, diff --git a/Locales/koKR.lua b/Locales/koKR.lua index 9fb5361..8ce2f55 100644 --- a/Locales/koKR.lua +++ b/Locales/koKR.lua @@ -50,6 +50,7 @@ local baseLocale = { ["UNHOLY_RUNE"] = "부정 룬", ["COMBO_POINTS"] = "연계 점수", ["OVERCHARGED_COMBO_POINTS"] = "과충전 연계 점수", + ["FERAL_FINISHER_COMBO_POINTS"] = "야성 마무리 연계 점수", ["SOUL_SHARDS"] = "영혼의 조각", ["HOLY_POWER"] = "신성한 힘", ["CHI"] = "기", diff --git a/Locales/ptBR.lua b/Locales/ptBR.lua index bfed232..a07ebed 100644 --- a/Locales/ptBR.lua +++ b/Locales/ptBR.lua @@ -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, diff --git a/Locales/ruRU.lua b/Locales/ruRU.lua index 15f4fdd..d47f3d3 100644 --- a/Locales/ruRU.lua +++ b/Locales/ruRU.lua @@ -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, diff --git a/Locales/zhCN.lua b/Locales/zhCN.lua index b650477..4c6b362 100644 --- a/Locales/zhCN.lua +++ b/Locales/zhCN.lua @@ -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, diff --git a/Settings/HealthAndPowerColorSettings.lua b/Settings/HealthAndPowerColorSettings.lua index 759eac8..b52043d 100644 --- a/Settings/HealthAndPowerColorSettings.lua +++ b/Settings/HealthAndPowerColorSettings.lua @@ -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,