mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- re-enabled DogTag after the stack overflow fix
- changed to registering FontStrings on the parent class instead of Evaluate'ing each child every Update
This commit is contained in:
@ -40,6 +40,11 @@ function IceBarElement.prototype:Enable()
|
||||
self:RegisterEvent("PLAYER_REGEN_ENABLED", "OutCombat")
|
||||
self:RegisterEvent("PLAYER_ENTERING_WORLD", "CheckCombat")
|
||||
self:RegisterEvent("PLAYER_TARGET_CHANGED", "TargetChanged")
|
||||
|
||||
if DogTag ~= nil then
|
||||
DogTag:AddFontString(self.frame.bottomUpperText, self.frame, self.unit, self.moduleSettings.upperText)
|
||||
DogTag:AddFontString(self.frame.bottomLowerText, self.frame, self.unit, self.moduleSettings.lowerText)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -246,7 +251,7 @@ function IceBarElement.prototype:GetOptions()
|
||||
upperTextString = {
|
||||
type = 'text',
|
||||
name = 'Upper Text',
|
||||
desc = 'The upper text to display under this bar (accepts LibDogTag formatting)\n\nSee http://www.wowace.com/wiki/LibDogTag-2.0/ for tag info',
|
||||
desc = 'The upper text to display under this bar (accepts LibDogTag formatting)\n\nSee http://www.wowace.com/wiki/LibDogTag-2.0/ or type /dogtag for tag info',
|
||||
disabled = function()
|
||||
return DogTag == nil or self.elementName == "DruidMana"
|
||||
end,
|
||||
@ -255,7 +260,7 @@ function IceBarElement.prototype:GetOptions()
|
||||
end,
|
||||
set = function(v)
|
||||
if DogTag ~= nil and v ~= '' and v ~= nil then
|
||||
v = DogTag:FixCasing(v)
|
||||
v = DogTag:FixCodeStyle(v)
|
||||
end
|
||||
|
||||
self.moduleSettings.upperText = v
|
||||
@ -267,7 +272,7 @@ function IceBarElement.prototype:GetOptions()
|
||||
lowerTextString = {
|
||||
type = 'text',
|
||||
name = 'Lower Text',
|
||||
desc = 'The lower text to display under this bar (accepts LibDogTag formatting)\n\nSee http://www.wowace.com/wiki/LibDogTag-2.0/ for tag info',
|
||||
desc = 'The lower text to display under this bar (accepts LibDogTag formatting)\n\nSee http://www.wowace.com/wiki/LibDogTag-2.0/ or type /dogtag for tag info',
|
||||
disabled = function()
|
||||
return DogTag == nil or self.elementName == "DruidMana"
|
||||
end,
|
||||
@ -276,7 +281,7 @@ function IceBarElement.prototype:GetOptions()
|
||||
end,
|
||||
set = function(v)
|
||||
if DogTag ~= nil and v ~= '' and v ~= nil then
|
||||
v = DogTag:FixCasing(v)
|
||||
v = DogTag:FixCodeStyle(v)
|
||||
end
|
||||
|
||||
self.moduleSettings.lowerText = v
|
||||
@ -579,6 +584,8 @@ function IceBarElement.prototype:UpdateBar(scale, color, alpha)
|
||||
end
|
||||
|
||||
self:SetScale(self.barFrame.bar, self.DesiredScale)
|
||||
|
||||
DogTag:UpdateAllForFrame(self.frame)
|
||||
end
|
||||
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
local AceOO = AceLibrary("AceOO-2.0")
|
||||
|
||||
local DogTag = nil
|
||||
|
||||
local PetHealth = AceOO.Class(IceUnitBar)
|
||||
|
||||
PetHealth.prototype.happiness = nil
|
||||
@ -16,10 +14,6 @@ function PetHealth.prototype:init()
|
||||
self:SetDefaultColor("PetHealthUnhappy", 164, 30, 30)
|
||||
|
||||
self.scalingEnabled = true
|
||||
|
||||
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||
DogTag = AceLibrary("LibDogTag-2.0")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -66,11 +60,6 @@ function PetHealth.prototype:Enable(core)
|
||||
|
||||
self:RegisterEvent("UNIT_HAPPINESS", "PetHappiness")
|
||||
|
||||
if DogTag ~= nil then
|
||||
-- DogTag:AddFontString(self.frame.bottomUpperText, self.frame, self.unit, self.moduleSettings.upperText)
|
||||
-- DogTag:AddFontString(self.frame.bottomLowerText, self.frame, self.unit, self.moduleSettings.lowerText)
|
||||
end
|
||||
|
||||
self:CheckPet()
|
||||
end
|
||||
|
||||
@ -120,9 +109,7 @@ function PetHealth.prototype:Update(unit)
|
||||
|
||||
self:UpdateBar(self.health/self.maxHealth, color)
|
||||
|
||||
if DogTag ~= nil and false then
|
||||
DogTag:UpdateAllForFrame(self.frame)
|
||||
else
|
||||
if not AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||
self:SetBottomText1(math.floor(self.healthPercentage * 100))
|
||||
end
|
||||
end
|
||||
|
@ -1,7 +1,5 @@
|
||||
local AceOO = AceLibrary("AceOO-2.0")
|
||||
|
||||
local DogTag = nil
|
||||
|
||||
local PetMana = AceOO.Class(IceUnitBar)
|
||||
|
||||
-- Constructor --
|
||||
@ -14,10 +12,6 @@ function PetMana.prototype:init()
|
||||
self:SetDefaultColor("PetFocus", 242, 149, 98)
|
||||
|
||||
self.scalingEnabled = true
|
||||
|
||||
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||
DogTag = AceLibrary("LibDogTag-2.0")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -72,11 +66,6 @@ function PetMana.prototype:Enable(core)
|
||||
|
||||
self:CheckPet()
|
||||
self:ManaType(self.unit)
|
||||
|
||||
if DogTag ~= nil then
|
||||
-- DogTag:AddFontString(self.frame.bottomUpperText, self.frame, self.unit, self.moduleSettings.upperText)
|
||||
-- DogTag:AddFontString(self.frame.bottomLowerText, self.frame, self.unit, self.moduleSettings.lowerText)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -131,9 +120,7 @@ function PetMana.prototype:Update(unit)
|
||||
|
||||
self:UpdateBar(self.mana/self.maxMana, color)
|
||||
|
||||
if DogTag ~= nil and false then
|
||||
DogTag:UpdateAllForFrame(self.frame)
|
||||
else
|
||||
if not AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||
self:SetBottomText1(math.floor(self.manaPercentage * 100))
|
||||
end
|
||||
end
|
||||
|
@ -1,7 +1,5 @@
|
||||
local AceOO = AceLibrary("AceOO-2.0")
|
||||
|
||||
local DogTag = nil
|
||||
|
||||
local PlayerHealth = AceOO.Class(IceUnitBar)
|
||||
|
||||
PlayerHealth.prototype.resting = nil
|
||||
@ -11,10 +9,6 @@ function PlayerHealth.prototype:init()
|
||||
PlayerHealth.super.prototype.init(self, "PlayerHealth", "player")
|
||||
|
||||
self:SetDefaultColor("PlayerHealth", 37, 164, 30)
|
||||
|
||||
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||
DogTag = AceLibrary("LibDogTag-2.0")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -44,11 +38,6 @@ function PlayerHealth.prototype:Enable(core)
|
||||
self:HideBlizz()
|
||||
end
|
||||
|
||||
if DogTag ~= nil then
|
||||
-- DogTag:AddFontString(self.frame.bottomUpperText, self.frame, self.unit, self.moduleSettings.upperText)
|
||||
-- DogTag:AddFontString(self.frame.bottomLowerText, self.frame, self.unit, self.moduleSettings.lowerText)
|
||||
end
|
||||
|
||||
self:Resting()
|
||||
--self:Update(self.unit)
|
||||
end
|
||||
@ -150,9 +139,7 @@ function PlayerHealth.prototype:Update(unit)
|
||||
|
||||
self:UpdateBar(self.health/self.maxHealth, color)
|
||||
|
||||
if DogTag ~= nil and false then
|
||||
DogTag:UpdateAllForFrame(self.frame)
|
||||
else
|
||||
if not AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||
self:SetBottomText1(math.floor(self.healthPercentage * 100))
|
||||
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), textColor)
|
||||
end
|
||||
|
@ -1,7 +1,5 @@
|
||||
local AceOO = AceLibrary("AceOO-2.0")
|
||||
|
||||
local DogTag = nil
|
||||
|
||||
local PlayerMana = AceOO.Class(IceUnitBar)
|
||||
|
||||
PlayerMana.prototype.manaType = nil
|
||||
@ -15,10 +13,6 @@ function PlayerMana.prototype:init()
|
||||
self:SetDefaultColor("PlayerMana", 62, 54, 152)
|
||||
self:SetDefaultColor("PlayerRage", 171, 59, 59)
|
||||
self:SetDefaultColor("PlayerEnergy", 218, 231, 31)
|
||||
|
||||
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||
DogTag = AceLibrary("LibDogTag-2.0")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -115,11 +109,6 @@ function PlayerMana.prototype:Enable(core)
|
||||
self:RegisterEvent("UNIT_DISPLAYPOWER", "ManaType")
|
||||
|
||||
self:ManaType(self.unit)
|
||||
|
||||
if DogTag ~= nil then
|
||||
-- DogTag:AddFontString(self.frame.bottomUpperText, self.frame, self.unit, self.moduleSettings.upperText)
|
||||
-- DogTag:AddFontString(self.frame.bottomLowerText, self.frame, self.unit, self.moduleSettings.lowerText)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -196,9 +185,7 @@ function PlayerMana.prototype:Update(unit)
|
||||
self.tickerFrame:SetStatusBarColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha))
|
||||
end
|
||||
|
||||
if DogTag ~= nil and false then
|
||||
DogTag:UpdateAllForFrame(self.frame)
|
||||
else
|
||||
if not AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||
-- extra hack for whiny rogues (are there other kind?)
|
||||
local displayPercentage = self.manaPercentage
|
||||
if (self.manaType == 3) then
|
||||
|
@ -1,7 +1,5 @@
|
||||
local AceOO = AceLibrary("AceOO-2.0")
|
||||
|
||||
local DogTag = nil
|
||||
|
||||
local TargetHealth = AceOO.Class(IceUnitBar)
|
||||
|
||||
TargetHealth.prototype.color = nil
|
||||
@ -14,10 +12,6 @@ function TargetHealth.prototype:init()
|
||||
self:SetDefaultColor("TargetHealthHostile", 231, 31, 36)
|
||||
self:SetDefaultColor("TargetHealthFriendly", 46, 223, 37)
|
||||
self:SetDefaultColor("TargetHealthNeutral", 210, 219, 87)
|
||||
|
||||
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||
DogTag = AceLibrary("LibDogTag-2.0")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -211,11 +205,6 @@ function TargetHealth.prototype:Enable(core)
|
||||
|
||||
self:CreateRaidIconFrame()
|
||||
|
||||
if DogTag ~= nil then
|
||||
-- DogTag:AddFontString(self.frame.bottomUpperText, self.frame, self.unit, self.moduleSettings.upperText)
|
||||
-- DogTag:AddFontString(self.frame.bottomLowerText, self.frame, self.unit, self.moduleSettings.lowerText)
|
||||
end
|
||||
|
||||
self:Update(self.unit)
|
||||
end
|
||||
|
||||
@ -264,9 +253,7 @@ function TargetHealth.prototype:Update(unit)
|
||||
|
||||
self:UpdateBar(self.health/self.maxHealth, self.color)
|
||||
|
||||
if DogTag ~= nil and false then
|
||||
DogTag:UpdateAllForFrame(self.frame)
|
||||
else
|
||||
if not AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||
self:SetBottomText1(math.floor(self.healthPercentage * 100))
|
||||
|
||||
-- assumption that if a unit's max health is 100, it's not actual amount
|
||||
|
@ -1,7 +1,5 @@
|
||||
local AceOO = AceLibrary("AceOO-2.0")
|
||||
|
||||
local DogTag = nil
|
||||
|
||||
local TargetMana = AceOO.Class(IceUnitBar)
|
||||
|
||||
|
||||
@ -13,10 +11,6 @@ function TargetMana.prototype:init()
|
||||
self:SetDefaultColor("TargetRage", 235, 44, 26)
|
||||
self:SetDefaultColor("TargetEnergy", 228, 242, 31)
|
||||
self:SetDefaultColor("TargetFocus", 242, 149, 98)
|
||||
|
||||
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||
DogTag = AceLibrary("LibDogTag-2.0")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -34,7 +28,7 @@ end
|
||||
|
||||
function TargetMana.prototype:Enable(core)
|
||||
TargetMana.super.prototype.Enable(self, core)
|
||||
|
||||
|
||||
self:RegisterEvent("UNIT_MANA", "Update")
|
||||
self:RegisterEvent("UNIT_MAXMANA", "Update")
|
||||
self:RegisterEvent("UNIT_RAGE", "Update")
|
||||
@ -46,11 +40,6 @@ function TargetMana.prototype:Enable(core)
|
||||
self:RegisterEvent("UNIT_AURA", "Update")
|
||||
self:RegisterEvent("UNIT_FLAGS", "Update")
|
||||
|
||||
if DogTag ~= nil then
|
||||
-- DogTag:AddFontString(self.frame.bottomUpperText, self.frame, self.unit, self.moduleSettings.upperText)
|
||||
-- DogTag:AddFontString(self.frame.bottomLowerText, self.frame, self.unit, self.moduleSettings.lowerText)
|
||||
end
|
||||
|
||||
self:Update("target")
|
||||
end
|
||||
|
||||
@ -90,9 +79,7 @@ function TargetMana.prototype:Update(unit)
|
||||
|
||||
self:UpdateBar(self.mana/self.maxMana, color)
|
||||
|
||||
if DogTag ~= nil and false then
|
||||
DogTag:UpdateAllForFrame(self.frame)
|
||||
else
|
||||
if not AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||
self:SetBottomText1(math.floor(self.manaPercentage * 100))
|
||||
self:SetBottomText2(self:GetFormattedText(self.mana, self.maxMana), color)
|
||||
end
|
||||
|
Reference in New Issue
Block a user