mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
- removed all references to pet happiness
This commit is contained in:
@ -1,16 +1,11 @@
|
|||||||
local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false)
|
local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false)
|
||||||
local PetHealth = IceCore_CreateClass(IceUnitBar)
|
local PetHealth = IceCore_CreateClass(IceUnitBar)
|
||||||
|
|
||||||
PetHealth.prototype.happiness = nil
|
|
||||||
|
|
||||||
|
|
||||||
-- Constructor --
|
-- Constructor --
|
||||||
function PetHealth.prototype:init()
|
function PetHealth.prototype:init()
|
||||||
PetHealth.super.prototype.init(self, "PetHealth", "pet")
|
PetHealth.super.prototype.init(self, "PetHealth", "pet")
|
||||||
|
|
||||||
self:SetDefaultColor("PetHealthHappy", 37, 164, 30)
|
self:SetDefaultColor("PetHealthHappy", 37, 164, 30)
|
||||||
self:SetDefaultColor("PetHealthContent", 164, 164, 30)
|
|
||||||
self:SetDefaultColor("PetHealthUnhappy", 164, 30, 30)
|
|
||||||
|
|
||||||
self.scalingEnabled = true
|
self.scalingEnabled = true
|
||||||
end
|
end
|
||||||
@ -54,12 +49,6 @@ function PetHealth.prototype:Enable(core)
|
|||||||
self:RegisterEvent("UNIT_HEALTH", "UpdateEvent")
|
self:RegisterEvent("UNIT_HEALTH", "UpdateEvent")
|
||||||
self:RegisterEvent("UNIT_MAXHEALTH", "UpdateEvent")
|
self:RegisterEvent("UNIT_MAXHEALTH", "UpdateEvent")
|
||||||
|
|
||||||
if IceHUD.WowVer >= 40000 then
|
|
||||||
self:RegisterEvent("UNIT_POWER", "PetHappiness")
|
|
||||||
else
|
|
||||||
self:RegisterEvent("UNIT_HAPPINESS", "PetHappiness")
|
|
||||||
end
|
|
||||||
|
|
||||||
self:RegisterEvent("UNIT_ENTERED_VEHICLE", "EnteringVehicle")
|
self:RegisterEvent("UNIT_ENTERED_VEHICLE", "EnteringVehicle")
|
||||||
self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle")
|
self:RegisterEvent("UNIT_EXITED_VEHICLE", "ExitingVehicle")
|
||||||
self:RegisterEvent("PLAYER_ENTERING_WORLD", "CheckVehicle")
|
self:RegisterEvent("PLAYER_ENTERING_WORLD", "CheckVehicle")
|
||||||
@ -75,24 +64,9 @@ function PetHealth.prototype:Disable(core)
|
|||||||
UnregisterUnitWatch(self.frame)
|
UnregisterUnitWatch(self.frame)
|
||||||
end
|
end
|
||||||
|
|
||||||
function PetHealth.prototype:PetHappiness(event, unit, powertype)
|
|
||||||
if (unit and (unit ~= self.unit)) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if IceHUD.WowVer >= 40000 and (powertype == nil or powertype ~= "HAPPINESS") then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
self.happiness = GetPetHappiness()
|
|
||||||
self.happiness = self.happiness or 3 -- '3' means happy
|
|
||||||
self:Update(unit)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function PetHealth.prototype:CheckPet()
|
function PetHealth.prototype:CheckPet()
|
||||||
if (UnitExists(self.unit)) then
|
if (UnitExists(self.unit)) then
|
||||||
self:PetHappiness(nil, self.unit, "HAPPINESS")
|
|
||||||
self:Update(self.unit)
|
self:Update(self.unit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -109,11 +83,6 @@ function PetHealth.prototype:Update(unit)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local color = "PetHealthHappy"
|
local color = "PetHealthHappy"
|
||||||
if (self.happiness == 2) then
|
|
||||||
color = "PetHealthContent"
|
|
||||||
elseif(self.happiness == 1) then
|
|
||||||
color = "PetHealthUnhappy"
|
|
||||||
end
|
|
||||||
|
|
||||||
if (self.moduleSettings.scaleHealthColor) then
|
if (self.moduleSettings.scaleHealthColor) then
|
||||||
color = "ScaledHealthColor"
|
color = "ScaledHealthColor"
|
||||||
|
Reference in New Issue
Block a user