Moved version 0.11 to SVN

This commit is contained in:
iceroth
2006-07-17 13:47:18 +00:00
parent 80a88cfdb1
commit 772fe5a179
19 changed files with 1839 additions and 0 deletions

65
modules/DruidMana.lua Normal file
View File

@ -0,0 +1,65 @@
local AceOO = AceLibrary("AceOO-2.0")
local Metrognome = AceLibrary("Metrognome-2.0")
local DruidMana = AceOO.Class(IceUnitBar)
DruidMana.prototype.inForms = nil
-- Constructor --
function DruidMana.prototype:init()
DruidMana.super.prototype.init(self, "DruidMana", "player")
self.side = IceCore.Side.Right
self.offset = 0
self:SetColor("druidMana", 87, 82, 141)
end
function DruidMana.prototype:Enable()
DruidMana.super.prototype.Enable(self)
if (DruidBar_OnLoad) then
Metrognome:Register("DruidMana", self.Update, 0.1, self)
Metrognome:Start("DruidMana")
end
self:RegisterEvent("UNIT_DISPLAYPOWER", "FormsChanged")
self:Update()
end
function DruidMana.prototype:FormsChanged(unit)
if (unit ~= self.unit) then
return
end
self.inForms = (UnitPowerType(self.unit) ~= 0)
end
function DruidMana.prototype:Update(unit)
if ((not self.alive) or (not self.inForms)) then
self.frame:Hide()
return
else
self.frame:Show()
end
--IceHUD:Debug(self.alive, self.inForms)
local color = "druidMana"
self:UpdateBar(DruidBarKey.keepthemana / DruidBarKey.maxmana, color)
local percentage = DruidBarKey.keepthemana / DruidBarKey.maxmana * 100
self:SetBottomText1(math.floor(percentage))
--self:SetBottomText2(self:GetFormattedText(DruidBarKey.keepthemana, DruidBarKey.maxmana), color)
end
-- Load us up (if we are a druid)
local _, unitClass = UnitClass("player")
if (unitClass == "DRUID") then
DruidMana:new()
end