- Changed to grab the most recent rev of AceGUI and LibDogTag since they have WoW 5.0 fixes that haven't been tagged yet.

- Added MonkManaBar module.
This commit is contained in:
Parnic
2012-07-01 03:11:36 +00:00
parent 0734ddd94c
commit 6b457e2b16
4 changed files with 77 additions and 24 deletions

View File

@ -24,7 +24,6 @@ externals:
tag: latest
libs/AceGUI-3.0:
url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceGUI-3.0
tag: latest
libs/AceGUI-3.0-SharedMediaWidgets:
url: svn://svn.wowace.com/wow/ace-gui-3-0-shared-media-widgets/mainline/trunk/AceGUI-3.0-SharedMediaWidgets
tag: latest
@ -44,10 +43,8 @@ externals:
tag: latest
libs/LibDogTag-3.0:
url: svn://svn.wowace.com/wow/libdogtag-3-0/mainline/trunk
tag: latest
libs/LibDogTag-Unit-3.0:
url: svn://svn.wowace.com/wow/libdogtag-unit-3-0/mainline/trunk
tag: latest
libs/LibDBIcon-1.0:
url: svn://svn.wowace.com/wow/libdbicon-1-0/mainline/trunk/LibDBIcon-1.0
libs/LibDualSpec-1.0:

View File

@ -80,6 +80,7 @@ modules\EclipseBar.lua
modules\Vengeance.lua
modules\PlayerAlternatePower.lua
modules\HarmonyPower.lua
modules\MonkManaBar.lua
#@do-not-package@
IceHUD_Options\Options.lua

53
modules/MonkManaBar.lua Normal file
View File

@ -0,0 +1,53 @@
local MonkManaBar = IceCore_CreateClass(IceHUDPlayerAlternatePower)
function MonkManaBar.prototype:init(moduleName, unit)
MonkManaBar.super.prototype.init(self, "MonkMana", unit)
self.bTreatEmptyAsFull = false
end
function MonkManaBar.prototype:GetDefaultSettings()
local settings = MonkManaBar.super.prototype.GetDefaultSettings(self)
settings["upperText"] = "[PercentMonkMP:Round]"
settings["lowerText"] = "[Concatenate(MonkMP:Short, \"/\", MaxMonkMP:Short):Bracket]"
return settings
end
function MonkManaBar.prototype:GetOptions()
local opts = MonkManaBar.super.prototype.GetOptions(self)
opts.showBlizz = nil
opts.hideBlizz = nil
return opts
end
function MonkManaBar.prototype:Enable(core)
self.specRestriction = SPEC_MONK_MISTWEAVER
self.powerIndex = SPELL_POWER_MANA
self:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED", "CheckShouldShowOnSpecChange")
self:RegisterEvent("UNIT_DISPLAYPOWER", "CheckShouldShowOnSpecChange")
MonkManaBar.super.prototype.Enable(self, core)
self:CheckShouldShowOnSpecChange(nil, self.unit)
end
function MonkManaBar.prototype:CheckShouldShowOnSpecChange(event, unit)
if unit ~= self.unit and event ~= "PLAYER_SPECIALIZATION_CHANGED" then
return
end
if GetSpecialization() == self.specRestriction then
self:PowerBarShow(event, self.unit)
else
self:PowerBarHide(event, self.unit)
end
end
-- Load us up
if select(2, UnitClass("player")) == "MONK" then
IceHUD.MonkManaBar = MonkManaBar:new()
end

View File

@ -1,18 +1,20 @@
local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false)
local PlayerAlternatePower = IceCore_CreateClass(IceUnitBar)
IceHUDPlayerAlternatePower = IceCore_CreateClass(IceUnitBar)
-- Constructor --
function PlayerAlternatePower.prototype:init(moduleName, unit)
PlayerAlternatePower.super.prototype.init(self, "PlayerAlternatePower", "player")
function IceHUDPlayerAlternatePower.prototype:init(moduleName, unit)
IceHUDPlayerAlternatePower.super.prototype.init(self, moduleName or "PlayerAlternatePower", "player")
self.bTreatEmptyAsFull = true
self.power = 0
self.maxPower = 0
self.powerPercent = 0
self.powerIndex = ALTERNATE_POWER_INDEX
self.powerName = "MANA"
end
function PlayerAlternatePower.prototype:GetDefaultSettings()
local settings = PlayerAlternatePower.super.prototype.GetDefaultSettings(self)
function IceHUDPlayerAlternatePower.prototype:GetDefaultSettings()
local settings = IceHUDPlayerAlternatePower.super.prototype.GetDefaultSettings(self)
settings["side"] = IceCore.Side.Left
settings["offset"] = -1
@ -23,8 +25,8 @@ function PlayerAlternatePower.prototype:GetDefaultSettings()
return settings
end
function PlayerAlternatePower.prototype:Enable(core)
PlayerAlternatePower.super.prototype.Enable(self, core)
function IceHUDPlayerAlternatePower.prototype:Enable(core)
IceHUDPlayerAlternatePower.super.prototype.Enable(self, core)
self:RegisterEvent("UNIT_POWER", "UpdateEvent")
self:RegisterEvent("UNIT_MAXPOWER", "UpdateEvent")
@ -41,7 +43,7 @@ function PlayerAlternatePower.prototype:Enable(core)
end
end
function PlayerAlternatePower.prototype:PowerBarShow(event, unit)
function IceHUDPlayerAlternatePower.prototype:PowerBarShow(event, unit)
if unit ~= self.unit then
return
end
@ -50,7 +52,7 @@ function PlayerAlternatePower.prototype:PowerBarShow(event, unit)
self:Update(self.unit)
end
function PlayerAlternatePower.prototype:PowerBarHide(event, unit)
function IceHUDPlayerAlternatePower.prototype:PowerBarHide(event, unit)
if unit ~= self.unit then
return
end
@ -59,18 +61,18 @@ function PlayerAlternatePower.prototype:PowerBarHide(event, unit)
self:Update(self.unit)
end
function PlayerAlternatePower.prototype:UpdateEvent(event, unit)
function IceHUDPlayerAlternatePower.prototype:UpdateEvent(event, unit)
self:Update(unit)
end
function PlayerAlternatePower.prototype:Update(unit)
PlayerAlternatePower.super.prototype.Update(self)
function IceHUDPlayerAlternatePower.prototype:Update(unit)
IceHUDPlayerAlternatePower.super.prototype.Update(self)
if (unit and (unit ~= self.unit)) then
return
end
self.maxPower = UnitPowerMax(self.unit, ALTERNATE_POWER_INDEX)
self.power = UnitPower(self.unit, ALTERNATE_POWER_INDEX)
self.maxPower = UnitPowerMax(self.unit, self.powerIndex)
self.power = UnitPower(self.unit, self.powerIndex)
if self.maxPower > 0 then
self.powerPercent = self.power / self.maxPower
else
@ -79,8 +81,8 @@ function PlayerAlternatePower.prototype:Update(unit)
self:UpdateBar(self.powerPercent)
local texture, r, g, b = UnitAlternatePowerTextureInfo(self.unit, ALT_POWER_TEX_FILL)
self.barFrame.bar:SetVertexColor(r, g, b, self.alpha)
local info = PowerBarColor[self.powerName];
self.barFrame.bar:SetVertexColor(info.r, info.g, info.b, self.alpha)
if not IceHUD.IceCore:ShouldUseDogTags() then
self:SetBottomText1(math.floor(self.powerPercent * 100))
@ -88,8 +90,8 @@ function PlayerAlternatePower.prototype:Update(unit)
end
end
function PlayerAlternatePower.prototype:GetOptions()
local opts = PlayerAlternatePower.super.prototype.GetOptions(self)
function IceHUDPlayerAlternatePower.prototype:GetOptions()
local opts = IceHUDPlayerAlternatePower.super.prototype.GetOptions(self)
opts["lowThresholdColor"] = nil
@ -117,15 +119,15 @@ function PlayerAlternatePower.prototype:GetOptions()
return opts
end
function PlayerAlternatePower.prototype:ShowBlizz()
function IceHUDPlayerAlternatePower.prototype:ShowBlizz()
PlayerPowerBarAlt:GetScript("OnLoad")(PlayerPowerBarAlt)
end
function PlayerAlternatePower.prototype:HideBlizz()
function IceHUDPlayerAlternatePower.prototype:HideBlizz()
PlayerPowerBarAlt:Hide()
PlayerPowerBarAlt:UnregisterAllEvents()
end
-- Load us up
IceHUD.PlayerAlternatePower = PlayerAlternatePower:new()
IceHUD.PlayerAlternatePower = IceHUDPlayerAlternatePower:new()