Commit 914e389b authored by Tukz's avatar Tukz
Browse files

Update ExperienceBar.lua

parent 00f9a493
......@@ -14,10 +14,6 @@ Experience.PetXPColor = {255 / 255, 255 / 255, 105 / 255}
function Experience:SetTooltip()
local BarType = self.BarType
local Current, Max, Pts
local happiness, damagePercentage, loyaltyRate
local happy
local loyalty
local petIcon, petName, petLevel, petType, petLoyalty
if (self == Experience.XPBar1) then
GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", -1, 5)
......@@ -41,23 +37,24 @@ function Experience:SetTooltip()
GameTooltip:AddLine("|cff4BAF4C"..TUTORIAL_TITLE26..": +" .. Rested .." (" .. floor(Rested / Max * 100) .. "%)|r")
end
elseif BarType == "PETXP" then
Current, Max = GetPetExperience()
happiness, damagePercentage, loyaltyRate = GetPetHappiness()
happy = ({"|cffFF0000Unhappy|r", "|cffFFFF00Content|r", "|cff00FF00Happy|r"})[happiness]
loyalty = loyaltyRate > 0 and "|cff00FF00gaining|r" or "|cffFF0000losing|r"
petIcon, petName, petLevel, petType, petLoyalty = GetStablePetInfo(0)
Local Happiness, DamagePercentage, LoyaltyRate = GetPetHappiness()
local Happy = ({"|cffFF0000Unhappy|r", "|cffFFFF00Content|r", "|cff00FF00Happy|r"})[Happiness]
local Loyalty = LoyaltyRate > 0 and "|cff00FF00gaining|r" or "|cffFF0000losing|r"
local PetIcon, PetName, PetLevel, PetType, PetLoyalty = GetStablePetInfo(0)
Current, Max = GetPetExperience()
if Max == 0 then
return
end
GameTooltip:AddLine("" ..petName.."")
GameTooltip:AddLine("" ..PetName.."")
GameTooltip:AddLine(" ")
GameTooltip:AddDoubleLine("|cffFFFFFFType:|r","|cffFFFFFF"..petType.."|r")
GameTooltip:AddDoubleLine("|cffFFFFFFLevel:|r","|cffFFFFFF"..petLevel.."|r")
GameTooltip:AddDoubleLine("|cffFFFFFFHappiness:|r",""..happy.."")
GameTooltip:AddDoubleLine("|cffFFFFFFDamage:|r","|cffFFFFFF"..damagePercentage.."%|r")
GameTooltip:AddDoubleLine("|cffFFFFFFLoyalty:|r",""..loyalty.."")
GameTooltip:AddDoubleLine("|cffFFFFFFType:|r","|cffFFFFFF"..PetType.."|r")
GameTooltip:AddDoubleLine("|cffFFFFFFLevel:|r","|cffFFFFFF"..PetLevel.."|r")
GameTooltip:AddDoubleLine("|cffFFFFFFHappiness:|r",""..Happy.."")
GameTooltip:AddDoubleLine("|cffFFFFFFDamage:|r","|cffFFFFFF"..DamagePercentage.."%|r")
GameTooltip:AddDoubleLine("|cffFFFFFFLoyalty:|r",""..Loyalty.."")
GameTooltip:AddDoubleLine(" ")
GameTooltip:AddLine("|cffFFFF66PET XP: " .. Current .. " / " .. Max .. " (" .. floor(Current / Max * 100) .. "% - " .. floor(Bars - (Bars * (Max - Current) / Max)) .. "/" .. Bars .. ")|r")
end
......
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