diff --git a/modules/ComboPoints.lua b/modules/ComboPoints.lua index 354ef62..070d433 100644 --- a/modules/ComboPoints.lua +++ b/modules/ComboPoints.lua @@ -70,9 +70,10 @@ function ComboPoints.prototype:GetOptions() end, set = function(v) self.moduleSettings.comboMode = v + self:CreateComboFrame(true) self:Redraw() end, - validate = { "Numeric", "Graphical" }, + validate = { "Numeric", "Graphical Bar", "Graphical Circle" }, disabled = function() return not self.moduleSettings.enabled end, @@ -131,6 +132,12 @@ function ComboPoints.prototype:Enable(core) else self:RegisterEvent("PLAYER_COMBO_POINTS", "UpdateComboPoints") end + + if self.moduleSettings.comboMode == "Graphical" then + self.moduleSettings.comboMode = "Graphical Bar" + end + + self:CreateComboFrame(true) end @@ -154,7 +161,7 @@ end -function ComboPoints.prototype:CreateComboFrame() +function ComboPoints.prototype:CreateComboFrame(forceTextureUpdate) -- create numeric combo points self.frame.numeric = self:FontFactory(self.moduleSettings.comboFontSize, nil, self.frame.numeric) @@ -174,8 +181,16 @@ function ComboPoints.prototype:CreateComboFrame() for i = 1, 5 do if (not self.frame.graphicalBG[i]) then self.frame.graphicalBG[i] = CreateFrame("StatusBar", nil, self.frame) - self.frame.graphicalBG[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboBG") end + + if forceTextureUpdate then + if self.moduleSettings.comboMode == "Graphical Bar" then + self.frame.graphicalBG[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboBG") + elseif self.moduleSettings.comboMode == "Graphical Circle" then + self.frame.graphicalBG[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboRoundBG") + end + end + self.frame.graphicalBG[i]:SetFrameStrata("BACKGROUND") self.frame.graphicalBG[i]:SetWidth(self.comboSize) self.frame.graphicalBG[i]:SetHeight(self.comboSize) @@ -190,8 +205,16 @@ function ComboPoints.prototype:CreateComboFrame() for i = 1, 5 do if (not self.frame.graphical[i]) then self.frame.graphical[i] = CreateFrame("StatusBar", nil, self.frame) - self.frame.graphical[i]:SetStatusBarTexture(IceElement.TexturePath .. "Combo") end + + if forceTextureUpdate then + if self.moduleSettings.comboMode == "Graphical Bar" then + self.frame.graphical[i]:SetStatusBarTexture(IceElement.TexturePath .. "Combo") + elseif self.moduleSettings.comboMode == "Graphical Circle" then + self.frame.graphical[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboRound") + end + end + self.frame.graphical[i]:SetFrameStrata("BACKGROUND") self.frame.graphical[i]:SetAllPoints(self.frame.graphicalBG[i]) @@ -205,8 +228,6 @@ function ComboPoints.prototype:CreateComboFrame() end end - - function ComboPoints.prototype:UpdateComboPoints() local points if IceHUD.WowVer >= 30000 then diff --git a/modules/LacerateCount.lua b/modules/LacerateCount.lua index 6708e49..0ac48a2 100644 --- a/modules/LacerateCount.lua +++ b/modules/LacerateCount.lua @@ -71,9 +71,10 @@ function LacerateCount.prototype:GetOptions() end, set = function(v) self.moduleSettings.lacerateMode = v + self:CreateLacerateFrame(true) self:Redraw() end, - validate = { "Numeric", "Graphical" }, + validate = { "Numeric", "Graphical Bar", "Graphical Circle" }, disabled = function() return not self.moduleSettings.enabled end, @@ -128,6 +129,12 @@ function LacerateCount.prototype:Enable(core) self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateLacerateCount") self:RegisterEvent("UNIT_AURA", "UpdateLacerateCount") + + if self.moduleSettings.lacerateMode == "Graphical" then + self.moduleSettings.lacerateMode = "Graphical Bar" + end + + self:CreateLacerateFrame(true) end @@ -151,7 +158,7 @@ end -function LacerateCount.prototype:CreateLacerateFrame() +function LacerateCount.prototype:CreateLacerateFrame(doTextureUpdate) -- create numeric lacerates self.frame.numeric = self:FontFactory(self.moduleSettings.lacerateFontSize, nil, self.frame.numeric) @@ -171,8 +178,16 @@ function LacerateCount.prototype:CreateLacerateFrame() for i = 1, 5 do if (not self.frame.graphicalBG[i]) then self.frame.graphicalBG[i] = CreateFrame("StatusBar", nil, self.frame) - self.frame.graphicalBG[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboBG") end + + if doTextureUpdate then + if self.moduleSettings.lacerateMode == "Graphical Bar" then + self.frame.graphicalBG[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboBG") + elseif self.moduleSettings.lacerateMode == "Graphical Circle" then + self.frame.graphicalBG[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboRoundBG") + end + end + self.frame.graphicalBG[i]:SetFrameStrata("BACKGROUND") self.frame.graphicalBG[i]:SetWidth(self.lacerateSize) self.frame.graphicalBG[i]:SetHeight(self.lacerateSize) @@ -187,8 +202,16 @@ function LacerateCount.prototype:CreateLacerateFrame() for i = 1, 5 do if (not self.frame.graphical[i]) then self.frame.graphical[i] = CreateFrame("StatusBar", nil, self.frame) - self.frame.graphical[i]:SetStatusBarTexture(IceElement.TexturePath .. "Combo") end + + if doTextureUpdate then + if self.moduleSettings.lacerateMode == "Graphical Bar" then + self.frame.graphical[i]:SetStatusBarTexture(IceElement.TexturePath .. "Combo") + elseif self.moduleSettings.lacerateMode == "Graphical Circle" then + self.frame.graphical[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboRound") + end + end + self.frame.graphical[i]:SetFrameStrata("BACKGROUND") self.frame.graphical[i]:SetAllPoints(self.frame.graphicalBG[i]) diff --git a/modules/SliceAndDice.lua b/modules/SliceAndDice.lua index 0c683b2..ffa32ef 100644 --- a/modules/SliceAndDice.lua +++ b/modules/SliceAndDice.lua @@ -37,7 +37,7 @@ end function SliceAndDice.prototype:Enable(core) SliceAndDice.super.prototype.Enable(self, core) - self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateDurationBar") + self:RegisterEvent("PLAYER_TARGET_CHANGED", "TargetChanged") if IceHUD.WowVer >= 30000 then self:RegisterEvent("UNIT_AURA", "UpdateSliceAndDice") self:RegisterEvent("UNIT_COMBO_POINTS", "UpdateDurationBar") @@ -51,6 +51,11 @@ function SliceAndDice.prototype:Enable(core) self:SetBottomText1("") end +function SliceAndDice.prototype:TargetChanged() + self:UpdateDurationBar() + self:UpdateSliceAndDice() +end + function SliceAndDice.prototype:Disable(core) SliceAndDice.super.prototype.Disable(self, core) @@ -226,7 +231,7 @@ function SliceAndDice.prototype:UpdateSliceAndDice(unit, fromUpdate) else self:UpdateBar(0, "SliceAndDice") - if ((IceHUD.WowVer >= 30000 and GetComboPoints(self.unit, "target") == 0) or (IceHUD.WowVer < 30000 and GetComboPoints("target") == 0)) or not UnitExists("target") then + if ((IceHUD.WowVer >= 30000 and GetComboPoints(self.unit, "target") == 0) or (IceHUD.WowVer < 30000 and GetComboPoints() == 0)) or not UnitExists("target") then if self.bIsVisible then self.frame:SetScript("OnUpdate", nil) end @@ -350,6 +355,12 @@ function SliceAndDice.prototype:IsItemIdInList(itemId, list) return false end +function SliceAndDice.prototype:OutCombat() + SliceAndDice.super.prototype.OutCombat(self) + + self:UpdateSliceAndDice() +end + local _, unitClass = UnitClass("player") -- Load us up if unitClass == "ROGUE" then diff --git a/modules/SunderCount.lua b/modules/SunderCount.lua index 03d2ca8..b3a19d8 100644 --- a/modules/SunderCount.lua +++ b/modules/SunderCount.lua @@ -71,9 +71,10 @@ function SunderCount.prototype:GetOptions() end, set = function(v) self.moduleSettings.sunderMode = v + self:CreateSunderFrame(true) self:Redraw() end, - validate = { "Numeric", "Graphical" }, + validate = { "Numeric", "Graphical Bar", "Graphical Circle" }, disabled = function() return not self.moduleSettings.enabled end, @@ -128,6 +129,12 @@ function SunderCount.prototype:Enable(core) self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateSunderCount") self:RegisterEvent("UNIT_AURA", "UpdateSunderCount") + + if self.moduleSettings.sunderMode == "Graphical" then + self.moduleSettings.sunderMode = "Graphical Bar" + end + + self:CreateSunderFrame(true) end @@ -151,7 +158,7 @@ end -function SunderCount.prototype:CreateSunderFrame() +function SunderCount.prototype:CreateSunderFrame(doTextureUpdate) -- create numeric sunders self.frame.numeric = self:FontFactory(self.moduleSettings.sunderFontSize, nil, self.frame.numeric) @@ -171,8 +178,16 @@ function SunderCount.prototype:CreateSunderFrame() for i = 1, 5 do if (not self.frame.graphicalBG[i]) then self.frame.graphicalBG[i] = CreateFrame("StatusBar", nil, self.frame) - self.frame.graphicalBG[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboBG") end + + if doTextureUpdate then + if self.moduleSettings.sunderMode == "Graphical Bar" then + self.frame.graphicalBG[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboBG") + elseif self.moduleSettings.sunderMode == "Graphical Circle" then + self.frame.graphicalBG[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboRoundBG") + end + end + self.frame.graphicalBG[i]:SetFrameStrata("BACKGROUND") self.frame.graphicalBG[i]:SetWidth(self.sunderSize) self.frame.graphicalBG[i]:SetHeight(self.sunderSize) @@ -187,8 +202,16 @@ function SunderCount.prototype:CreateSunderFrame() for i = 1, 5 do if (not self.frame.graphical[i]) then self.frame.graphical[i] = CreateFrame("StatusBar", nil, self.frame) - self.frame.graphical[i]:SetStatusBarTexture(IceElement.TexturePath .. "Combo") end + + if doTextureUpdate then + if self.moduleSettings.sunderMode == "Graphical Bar" then + self.frame.graphical[i]:SetStatusBarTexture(IceElement.TexturePath .. "Combo") + elseif self.moduleSettings.sunderMode == "Graphical Circle" then + self.frame.graphical[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboRound") + end + end + self.frame.graphical[i]:SetFrameStrata("BACKGROUND") self.frame.graphical[i]:SetAllPoints(self.frame.graphicalBG[i]) diff --git a/textures/ComboRound.blp b/textures/ComboRound.blp new file mode 100644 index 0000000..c1bc2d2 Binary files /dev/null and b/textures/ComboRound.blp differ diff --git a/textures/ComboRoundBG.blp b/textures/ComboRoundBG.blp new file mode 100644 index 0000000..b674604 Binary files /dev/null and b/textures/ComboRoundBG.blp differ