Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit 13db259

Browse files
committed
fixed #431 and #432
1 parent 29057ad commit 13db259

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

Objects/STATUSBTN.lua

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -449,30 +449,29 @@ function STATUSBTN:repstrings_Update(repGainedString)
449449
isParagon = C_Reputation.IsFactionParagon(factionID)
450450
end
451451

452-
if not friendID then --not a "Friendship" faction, i.e. Chromie or Brawlers Guild
453-
if not isParagon then
454-
colors.r, colors.g, colors.b = BAR_REP_DATA[standingID].r, BAR_REP_DATA[standingID].g, BAR_REP_DATA[standingID].b
455-
standing = BAR_REP_DATA[standingID].l --convert numerical standingID to text i.e "Exalted" instead of 8
456-
else
457-
local para_value, para_max, _, hasRewardPending = C_Reputation.GetFactionParagonInfo(factionID);
458-
value = para_value % para_max;
459-
max = para_max
460-
if hasRewardPending then
461-
name = name.." ("..L["Reward"]:upper()..")"
452+
if not isParagon then
453+
colors.r, colors.g, colors.b = BAR_REP_DATA[standingID].r, BAR_REP_DATA[standingID].g, BAR_REP_DATA[standingID].b
454+
standing = BAR_REP_DATA[standingID].l --convert numerical standingID to text i.e "Exalted" instead of 8
455+
--if not friendID then --not a "Friendship" faction, i.e. Chromie or Brawlers Guild
456+
if friendID then --is a "Friendship" faction
457+
if not string.find(name, "Brawl'gar Arena") or string.find(name, "Bizmo's Brawlpub") then --these two use the normal 9 rank system, the rest use a 7 rank system
458+
if standingID + 2 > 8 then
459+
standingID = 7
460+
end
461+
colors.r, colors.g, colors.b = BAR_REP_DATA[standingID+2].r, BAR_REP_DATA[standingID+2].g, BAR_REP_DATA[standingID+2].b --offset by two, because friendships don't have "hated" or "hostile" ranks
462462
end
463-
min = 0
464-
colors.r, colors.g, colors.b = BAR_REP_DATA[9].r, BAR_REP_DATA[9].g, BAR_REP_DATA[9].b
465-
standing = BAR_REP_DATA[9].l --set standing text to be "Paragon"
466463
end
467-
else --is a "Friendship" faction
468-
if string.find(name, "Brawl'gar Arena") or string.find(name, "Bizmo's Brawlpub") then
469-
colors.r, colors.g, colors.b = BAR_REP_DATA[standingID].r, BAR_REP_DATA[standingID].g, BAR_REP_DATA[standingID].b
470-
else
471-
if standingID + 2 > 8 then
472-
standingID = 6
473-
end
474-
colors.r, colors.g, colors.b = BAR_REP_DATA[standingID+2].r, BAR_REP_DATA[standingID+2].g, BAR_REP_DATA[standingID+2].b --offset by two, because friendships don't have "hated" or "hostile" ranks
464+
else
465+
local para_value, para_max, _, hasRewardPending = C_Reputation.GetFactionParagonInfo(factionID);
466+
standingID = 9
467+
value = para_value % para_max;
468+
max = para_max
469+
if hasRewardPending then
470+
name = name.." ("..L["Reward"]:upper()..")"
475471
end
472+
min = 0
473+
colors.r, colors.g, colors.b = BAR_REP_DATA[9].r, BAR_REP_DATA[9].g, BAR_REP_DATA[9].b
474+
standing = BAR_REP_DATA[9].l --set standing text to be "Paragon"
476475
end
477476

478477
local repData = self:SetRepWatch(i, name, standing, header, min, max, value, colors)
@@ -1285,7 +1284,7 @@ function STATUSBTN:OnEnter()
12851284
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
12861285
end
12871286

1288-
GameTooltip:SetText(self.tFunc(self.StatusBar) or "", self.tColor[1] or 1, self.tColor[2] or 1, self.tColor[3] or 1, self.tColor[4] or 1)
1287+
GameTooltip:SetText(self:tFunc() or "", self.tColor[1] or 1, self.tColor[2] or 1, self.tColor[3] or 1, self.tColor[4] or 1)
12891288
GameTooltip:Show()
12901289
end
12911290
end
@@ -1749,6 +1748,7 @@ function STATUSBTN:SetData(bar)
17491748
if not sbStrings[self.config.sbType][self.config.tIndex] then
17501749
self.config.tIndex = 1
17511750
end
1751+
17521752
self.tFunc = sbStrings[self.config.sbType][self.config.tIndex][2]
17531753

17541754
else

0 commit comments

Comments
 (0)