From aa559113eb849803542818621a3a81275ba74d14 Mon Sep 17 00:00:00 2001 From: Chris Pickett Date: Sat, 17 Jun 2017 20:37:51 -0500 Subject: [PATCH] Updated shard display for Destro Warlocks Ticket #234, thanks stencil! --- modules/ClassPowerCounter.lua | 10 +++++++--- modules/Shards.lua | 10 ++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/modules/ClassPowerCounter.lua b/modules/ClassPowerCounter.lua index e0003eb..b2c138c 100644 --- a/modules/ClassPowerCounter.lua +++ b/modules/ClassPowerCounter.lua @@ -18,7 +18,7 @@ IceClassPowerCounter.prototype.requiredSpec = nil IceClassPowerCounter.prototype.shouldShowUnmodified = false IceClassPowerCounter.prototype.unmodifiedMaxPerRune = 10 IceClassPowerCounter.prototype.unit = "player" - +IceClassPowerCounter.prototype.round = ceil IceClassPowerCounter.prototype.growModes = { width = 1, height = 2 } IceClassPowerCounter.prototype.currentGrowMode = nil @@ -501,13 +501,17 @@ function IceClassPowerCounter.prototype:UpdateRunePower(event, arg1, arg2) local percentReady = self.shouldShowUnmodified and (UnitPower("player", self.unitPower, true) / self.unmodifiedMaxPerRune) or numReady if self:GetRuneMode() == "Numeric" or self.moduleSettings.alsoShowNumeric then - self.frame.numeric:SetText(tostring(percentReady)) + if self.numericFormat then + self.frame.numeric:SetText(format(self.numericFormat, percentReady)) + else + self.frame.numeric:SetText(tostring(percentReady)) + end self.frame.numeric:SetTextColor(self:GetColor(self.numericColor)) end if self:GetRuneMode() ~= "Numeric" then for i=1, self.numRunes do - if i <= ceil(percentReady) then + if i <= self.round(percentReady) then if self:GetRuneMode() == "Graphical" then self.frame.graphical[i].rune:SetVertexColor(1, 1, 1) else diff --git a/modules/Shards.lua b/modules/Shards.lua index 8ea2a76..1cdc6ed 100644 --- a/modules/Shards.lua +++ b/modules/Shards.lua @@ -45,6 +45,16 @@ end function ShardCounter.prototype:Enable(core) if IceHUD.WowVer >= 70000 then self.numRunes = UnitPowerMax(self.unit, self.unitPower) + + if GetSpecialization() == SPEC_WARLOCK_DESTRUCTION then + self.shouldShowUnmodified = true + self.numericFormat = "%.1f" + self.round = floor + else + self.shouldShowUnmodified = nil + self.numericFormat = nil + self.round = nil + end end ShardCounter.super.prototype.Enable(self, core)