Commit e66fad7b authored by Tukz's avatar Tukz

More details for pet happiness.

parent b8c82a46
......@@ -8,12 +8,6 @@ oUF.colors.disconnected = {
0.1, 0.1, 0.1
}
oUF.colors.runes = {
[1] = {0.69, 0.31, 0.31},
[2] = {0.41, 0.80, 1.00},
[3] = {0.65, 0.63, 0.35},
}
oUF.colors.reaction = {
[1] = { 0.87, 0.37, 0.37 }, -- Hated
[2] = { 0.87, 0.37, 0.37 }, -- Hostile
......
......@@ -120,6 +120,8 @@ T.SlashHandler = function(cmd)
T.Print("Pet is doing " .. DamagePercentage .. "% damage")
T.Print("Pet is " .. Loyalty .. " loyalty")
end
T.Print("You can also track your current pet happiness according to the pet frame health bar color. Red mean unhappy, yellow mean content, green mean happy.")
elseif (arg1 == "c" or arg1 == "config") then
T.GUI:Toggle()
elseif (arg1 == "gold") and (arg2 == "reset") then
......
local parent, ns = ...
local oUF = ns.oUF
local Update = function(self, event, unit, powerType)
if(self.unit ~= unit) then return end
local happ = self.Happiness
if(happ and (powerType == 'HAPPINESS' or not powerType)) then
local happiness = GetPetHappiness()
local _, hunterPet = HasPetUI()
if(not (happiness or hunterPet)) then
return happ:Hide()
end
happ:Show()
if(happiness == 1) then
happ:SetTexCoord(0.375, 0.5625, 0, 0.359375)
elseif(happiness == 2) then
happ:SetTexCoord(0.1875, 0.375, 0, 0.359375)
elseif(happiness == 3) then
happ:SetTexCoord(0, 0.1875, 0, 0.359375)
end
if(happ.PostUpdate) then
return happ:PostUpdate(unit, happiness)
end
end
end
local Path = function(self, ...)
return (self.Happiness.Override or Update) (self, ...)
end
local ForceUpdate = function(element)
return Path(element.__owner, 'ForceUpdate', element.__owner.unit)
end
local Enable = function(self)
local happiness = self.Happiness
if(happiness) then
happiness.__owner = self
happiness.ForceUpdate = ForceUpdate
self:RegisterEvent('UNIT_POWER_UPDATE', Path)
if(happiness:IsObjectType"Texture" and not happiness:GetTexture()) then
happiness:SetTexture[[Interface\PetPaperDollFrame\UI-PetHappiness]]
end
return true
end
end
local Disable = function(self)
local happiness = self.Happiness
if(happiness) then
self:UnregisterEvent('UNIT_POWER_UPDATE', Path)
end
end
oUF:AddElement('Happiness', Path, Enable, Disable)
......@@ -14,7 +14,6 @@
<Script file="elements\classpower.lua"/>
<Script file="elements\combatindicator.lua"/>
<Script file="elements\druidmana.lua"/>
<Script file="elements\happiness.lua"/>
<Script file="elements\health.lua"/>
<Script file="elements\leaderindicator.lua"/>
<Script file="elements\phaseindicator.lua"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment