WoWInterface SVN AuraUnitFrames

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/AuraUnitFramesCore
    from Rev 42 to Rev 44
    Reverse comparison

Rev 42 → Rev 44

AuraUnitFramesCore.lua
45,6 → 45,37
end
 
 
function AuraUnitFramesCore_UpdatePower(self, unit)
--update the value
local value = UnitPower(unit);
self.Mana.Bar:SetValue(value);
self.Mana.Bar.Text:SetText(value);
 
end
 
function AuraUnitFramesCore_UpdateMaxPower(self, unit)
local max = UnitPowerMax(unit);
self.Mana.Bar:SetMinMaxValues(0, max);
AuraUnitFramesCore_UpdatePower(self, unit);
end
 
function AuraUnitFramesCore_UpdatePowerType(self, unit)
local max = UnitPowerMax(unit);
local type, token, r, g, b = UnitPowerType(unit);
local colour = PowerBarColor[token];
 
if (colour) then
self.Mana.Bar:SetStatusBarColor(colour.r, colour.g, colour.b);
else
self.Mana.Bar:SetStatusBarColor(r, g, b);
end
 
self.Mana.Bar:SetMinMaxValues(0, max);
 
--finally update the current value
AuraUnitFramesCore_UpdatePower(self,unit);
end
 
--[[=================================================
UTILITY METHODS
===================================================]]--
87,8 → 118,23
end
end
 
function AuraUnitFramesCore_UnRegPowerEvents(self)
self:UnregisterEvent("UNIT_MANA");
self:UnregisterEvent("UNIT_RAGE");
self:UnregisterEvent("UNIT_FOCUS");
self:UnregisterEvent("UNIT_ENERGY");
self:UnregisterEvent("UNIT_HAPPINESS");
self:UnregisterEvent("UNIT_RUNIC_POWER");
end
 
 
function AuraUnitFramesCore_RegPowerEvents(self)
self:RegisterEvent("UNIT_MANA");
self:RegisterEvent("UNIT_RAGE");
self:RegisterEvent("UNIT_FOCUS");
self:RegisterEvent("UNIT_ENERGY");
self:RegisterEvent("UNIT_HAPPINESS");
self:RegisterEvent("UNIT_RUNIC_POWER");
end
--[[=================================================
SETUP METHODS
===================================================]]--
124,7 → 170,6
frame:SetPoint(values.point, values.relativeto, values.relativepoint, values.xoff, values.yoff);
AUF_loadtexturelayer(frame.Texture,values.texture);
AUF_loadfontstring(frame.Text, values.fontstring);
print(frame:GetParent():GetName());
frame:Show();
end
 
140,7 → 185,8
AUF_loadtexturelayer(statusbar.Texture, values.texture);
-- load the fontstring for the bar
AUF_loadfontstring(statusbar.Text, values.fontstring);
print(statusbar:GetParent():GetName());
 
statusbar.currValue = 0;
statusbar:Show();
 
end
154,6 → 200,7
-- you only control where the background is anchored for each independantly the rest is automatic
-- we don't have to load the settings for healthbars based on the frame
local healthbarvalues = values.healthbar;
local manabarvalues = values.manabar;
 
 
--[[
200,6 → 247,10
 
--setup the statusbar
AUF_loadstatusbar(frame.Health.Bar, healthbarvalues.bar);
 
-- setup the manabar
AUF_loadframe(frame.Mana, manabarvalues);
AUF_loadstatusbar(frame.Mana.Bar, manabarvalues.bar);
 
end
 
224,7 → 275,7
height = 64, --height
width = 128, --width
point = "CENTER", -- point
relativeto = "UIParent", -- relative to
relativeto = "$parent", -- relative to
relativepoint = "CENTER", --relative point - At a later date this will become TOPLEFT
xoff = 0, -- x offset
yoff = 0, -- y offset
251,11 → 302,11
]]--
 
healthbar = { --defaults for any and all healthbars that will be shown
height = 64, -- height
height = 32, -- height
width = 128, -- width
point = "CENTER", -- point
relativeto = nil, -- relative to - nil so we make it behave like its parent
relativepoint = nil, --relative point - nil again
point = "TOPLEFT", -- point
relativeto = "$parent", -- relative to - nil so we make it anchor to its parent
relativepoint = "TOPLEFT", --relative point
xoff = 0, -- x offset
yoff = 0, -- y offset
--buttons need backgrounds too!
266,10 → 317,10
fontstring = {
layer = "OVERLAY",
font = "GameFontNormal",
height = 64,
height = 32,
width = 128,
point = "CENTER", -- point
relativeto = nil, -- relative to - nil so we make it behave like its parent
relativeto = "$parent", -- relative to - nil so we make it anchor to its parent
relativepoint = nil, --relative point - nil again
xoff = 0, -- x offset
yoff = 0, -- y offset
278,10 → 329,10
bar = { -- defaults for the actual healthbar itself
bartexture = "Interface\\TargetingFrame\\UI-TargetingFrame-BarFill",
-- rgb info + alpha
colourred = 0.0,
colourgreen = 1.0,
colourblue = 0.0,
colouralpha = 1.0,
r = 0.0,
g = 1.0,
b = 0.0,
a = 1.0,
-- no need for points as the bar fits the button its embeded in
texture = {
layer = "BACKGROUND",
290,10 → 341,10
fontstring = {
layer = "OVERLAY",
font = "GameFontNormal",
height = 64,
height = 32,
width = 128,
point = "CENTER", -- point
relativeto = nil, -- relative to - nil so we make it behave like its parent
relativeto = "$parent", -- relative to - nil so we make it anchor to its parent
relativepoint = nil, --relative point - nil again
xoff = 0, -- x offset
yoff = 0, -- y offset
301,6 → 352,58
},
 
},
},
manabar = { --defaults for any and all healthbars that will be shown
height = 32, -- height
width = 128, -- width
point = "TOPLEFT", -- point
relativeto = "$parentHealth", -- relative to - nil so we make it anchor to its parent
relativepoint = "BOTTOMLEFT", --relative point
xoff = 0, -- x offset
yoff = 0, -- y offset
--buttons need backgrounds too!
texture = {
layer = "BACKGROUND",
texture = "Interface\\Tooltips\\ChatBubble-Background",
},
fontstring = {
layer = "OVERLAY",
font = "GameFontNormal",
height = 32,
width = 128,
point = "CENTER", -- point
relativeto = "$parent", -- relative to - nil so we make it anchor to its parent
relativepoint = nil, --relative point - nil again
xoff = 0, -- x offset
yoff = 0, -- y offset
 
},
bar = { -- defaults for the actual bar itself
bartexture = "Interface\\TargetingFrame\\UI-TargetingFrame-BarFill",
-- rgb info + alpha
r = 0.0,
g = 1.0,
b = 0.0,
a = 1.0,
-- no need for points as the bar fits the button its embeded in
texture = {
layer = "BACKGROUND",
texture = "Interface\\Tooltips\\ChatBubble-Background",
},
fontstring = {
layer = "OVERLAY",
font = "GameFontNormal",
height = 32,
width = 128,
point = "CENTER", -- point
relativeto = "$parent", -- relative to - nil so we make it anchor to its parent
relativepoint = nil, --relative point - nil again
xoff = 0, -- x offset
yoff = 0, -- y offset
 
},
 
},
 
},
 
AuraUnitFramesCore.toc
2,6 → 2,6
## Interface: 30200
## Notes: Core for all modules, contains shared methods and the defaults for the addon. Needed by all parts of Aura Unit Frames.
## Title: AuraUnitFramesCore
## Version: 3.0.5 $Revision$
## Version: 3.0.6 $Revision$
AuraUnitFramesOptions.lua
AuraUnitFramesCore.xml