Skip to content

Commit

Permalink
Proper fix for the bug where the XP bar wouldn't hide on max level
Browse files Browse the repository at this point in the history
  • Loading branch information
azuraji committed Feb 19, 2023
1 parent 928e361 commit 0c7eeb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions FuBar_FuXPFu/FuBar_FuXPFu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions FuBar_FuXPFu/FuBar_FuXPFu.toc
Original file line number Diff line number Diff line change
@@ -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: [email protected]
## X-Credits: Bant (For the design)
Expand Down

0 comments on commit 0c7eeb4

Please sign in to comment.