diff --git a/IceHUD.toc b/IceHUD.toc
index 22d91ad..fc69488 100644
--- a/IceHUD.toc
+++ b/IceHUD.toc
@@ -5,8 +5,8 @@
## Notes: Another HUD addon
## Version: 1.2 ($Revision$)
## SavedVariables: IceCoreDB
-## OptionalDeps: Ace2, GratuityLib, LibSharedMedia-3.0, Waterfall-1.0, Deformat, LibDogTag-3.0, LibDogTag-Unit-3.0, LibDruidMana-1.0
-## X-Embeds: Ace2, GratuityLib, LibSharedMedia-3.0, Waterfall-1.0, Deformat, LibDogTag-3.0, LibDogTag-Unit-3.0, LibDruidMana-1.0
+## OptionalDeps: Ace2, LibSharedMedia-3.0, Waterfall-1.0, Deformat, LibDogTag-3.0, LibDogTag-Unit-3.0, LibDruidMana-1.0
+## X-Embeds: Ace2, LibSharedMedia-3.0, Waterfall-1.0, Deformat, LibDogTag-3.0, LibDogTag-Unit-3.0, LibDruidMana-1.0
## X-Category: UnitFrame
## X-Date: $Date$
## X-Website: http://www.wowace.com/forums/index.php/topic,1705.0.html
diff --git a/embeds.xml b/embeds.xml
index 414b385..02b93f4 100644
--- a/embeds.xml
+++ b/embeds.xml
@@ -10,7 +10,6 @@
-
diff --git a/modules/DruidMana.lua b/modules/DruidMana.lua
index 0c5a6f8..cc78f46 100644
--- a/modules/DruidMana.lua
+++ b/modules/DruidMana.lua
@@ -4,14 +4,9 @@ local DruidMana = AceOO.Class(IceUnitBar)
DruidMana.prototype.druidMana = nil
DruidMana.prototype.druidManaMax = nil
-DruidMana.prototype.lastCast = nil
-DruidMana.prototype.baseMana = nil
-local gratuity = nil
local LibDruidMana = nil
-local intMod = 14
-
-- Constructor --
function DruidMana.prototype:init()
@@ -24,8 +19,6 @@ function DruidMana.prototype:init()
if AceLibrary:HasInstance("LibDogTag-3.0") and AceLibrary:HasInstance("LibDruidMana-1.0") then
LibDruidMana = AceLibrary("LibDruidMana-1.0")
- else
- gratuity = AceLibrary("Gratuity-2.0")
end
end
@@ -49,14 +42,7 @@ end
function DruidMana.prototype:Enable(core)
DruidMana.super.prototype.Enable(self, core)
- if not LibDruidMana then
- self:FormsChanged(self.unit)
-
- self:RegisterEvent("UNIT_DISPLAYPOWER", "FormsChanged")
- self:RegisterEvent("UPDATE_SHAPESHIFT_FORM", "FormsChanged")
- self:RegisterEvent("UNIT_MANA", "UpdateMana")
- self:RegisterEvent("UNIT_MAXMANA", "UpdateManaMax")
- else
+ if LibDruidMana then
self:RegisterEvent("UPDATE_SHAPESHIFT_FORM", "Update")
self:RegisterEvent("UNIT_MANA", "Update")
self:RegisterEvent("UNIT_MAXMANA", "Update")
@@ -68,104 +54,6 @@ function DruidMana.prototype:Disable(core)
DruidMana.super.prototype.Disable(self, core)
end
--- Only called if the user doesn't have LibDruidMana installed
-function DruidMana.prototype:FormsChanged(unit)
- if (unit ~= self.unit) then
- return
- end
-
- local forms = (UnitPowerType(self.unit) ~= 0)
-
- if (forms) then
- self.lastCast = GetTime()
-
- if (not self.druidMana or not gratuity) then
- return
- end
-
- -- deduct the shapeshift cost from last known mana value
- -- when we shift to forms
- local uberTooltips = GetCVar("UberTooltips")
- SetCVar("UberTooltips", 1)
-
- gratuity:SetShapeshift(1) -- 1 = bear form, rawr
- local _, _, manaCost = gratuity:Find("(%d+)", 2, 2) -- 2 = mana cost line
-
- self.druidMana = self.druidMana - (manaCost or 0)
-
- SetCVar("UberTooltips", uberTooltips)
- else
- -- always update with actual mana values when shifting out
- self:UpdateMana(self.unit)
- self:UpdateManaMax(self.unit)
-
- local _, intellect, _, _ = UnitStat(self.unit, 4)
- self.baseMana = UnitMana(self.unit) - (intellect * intMod)
- end
-
- self:Update()
-end
-
--- Only called if the user doesn't have LibDruidMana installed
-function DruidMana.prototype:UpdateMana(unit)
- if (unit ~= self.unit) then
- return
- end
-
- local forms = (UnitPowerType(self.unit) ~= 0)
-
- if (forms) then
- if (not self.druidMana or not self.lastCast) then
- return
- end
-
- local time = GetTime()
- local normal, casting = GetManaRegen()
-
- if (time - self.lastCast > 5) then
- self.druidMana = self.druidMana + (normal * 2)
- else
- self.druidMana = self.druidMana + (casting * 2)
- end
-
- -- sanity check, the tick can be off a little sometimes
- if (self.druidMana > self.druidManaMax) then
- self.druidMana = self.druidManaMax
- end
- else
- self.druidMana = UnitMana(self.unit)
- end
-
- self:Update()
-end
-
--- Only called if the user doesn't have LibDruidMana installed
-function DruidMana.prototype:UpdateManaMax(unit)
- if (unit ~= self.unit) then
- return
- end
-
- local forms = (UnitPowerType(self.unit) ~= 0)
-
- if (forms) then
- if not (self.baseMana) then
- return
- end
-
- local _, intellect, _, _ = UnitStat(self.unit, 4)
-
- self.druidManaMax = self.baseMana + (intellect * intMod)
-
- if (self.druidMana > self.druidManaMax) then
- self.druidMana = self.druidManaMax
- end
- else
- self.druidManaMax = UnitManaMax(self.unit)
- end
-
- self:Update()
-end
-
function DruidMana.prototype:Update()
DruidMana.super.prototype.Update(self)
@@ -185,14 +73,6 @@ function DruidMana.prototype:Update()
end
self:UpdateBar(self.druidMana / self.druidManaMax, "DruidMana")
-
- if not LibDruidMana then
- local percentage = (self.druidMana / self.druidManaMax) * 100
-
- self:SetBottomText1(math.floor(percentage))
- self:SetBottomText2(self:GetFormattedText(string.format("%.0f", self.druidMana),
- string.format("%.0f", self.druidManaMax)), "DruidMana")
- end
end