WoWInterface SVN AuraUnitFrames

Compare Revisions

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

Rev 44 → Rev 42

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.6 $Revision$
## Version: 3.0.5 $Revision$
AuraUnitFramesOptions.lua
AuraUnitFramesCore.xml
AuraUnitFramesCore.lua
45,37 → 45,6
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
===================================================]]--
118,23 → 87,8
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
===================================================]]--
170,6 → 124,7
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
 
185,8 → 140,7
AUF_loadtexturelayer(statusbar.Texture, values.texture);
-- load the fontstring for the bar
AUF_loadfontstring(statusbar.Text, values.fontstring);
 
statusbar.currValue = 0;
print(statusbar:GetParent():GetName());
statusbar:Show();
 
end
200,7 → 154,6
-- 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;
 
 
--[[
247,10 → 200,6
 
--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
 
275,7 → 224,7
height = 64, --height
width = 128, --width
point = "CENTER", -- point
relativeto = "$parent", -- relative to
relativeto = "UIParent", -- relative to
relativepoint = "CENTER", --relative point - At a later date this will become TOPLEFT
xoff = 0, -- x offset
yoff = 0, -- y offset
302,11 → 251,11
]]--
 
healthbar = { --defaults for any and all healthbars that will be shown
height = 32, -- height
height = 64, -- height
width = 128, -- width
point = "TOPLEFT", -- point
relativeto = "$parent", -- relative to - nil so we make it anchor to its parent
relativepoint = "TOPLEFT", --relative point
point = "CENTER", -- point
relativeto = nil, -- relative to - nil so we make it behave like its parent
relativepoint = nil, --relative point - nil again
xoff = 0, -- x offset
yoff = 0, -- y offset
--buttons need backgrounds too!
317,10 → 266,10
fontstring = {
layer = "OVERLAY",
font = "GameFontNormal",
height = 32,
height = 64,
width = 128,
point = "CENTER", -- point
relativeto = "$parent", -- relative to - nil so we make it anchor to its parent
relativeto = nil, -- relative to - nil so we make it behave like its parent
relativepoint = nil, --relative point - nil again
xoff = 0, -- x offset
yoff = 0, -- y offset
329,10 → 278,10
bar = { -- defaults for the actual healthbar itself
bartexture = "Interface\\TargetingFrame\\UI-TargetingFrame-BarFill",
-- rgb info + alpha
r = 0.0,
g = 1.0,
b = 0.0,
a = 1.0,
colourred = 0.0,
colourgreen = 1.0,
colourblue = 0.0,
colouralpha = 1.0,
-- no need for points as the bar fits the button its embeded in
texture = {
layer = "BACKGROUND",
341,10 → 290,10
fontstring = {
layer = "OVERLAY",
font = "GameFontNormal",
height = 32,
height = 64,
width = 128,
point = "CENTER", -- point
relativeto = "$parent", -- relative to - nil so we make it anchor to its parent
relativeto = nil, -- relative to - nil so we make it behave like its parent
relativepoint = nil, --relative point - nil again
xoff = 0, -- x offset
yoff = 0, -- y offset
352,58 → 301,6
},
 
},
},
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
 
},
 
},
 
},