- Created Monk Harmony Power module.

- Added localization to HolyPower module description.
- Fixed a comment in the Shard module.
This commit is contained in:
Parnic
2012-06-30 22:30:54 +00:00
parent feb7a3390b
commit 0734ddd94c
4 changed files with 87 additions and 2 deletions

View File

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

84
modules/HarmonyPower.lua Normal file
View File

@ -0,0 +1,84 @@
local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false)
local HarmonyPower = IceCore_CreateClass(IceClassPowerCounter)
function HarmonyPower.prototype:init()
HarmonyPower.super.prototype.init(self, "HarmonyPower")
self:SetDefaultColor("HarmonyPowerNumeric", 218, 231, 31)
-- pulled from MonkHarmonyBar.xml in Blizzard's UI source
self.runeCoords =
{
{0.00390625, 0.08593750, 0.71093750, 0.87500000},
{0.00390625, 0.08593750, 0.71093750, 0.87500000},
{0.00390625, 0.08593750, 0.71093750, 0.87500000},
{0.00390625, 0.08593750, 0.71093750, 0.87500000},
{0.00390625, 0.08593750, 0.71093750, 0.87500000},
}
self.numRunes = 4
self.numericColor = "HarmonyPowerNumeric"
self.unitPower = SPELL_POWER_LIGHT_FORCE
self.minLevel = MONKHARMONYBAR_SHOW_LEVEL
self.bTreatEmptyAsFull = true
self.unit = "player"
self.runeWidth = self.runeHeight
end
function HarmonyPower.prototype:UpdateRunePower()
local numRunes = UnitPowerMax(self.unit, self.unitPower)
if self.fakeNumRunes ~= nil and self.fakeNumRunes > 0 then
numRunes = self.fakeNumRunes
end
if numRunes ~= self.numRunes then
if numRunes < self.numRunes and #self.frame.graphical >= numRunes then
for i=numRunes + 1, #self.frame.graphical do
self.frame.graphical[i]:Hide()
end
end
self.numRunes = numRunes
self:CreateRuneFrame()
local width = self.runeHeight
if self.moduleSettings.runeMode == "Graphical" then
width = self.runeWidth
end
self.frame:SetWidth(width*self.numRunes)
end
HarmonyPower.super.prototype.UpdateRunePower(self)
end
function HarmonyPower.prototype:GetOptions()
local opts = HarmonyPower.super.prototype.GetOptions(self)
opts.hideBlizz.desc = L["Hides Blizzard Harmony Power frame and disables all events related to it.\n\nNOTE: Blizzard attaches the harmony power UI to the player's unitframe, so if you have that hidden in PlayerHealth, then this won't do anything."]
return opts
end
function HarmonyPower.prototype:GetRuneTexture(rune)
if not rune or rune ~= tonumber(rune) then
return
end
return "Interface\\PlayerFrame\\MonkUI"
end
function HarmonyPower.prototype:ShowBlizz()
MonkHarmonyBar:Show()
MonkHarmonyBar:GetScript("OnLoad")(MonkHarmonyBar)
end
function HarmonyPower.prototype:HideBlizz()
MonkHarmonyBar:Hide()
MonkHarmonyBar:UnregisterAllEvents()
end
-- Load us up
local _, unitClass = UnitClass("player")
if (unitClass == "MONK" and IceHUD.WowVer >= 50000) then
IceHUD.HarmonyPower = HarmonyPower:new()
end

View File

@ -22,7 +22,7 @@ end
function HolyPower.prototype:GetOptions()
local opts = HolyPower.super.prototype.GetOptions(self)
opts.hideBlizz.desc = "Hides Blizzard Holy Power frame and disables all events related to it.\n\nNOTE: Blizzard attaches the holy power UI to the player's unitframe, so if you have that hidden in PlayerHealth, then this won't do anything."
opts.hideBlizz.desc = L["Hides Blizzard Holy Power frame and disables all events related to it.\n\nNOTE: Blizzard attaches the holy power UI to the player's unitframe, so if you have that hidden in PlayerHealth, then this won't do anything."]
return opts
end

View File

@ -6,7 +6,7 @@ function ShardCounter.prototype:init()
self:SetDefaultColor("ShardCounterNumeric", 218, 231, 31)
-- pulled from PaladinPowerBar.xml in Blizzard's UI source
-- pulled from ShardBar.xml in Blizzard's UI source
self.runeCoords =
{
{0.01562500, 0.28125000, 0.00781250, 0.13281250},