mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
- removed dependency on LibDogTag-2.0 by request. DogTag formatting is available if DogTag is present but IceHUD will use the old formatting otherwise
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
local AceOO = AceLibrary("AceOO-2.0")
|
local AceOO = AceLibrary("AceOO-2.0")
|
||||||
local DogTag = AceLibrary("LibDogTag-2.0")
|
|
||||||
|
local DogTag = nil
|
||||||
|
|
||||||
IceBarElement = AceOO.Class(IceElement)
|
IceBarElement = AceOO.Class(IceElement)
|
||||||
IceBarElement.virtual = true
|
IceBarElement.virtual = true
|
||||||
@ -16,6 +17,10 @@ IceBarElement.prototype.target = nil
|
|||||||
-- Constructor --
|
-- Constructor --
|
||||||
function IceBarElement.prototype:init(name)
|
function IceBarElement.prototype:init(name)
|
||||||
IceBarElement.super.prototype.init(self, name)
|
IceBarElement.super.prototype.init(self, name)
|
||||||
|
|
||||||
|
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||||
|
DogTag = AceLibrary("LibDogTag-2.0")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -239,11 +244,14 @@ function IceBarElement.prototype:GetOptions()
|
|||||||
type = 'text',
|
type = 'text',
|
||||||
name = 'Upper 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/ for tag info',
|
||||||
|
disabled = function()
|
||||||
|
return DogTag == nil
|
||||||
|
end,
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.upperText
|
return self.moduleSettings.upperText
|
||||||
end,
|
end,
|
||||||
set = function(v)
|
set = function(v)
|
||||||
if v ~= '' and v ~= nil then
|
if DogTag ~= nil and v ~= '' and v ~= nil then
|
||||||
v = DogTag:FixCasing(v)
|
v = DogTag:FixCasing(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -256,11 +264,14 @@ function IceBarElement.prototype:GetOptions()
|
|||||||
type = 'text',
|
type = 'text',
|
||||||
name = 'Lower 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/ for tag info',
|
||||||
|
disabled = function()
|
||||||
|
return DogTag == nil
|
||||||
|
end,
|
||||||
get = function()
|
get = function()
|
||||||
return self.moduleSettings.lowerText
|
return self.moduleSettings.lowerText
|
||||||
end,
|
end,
|
||||||
set = function(v)
|
set = function(v)
|
||||||
if v ~= '' and v ~= nil then
|
if DogTag ~= nil and v ~= '' and v ~= nil then
|
||||||
v = DogTag:FixCasing(v)
|
v = DogTag:FixCasing(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
local AceOO = AceLibrary("AceOO-2.0")
|
local AceOO = AceLibrary("AceOO-2.0")
|
||||||
local DogTag = AceLibrary("LibDogTag-2.0")
|
|
||||||
|
local DogTag = nil
|
||||||
|
|
||||||
local PetHealth = AceOO.Class(IceUnitBar)
|
local PetHealth = AceOO.Class(IceUnitBar)
|
||||||
|
|
||||||
@ -15,6 +16,10 @@ function PetHealth.prototype:init()
|
|||||||
self:SetDefaultColor("PetHealthUnhappy", 164, 30, 30)
|
self:SetDefaultColor("PetHealthUnhappy", 164, 30, 30)
|
||||||
|
|
||||||
self.scalingEnabled = true
|
self.scalingEnabled = true
|
||||||
|
|
||||||
|
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||||
|
DogTag = AceLibrary("LibDogTag-2.0")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -110,11 +115,15 @@ function PetHealth.prototype:Update(unit)
|
|||||||
|
|
||||||
self:UpdateBar(self.health/self.maxHealth, color)
|
self:UpdateBar(self.health/self.maxHealth, color)
|
||||||
|
|
||||||
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
|
if DogTag ~= nil then
|
||||||
self:SetBottomText1(DogTag:Evaluate("pet", self.moduleSettings.upperText))
|
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
|
||||||
end
|
self:SetBottomText1(DogTag:Evaluate("pet", self.moduleSettings.upperText))
|
||||||
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
|
end
|
||||||
self:SetBottomText2(DogTag:Evaluate("pet", self.moduleSettings.lowerText))
|
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
|
||||||
|
self:SetBottomText2(DogTag:Evaluate("pet", self.moduleSettings.lowerText))
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self:SetBottomText1(self.healthPercentage)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
local AceOO = AceLibrary("AceOO-2.0")
|
local AceOO = AceLibrary("AceOO-2.0")
|
||||||
local DogTag = AceLibrary("LibDogTag-2.0")
|
|
||||||
|
local DogTag = nil
|
||||||
|
|
||||||
local PetMana = AceOO.Class(IceUnitBar)
|
local PetMana = AceOO.Class(IceUnitBar)
|
||||||
|
|
||||||
@ -13,6 +14,10 @@ function PetMana.prototype:init()
|
|||||||
self:SetDefaultColor("PetFocus", 242, 149, 98)
|
self:SetDefaultColor("PetFocus", 242, 149, 98)
|
||||||
|
|
||||||
self.scalingEnabled = true
|
self.scalingEnabled = true
|
||||||
|
|
||||||
|
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||||
|
DogTag = AceLibrary("LibDogTag-2.0")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -121,11 +126,15 @@ function PetMana.prototype:Update(unit)
|
|||||||
|
|
||||||
self:UpdateBar(self.mana/self.maxMana, color)
|
self:UpdateBar(self.mana/self.maxMana, color)
|
||||||
|
|
||||||
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
|
if DogTag ~= nil then
|
||||||
self:SetBottomText1(DogTag:Evaluate("player", self.moduleSettings.upperText))
|
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
|
||||||
end
|
self:SetBottomText1(DogTag:Evaluate("player", self.moduleSettings.upperText))
|
||||||
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
|
end
|
||||||
self:SetBottomText2(DogTag:Evaluate("player", self.moduleSettings.lowerText))
|
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
|
||||||
|
self:SetBottomText2(DogTag:Evaluate("player", self.moduleSettings.lowerText))
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self:SetBottomText1(self.manaPercentage)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
local AceOO = AceLibrary("AceOO-2.0")
|
local AceOO = AceLibrary("AceOO-2.0")
|
||||||
local DogTag = AceLibrary("LibDogTag-2.0")
|
|
||||||
|
local DogTag = nil
|
||||||
|
|
||||||
local PlayerHealth = AceOO.Class(IceUnitBar)
|
local PlayerHealth = AceOO.Class(IceUnitBar)
|
||||||
|
|
||||||
@ -10,6 +11,10 @@ function PlayerHealth.prototype:init()
|
|||||||
PlayerHealth.super.prototype.init(self, "PlayerHealth", "player")
|
PlayerHealth.super.prototype.init(self, "PlayerHealth", "player")
|
||||||
|
|
||||||
self:SetDefaultColor("PlayerHealth", 37, 164, 30)
|
self:SetDefaultColor("PlayerHealth", 37, 164, 30)
|
||||||
|
|
||||||
|
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||||
|
DogTag = AceLibrary("LibDogTag-2.0")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -140,11 +145,16 @@ function PlayerHealth.prototype:Update(unit)
|
|||||||
|
|
||||||
self:UpdateBar(self.health/self.maxHealth, color)
|
self:UpdateBar(self.health/self.maxHealth, color)
|
||||||
|
|
||||||
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
|
if DogTag ~= nil then
|
||||||
self:SetBottomText1(DogTag:Evaluate("player", self.moduleSettings.upperText))
|
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
|
||||||
end
|
self:SetBottomText1(DogTag:Evaluate("player", self.moduleSettings.upperText))
|
||||||
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
|
end
|
||||||
self:SetBottomText2(DogTag:Evaluate("player", self.moduleSettings.lowerText))
|
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
|
||||||
|
self:SetBottomText2(DogTag:Evaluate("player", self.moduleSettings.lowerText))
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self:SetBottomText1(self.healthPercentage)
|
||||||
|
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), textColor)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
local AceOO = AceLibrary("AceOO-2.0")
|
local AceOO = AceLibrary("AceOO-2.0")
|
||||||
local DogTag = AceLibrary("LibDogTag-2.0")
|
|
||||||
|
local DogTag = nil
|
||||||
|
|
||||||
local PlayerMana = AceOO.Class(IceUnitBar)
|
local PlayerMana = AceOO.Class(IceUnitBar)
|
||||||
|
|
||||||
@ -14,6 +15,10 @@ function PlayerMana.prototype:init()
|
|||||||
self:SetDefaultColor("PlayerMana", 62, 54, 152)
|
self:SetDefaultColor("PlayerMana", 62, 54, 152)
|
||||||
self:SetDefaultColor("PlayerRage", 171, 59, 59)
|
self:SetDefaultColor("PlayerRage", 171, 59, 59)
|
||||||
self:SetDefaultColor("PlayerEnergy", 218, 231, 31)
|
self:SetDefaultColor("PlayerEnergy", 218, 231, 31)
|
||||||
|
|
||||||
|
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||||
|
DogTag = AceLibrary("LibDogTag-2.0")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -186,29 +191,29 @@ function PlayerMana.prototype:Update(unit)
|
|||||||
self.tickerFrame:SetStatusBarColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha))
|
self.tickerFrame:SetStatusBarColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha))
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
if DogTag ~= nil then
|
||||||
-- extra hack for whiny rogues (are there other kind?)
|
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
|
||||||
local displayPercentage = self.manaPercentage
|
self:SetBottomText1(DogTag:Evaluate("player", self.moduleSettings.upperText))
|
||||||
if (self.manaType == 3) then
|
end
|
||||||
displayPercentage = self.mana
|
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
|
||||||
end
|
self:SetBottomText2(DogTag:Evaluate("player", self.moduleSettings.lowerText))
|
||||||
self:SetBottomText1(displayPercentage)
|
end
|
||||||
|
else
|
||||||
|
-- extra hack for whiny rogues (are there other kind?)
|
||||||
|
local displayPercentage = self.manaPercentage
|
||||||
|
if (self.manaType == 3) then
|
||||||
|
displayPercentage = self.mana
|
||||||
|
end
|
||||||
|
self:SetBottomText1(displayPercentage)
|
||||||
|
|
||||||
|
|
||||||
local amount = self:GetFormattedText(self.mana, self.maxMana)
|
local amount = self:GetFormattedText(self.mana, self.maxMana)
|
||||||
|
|
||||||
-- druids get a little shorted string to make room for druid mana in forms
|
-- druids get a little shorted string to make room for druid mana in forms
|
||||||
if (self.unitClass == "DRUID" and self.manaType ~= 0) then
|
if (self.unitClass == "DRUID" and self.manaType ~= 0) then
|
||||||
amount = self:GetFormattedText(self.mana)
|
amount = self:GetFormattedText(self.mana)
|
||||||
end
|
end
|
||||||
self:SetBottomText2(amount, color)
|
self:SetBottomText2(amount, color)
|
||||||
]]
|
|
||||||
|
|
||||||
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
|
|
||||||
self:SetBottomText1(DogTag:Evaluate("player", self.moduleSettings.upperText))
|
|
||||||
end
|
|
||||||
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
|
|
||||||
self:SetBottomText2(DogTag:Evaluate("player", self.moduleSettings.lowerText))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
local AceOO = AceLibrary("AceOO-2.0")
|
local AceOO = AceLibrary("AceOO-2.0")
|
||||||
local DogTag = AceLibrary("LibDogTag-2.0")
|
|
||||||
|
local DogTag = nil
|
||||||
|
|
||||||
local TargetHealth = AceOO.Class(IceUnitBar)
|
local TargetHealth = AceOO.Class(IceUnitBar)
|
||||||
|
|
||||||
@ -13,6 +14,10 @@ function TargetHealth.prototype:init()
|
|||||||
self:SetDefaultColor("TargetHealthHostile", 231, 31, 36)
|
self:SetDefaultColor("TargetHealthHostile", 231, 31, 36)
|
||||||
self:SetDefaultColor("TargetHealthFriendly", 46, 223, 37)
|
self:SetDefaultColor("TargetHealthFriendly", 46, 223, 37)
|
||||||
self:SetDefaultColor("TargetHealthNeutral", 210, 219, 87)
|
self:SetDefaultColor("TargetHealthNeutral", 210, 219, 87)
|
||||||
|
|
||||||
|
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||||
|
DogTag = AceLibrary("LibDogTag-2.0")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -168,33 +173,32 @@ function TargetHealth.prototype:Update(unit)
|
|||||||
end
|
end
|
||||||
|
|
||||||
self:UpdateBar(self.health/self.maxHealth, self.color)
|
self:UpdateBar(self.health/self.maxHealth, self.color)
|
||||||
--[[
|
|
||||||
self:SetBottomText1(self.healthPercentage)
|
|
||||||
|
|
||||||
|
if DogTag ~= nil then
|
||||||
-- assumption that if a unit's max health is 100, it's not actual amount
|
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
|
||||||
-- but rather a percentage - this obviously has one caveat though
|
self:SetBottomText1(DogTag:Evaluate("target", self.moduleSettings.upperText))
|
||||||
|
end
|
||||||
if (self.maxHealth == 100 and self.moduleSettings.mobhealth and MobHealth3) then
|
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
|
||||||
self.health, self.maxHealth, _ = MobHealth3:GetUnitHealth(self.unit, self.health, self.maxHealth)
|
self:SetBottomText2(DogTag:Evaluate("target", self.moduleSettings.lowerText))
|
||||||
|
end
|
||||||
self.health = self:Round(self.health)
|
|
||||||
self.maxHealth = self:Round(self.maxHealth)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
if (self.maxHealth ~= 100) then
|
|
||||||
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), self.color)
|
|
||||||
else
|
else
|
||||||
self:SetBottomText2()
|
self:SetBottomText1(self.healthPercentage)
|
||||||
end
|
|
||||||
]]
|
|
||||||
|
|
||||||
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
|
-- assumption that if a unit's max health is 100, it's not actual amount
|
||||||
self:SetBottomText1(DogTag:Evaluate("target", self.moduleSettings.upperText))
|
-- but rather a percentage - this obviously has one caveat though
|
||||||
end
|
|
||||||
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
|
if (self.maxHealth == 100 and self.moduleSettings.mobhealth and MobHealth3) then
|
||||||
self:SetBottomText2(DogTag:Evaluate("target", self.moduleSettings.lowerText))
|
self.health, self.maxHealth, _ = MobHealth3:GetUnitHealth(self.unit, self.health, self.maxHealth)
|
||||||
|
|
||||||
|
self.health = self:Round(self.health)
|
||||||
|
self.maxHealth = self:Round(self.maxHealth)
|
||||||
|
end
|
||||||
|
|
||||||
|
if (self.maxHealth ~= 100) then
|
||||||
|
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), self.color)
|
||||||
|
else
|
||||||
|
self:SetBottomText2()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
local AceOO = AceLibrary("AceOO-2.0")
|
local AceOO = AceLibrary("AceOO-2.0")
|
||||||
local DogTag = AceLibrary("LibDogTag-2.0")
|
|
||||||
|
local DogTag = nil
|
||||||
|
|
||||||
local TargetMana = AceOO.Class(IceUnitBar)
|
local TargetMana = AceOO.Class(IceUnitBar)
|
||||||
|
|
||||||
@ -12,6 +13,10 @@ function TargetMana.prototype:init()
|
|||||||
self:SetDefaultColor("TargetRage", 235, 44, 26)
|
self:SetDefaultColor("TargetRage", 235, 44, 26)
|
||||||
self:SetDefaultColor("TargetEnergy", 228, 242, 31)
|
self:SetDefaultColor("TargetEnergy", 228, 242, 31)
|
||||||
self:SetDefaultColor("TargetFocus", 242, 149, 98)
|
self:SetDefaultColor("TargetFocus", 242, 149, 98)
|
||||||
|
|
||||||
|
if AceLibrary:HasInstance("LibDogTag-2.0") then
|
||||||
|
DogTag = AceLibrary("LibDogTag-2.0")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -80,14 +85,16 @@ function TargetMana.prototype:Update(unit)
|
|||||||
|
|
||||||
self:UpdateBar(self.mana/self.maxMana, color)
|
self:UpdateBar(self.mana/self.maxMana, color)
|
||||||
|
|
||||||
-- self:SetBottomText1(self.manaPercentage)
|
if DogTag ~= nil then
|
||||||
-- self:SetBottomText2(self:GetFormattedText(self.mana, self.maxMana), color)
|
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
|
||||||
|
self:SetBottomText1(DogTag:Evaluate("target", self.moduleSettings.upperText))
|
||||||
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
|
end
|
||||||
self:SetBottomText1(DogTag:Evaluate("target", self.moduleSettings.upperText))
|
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
|
||||||
end
|
self:SetBottomText2(DogTag:Evaluate("target", self.moduleSettings.lowerText))
|
||||||
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
|
end
|
||||||
self:SetBottomText2(DogTag:Evaluate("target", self.moduleSettings.lowerText))
|
else
|
||||||
|
self:SetBottomText1(self.manaPercentage)
|
||||||
|
self:SetBottomText2(self:GetFormattedText(self.mana, self.maxMana), color)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user