- converted upper/lower text on most bars to use LibDogTag formatting for greater user control

- added Deformat library references in embeds.xml
This commit is contained in:
Parnic
2008-01-21 03:02:51 +00:00
parent 0b6ef43fb5
commit 9b27f345ec
10 changed files with 171 additions and 17 deletions

View File

@ -1,4 +1,5 @@
local AceOO = AceLibrary("AceOO-2.0")
local DogTag = AceLibrary("LibDogTag-2.0")
IceBarElement = AceOO.Class(IceElement)
IceBarElement.virtual = true
@ -42,7 +43,8 @@ function IceBarElement.prototype:GetDefaultSettings()
settings["barFontSize"] = 12
settings["lockTextAlpha"] = true
settings["textVisible"] = {upper = true, lower = true}
settings["brackets"] = true
settings["upperText"] = ''
settings["lowerText"] = ''
return settings
end
@ -190,19 +192,40 @@ function IceBarElement.prototype:GetOptions()
end,
order = 15
},
brackets = {
type = 'toggle',
name = 'Brackets around lower text',
desc = 'Toggle brackets visibility',
upperTextString = {
type = 'text',
name = 'Upper Text',
desc = 'The upper text to display under this bar (accepts LibDogTag formatting)\n\nSee http://www.wowace.com/wiki/LibDogTag-2.0/ for tag info',
get = function()
return self.moduleSettings.brackets
return self.moduleSettings.upperText
end,
set = function(v)
self.moduleSettings.brackets = v
if v ~= '' and v ~= nil then
v = DogTag:FixCasing(v)
end
self.moduleSettings.upperText = v
self:Redraw()
end,
order = 16
},
lowerTextString = {
type = 'text',
name = 'Lower Text',
desc = 'The lower text to display under this bar (accepts LibDogTag formatting)\n\nSee http://www.wowace.com/wiki/LibDogTag-2.0/ for tag info',
get = function()
return self.moduleSettings.lowerText
end,
set = function(v)
if v ~= '' and v ~= nil then
v = DogTag:FixCasing(v)
end
self.moduleSettings.lowerText = v
self:Redraw()
end,
}
}
}

View File

@ -5,8 +5,8 @@
## Notes: Another HUD addon
## Version: 1.1 ($Revision$)
## SavedVariables: IceCoreDB
## OptionalDeps: Ace2, GratuityLib, LibSharedMedia, WaterfallLib, MobHealth, Deformat
## X-Embeds: Ace2, GratuityLib, LibSharedMedia, WaterfallLib, Deformat
## OptionalDeps: Ace2, GratuityLib, LibSharedMedia-2.0, WaterfallLib, MobHealth, Deformat-2.0, LibDogTag-2.0
## X-Embeds: Ace2, GratuityLib, LibSharedMedia-2.0, WaterfallLib, Deformat-2.0, LibDogTag-2.0
## X-Category: UnitFrame
## X-Date: $Date$
## X-Website: http://www.wowace.com/forums/index.php/topic,1705.0.html

View File

@ -8,7 +8,9 @@
<Script file="libs\AceDebug-2.0\AceDebug-2.0.lua"/>
<Script file="libs\AceConsole-2.0\AceConsole-2.0.lua"/>
<Script file="libs\AceAddon-2.0\AceAddon-2.0.lua"/>
<Script file="libs\Deformat-2.0\Deformat-2.0.lua"/>
<Script file="libs\Gratuity-2.0\Gratuity-2.0.lua"/>
<Include file="libs\LibDogTag-2.0\lib.xml"/>
<Include file="libs\LibSharedMedia-2.0\lib.xml"/>
<Script file="libs\Waterfall-1.0\Waterfall-1.0.lua"/>

View File

@ -86,6 +86,63 @@ function CastBar.prototype:GetOptions()
order = 42
}
opts["textSettings"] =
{
type = 'group',
name = '|c' .. self.configColor .. 'Text Settings|r',
desc = 'Settings related to texts',
order = 32,
disabled = function()
return not self.moduleSettings.enabled
end,
args = {
fontsize = {
type = 'range',
name = 'Bar Font Size',
desc = 'Bar Font Size',
get = function()
return self.moduleSettings.barFontSize
end,
set = function(v)
self.moduleSettings.barFontSize = v
self:Redraw()
end,
min = 8,
max = 20,
step = 1,
order = 11
},
lockFontAlpha = {
type = "toggle",
name = "Lock Bar Text Alpha",
desc = "Locks text alpha to 100%",
get = function()
return self.moduleSettings.lockTextAlpha
end,
set = function(v)
self.moduleSettings.lockTextAlpha = v
self:Redraw()
end,
order = 13
},
upperTextVisible = {
type = 'toggle',
name = 'Spell cast text visible',
desc = 'Toggle spell cast text visibility',
get = function()
return self.moduleSettings.textVisible['upper']
end,
set = function(v)
self.moduleSettings.textVisible['upper'] = v
self:Redraw()
end,
order = 14
}
}
}
return opts
end

View File

@ -1,4 +1,5 @@
local AceOO = AceLibrary("AceOO-2.0")
local DogTag = AceLibrary("LibDogTag-2.0")
local PetHealth = AceOO.Class(IceUnitBar)
@ -20,9 +21,13 @@ end
-- OVERRIDE
function PetHealth.prototype:GetDefaultSettings()
local settings = PetHealth.super.prototype.GetDefaultSettings(self)
settings["side"] = IceCore.Side.Left
settings["offset"] = -1
settings.scale = 0.7
settings["upperText"] = ""
settings["lowerText"] = "[PercentHP:Round]"
return settings
end
@ -104,7 +109,13 @@ function PetHealth.prototype:Update(unit)
self:UpdateBar(self.health/self.maxHealth, color)
self:SetBottomText1(self.healthPercentage)
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
self:SetBottomText1(DogTag:Evaluate("pet", self.moduleSettings.upperText))
end
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
self:SetBottomText2(DogTag:Evaluate("pet", self.moduleSettings.lowerText))
end
end

View File

@ -1,4 +1,5 @@
local AceOO = AceLibrary("AceOO-2.0")
local DogTag = AceLibrary("LibDogTag-2.0")
local PetMana = AceOO.Class(IceUnitBar)
@ -18,9 +19,13 @@ end
-- OVERRIDE
function PetMana.prototype:GetDefaultSettings()
local settings = PetMana.super.prototype.GetDefaultSettings(self)
settings["side"] = IceCore.Side.Right
settings["offset"] = -1
settings.scale = 0.7
settings["upperText"] = ""
settings["lowerText"] = "[PercentMP:Round]"
return settings
end
@ -115,7 +120,13 @@ function PetMana.prototype:Update(unit)
end
self:UpdateBar(self.mana/self.maxMana, color)
self:SetBottomText1(self.manaPercentage)
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
self:SetBottomText1(DogTag:Evaluate("player", self.moduleSettings.upperText))
end
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
self:SetBottomText2(DogTag:Evaluate("player", self.moduleSettings.lowerText))
end
end

View File

@ -1,4 +1,5 @@
local AceOO = AceLibrary("AceOO-2.0")
local DogTag = AceLibrary("LibDogTag-2.0")
local PlayerHealth = AceOO.Class(IceUnitBar)
@ -14,9 +15,13 @@ end
function PlayerHealth.prototype:GetDefaultSettings()
local settings = PlayerHealth.super.prototype.GetDefaultSettings(self)
settings["side"] = IceCore.Side.Left
settings["offset"] = 1
settings["hideBlizz"] = true
settings["upperText"] = "[PercentHP:Round]"
settings["lowerText"] = "[FractionalHP:Color(00ff00):Bracket]"
return settings
end
@ -134,8 +139,13 @@ function PlayerHealth.prototype:Update(unit)
end
self:UpdateBar(self.health/self.maxHealth, color)
self:SetBottomText1(self.healthPercentage)
self:SetBottomText2(self:GetFormattedText(self.health, self.maxHealth), textColor)
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
self:SetBottomText1(DogTag:Evaluate("player", self.moduleSettings.upperText))
end
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
self:SetBottomText2(DogTag:Evaluate("player", self.moduleSettings.lowerText))
end
end

View File

@ -1,4 +1,5 @@
local AceOO = AceLibrary("AceOO-2.0")
local DogTag = AceLibrary("LibDogTag-2.0")
local PlayerMana = AceOO.Class(IceUnitBar)
@ -19,10 +20,14 @@ end
-- OVERRIDE
function PlayerMana.prototype:GetDefaultSettings()
local settings = PlayerMana.super.prototype.GetDefaultSettings(self)
settings["side"] = IceCore.Side.Right
settings["offset"] = 1
settings["tickerEnabled"] = true
settings["tickerAlpha"] = 0.5
settings["upperText"] = "[PercentMP:Round]"
settings["lowerText"] = "[FractionalMP:Color(0000ff)]"
return settings
end
@ -181,7 +186,7 @@ function PlayerMana.prototype:Update(unit)
self.tickerFrame:SetStatusBarColor(self:GetColor("PlayerEnergy", self.moduleSettings.tickerAlpha))
end
--[[
-- extra hack for whiny rogues (are there other kind?)
local displayPercentage = self.manaPercentage
if (self.manaType == 3) then
@ -197,6 +202,14 @@ function PlayerMana.prototype:Update(unit)
amount = self:GetFormattedText(self.mana)
end
self:SetBottomText2(amount, color)
]]
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
self:SetBottomText1(DogTag:Evaluate("player", self.moduleSettings.upperText))
end
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
self:SetBottomText2(DogTag:Evaluate("player", self.moduleSettings.lowerText))
end
end

View File

@ -1,4 +1,5 @@
local AceOO = AceLibrary("AceOO-2.0")
local DogTag = AceLibrary("LibDogTag-2.0")
local TargetHealth = AceOO.Class(IceUnitBar)
@ -17,11 +18,15 @@ end
function TargetHealth.prototype:GetDefaultSettings()
local settings = TargetHealth.super.prototype.GetDefaultSettings(self)
settings["side"] = IceCore.Side.Left
settings["offset"] = 2
settings["mobhealth"] = (MobHealth3 ~= nil)
settings["classColor"] = false
settings["hideBlizz"] = true
settings["upperText"] = "[PercentHP:Round]"
settings["lowerText"] = "[FractionalHP:Color(00ff00):Bracket]"
return settings
end
@ -163,6 +168,7 @@ function TargetHealth.prototype:Update(unit)
end
self:UpdateBar(self.health/self.maxHealth, self.color)
--[[
self:SetBottomText1(self.healthPercentage)
@ -182,6 +188,14 @@ function TargetHealth.prototype:Update(unit)
else
self:SetBottomText2()
end
]]
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
self:SetBottomText1(DogTag:Evaluate("target", self.moduleSettings.upperText))
end
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
self:SetBottomText2(DogTag:Evaluate("target", self.moduleSettings.lowerText))
end
end

View File

@ -1,4 +1,5 @@
local AceOO = AceLibrary("AceOO-2.0")
local DogTag = AceLibrary("LibDogTag-2.0")
local TargetMana = AceOO.Class(IceUnitBar)
@ -16,8 +17,12 @@ end
function TargetMana.prototype:GetDefaultSettings()
local settings = TargetMana.super.prototype.GetDefaultSettings(self)
settings["side"] = IceCore.Side.Right
settings["offset"] = 2
settings["upperText"] = "[PercentMP:Round]"
settings["lowerText"] = "[FractionalMP:Color(0000ff)]"
return settings
end
@ -74,8 +79,16 @@ function TargetMana.prototype:Update(unit)
end
self:UpdateBar(self.mana/self.maxMana, color)
self:SetBottomText1(self.manaPercentage)
self:SetBottomText2(self:GetFormattedText(self.mana, self.maxMana), color)
-- self:SetBottomText1(self.manaPercentage)
-- self:SetBottomText2(self:GetFormattedText(self.mana, self.maxMana), color)
if self.moduleSettings.upperText ~= nil and self.moduleSettings.upperText ~= '' then
self:SetBottomText1(DogTag:Evaluate("target", self.moduleSettings.upperText))
end
if self.moduleSettings.lowerText ~= nil and self.moduleSettings.lowerText ~= '' then
self:SetBottomText2(DogTag:Evaluate("target", self.moduleSettings.lowerText))
end
end