From 5fbf85811e05b0e45207b6397e5f1467b7556a3e Mon Sep 17 00:00:00 2001 From: Parnic Date: Tue, 24 May 2016 00:52:56 -0500 Subject: [PATCH] Replaced UNIT_COMBO_POINTS with UNIT_POWER for Legion --- modules/ComboPoints.lua | 12 ++++++++++-- modules/ComboPointsBar.lua | 12 ++++++++++-- modules/SliceAndDice.lua | 12 ++++++++++-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/modules/ComboPoints.lua b/modules/ComboPoints.lua index acd6422..d09dfeb 100644 --- a/modules/ComboPoints.lua +++ b/modules/ComboPoints.lua @@ -238,7 +238,11 @@ function ComboPoints.prototype:Enable(core) self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateComboPoints") if IceHUD.WowVer >= 30000 then - self:RegisterEvent("UNIT_COMBO_POINTS", "UpdateComboPoints") + if IceHUD.WowVer < 70000 then + self:RegisterEvent("UNIT_COMBO_POINTS", "UpdateComboPoints") + else + self:RegisterEvent("UNIT_POWER", "UpdateComboPoints") + end self:RegisterEvent("UNIT_ENTERED_VEHICLE", "UpdateComboPoints") self:RegisterEvent("UNIT_EXITED_VEHICLE", "UpdateComboPoints") self:RegisterEvent("PLAYER_TALENT_UPDATE", "AddAnticipation") @@ -405,7 +409,11 @@ function ComboPoints.prototype:CreateComboFrame(forceTextureUpdate) end -function ComboPoints.prototype:UpdateComboPoints() +function ComboPoints.prototype:UpdateComboPoints(...) + if select('#', ...) >= 3 and select(1, ...) == "UNIT_POWER" and select(3, ...) ~= "COMBO_POINTS" then + return + end + local points, anticipate, _ if IceHUD.IceCore:IsInConfigMode() then points = 5 diff --git a/modules/ComboPointsBar.lua b/modules/ComboPointsBar.lua index f6f58c5..b08da69 100644 --- a/modules/ComboPointsBar.lua +++ b/modules/ComboPointsBar.lua @@ -66,7 +66,11 @@ function ComboPointsBar.prototype:Enable(core) self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateComboPoints") if IceHUD.WowVer >= 30000 then - self:RegisterEvent("UNIT_COMBO_POINTS", "UpdateComboPoints") + if IceHUD.WowVer < 70000 then + self:RegisterEvent("UNIT_COMBO_POINTS", "UpdateComboPoints") + else + self:RegisterEvent("UNIT_POWER", "UpdateComboPoints") + end self:RegisterEvent("UNIT_ENTERED_VEHICLE", "UpdateComboPoints") self:RegisterEvent("UNIT_EXITED_VEHICLE", "UpdateComboPoints") else @@ -80,7 +84,11 @@ function ComboPointsBar.prototype:CreateFrame() self:UpdateComboPoints() end -function ComboPointsBar.prototype:UpdateComboPoints() +function ComboPointsBar.prototype:UpdateComboPoints(...) + if select('#', ...) >= 3 and select(1, ...) == "UNIT_POWER" and select(3, ...) ~= "COMBO_POINTS" then + return + end + local points if IceHUD.IceCore:IsInConfigMode() then points = 5 diff --git a/modules/SliceAndDice.lua b/modules/SliceAndDice.lua index b6e8293..180bfbc 100644 --- a/modules/SliceAndDice.lua +++ b/modules/SliceAndDice.lua @@ -50,7 +50,11 @@ function SliceAndDice.prototype:Enable(core) SliceAndDice.super.prototype.Enable(self, core) self:RegisterEvent("UNIT_AURA", "UpdateSliceAndDice") - self:RegisterEvent("UNIT_COMBO_POINTS", "ComboPointsChanged") + if IceHUD.WowVer < 70000 then + self:RegisterEvent("UNIT_COMBO_POINTS", "ComboPointsChanged") + else + self:RegisterEvent("UNIT_POWER", "ComboPointsChanged") + end if not self.moduleSettings.alwaysFullAlpha then self:Show(false) @@ -65,7 +69,11 @@ function SliceAndDice.prototype:Disable(core) SliceAndDice.super.prototype.Disable(self, core) end -function SliceAndDice.prototype:ComboPointsChanged() +function SliceAndDice.prototype:ComboPointsChanged(...) + if select('#', ...) >= 3 and select(1, ...) == "UNIT_POWER" and select(3, ...) ~= "COMBO_POINTS" then + return + end + self:TargetChanged() self:UpdateDurationBar() end