WoWInterface SVN AuraUnitFrames

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 44 to Rev 45
    Reverse comparison

Rev 44 → Rev 45

trunk/AuraUnitFramesPlayer/AuraUnitFramesPlayer.xml
9,6 → 9,9
<Button name="$parentHealth" inherits="AuraUnitFrames_StatusBarTemplate">
 
</Button>
<Button name="$parentMana" inherits="AuraUnitFrames_StatusBarTemplate">
 
</Button>
</Frames>
<Scripts>
<OnLoad>AuraUnitFramesPlayer_OnLoad(self);</OnLoad>
trunk/AuraUnitFramesPlayer/AuraUnitFramesPlayer.lua
3,7 → 3,9
 
local AuraUnitFramesPlayer_Events = {};
 
local fastregen = true;
 
 
function AuraUnitFramesPlayer_OnLoad(self)
 
AuraUnitFrames_SetChildren(self, "player");
36,9 → 38,20
 
if (arg1 == "AuraUnitFramesPlayer") then
 
local events = {"UNIT_HEALTH","UNIT_MAXHEALTH", "PLAYER_ENTERING_WORLD"};
 
 
local events = {"UNIT_HEALTH","UNIT_MAXHEALTH", "PLAYER_ENTERING_WORLD",
"UNIT_MAXMANA","UNIT_MAXENERGY",
"UNIT_MAXRAGE", "UNIT_MAXRUNIC_POWER",
"UNIT_DISPLAYPOWER", -- "UNIT_FOCUS", "UNIT_MAXFOCUS" --no need for these till 4.0
};
if (fastregen) then
self.Mana.Bar.unit = "player";
self.Mana.Bar:SetScript("OnUpdate", AuraUnitFramesPlayer_ManaBar_OnUpdate);
AuraUnitFramesCore_UnRegPowerEvents(self);
else
AuraUnitFramesCore_RegPowerEvents(self);
self.Mana.Bar:SetScript("OnUpdate", nil);
end
 
for k, v in pairs(events) do
self:RegisterEvent(v);
end
47,8 → 60,8
AuraUnitFramesPlayer_Loaded(self);
 
end
end
 
end
 
function AuraUnitFramesPlayer_Events:PLAYER_ENTERING_WORLD()
AuraUnitFramesPlayer_UpdateAll(self);
62,15 → 75,49
--UpdateHealth also tracks max hp
AuraUnitFramesPlayer_Events.UNIT_MAXHEALTH = AuraUnitFramesPlayer_Events.UNIT_HEALTH;
 
function AuraUnitFramesPlayer_Events:UNIT_MANA()
AuraUnitFramesCore_UpdatePower(self, "player");
end
 
function AuraUnitFramesPlayer_Events:UNIT_MAXMANA()
AuraUnitFramesCore_UpdateMaxPower(self, "player");
end
 
--all other power update methods do the same as the 2 above
AuraUnitFramesPlayer_Events.UNIT_MAXENERGY = AuraUnitFramesPlayer_Events.UNIT_MAXMANA;
AuraUnitFramesPlayer_Events.UNIT_MAXRAGE = AuraUnitFramesPlayer_Events.UNIT_MAXMANA;
AuraUnitFramesPlayer_Events.UNIT_MAXRUNIC_POWER = AuraUnitFramesPlayer_Events.UNIT_MAXMANA;
--AuraUnitFramesPlayer_Events.UNIT_MAXFOCUS = AuraUnitFramesPlayer_Events.UNIT_MAXMANA;
AuraUnitFramesPlayer_Events.UNIT_ENERGY = AuraUnitFramesPlayer_Events.UNIT_MANA;
AuraUnitFramesPlayer_Events.UNIT_RAGE = AuraUnitFramesPlayer_Events.UNIT_MANA;
AuraUnitFramesPlayer_Events.UNIT_RUNIC_POWER = AuraUnitFramesPlayer_Events.UNIT_MANA;
--AuraUnitFramesPlayer_Events.UNIT_FOCUS = AuraUnitFramesPlayer_Events.UNIT_MANA;
 
function AuraUnitFramesPlayer_Events:UNIT_DISPLAYPOWER()
AuraUnitFramesCore_UpdatePowerType(self, "player");
end
 
--[[=================================================
UPDATE METHODS
===================================================]]--
 
function AuraUnitFramesPlayer_UpdateAll(self)
AuraUnitFramesCore_UpdateHealth(self, "player");
AuraUnitFramesCore_UpdatePowerType(self, "player");
AuraUnitFramesCore_UpdateMaxPower(self, "player");
 
end
 
function AuraUnitFramesPlayer_ManaBar_OnUpdate(self)
-- using a copy of the blizzard code for this few edits here and there
local currValue = UnitPower(self.unit);
if ( currValue ~= self.currValue ) then
self:SetValue(currValue);
self.currValue = currValue;
-- edited for own setup
self.Text:SetText(currValue);
end
end
 
--[[=================================================
SETUP
trunk/AuraUnitFramesPlayer/AuraUnitFramesPlayer.toc
3,6 → 3,5
## Interface: 30200
## Notes: Player Frame
## Title: AuraUnitFramesPlayer
## Version: 3.0.3 $Revision$
 
## Version: 3.0.4 $Revision$
AuraUnitFramesPlayer.xml