Version 0.7

- Added an option to change the bar colors
- Using scheduled events now instead of Metrognome
- Some small bug fixes
This commit is contained in:
iceroth
2006-09-24 14:41:55 +00:00
parent 4a0991adac
commit fdbb8843ee
19 changed files with 178 additions and 112 deletions

View File

@ -15,8 +15,6 @@ IceBarElement.prototype.target = nil
-- Constructor --
function IceBarElement.prototype:init(name)
IceBarElement.super.prototype.init(self, name)
self:SetColor("background", 50, 50, 50)
end
@ -40,7 +38,7 @@ function IceBarElement.prototype:GetDefaultSettings()
settings["side"] = IceCore.Side.Left
settings["offset"] = 1
settings["barFontSize"] = 13
settings["barFontSize"] = 12
settings["barFontBold"] = true
settings["lockTextAlpha"] = true
settings["textVisible"] = {upper = true, lower = true}
@ -421,7 +419,7 @@ function IceBarElement.prototype:SetBottomText1(text, color)
end
if not (color) then
color = "text"
color = "Text"
end
local alpha = self.alpha
@ -451,7 +449,7 @@ function IceBarElement.prototype:SetBottomText2(text, color, alpha)
end
if not (color) then
color = "text"
color = "Text"
end
if not (alpha) then
-- boost text alpha a bit to make it easier to see

View File

@ -36,7 +36,7 @@ function IceCore.prototype:init()
local defaults = {
gap = 150,
verticalPos = -150,
scale = 1,
scale = 0.9,
alphaooc = 0.3,
alphaic = 0.6,
@ -47,7 +47,7 @@ function IceCore.prototype:init()
alphaTargetbg = 0.25,
backgroundToggle = false,
backgroundColor = {r = 0.2, g = 0.2, b = 0.2},
backgroundColor = {r = 0.5, g = 0.5, b = 0.5},
barTexture = "Bar",
barPreset = defaultPreset,
fontFamily = "IceHUD",
@ -66,6 +66,11 @@ function IceCore.prototype:init()
defaults.modules[name] = self.elements[i]:GetDefaultSettings()
end
if (table.getn(self.elements) > 0) then
defaults.colors = self.elements[1].defaultColors
end
self:RegisterDefaults('account', defaults)
end
@ -124,6 +129,7 @@ end
function IceCore.prototype:GetModuleOptions()
local options = {}
for i = 1, table.getn(self.elements) do
local modName = self.elements[i]:GetElementName()
local opt = self.elements[i]:GetOptions()
@ -139,6 +145,31 @@ function IceCore.prototype:GetModuleOptions()
end
function IceCore.prototype:GetColorOptions()
assert(table.getn(IceHUD.IceCore.elements) > 0, "Unable to get color options, no elements found!")
local options = {}
for k, v in pairs(self.elements[1]:GetColors()) do
local kk, vv = k, v
options[k] = {
type = 'color',
desc = k,
name = k,
get = function()
return IceHUD.IceCore:GetColor(kk)
end,
set = function(r, g, b)
local color = k
IceHUD.IceCore:SetColor(kk, r, g, b)
end
}
end
return options
end
-- Method to handle module registration
function IceCore.prototype:Register(element)
assert(element, "Trying to register a nil module")
@ -330,6 +361,19 @@ function IceCore.prototype:SetDebug(value)
end
function IceCore.prototype:GetColor(color)
return self.settings.colors[color].r,
self.settings.colors[color].g,
self.settings.colors[color].b
end
function IceCore.prototype:SetColor(color, r, g, b)
self.settings.colors[color].r = r
self.settings.colors[color].g = g
self.settings.colors[color].b = b
self:Redraw()
end
-------------------------------------------------------------------------------

View File

@ -10,7 +10,7 @@ IceElement.prototype.elementName = nil
IceElement.prototype.parent = nil
IceElement.prototype.frame = nil
IceElement.prototype.colors = {} -- Shared table for all child classes to save some memory
IceElement.prototype.defaultColors = {} -- Shared table for all child classes to save some memory
IceElement.prototype.alpha = nil
IceElement.settings = nil
@ -32,8 +32,8 @@ function IceElement.prototype:init(name)
self.scalingEnabled = false
-- Some common colors
self:SetColor("text", 1, 1, 1)
self:SetColor("undef", 0.7, 0.7, 0.7)
self:SetDefaultColor("Text", 1, 1, 1)
self:SetDefaultColor("undef", 0.7, 0.7, 0.7)
self:RegisterEvent(IceCore.Loaded, "OnCoreLoad")
end
@ -170,6 +170,11 @@ function IceElement.prototype:CreateFrame()
end
function IceElement.prototype:GetColors()
return self.settings.colors
end
function IceElement.prototype:GetColor(color, alpha)
if not (color) then
return 1, 1, 1, 1
@ -179,12 +184,12 @@ function IceElement.prototype:GetColor(color, alpha)
alpha = self.alpha
end
if not (self.colors[color]) then
if not (self.settings.colors[color]) then
local r, g, b = self:GetClassColor(color)
return r, g, b, alpha
end
return self.colors[color].r, self.colors[color].g, self.colors[color].b, alpha
return self.settings.colors[color].r, self.settings.colors[color].g, self.settings.colors[color].b, alpha
end
@ -204,7 +209,22 @@ function IceElement.prototype:SetColor(color, red, green, blue)
if (blue > 1) then
blue = blue / 255
end
self.colors[color] = {r = red, g = green, b = blue}
self.settings.colors[color] = {r = red, g = green, b = blue}
end
function IceElement.prototype:SetDefaultColor(color, red, green, blue)
if (red > 1) then
red = red / 255
end
if (green > 1) then
green = green / 255
end
if (blue > 1) then
blue = blue / 255
end
self.defaultColors[color] = {r = red, g = green, b = blue}
end

View File

@ -373,6 +373,13 @@ IceHUD.options =
order = 41
},
colors = {
type='group',
desc = 'Module color configuration options',
name = 'Colors',
args = {},
order = 42
},
headerOtherBlank = { type = 'header', name = ' ', order = 90 },
headerOther = {
@ -478,17 +485,22 @@ function IceHUD:OnInitialize()
self.IceCore = IceCore:new()
self.options.args.modules.args = self.IceCore:GetModuleOptions()
self:RegisterChatCommand({ "/icehud" }, IceHUD.slashMenu)
end
function IceHUD:OnEnable()
self:Debug("IceHUD:OnEnable()")
self.IceCore:Enable()
self:SetDebugging(self.IceCore:GetDebug())
self.debugFrame = ChatFrame2
self.options.args.modules.args = self.IceCore:GetModuleOptions()
self.options.args.colors.args = self.IceCore:GetColorOptions()
self:RegisterChatCommand({ "/icehud" }, IceHUD.slashMenu)
end

View File

@ -3,7 +3,7 @@
## Name: IceHUD
## Title: IceHUD |cff7fff7f -Ace2-|r
## Notes: Another HUD mod
## Version: 0.6.6 ($Revision$)
## Version: 0.7 ($Revision$)
## SavedVariables: IceCoreDB
## OptionalDeps: Ace2, DewdropLib, FuBar_ToFu, DruidBar, SoleManax, MobHealth, SpellStatusLib
## X-Category: UnitFrame
@ -21,7 +21,6 @@ libs\AceDebug-2.0\AceDebug-2.0.lua
libs\AceLocale-2.0\AceLocale-2.0.lua
libs\AceConsole-2.0\AceConsole-2.0.lua
libs\AceAddon-2.0\AceAddon-2.0.lua
libs\Metrognome-2.0\Metrognome-2.0.lua
libs\Dewdrop-2.0\Dewdrop-2.0.lua
libs\Deformat-2.0\Deformat-2.0.lua
libs\Gratuity-2.0\Gratuity-2.0.lua

View File

@ -28,8 +28,8 @@ function IceUnitBar.prototype:init(name, unit)
self.unit = unit
_, self.unitClass = UnitClass(self.unit)
self:SetColor("dead", 0.5, 0.5, 0.5)
self:SetColor("tapped", 0.8, 0.8, 0.8)
self:SetDefaultColor("Dead", 0.5, 0.5, 0.5)
self:SetDefaultColor("Tapped", 0.8, 0.8, 0.8)
end

View File

@ -17,10 +17,10 @@ CastBar.prototype.actionMessage = nil
function CastBar.prototype:init()
CastBar.super.prototype.init(self, "CastBar")
self:SetColor("castCasting", 242, 242, 10)
self:SetColor("castChanneling", 117, 113, 161)
self:SetColor("castSuccess", 242, 242, 70)
self:SetColor("castFail", 1, 0, 0)
self:SetDefaultColor("CastCasting", 242, 242, 10)
self:SetDefaultColor("CastChanneling", 117, 113, 161)
self:SetDefaultColor("CastSuccess", 242, 242, 70)
self:SetDefaultColor("CastFail", 1, 0, 0)
self.delay = 0
self.action = CastBar.Actions.None
@ -36,7 +36,7 @@ function CastBar.prototype:GetDefaultSettings()
settings["side"] = IceCore.Side.Left
settings["offset"] = 0
settings["flashInstants"] = "Caster"
settings["flashFailures"] = true
settings["flashFailures"] = "Caster"
return settings
end
@ -165,7 +165,7 @@ function CastBar.prototype:OnUpdate()
scale = scale > 1 and 1 or scale
scale = scale < 0 and 0 or scale
self:UpdateBar(scale, "castCasting")
self:UpdateBar(scale, "CastCasting")
self:SetBottomText1(string.format("%.1fs %s%s", remainingTime , spellName, spellRankShort))
return
@ -188,7 +188,7 @@ function CastBar.prototype:OnUpdate()
return
end
self:FlashBar("castSuccess", 1-instanting, spellName .. spellRankShort)
self:FlashBar("CastSuccess", 1-instanting, spellName .. spellRankShort)
return
end
@ -202,7 +202,7 @@ function CastBar.prototype:OnUpdate()
return
end
self:FlashBar("castFail", 1-failing, self.actionMessage, "castFail")
self:FlashBar("CastFail", 1-failing, self.actionMessage, "CastFail")
return
end
@ -219,7 +219,7 @@ function CastBar.prototype:OnUpdate()
return
end
self:FlashBar("castSuccess", 1-succeeding)
self:FlashBar("CastSuccess", 1-succeeding)
return
end
@ -240,7 +240,7 @@ function CastBar.prototype:FlashBar(color, alpha, text, textColor)
self.barFrame:SetStatusBarColor(self:GetColor(color, 0.8))
self:SetScale(self.barFrame.bar, 1)
self:SetBottomText1(text, textColor or "text")
self:SetBottomText1(text, textColor or "Text")
end
@ -312,7 +312,7 @@ function CastBar.prototype:SpellStatus_SpellCastFailure(sId, sName, sRank, sFull
-- determine if we want to show failed casts
if (self.moduleSettings.flashFailures == "Never") then
return
elseif (isActiveSpell and self.moduleSettings.flashFailures == "Caster") then
elseif (self.moduleSettings.flashFailures == "Caster") then
if (UnitPowerType("player") ~= 0) then -- 0 == mana user
return
end

View File

@ -8,7 +8,7 @@ ComboPoints.prototype.comboSize = 20
function ComboPoints.prototype:init()
ComboPoints.super.prototype.init(self, "ComboPoints")
self:SetColor("combo", 1, 1, 0)
self:SetDefaultColor("ComboPoints", 1, 1, 0)
self.scalingEnabled = true
end
@ -105,7 +105,7 @@ function ComboPoints.prototype:GetDefaultSettings()
local defaults = ComboPoints.super.prototype.GetDefaultSettings(self)
defaults["vpos"] = 0
defaults["comboFontSize"] = 20
defaults["comboMode"] = "Graphical"
defaults["comboMode"] = "Numeric"
defaults["gradient"] = false
return defaults
end
@ -176,7 +176,7 @@ function ComboPoints.prototype:CreateComboFrame()
self.frame.graphicalBG[i]:SetHeight(self.comboSize)
self.frame.graphicalBG[i]:SetPoint("TOPLEFT", (i-1) * (self.comboSize-5) + (i-1), 0)
self.frame.graphicalBG[i]:SetAlpha(0.15)
self.frame.graphicalBG[i]:SetStatusBarColor(self:GetColor("combo"))
self.frame.graphicalBG[i]:SetStatusBarColor(self:GetColor("ComboPoints"))
self.frame.graphicalBG[i]:Hide()
end
@ -190,7 +190,7 @@ function ComboPoints.prototype:CreateComboFrame()
self.frame.graphical[i]:SetFrameStrata("BACKGROUND")
self.frame.graphical[i]:SetAllPoints(self.frame.graphicalBG[i])
local r, g, b = self:GetColor("combo")
local r, g, b = self:GetColor("ComboPoints")
if (self.moduleSettings.gradient) then
g = g - (0.15*i)
end
@ -210,7 +210,7 @@ function ComboPoints.prototype:UpdateComboPoints()
end
if (self.moduleSettings.comboMode == "Numeric") then
local r, g, b = self:GetColor("combo")
local r, g, b = self:GetColor("ComboPoints")
if (self.moduleSettings.gradient and points) then
g = g - (0.15*points)
end

View File

@ -1,5 +1,4 @@
local AceOO = AceLibrary("AceOO-2.0")
local Metrognome = AceLibrary("Metrognome-2.0")
local DruidMana = AceOO.Class(IceUnitBar)
@ -15,7 +14,7 @@ function DruidMana.prototype:init()
self.side = IceCore.Side.Right
self.offset = 0
self:SetColor("druidMana", 87, 82, 141)
self:SetDefaultColor("DruidMana", 87, 82, 141)
end
@ -38,8 +37,7 @@ function DruidMana.prototype:Enable(core)
elseif (IsAddOnLoaded("DruidBar")) then
self.mode = "DruidBar"
Metrognome:Register("DruidMana", self.UpdateDruidBarMana, 0.1, self)
Metrognome:Start("DruidMana")
self:ScheduleRepeatingEvent("DruidBar", self.UpdateDruidBarMana, 0.2, self)
end
self:RegisterEvent("UNIT_DISPLAYPOWER", "FormsChanged")
@ -56,7 +54,7 @@ function DruidMana.prototype:Disable(core)
end
if (IsAddOnLoaded("DruidBar")) then
Metrognome:Unregister("DruidMana")
self:CancelScheduledEvent("DruidBar")
end
end
@ -94,13 +92,11 @@ function DruidMana.prototype:Update()
self.frame:Show()
end
local color = "druidMana"
self:UpdateBar(self.druidMana / self.druidMaxMana, color)
self:UpdateBar(self.druidMana / self.druidMaxMana, "DruidMana")
local percentage = (self.druidMana / self.druidMaxMana) * 100
self:SetBottomText1(math.floor(percentage))
self:SetBottomText2(self:GetFormattedText(string.format("%.0f", self.druidMana), string.format("%.0f", self.druidMaxMana)), color)
self:SetBottomText2(self:GetFormattedText(string.format("%.0f", self.druidMana), string.format("%.0f", self.druidMaxMana)), "DruidMana")
end

View File

@ -96,7 +96,7 @@ function MirrorBar.prototype:OnUpdate(elapsed)
self:SetBottomText2()
else
self:SetBottomText1()
self:SetBottomText2(text, "text", 1)
self:SetBottomText2(text, "Text", 1)
end
end
@ -165,10 +165,10 @@ function MirrorBarHandler.prototype:init()
self.bars = {}
self:SetColor("EXHAUSTION", 1, 0.9, 0)
self:SetColor("BREATH", 0, 0.5, 1)
self:SetColor("DEATH", 1, 0.7, 0)
self:SetColor("FEIGNDEATH", 1, 0.9, 0)
self:SetDefaultColor("EXHAUSTION", 1, 0.9, 0)
self:SetDefaultColor("BREATH", 0, 0.5, 1)
self:SetDefaultColor("DEATH", 1, 0.7, 0)
self:SetDefaultColor("FEIGNDEATH", 1, 0.9, 0)
end

View File

@ -6,7 +6,7 @@ local PetHealth = AceOO.Class(IceUnitBar)
function PetHealth.prototype:init()
PetHealth.super.prototype.init(self, "PetHealth", "pet")
self:SetColor("petHealth", 37, 164, 30)
self:SetDefaultColor("PetHealth", 37, 164, 30)
self.scalingEnabled = true
end
@ -69,9 +69,9 @@ function PetHealth.prototype:Update(unit)
return
end
local color = "petHealth"
local color = "PetHealth"
if not (self.alive) then
color = "dead"
color = "Dead"
end

View File

@ -6,10 +6,10 @@ local PetMana = AceOO.Class(IceUnitBar)
function PetMana.prototype:init()
PetMana.super.prototype.init(self, "PetMana", "pet")
self:SetColor("petMana", 62, 54, 152)
self:SetColor("petRage", 171, 59, 59)
self:SetColor("petEnergy", 218, 231, 31)
self:SetColor("targetFocus", 242, 149, 98)
self:SetDefaultColor("PetMana", 62, 54, 152)
self:SetDefaultColor("PetRage", 171, 59, 59)
self:SetDefaultColor("PetEnergy", 218, 231, 31)
self:SetDefaultColor("PetFocus", 242, 149, 98)
self.scalingEnabled = true
end
@ -96,17 +96,17 @@ function PetMana.prototype:Update(unit)
self.frame:Show()
end
local color = "petMana"
local color = "PetMana"
if not (self.alive) then
color = "dead"
color = "Dead"
else
local color = "petMana"
local color = "PetMana"
if (self.manaType == 1) then
color = "petRage"
color = "PetRage"
elseif (self.manaType == 2) then
color = "petFocus"
color = "PetFocus"
elseif (self.manaType == 3) then
color = "petEnergy"
color = "PetEnergy"
end
end

View File

@ -6,7 +6,7 @@ local PlayerHealth = AceOO.Class(IceUnitBar)
function PlayerHealth.prototype:init()
PlayerHealth.super.prototype.init(self, "PlayerHealth", "player")
self:SetColor("playerHealth", 37, 164, 30)
self:SetDefaultColor("PlayerHealth", 37, 164, 30)
end
@ -85,14 +85,14 @@ function PlayerHealth.prototype:Update(unit)
return
end
local color = "playerHealth"
local color = "PlayerHealth"
if (self.moduleSettings.classColor) then
color = self.unitClass
end
if not (self.alive) then
color = "dead"
color = "Dead"
end

View File

@ -10,9 +10,9 @@ PlayerMana.prototype.previousEnergy = nil
function PlayerMana.prototype:init()
PlayerMana.super.prototype.init(self, "PlayerMana", "player")
self:SetColor("playerMana", 62, 54, 152)
self:SetColor("playerRage", 171, 59, 59)
self:SetColor("playerEnergy", 218, 231, 31)
self:SetDefaultColor("PlayerMana", 62, 54, 152)
self:SetDefaultColor("PlayerRage", 171, 59, 59)
self:SetDefaultColor("PlayerEnergy", 218, 231, 31)
end
@ -61,7 +61,7 @@ function PlayerMana.prototype:GetOptions()
end,
set = function(value)
self.moduleSettings.tickerAlpha = value
self.tickerFrame:SetStatusBarColor(self:GetColor("playerEnergy", self.moduleSettings.tickerAlpha))
self.tickerFrame:SetStatusBarColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha))
end,
disabled = function()
return not self.moduleSettings.enabled
@ -141,14 +141,14 @@ function PlayerMana.prototype:Update(unit)
self.tickerFrame:Hide()
end
local color = "playerMana"
local color = "PlayerMana"
if not (self.alive) then
color = "dead"
color = "Dead"
else
if (self.manaType == 1) then
color = "playerRage"
color = "PlayerRage"
elseif (self.manaType == 3) then
color = "playerEnergy"
color = "PlayerEnergy"
end
end
@ -156,9 +156,9 @@ function PlayerMana.prototype:Update(unit)
-- hide ticker if rest of the bar is not visible
if (self.alpha == 0) then
self.tickerFrame:SetStatusBarColor(self:GetColor("playerEnergy", 0))
self.tickerFrame:SetStatusBarColor(self:GetColor("PlayerEnergy", 0))
else
self.tickerFrame:SetStatusBarColor(self:GetColor("playerEnergy", self.moduleSettings.tickerAlpha))
self.tickerFrame:SetStatusBarColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha))
end
@ -204,7 +204,7 @@ function PlayerMana.prototype:EnergyTick()
end
local pos = elapsed / 2
local y = pos * (self.settings.barHeight)
local y = pos * (self.settings.barHeight-2)
if (self.moduleSettings.side == IceCore.Side.Left) then
self.tickerFrame.spark:SetTexCoord(1, 0, 1-pos-0.01, 1-pos)
@ -236,7 +236,7 @@ function PlayerMana.prototype:CreateTickerFrame()
self.tickerFrame.spark:SetAllPoints(self.tickerFrame)
self.tickerFrame:SetStatusBarTexture(self.tickerFrame.spark)
self.tickerFrame:SetStatusBarColor(self:GetColor("playerEnergy", self.moduleSettings.tickerAlpha))
self.tickerFrame:SetStatusBarColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha))
self.tickerFrame:ClearAllPoints()
self.tickerFrame:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", 0, 0)

View File

@ -9,9 +9,9 @@ TargetHealth.prototype.color = nil
function TargetHealth.prototype:init()
TargetHealth.super.prototype.init(self, "TargetHealth", "target")
self:SetColor("targetHealthHostile", 231, 31, 36)
self:SetColor("targetHealthFriendly", 46, 223, 37)
self:SetColor("targetHealthNeutral", 210, 219, 87)
self:SetDefaultColor("TargetHealthHostile", 231, 31, 36)
self:SetDefaultColor("TargetHealthFriendly", 46, 223, 37)
self:SetDefaultColor("TargetHealthNeutral", 210, 219, 87)
end
@ -123,13 +123,13 @@ function TargetHealth.prototype:Update(unit)
self.frame:Show()
end
self.color = "targetHealthFriendly" -- friendly > 4
self.color = "TargetHealthFriendly" -- friendly > 4
local reaction = UnitReaction("target", "player")
if (reaction and (reaction == 4)) then
self.color = "targetHealthNeutral"
self.color = "TargetHealthNeutral"
elseif (reaction and (reaction < 4)) then
self.color = "targetHealthHostile"
self.color = "TargetHealthHostile"
end
if (self.moduleSettings.classColor) then
@ -137,7 +137,7 @@ function TargetHealth.prototype:Update(unit)
end
if (self.tapped) then
self.color = "tapped"
self.color = "Tapped"
end
self:UpdateBar(self.health/self.maxHealth, self.color)

View File

@ -199,8 +199,6 @@ function TargetInfo.prototype:CreateFrame()
self.frame:SetPoint("TOP", self.parent, "BOTTOM", 0, self.moduleSettings.vpos)
self.frame:SetScale(self.moduleSettings.scale)
self.frame:Show()
self:CreateTextFrame()
self:CreateInfoTextFrame()
self:CreateGuildTextFrame()
@ -209,6 +207,8 @@ function TargetInfo.prototype:CreateFrame()
self:CreateDebuffFrame()
self:CreateRaidIconFrame()
self.frame:Hide()
end
@ -254,7 +254,7 @@ function TargetInfo.prototype:CreateTextFrame()
end
self.frame.target:Show()
self.frame.target:Hide()
end
@ -501,6 +501,7 @@ end
function TargetInfo.prototype:TargetChanged()
if (not UnitExists(target)) then
self.frame:Hide()
self.frame.target:Hide()
self.frame.targetName:SetText()
self.frame.targetInfo:SetText()
@ -512,6 +513,7 @@ function TargetInfo.prototype:TargetChanged()
end
self.frame:Show()
self.frame.target:Show()
self.name, self.realm = UnitName(target)
self.classLocale, self.classEnglish = UnitClass(target)
@ -628,7 +630,7 @@ function TargetInfo.prototype:Update(unit)
local reactionColor = self:ConvertToHex(UnitReactionColor[self.reaction])
if (self.tapped) then
reactionColor = self:GetHexColor("tapped")
reactionColor = self:GetHexColor("Tapped")
end
local line1 = string.format("|c%s%s|r", reactionColor, self.name or '')

View File

@ -7,10 +7,10 @@ local TargetMana = AceOO.Class(IceUnitBar)
function TargetMana.prototype:init()
TargetMana.super.prototype.init(self, "TargetMana", "target")
self:SetColor("targetMana", 52, 64, 221)
self:SetColor("targetRage", 235, 44, 26)
self:SetColor("targetEnergy", 228, 242, 31)
self:SetColor("targetFocus", 242, 149, 98)
self:SetDefaultColor("TargetMana", 52, 64, 221)
self:SetDefaultColor("TargetRage", 235, 44, 26)
self:SetDefaultColor("TargetEnergy", 228, 242, 31)
self:SetDefaultColor("TargetFocus", 242, 149, 98)
end
@ -55,17 +55,17 @@ function TargetMana.prototype:Update(unit)
local manaType = UnitPowerType(self.unit)
local color = "targetMana"
local color = "TargetMana"
if (manaType == 1) then
color = "targetRage"
color = "TargetRage"
elseif (manaType == 2) then
color = "targetFocus"
color = "TargetFocus"
elseif (manaType == 3) then
color = "targetEnergy"
color = "TargetEnergy"
end
if (self.tapped) then
color = "tapped"
color = "Tapped"
end
self:UpdateBar(self.mana/self.maxMana, color)

View File

@ -1,6 +1,6 @@
local AceOO = AceLibrary("AceOO-2.0")
local TargetOfTarget = AceOO.Class(IceElement, "Metrognome-2.0")
local TargetOfTarget = AceOO.Class(IceElement)
TargetOfTarget.prototype.stackedDebuffs = nil
TargetOfTarget.prototype.buffSize = nil
@ -12,10 +12,6 @@ TargetOfTarget.prototype.unit = nil
function TargetOfTarget.prototype:init()
TargetOfTarget.super.prototype.init(self, "TargetOfTarget")
self:SetColor("totHostile", 0.8, 0.1, 0.1)
self:SetColor("totFriendly", 0.2, 1, 0.2)
self:SetColor("totNeutral", 0.9, 0.9, 0)
self.buffSize = 12
self.height = 12
self.stackedDebuffs = {}
@ -110,9 +106,9 @@ end
-- OVERRIDE
function TargetOfTarget.prototype:GetDefaultSettings()
local defaults = TargetOfTarget.super.prototype.GetDefaultSettings(self)
defaults["vpos"] = -50
defaults["vpos"] = -130
defaults["showDebuffs"] = true
defaults["fontSize"] = 13
defaults["fontSize"] = 12
defaults["mouse"] = true
return defaults
end
@ -133,8 +129,7 @@ function TargetOfTarget.prototype:Enable(core)
self:RegisterEvent("PLAYER_TARGET_CHANGED", "Update")
self:RegisterMetro(self.elementName, self.Update, 0.2, self)
self:StartMetro(self.elementName)
self:ScheduleRepeatingEvent(self.elementName, self.Update, 0.2, self)
self:Update()
end
@ -142,7 +137,7 @@ end
function TargetOfTarget.prototype:Disable(core)
TargetOfTarget.super.prototype.Disable(self, core)
self:UnregisterMetro(self.elementName)
self:CancelScheduledEvent(self.elementName)
end

View File

@ -1,6 +1,6 @@
local AceOO = AceLibrary("AceOO-2.0")
local TimerBar = AceOO.Class(IceBarElement, "AceHook-2.0", "Metrognome-2.0")
local TimerBar = AceOO.Class(IceBarElement, "AceHook-2.0")
local abacus = nil
@ -8,7 +8,7 @@ local abacus = nil
function TimerBar.prototype:init()
TimerBar.super.prototype.init(self, "TimerBar")
self:SetColor("timerFlight", 0.2, 0.7, 0.7)
self:SetDefaultColor("TimerFlight", 0.2, 0.7, 0.7)
end
@ -50,7 +50,7 @@ function TimerBar.prototype:OnTextUpdate(object)
local timeRemaining = ToFu.timeAvg - ToFu.timeFlown
self.frame:Show()
self:UpdateBar(timeRemaining / ToFu.timeAvg, "timerFlight")
self:UpdateBar(timeRemaining / ToFu.timeAvg, "TimerFlight")
self:Update()
local text = abacus:FormatDurationCondensed(timeRemaining, true)