mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
v1.3.3-Release
- interface version up to 3.0! hooray new stuff. - mod version bumped to 1.3.3 for all the new stuff and 3.0 client compatibility - made the threat module wow 3.0-compatible (these changes do not branch based on interface version due to the removal of lots of libs...there's no goin' back now!) - fixed text display on threat module to actually show threat % as intended - extracted MathRound function to make it accessible to all modules instead of being embedded within TargetHealth - added a few more user-submitted bar textures - removed LibDruidMana and fixed up DruidMana module to work with the new UnitPower API
This commit is contained in:
@ -5,8 +5,6 @@ local DruidMana = AceOO.Class(IceUnitBar)
|
||||
DruidMana.prototype.druidMana = nil
|
||||
DruidMana.prototype.druidManaMax = nil
|
||||
|
||||
local LibDruidMana = nil
|
||||
|
||||
|
||||
-- Constructor --
|
||||
function DruidMana.prototype:init()
|
||||
@ -16,10 +14,6 @@ function DruidMana.prototype:init()
|
||||
self.offset = 0
|
||||
|
||||
self:SetDefaultColor("DruidMana", 87, 82, 141)
|
||||
|
||||
if AceLibrary:HasInstance("LibDogTag-3.0") and AceLibrary:HasInstance("LibDruidMana-1.0") then
|
||||
LibDruidMana = AceLibrary("LibDruidMana-1.0")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -29,11 +23,8 @@ function DruidMana.prototype:GetDefaultSettings()
|
||||
settings["side"] = IceCore.Side.Right
|
||||
settings["offset"] = 0
|
||||
settings["textVisible"] = {upper = true, lower = false}
|
||||
|
||||
if LibDruidMana then
|
||||
settings["upperText"] = "[PercentDruidMP:Round]"
|
||||
settings["lowerText"] = "[FractionalDruidMP:Color('3071bf'):Bracket]"
|
||||
end
|
||||
settings["upperText"] = "[PercentDruidMP:Round]"
|
||||
settings["lowerText"] = "[FractionalDruidMP:Color('3071bf'):Bracket]"
|
||||
|
||||
return settings
|
||||
end
|
||||
@ -42,19 +33,17 @@ end
|
||||
function DruidMana.prototype:Enable(core)
|
||||
DruidMana.super.prototype.Enable(self, core)
|
||||
|
||||
if LibDruidMana then
|
||||
self:RegisterEvent("UPDATE_SHAPESHIFT_FORM", "Update")
|
||||
self:RegisterEvent("UNIT_MAXMANA", "Update")
|
||||
self:RegisterEvent("UPDATE_SHAPESHIFT_FORM", "Update")
|
||||
self:RegisterEvent("UNIT_MAXMANA", "Update")
|
||||
|
||||
if IceHUD.WowVer >= 30000 then
|
||||
if GetCVarBool("predictedPower") and self.frame then
|
||||
self.frame:SetScript("OnUpdate", function() self:Update(self.unit) end)
|
||||
else
|
||||
self:RegisterEvent("UNIT_MANA", "Update")
|
||||
end
|
||||
if IceHUD.WowVer >= 30000 then
|
||||
if GetCVarBool("predictedPower") and self.frame then
|
||||
self.frame:SetScript("OnUpdate", function() self:Update() end)
|
||||
else
|
||||
self:RegisterEvent("UNIT_MANA", "Update")
|
||||
end
|
||||
else
|
||||
self:RegisterEvent("UNIT_MANA", "Update")
|
||||
end
|
||||
end
|
||||
|
||||
@ -69,10 +58,8 @@ function DruidMana.prototype:Update()
|
||||
|
||||
local forms = (UnitPowerType(self.unit) ~= 0)
|
||||
|
||||
if LibDruidMana then
|
||||
self.druidMana = LibDruidMana:GetCurrentMana()
|
||||
self.druidManaMax = LibDruidMana:GetMaximumMana()
|
||||
end
|
||||
self.druidMana = UnitPower(self.unit, 0)
|
||||
self.druidManaMax = UnitPowerMax(self.unit, 0)
|
||||
|
||||
if (not self.alive or not forms or not self.druidMana or not self.druidManaMax or self.druidManaMax == 0) then
|
||||
self:Show(false)
|
||||
|
Reference in New Issue
Block a user