diff --git a/api/config.lua b/api/config.lua index 0507506c..a812eac9 100644 --- a/api/config.lua +++ b/api/config.lua @@ -676,6 +676,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", "pet", "raidicon", "1") pfUI:UpdateConfig("unitframes", "pet", "leadericon", "1") pfUI:UpdateConfig("unitframes", "pet", "looticon", "1") + pfUI:UpdateConfig("unitframes", "pet", "happinessicon", "0") pfUI:UpdateConfig("unitframes", "pet", "raidiconsize", "24") pfUI:UpdateConfig("unitframes", "pet", "portrait", "bar") pfUI:UpdateConfig("unitframes", "pet", "bartexture", "Interface\\AddOns\\pfUI\\img\\bar") diff --git a/api/unitframes.lua b/api/unitframes.lua index 22352b2c..12dcc5bf 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -1043,21 +1043,25 @@ function pfUI.uf:RefreshIndicators(unit) end if unit.happinessIcon and unit:GetName() == "pfPet" then -- Happiness Icon - if UnitIsVisible("pet") then - local happiness = GetPetHappiness() - if happiness == 1 then - unit.happinessIcon.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\sad") - unit.happinessIcon.texture:SetVertexColor(1, 0, 0, 1) - elseif happiness == 2 then - unit.happinessIcon.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\neutral") - unit.happinessIcon.texture:SetVertexColor(1, 1, 0, 1) - else - unit.happinessIcon.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\happy") - unit.happinessIcon.texture:SetVertexColor(0, 1, 0, 1) - end - unit.happinessIcon:Show() - else + if unit.config.happinessicon == "0" then unit.happinessIcon:Hide() + else + if UnitIsVisible("pet") then + local happiness = GetPetHappiness() + if happiness == 1 then + unit.happinessIcon.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\sad") + unit.happinessIcon.texture:SetVertexColor(1, 0, 0, 1) + elseif happiness == 2 then + unit.happinessIcon.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\neutral") + unit.happinessIcon.texture:SetVertexColor(1, 1, 0, 1) + else + unit.happinessIcon.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\happy") + unit.happinessIcon.texture:SetVertexColor(0, 1, 0, 1) + end + unit.happinessIcon:Show() + else + unit.happinessIcon:Hide() + end end end diff --git a/modules/gui.lua b/modules/gui.lua index caa4b287..dd751d44 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1535,6 +1535,9 @@ pfUI:RegisterModule("gui", 20400, function () CreateConfig(U[c], T["Show PvP-Flag"], C.unitframes[c], "showPVP", "checkbox") CreateConfig(U[c], T["Show Loot Icon"], C.unitframes[c], "looticon", "checkbox") CreateConfig(U[c], T["Show Leader Icon"], C.unitframes[c], "leadericon", "checkbox") + if c == "pet" then + CreateConfig(U[c], T["Show Happiness Icon"], C.unitframes[c], "happinessicon", "checkbox") + end CreateConfig(U[c], T["Show Raid Mark"], C.unitframes[c], "raidicon", "checkbox") CreateConfig(U[c], T["Raid Mark Size"], C.unitframes[c], "raidiconsize") CreateConfig(U[c], T["Show Class Buff Indicators"], C.unitframes[c], "buff_indicator", "checkbox")