mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-15 22:30:13 -05:00
Pulled some common functionality out of CustomCount and into a helper file. I intend on using this same helper for a bar version of a buff counter.
This commit is contained in:
@ -26,6 +26,7 @@ IceElement.lua
|
|||||||
IceBarElement.lua
|
IceBarElement.lua
|
||||||
IceUnitBar.lua
|
IceUnitBar.lua
|
||||||
IceCastBar.lua
|
IceCastBar.lua
|
||||||
|
IceStackCounter.lua
|
||||||
|
|
||||||
# IceHUD modules
|
# IceHUD modules
|
||||||
# - Feel free to comment these out if you like
|
# - Feel free to comment these out if you like
|
||||||
|
182
IceStackCounter.lua
Normal file
182
IceStackCounter.lua
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false)
|
||||||
|
|
||||||
|
local validUnits = {"player", "target", "focus", "pet", "vehicle", "targettarget", "main hand weapon", "off hand weapon"}
|
||||||
|
local buffOrDebuff = {"buff", "debuff", "charges", "spell count"}
|
||||||
|
|
||||||
|
-- OVERRIDE
|
||||||
|
function IceStackCounter_GetOptions(frame)
|
||||||
|
local opts = {}
|
||||||
|
|
||||||
|
opts["customHeader"] = {
|
||||||
|
type = 'header',
|
||||||
|
name = L["Aura settings"],
|
||||||
|
order = 30.1,
|
||||||
|
}
|
||||||
|
|
||||||
|
opts["auraTarget"] = {
|
||||||
|
type = 'select',
|
||||||
|
values = validUnits,
|
||||||
|
name = L["Unit to track"],
|
||||||
|
desc = L["Select which unit that this bar should be looking for buffs/debuffs on"],
|
||||||
|
get = function(info)
|
||||||
|
return IceHUD:GetSelectValue(info, frame.moduleSettings.auraTarget)
|
||||||
|
end,
|
||||||
|
set = function(info, v)
|
||||||
|
frame.moduleSettings.auraTarget = info.option.values[v]
|
||||||
|
frame.unit = info.option.values[v]
|
||||||
|
frame:Redraw()
|
||||||
|
IceHUD:NotifyOptionsChange()
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not frame.moduleSettings.enabled or frame.moduleSettings.auraType == "charges" or frame.moduleSettings.auraType == "spell count"
|
||||||
|
end,
|
||||||
|
order = 30.4,
|
||||||
|
}
|
||||||
|
|
||||||
|
opts["auraType"] = {
|
||||||
|
type = 'select',
|
||||||
|
values = buffOrDebuff,
|
||||||
|
name = L["Buff or debuff?"],
|
||||||
|
desc = L["Whether we are tracking a buff or debuff"],
|
||||||
|
get = function(info)
|
||||||
|
return IceHUD:GetSelectValue(info, frame.moduleSettings.auraType)
|
||||||
|
end,
|
||||||
|
set = function(info, v)
|
||||||
|
frame.moduleSettings.auraType = info.option.values[v]
|
||||||
|
frame:Redraw()
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not frame.moduleSettings.enabled or frame.unit == "main hand weapon" or frame.unit == "off hand weapon"
|
||||||
|
end,
|
||||||
|
order = 30.5,
|
||||||
|
}
|
||||||
|
|
||||||
|
opts["auraName"] = {
|
||||||
|
type = 'input',
|
||||||
|
name = L["Aura to track"],
|
||||||
|
desc = L["Which buff/debuff this counter will be tracking. \n\nRemember to press ENTER after filling out this box with the name you want or it will not save."],
|
||||||
|
get = function()
|
||||||
|
return frame.moduleSettings.auraName
|
||||||
|
end,
|
||||||
|
set = function(info, v)
|
||||||
|
frame.moduleSettings.auraName = v
|
||||||
|
frame:Redraw()
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not frame.moduleSettings.enabled or frame.unit == "main hand weapon" or frame.unit == "off hand weapon"
|
||||||
|
end,
|
||||||
|
usage = "<which aura to track>",
|
||||||
|
order = 30.6,
|
||||||
|
}
|
||||||
|
|
||||||
|
opts["trackOnlyMine"] = {
|
||||||
|
type = 'toggle',
|
||||||
|
name = L["Only track auras by me"],
|
||||||
|
desc = L["Checking this means that only buffs or debuffs that the player applied will trigger this bar"],
|
||||||
|
get = function()
|
||||||
|
return frame.moduleSettings.onlyMine
|
||||||
|
end,
|
||||||
|
set = function(info, v)
|
||||||
|
frame.moduleSettings.onlyMine = v
|
||||||
|
frame:Redraw()
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not frame.moduleSettings.enabled or frame.unit == "main hand weapon" or frame.unit == "off hand weapon"
|
||||||
|
or frame.moduleSettings.auraType == "charges" or frame.moduleSettings.auraType == "spell count"
|
||||||
|
end,
|
||||||
|
order = 30.7,
|
||||||
|
}
|
||||||
|
|
||||||
|
opts["maxCount"] = {
|
||||||
|
type = 'input',
|
||||||
|
name = L["Maximum applications"],
|
||||||
|
desc = L["How many total applications of this buff/debuff can be applied. For example, only 5 sunders can ever be on a target, so this would be set to 5 for tracking Sunder.\n\nRemember to press ENTER after filling out this box with the name you want or it will not save."],
|
||||||
|
get = function()
|
||||||
|
return tostring(frame.moduleSettings.maxCount)
|
||||||
|
end,
|
||||||
|
set = function(info, v)
|
||||||
|
if not v or not tonumber(v) or tonumber(v) <= 0 then
|
||||||
|
v = 5
|
||||||
|
end
|
||||||
|
frame.moduleSettings.maxCount = tonumber(v)
|
||||||
|
frame:CreateCustomFrame(true)
|
||||||
|
frame:Redraw()
|
||||||
|
end,
|
||||||
|
disabled = function()
|
||||||
|
return not frame.moduleSettings.enabled or frame.moduleSettings.auraType == "charges"
|
||||||
|
end,
|
||||||
|
usage = "<the maximum number of valid applications>",
|
||||||
|
order = 30.9,
|
||||||
|
}
|
||||||
|
|
||||||
|
return opts
|
||||||
|
end
|
||||||
|
|
||||||
|
function IceStackCounter_GetMaxCount(frame)
|
||||||
|
if frame.moduleSettings.auraType == "charges" then
|
||||||
|
local _, max = GetSpellCharges(frame.moduleSettings.auraName)
|
||||||
|
return max or 1
|
||||||
|
else
|
||||||
|
return frame.moduleSettings.maxCount
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function IceStackCounter_GetDefaultSettings()
|
||||||
|
local defaults = {}
|
||||||
|
defaults["maxCount"] = 5
|
||||||
|
defaults["auraTarget"] = "player"
|
||||||
|
defaults["auraName"] = ""
|
||||||
|
defaults["onlyMine"] = true
|
||||||
|
defaults["auraType"] = "buff"
|
||||||
|
return defaults
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function IceStackCounter_Enable(frame)
|
||||||
|
frame:RegisterEvent("UNIT_AURA", "UpdateCustomCount")
|
||||||
|
frame:RegisterEvent("UNIT_PET", "UpdateCustomCount")
|
||||||
|
frame:RegisterEvent("PLAYER_PET_CHANGED", "UpdateCustomCount")
|
||||||
|
frame:RegisterEvent("PLAYER_FOCUS_CHANGED", "UpdateCustomCount")
|
||||||
|
frame:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateCustomCount")
|
||||||
|
frame:RegisterEvent("PLAYER_DEAD", "UpdateCustomCount")
|
||||||
|
frame:RegisterEvent("SPELL_UPDATE_CHARGES", "UpdateCustomCount")
|
||||||
|
|
||||||
|
frame.unit = frame.moduleSettings.auraTarget or "player"
|
||||||
|
|
||||||
|
if not tonumber(frame.moduleSettings.maxCount) or tonumber(frame.moduleSettings.maxCount) <= 0 then
|
||||||
|
frame.moduleSettings.maxCount = 5
|
||||||
|
frame:Redraw()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function IceStackCounter_GetCount(frame)
|
||||||
|
if not frame.moduleSettings.auraName then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local points
|
||||||
|
if IceHUD.IceCore:IsInConfigMode() then
|
||||||
|
points = tonumber(frame.moduleSettings.maxCount)
|
||||||
|
else
|
||||||
|
if frame.moduleSettings.auraType == "charges" then
|
||||||
|
points = GetSpellCharges(frame.moduleSettings.auraName) or 0
|
||||||
|
elseif frame.moduleSettings.auraType == "spell count" then
|
||||||
|
points = GetSpellCount(frame.moduleSettings.auraName) or 0
|
||||||
|
else
|
||||||
|
points = IceHUD:GetAuraCount(frame.moduleSettings.auraType == "buff" and "HELPFUL" or "HARMFUL",
|
||||||
|
frame.unit, frame.moduleSettings.auraName, frame.moduleSettings.onlyMine, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
frame.lastPoints = points
|
||||||
|
|
||||||
|
if (points == 0) then
|
||||||
|
points = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
return points
|
||||||
|
end
|
||||||
|
|
||||||
|
function IceStackCounter_UseTargetAlpha(frame)
|
||||||
|
return frame.lastPoints ~= nil and frame.lastPoints > 0
|
||||||
|
end
|
@ -6,9 +6,6 @@ local IceHUD = _G.IceHUD
|
|||||||
IceCustomCount.prototype.countSize = 20
|
IceCustomCount.prototype.countSize = 20
|
||||||
IceCustomCount.prototype.lastPoints = 0
|
IceCustomCount.prototype.lastPoints = 0
|
||||||
|
|
||||||
local validUnits = {"player", "target", "focus", "pet", "vehicle", "targettarget", "main hand weapon", "off hand weapon"}
|
|
||||||
local buffOrDebuff = {"buff", "debuff", "charges", "spell count"}
|
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
function IceCustomCount.prototype:init()
|
function IceCustomCount.prototype:init()
|
||||||
IceCustomCount.super.prototype.init(self, "CustomCount")
|
IceCustomCount.super.prototype.init(self, "CustomCount")
|
||||||
@ -21,11 +18,9 @@ end
|
|||||||
function IceCustomCount.prototype:GetOptions()
|
function IceCustomCount.prototype:GetOptions()
|
||||||
local opts = IceCustomCount.super.prototype.GetOptions(self)
|
local opts = IceCustomCount.super.prototype.GetOptions(self)
|
||||||
|
|
||||||
opts["customHeader"] = {
|
for k,v in pairs(IceStackCounter_GetOptions(self)) do
|
||||||
type = 'header',
|
opts[k] = v
|
||||||
name = L["Aura settings"],
|
end
|
||||||
order = 30.1,
|
|
||||||
}
|
|
||||||
|
|
||||||
opts["deleteme"] = {
|
opts["deleteme"] = {
|
||||||
type = 'execute',
|
type = 'execute',
|
||||||
@ -75,80 +70,6 @@ function IceCustomCount.prototype:GetOptions()
|
|||||||
order = 30.3,
|
order = 30.3,
|
||||||
}
|
}
|
||||||
|
|
||||||
opts["auraTarget"] = {
|
|
||||||
type = 'select',
|
|
||||||
values = validUnits,
|
|
||||||
name = L["Unit to track"],
|
|
||||||
desc = L["Select which unit that this bar should be looking for buffs/debuffs on"],
|
|
||||||
get = function(info)
|
|
||||||
return IceHUD:GetSelectValue(info, self.moduleSettings.auraTarget)
|
|
||||||
end,
|
|
||||||
set = function(info, v)
|
|
||||||
self.moduleSettings.auraTarget = info.option.values[v]
|
|
||||||
self.unit = info.option.values[v]
|
|
||||||
self:Redraw()
|
|
||||||
IceHUD:NotifyOptionsChange()
|
|
||||||
end,
|
|
||||||
disabled = function()
|
|
||||||
return not self.moduleSettings.enabled or self.moduleSettings.auraType == "charges" or self.moduleSettings.auraType == "spell count"
|
|
||||||
end,
|
|
||||||
order = 30.4,
|
|
||||||
}
|
|
||||||
|
|
||||||
opts["auraType"] = {
|
|
||||||
type = 'select',
|
|
||||||
values = buffOrDebuff,
|
|
||||||
name = L["Buff or debuff?"],
|
|
||||||
desc = L["Whether we are tracking a buff or debuff"],
|
|
||||||
get = function(info)
|
|
||||||
return IceHUD:GetSelectValue(info, self.moduleSettings.auraType)
|
|
||||||
end,
|
|
||||||
set = function(info, v)
|
|
||||||
self.moduleSettings.auraType = info.option.values[v]
|
|
||||||
self:Redraw()
|
|
||||||
end,
|
|
||||||
disabled = function()
|
|
||||||
return not self.moduleSettings.enabled or self.unit == "main hand weapon" or self.unit == "off hand weapon"
|
|
||||||
end,
|
|
||||||
order = 30.5,
|
|
||||||
}
|
|
||||||
|
|
||||||
opts["auraName"] = {
|
|
||||||
type = 'input',
|
|
||||||
name = L["Aura to track"],
|
|
||||||
desc = L["Which buff/debuff this counter will be tracking. \n\nRemember to press ENTER after filling out this box with the name you want or it will not save."],
|
|
||||||
get = function()
|
|
||||||
return self.moduleSettings.auraName
|
|
||||||
end,
|
|
||||||
set = function(info, v)
|
|
||||||
self.moduleSettings.auraName = v
|
|
||||||
self:Redraw()
|
|
||||||
end,
|
|
||||||
disabled = function()
|
|
||||||
return not self.moduleSettings.enabled or self.unit == "main hand weapon" or self.unit == "off hand weapon"
|
|
||||||
end,
|
|
||||||
usage = "<which aura to track>",
|
|
||||||
order = 30.6,
|
|
||||||
}
|
|
||||||
|
|
||||||
opts["trackOnlyMine"] = {
|
|
||||||
type = 'toggle',
|
|
||||||
name = L["Only track auras by me"],
|
|
||||||
desc = L["Checking this means that only buffs or debuffs that the player applied will trigger this bar"],
|
|
||||||
get = function()
|
|
||||||
return self.moduleSettings.onlyMine
|
|
||||||
end,
|
|
||||||
set = function(info, v)
|
|
||||||
self.moduleSettings.onlyMine = v
|
|
||||||
self:Redraw()
|
|
||||||
end,
|
|
||||||
disabled = function()
|
|
||||||
return not self.moduleSettings.enabled or self.unit == "main hand weapon" or self.unit == "off hand weapon"
|
|
||||||
or self.moduleSettings.auraType == "charges" or self.moduleSettings.auraType == "spell count"
|
|
||||||
end,
|
|
||||||
order = 30.7,
|
|
||||||
}
|
|
||||||
|
|
||||||
opts["countColor"] = {
|
opts["countColor"] = {
|
||||||
type = 'color',
|
type = 'color',
|
||||||
name = L["Count color"],
|
name = L["Count color"],
|
||||||
@ -187,28 +108,6 @@ function IceCustomCount.prototype:GetOptions()
|
|||||||
order = 30.81,
|
order = 30.81,
|
||||||
}
|
}
|
||||||
|
|
||||||
opts["maxCount"] = {
|
|
||||||
type = 'input',
|
|
||||||
name = L["Maximum applications"],
|
|
||||||
desc = L["How many total applications of this buff/debuff can be applied. For example, only 5 sunders can ever be on a target, so this would be set to 5 for tracking Sunder.\n\nRemember to press ENTER after filling out this box with the name you want or it will not save."],
|
|
||||||
get = function()
|
|
||||||
return tostring(self.moduleSettings.maxCount)
|
|
||||||
end,
|
|
||||||
set = function(info, v)
|
|
||||||
if not v or not tonumber(v) or tonumber(v) <= 0 then
|
|
||||||
v = 5
|
|
||||||
end
|
|
||||||
self.moduleSettings.maxCount = tonumber(v)
|
|
||||||
self:CreateCustomFrame(true)
|
|
||||||
self:Redraw()
|
|
||||||
end,
|
|
||||||
disabled = function()
|
|
||||||
return not self.moduleSettings.enabled or self.moduleSettings.auraType == "charges"
|
|
||||||
end,
|
|
||||||
usage = "<the maximum number of valid applications>",
|
|
||||||
order = 30.9,
|
|
||||||
}
|
|
||||||
|
|
||||||
opts["normalHeader"] = {
|
opts["normalHeader"] = {
|
||||||
type = 'header',
|
type = 'header',
|
||||||
name = L["Counter look and feel"],
|
name = L["Counter look and feel"],
|
||||||
@ -361,18 +260,13 @@ function IceCustomCount.prototype:GetCustomMinColor()
|
|||||||
return self.moduleSettings.countMinColor.r, self.moduleSettings.countMinColor.g, self.moduleSettings.countMinColor.b, self.alpha
|
return self.moduleSettings.countMinColor.r, self.moduleSettings.countMinColor.g, self.moduleSettings.countMinColor.b, self.alpha
|
||||||
end
|
end
|
||||||
|
|
||||||
function IceCustomCount.prototype:GetMaxCount()
|
|
||||||
if self.moduleSettings.auraType == "charges" then
|
|
||||||
local _, max = GetSpellCharges(self.moduleSettings.auraName)
|
|
||||||
return max or 1
|
|
||||||
else
|
|
||||||
return self.moduleSettings.maxCount
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- OVERRIDE
|
|
||||||
function IceCustomCount.prototype:GetDefaultSettings()
|
function IceCustomCount.prototype:GetDefaultSettings()
|
||||||
local defaults = IceCustomCount.super.prototype.GetDefaultSettings(self)
|
local defaults = IceCustomCount.super.prototype.GetDefaultSettings(self)
|
||||||
|
|
||||||
|
for k,v in pairs(IceStackCounter_GetDefaultSettings(self)) do
|
||||||
|
defaults[k] = v
|
||||||
|
end
|
||||||
|
|
||||||
defaults["vpos"] = 0
|
defaults["vpos"] = 0
|
||||||
defaults["hpos"] = 0
|
defaults["hpos"] = 0
|
||||||
defaults["countFontSize"] = 20
|
defaults["countFontSize"] = 20
|
||||||
@ -382,14 +276,10 @@ function IceCustomCount.prototype:GetDefaultSettings()
|
|||||||
defaults["alwaysFullAlpha"] = true
|
defaults["alwaysFullAlpha"] = true
|
||||||
defaults["graphicalLayout"] = "Horizontal"
|
defaults["graphicalLayout"] = "Horizontal"
|
||||||
defaults["countGap"] = 0
|
defaults["countGap"] = 0
|
||||||
defaults["maxCount"] = 5
|
|
||||||
defaults["auraTarget"] = "player"
|
|
||||||
defaults["auraName"] = ""
|
|
||||||
defaults["onlyMine"] = true
|
|
||||||
defaults["customBarType"] = "Counter"
|
defaults["customBarType"] = "Counter"
|
||||||
defaults["countMinColor"] = {r=1, g=1, b=0, a=1}
|
defaults["countMinColor"] = {r=1, g=1, b=0, a=1}
|
||||||
defaults["countColor"] = {r=1, g=0, b=0, a=1}
|
defaults["countColor"] = {r=1, g=0, b=0, a=1}
|
||||||
defaults["auraType"] = "buff"
|
|
||||||
return defaults
|
return defaults
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -407,23 +297,8 @@ end
|
|||||||
function IceCustomCount.prototype:Enable(core)
|
function IceCustomCount.prototype:Enable(core)
|
||||||
IceCustomCount.super.prototype.Enable(self, core)
|
IceCustomCount.super.prototype.Enable(self, core)
|
||||||
|
|
||||||
self:RegisterEvent("UNIT_AURA", "UpdateCustomCount")
|
self:CreateCustomFrame(true)
|
||||||
self:RegisterEvent("UNIT_PET", "UpdateCustomCount")
|
IceStackCounter_Enable(self)
|
||||||
self:RegisterEvent("PLAYER_PET_CHANGED", "UpdateCustomCount")
|
|
||||||
self:RegisterEvent("PLAYER_FOCUS_CHANGED", "UpdateCustomCount")
|
|
||||||
self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateCustomCount")
|
|
||||||
self:RegisterEvent("PLAYER_DEAD", "UpdateCustomCount")
|
|
||||||
self:RegisterEvent("SPELL_UPDATE_CHARGES", "UpdateCustomCount")
|
|
||||||
|
|
||||||
self.unit = self.moduleSettings.auraTarget or "player"
|
|
||||||
|
|
||||||
if not tonumber(self.moduleSettings.maxCount) or tonumber(self.moduleSettings.maxCount) <= 0 then
|
|
||||||
self.moduleSettings.maxCount = 5
|
|
||||||
self:CreateCustomFrame(true)
|
|
||||||
self:Redraw()
|
|
||||||
else
|
|
||||||
self:CreateCustomFrame(true)
|
|
||||||
end
|
|
||||||
self:UpdateCustomCount()
|
self:UpdateCustomCount()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -437,11 +312,11 @@ function IceCustomCount.prototype:CreateFrame()
|
|||||||
|
|
||||||
self.frame:SetFrameStrata("BACKGROUND")
|
self.frame:SetFrameStrata("BACKGROUND")
|
||||||
if self.moduleSettings.graphicalLayout == "Horizontal" then
|
if self.moduleSettings.graphicalLayout == "Horizontal" then
|
||||||
self.frame:SetWidth((self.countSize + self.moduleSettings.countGap)*self:GetMaxCount())
|
self.frame:SetWidth((self.countSize + self.moduleSettings.countGap)*IceStackCounter_GetMaxCount(self))
|
||||||
self.frame:SetHeight(1)
|
self.frame:SetHeight(1)
|
||||||
else
|
else
|
||||||
self.frame:SetWidth(1)
|
self.frame:SetWidth(1)
|
||||||
self.frame:SetHeight((self.countSize + self.moduleSettings.countGap)*self:GetMaxCount())
|
self.frame:SetHeight((self.countSize + self.moduleSettings.countGap)*IceStackCounter_GetMaxCount(self))
|
||||||
end
|
end
|
||||||
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)
|
||||||
@ -468,7 +343,7 @@ function IceCustomCount.prototype:CreateCustomFrame(doTextureUpdate)
|
|||||||
self.frame.graphical = {}
|
self.frame.graphical = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
local max = self:GetMaxCount()
|
local max = IceStackCounter_GetMaxCount(self)
|
||||||
|
|
||||||
-- create backgrounds
|
-- create backgrounds
|
||||||
for i = 1, max do
|
for i = 1, max do
|
||||||
@ -536,7 +411,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function IceCustomCount.prototype:SetCustomColor()
|
function IceCustomCount.prototype:SetCustomColor()
|
||||||
for i=1, self:GetMaxCount() do
|
for i=1, IceStackCounter_GetMaxCount(self) do
|
||||||
self.frame.graphicalBG[i].texture:SetVertexColor(self:GetCustomColor())
|
self.frame.graphicalBG[i].texture:SetVertexColor(self:GetCustomColor())
|
||||||
|
|
||||||
local r, g, b = self:GetCustomColor()
|
local r, g, b = self:GetCustomColor()
|
||||||
@ -548,7 +423,7 @@ function IceCustomCount.prototype:SetCustomColor()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function IceCustomCount.prototype:GetGradientColor(curr)
|
function IceCustomCount.prototype:GetGradientColor(curr)
|
||||||
local max = self:GetMaxCount()
|
local max = IceStackCounter_GetMaxCount(self)
|
||||||
local r, g, b = self:GetCustomColor()
|
local r, g, b = self:GetCustomColor()
|
||||||
local mr, mg, mb = self:GetCustomMinColor()
|
local mr, mg, mb = self:GetCustomMinColor()
|
||||||
local scale = max > 1 and ((curr-1)/(max-1)) or 1
|
local scale = max > 1 and ((curr-1)/(max-1)) or 1
|
||||||
@ -566,25 +441,7 @@ function IceCustomCount.prototype:UpdateCustomCount()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local points
|
local points = IceStackCounter_GetCount(self)
|
||||||
if IceHUD.IceCore:IsInConfigMode() then
|
|
||||||
points = tonumber(self.moduleSettings.maxCount)
|
|
||||||
else
|
|
||||||
if self.moduleSettings.auraType == "charges" then
|
|
||||||
points = GetSpellCharges(self.moduleSettings.auraName) or 0
|
|
||||||
elseif self.moduleSettings.auraType == "spell count" then
|
|
||||||
points = GetSpellCount(self.moduleSettings.auraName) or 0
|
|
||||||
else
|
|
||||||
points = IceHUD:GetAuraCount(self.moduleSettings.auraType == "buff" and "HELPFUL" or "HARMFUL",
|
|
||||||
self.unit, self.moduleSettings.auraName, self.moduleSettings.onlyMine, true)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self.lastPoints = points
|
|
||||||
|
|
||||||
if (points == 0) then
|
|
||||||
points = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
if (self.moduleSettings.countMode == "Numeric") then
|
if (self.moduleSettings.countMode == "Numeric") then
|
||||||
local r, g, b = self:GetCustomColor()
|
local r, g, b = self:GetCustomColor()
|
||||||
@ -616,5 +473,5 @@ function IceCustomCount.prototype:UpdateCustomCount()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function IceCustomCount.prototype:UseTargetAlpha(scale)
|
function IceCustomCount.prototype:UseTargetAlpha(scale)
|
||||||
return self.lastPoints ~= nil and self.lastPoints > 0
|
return IceStackCounter_UseTargetAlpha(self)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user