mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- Added support for showing the numeric value on top of a class power's graphical display. This number can also be moved vertically.
This commit is contained in:
@ -116,6 +116,50 @@ function IceClassPowerCounter.prototype:GetOptions()
|
|||||||
order = 34
|
order = 34
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts["alsoShowNumeric"] = {
|
||||||
|
type = 'toggle',
|
||||||
|
name = L["Also show numeric"],
|
||||||
|
desc = L["If this is set, the numeric value of the current rune count will show on top of the runes display."],
|
||||||
|
get = function(info)
|
||||||
|
return self.moduleSettings.alsoShowNumeric
|
||||||
|
end,
|
||||||
|
set = function(info, v)
|
||||||
|
self.moduleSettings.alsoShowNumeric = v
|
||||||
|
self:SetDisplayMode()
|
||||||
|
self:UpdateRunePower()
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled
|
||||||
|
end,
|
||||||
|
hidden = function()
|
||||||
|
return self.moduleSettings.runeMode == "Numeric"
|
||||||
|
end,
|
||||||
|
order = 34.01,
|
||||||
|
}
|
||||||
|
|
||||||
|
opts["numericVerticalOffset"] = {
|
||||||
|
type = 'range',
|
||||||
|
min = -500,
|
||||||
|
max = 500,
|
||||||
|
step = 1,
|
||||||
|
name = L["Numeric vertical offset"],
|
||||||
|
desc = L["How far to offset the numeric display up or down."],
|
||||||
|
get = function(info)
|
||||||
|
return self.moduleSettings.numericVerticalOffset
|
||||||
|
end,
|
||||||
|
set = function(info, v)
|
||||||
|
self.moduleSettings.numericVerticalOffset = v
|
||||||
|
self:Redraw()
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not self.moduleSettings.enabled
|
||||||
|
end,
|
||||||
|
hidden = function()
|
||||||
|
return self.moduleSettings.runeMode == "Numeric" or not self.moduleSettings.alsoShowNumeric
|
||||||
|
end,
|
||||||
|
order = 34.02,
|
||||||
|
}
|
||||||
|
|
||||||
opts["runeGap"] = {
|
opts["runeGap"] = {
|
||||||
type = 'range',
|
type = 'range',
|
||||||
name = L["Rune gap"],
|
name = L["Rune gap"],
|
||||||
@ -346,6 +390,8 @@ function IceClassPowerCounter.prototype:GetDefaultSettings()
|
|||||||
defaults["hideFriendly"] = false
|
defaults["hideFriendly"] = false
|
||||||
defaults["pulseWhenFull"] = true
|
defaults["pulseWhenFull"] = true
|
||||||
defaults["overrideAlpha"] = true
|
defaults["overrideAlpha"] = true
|
||||||
|
defaults["numericVerticalOffset"] = 0
|
||||||
|
defaults["alwaysShowNumeric"] = false
|
||||||
|
|
||||||
return defaults
|
return defaults
|
||||||
end
|
end
|
||||||
@ -440,10 +486,12 @@ function IceClassPowerCounter.prototype:UpdateRunePower(event, arg1, arg2)
|
|||||||
local numReady = UnitPower("player", self.unitPower)
|
local numReady = UnitPower("player", self.unitPower)
|
||||||
local percentReady = self.shouldShowUnmodified and (UnitPower("player", self.unitPower, true) / self.unmodifiedMaxPerRune) or numReady
|
local percentReady = self.shouldShowUnmodified and (UnitPower("player", self.unitPower, true) / self.unmodifiedMaxPerRune) or numReady
|
||||||
|
|
||||||
if self.moduleSettings.runeMode == "Numeric" then
|
if self.moduleSettings.runeMode == "Numeric" or self.moduleSettings.alsoShowNumeric then
|
||||||
self.frame.numeric:SetText(tostring(percentReady))
|
self.frame.numeric:SetText(tostring(percentReady))
|
||||||
self.frame.numeric:SetTextColor(self:GetColor(self.numericColor))
|
self.frame.numeric:SetTextColor(self:GetColor(self.numericColor))
|
||||||
else
|
end
|
||||||
|
|
||||||
|
if self.moduleSettings.runeMode ~= "Numeric" then
|
||||||
for i=1, self.numRunes do
|
for i=1, self.numRunes do
|
||||||
if i <= ceil(percentReady) then
|
if i <= ceil(percentReady) then
|
||||||
if self.moduleSettings.runeMode == "Graphical" then
|
if self.moduleSettings.runeMode == "Graphical" then
|
||||||
@ -577,7 +625,7 @@ end
|
|||||||
function IceClassPowerCounter.prototype:CreateFrame()
|
function IceClassPowerCounter.prototype:CreateFrame()
|
||||||
IceClassPowerCounter.super.prototype.CreateFrame(self)
|
IceClassPowerCounter.super.prototype.CreateFrame(self)
|
||||||
|
|
||||||
self.frame:SetFrameStrata("BACKGROUND")
|
self.frame:SetFrameStrata("LOW")
|
||||||
self.frame:SetHeight(self.runeHeight)
|
self.frame:SetHeight(self.runeHeight)
|
||||||
self.frame:ClearAllPoints()
|
self.frame:ClearAllPoints()
|
||||||
self.frame:SetPoint("TOP", self.parent, "BOTTOM", self.moduleSettings.hpos, self.moduleSettings.vpos)
|
self.frame:SetPoint("TOP", self.parent, "BOTTOM", self.moduleSettings.hpos, self.moduleSettings.vpos)
|
||||||
@ -588,13 +636,16 @@ function IceClassPowerCounter.prototype:CreateFrame()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function IceClassPowerCounter.prototype:SetDisplayMode()
|
function IceClassPowerCounter.prototype:SetDisplayMode()
|
||||||
if self.moduleSettings.runeMode == "Numeric" then
|
if self.moduleSettings.runeMode == "Numeric" or self.moduleSettings.alsoShowNumeric then
|
||||||
self.frame.numeric:Show()
|
self.frame.numeric:Show()
|
||||||
for i=1, self.numRunes do
|
for i=1, self.numRunes do
|
||||||
self.frame.graphical[i]:Hide()
|
self.frame.graphical[i]:Hide()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self.frame.numeric:Hide()
|
self.frame.numeric:Hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.moduleSettings.runeMode ~= "Numeric" then
|
||||||
for i=1, self.numRunes do
|
for i=1, self.numRunes do
|
||||||
self:SetupRuneTexture(i)
|
self:SetupRuneTexture(i)
|
||||||
self.frame.graphical[i]:Show()
|
self.frame.graphical[i]:Show()
|
||||||
@ -609,7 +660,7 @@ function IceClassPowerCounter.prototype:CreateRuneFrame()
|
|||||||
self.frame.numeric:SetWidth(100)
|
self.frame.numeric:SetWidth(100)
|
||||||
self.frame.numeric:SetJustifyH("CENTER")
|
self.frame.numeric:SetJustifyH("CENTER")
|
||||||
|
|
||||||
self.frame.numeric:SetAllPoints(self.frame)
|
self.frame.numeric:SetPoint("CENTER", self.frame, "CENTER", 0, self.moduleSettings.numericVerticalOffset)
|
||||||
self.frame.numeric:Hide()
|
self.frame.numeric:Hide()
|
||||||
|
|
||||||
if (not self.frame.graphical) then
|
if (not self.frame.graphical) then
|
||||||
|
Reference in New Issue
Block a user