From 0c7eeb464140c7b49e59b39bd4ff9e63b839ec96 Mon Sep 17 00:00:00 2001 From: azuraji <72912613+azuraji@users.noreply.github.com> Date: Sun, 19 Feb 2023 15:53:37 +0100 Subject: [PATCH] Proper fix for the bug where the XP bar wouldn't hide on max level --- FuBar_FuXPFu/FuBar_FuXPFu.lua | 11 ++++++----- FuBar_FuXPFu/FuBar_FuXPFu.toc | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/FuBar_FuXPFu/FuBar_FuXPFu.lua b/FuBar_FuXPFu/FuBar_FuXPFu.lua index bc56f5e..42ea32a 100644 --- a/FuBar_FuXPFu/FuBar_FuXPFu.lua +++ b/FuBar_FuXPFu/FuBar_FuXPFu.lua @@ -586,8 +586,9 @@ function FuXP:Reanchor() end function FuXP:ShowBar() - self:HideBar() - if self.db.profile.ShowXP == true and not UnitLevel("player") == MAX_PLAYER_LEVEL then + self:HideBar() + + if self.db.profile.ShowXP == true and UnitLevel("player") ~= MAX_PLAYER_LEVEL then self.XPBar:Show() self.Spark:Show() self.Spark2:Show() @@ -660,7 +661,7 @@ function FuXP:OnDataUpdate() self.RepBarTex:SetVertexColor(self.db.profile.ParagonRep[1], self.db.profile.ParagonRep[2], self.db.profile.ParagonRep[3], self.db.profile.ParagonRep[4]) self.RepSpark:SetVertexColor(self.db.profile.ParagonRep[1], self.db.profile.ParagonRep[2], self.db.profile.ParagonRep[3], self.db.profile.Spark) - elseif friendshipReputationInfo.friendshipFactionID == factionID then --Friendship + elseif friendshipReputationInfo and friendshipReputationInfo.friendshipFactionID == factionID then --Friendship minRep = 0 maxRep = friendshipReputationInfo.nextThreshold and friendshipReputationInfo.nextThreshold - friendshipReputationInfo.reactionThreshold or friendshipReputationInfo.maxRep currentRep = maxRep - (friendshipReputationInfo.nextThreshold and friendshipReputationInfo.nextThreshold - friendshipReputationInfo.standing or 0) @@ -753,7 +754,7 @@ function FuXP:OnTextUpdate() currentRep = currentRepParagon % maxRepParagon factionStandingLabel = "|cffB2D7F7Paragon" - elseif friendshipReputationInfo.friendshipFactionID == factionID then --Friendship + elseif friendshipReputationInfo and friendshipReputationInfo.friendshipFactionID == factionID then --Friendship minRep = 0 maxRep = friendshipReputationInfo.nextThreshold and friendshipReputationInfo.nextThreshold - friendshipReputationInfo.reactionThreshold or friendshipReputationInfo.maxRep currentRep = maxRep - (friendshipReputationInfo.nextThreshold and friendshipReputationInfo.nextThreshold - friendshipReputationInfo.standing or 0) @@ -876,7 +877,7 @@ function FuXP:OnTooltipUpdate() currentRep = currentRepParagon % maxRepParagon standing = "|cffB2D7F7Paragon|r" --Paragon - elseif friendshipReputationInfo.friendshipFactionID == factionID then + elseif friendshipReputationInfo and friendshipReputationInfo.friendshipFactionID == factionID then maxRep = friendshipReputationInfo.nextThreshold and friendshipReputationInfo.nextThreshold - friendshipReputationInfo.reactionThreshold or friendshipReputationInfo.maxRep currentRep = maxRep - (friendshipReputationInfo.nextThreshold and friendshipReputationInfo.nextThreshold - friendshipReputationInfo.standing or 0) diff --git a/FuBar_FuXPFu/FuBar_FuXPFu.toc b/FuBar_FuXPFu/FuBar_FuXPFu.toc index 1b2ff15..4856e3d 100644 --- a/FuBar_FuXPFu/FuBar_FuXPFu.toc +++ b/FuBar_FuXPFu/FuBar_FuXPFu.toc @@ -1,10 +1,10 @@ -## Interface: 100002 +## Interface: 100005 ## Title: FuBar - |cffffffffFuXP|r|cff00ff00Fu|r ## Title-koKR: |CFF99FF99F|CFFFFFFFFu|CFF99FF99B|CFFFFFFFFar - |cffffffffFuXP|r|cff00ff00Fu|r ## Notes: Lightweight XP Bar ## Notes-zhCN: 迷你经验条 ## Notes-zhTW: 輕量級的經驗值條模組。 -## Version: 10.0.2.8 +## Version: 10.0.5.0 ## Author: Wobin, azuraji ## eMail: wobster@gmail.com ## X-Credits: Bant (For the design)