- added support to player health, mana, and cast bars to change which unit they are monitoring to be the vehicle when the player enters one
This commit is contained in:
Parnic
2009-07-08 02:48:30 +00:00
parent b9c9182c27
commit 50dcfb6a8c
3 changed files with 70 additions and 2 deletions

View File

@ -75,6 +75,11 @@ function PlayerHealth.prototype:Enable(core)
self:RegisterEvent("PLAYER_FLAGS_CHANGED", "CheckPvP")
self:RegisterEvent("UNIT_FACTION", "CheckPvP")
self:RegisterEvent("UNIT_ENTERED_VEHICLE", "EnteringVehicle")
self:RegisterEvent("UNIT_ENTERING_VEHICLE", "EnteringVehicle")
self:RegisterEvent("UNIT_EXITING_VEHICLE", "ExitingVehicle")
self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle")
if AceLibrary:HasInstance("LibHealComm-3.0") then
HealComm = AceLibrary("LibHealComm-3.0")
HealComm.RegisterCallback(self, "HealComm_DirectHealStart", function(event, healerName, healSize, endTime, ...) self:HealComm_DirectHealStart(event, healerName, healSize, endTime, ...) end)
@ -643,6 +648,20 @@ function PlayerHealth.prototype:GetOptions()
end
function PlayerHealth.prototype:EnteringVehicle()
self.unit = "vehicle"
self:RegisterFontStrings()
self:Update(self.unit)
end
function PlayerHealth.prototype:ExitingVehicle()
self.unit = "player"
self:RegisterFontStrings()
self:Update(self.unit)
end
function PlayerHealth.prototype:CreateFrame()
PlayerHealth.super.prototype.CreateFrame(self)