oUF Reputation

28.9k Downloads

Error when tracking Legion Exalted Legion factions

greven opened this issue ยท 4 comments

commented

Hey p3lim.
I always get this error when tracking factions in Legion which have the Exalted reward (continue to earn rewards with exalted factions in Legion).

Using the latest version.

1x oUF_lumen\embeds\oUF_Reputation.lua:107: attempt to index local 'colors' (a nil value) oUF_lumen\embeds\oUF_Reputation.lua:107: in function <oUF_lumen\embeds\oUF_Reputation.lua:96> (tail call): ? (tail call): ?

commented

@Rainrider Could you take a look at this? I'm away this week.

commented

@p3lim yes :)

commented

The problem is caused by how you set the colors in your layout. You simply overwrite oUF.colors.reaction in oUF_lumen/config/config.lua. Then you load your embeds before your config, so it ends up missing the color for paragon factions.

The recommended way for customizing oUF.colors is by using a metatable.

On a side note, you do not seem to have embedded oUF_Raputation exactly either:

diff --git a/oUF_Reputation/oUF_Reputation.lua b/oUF_lumen/embeds/oUF_Reputation.lua
index 051cd3d..1ca7a43 100755
--- a/oUF_Reputation/oUF_Reputation.lua
+++ b/oUF_lumen/embeds/oUF_Reputation.lua
@@ -65,14 +65,13 @@ oUF.colors.reaction[MAX_REPUTATION_REACTION + 1] = {0, 0.5, 0.9} -- paragon colo
 
 local function UpdateTooltip(element)
 	local cur, max, name, factionID, standingID, standingText, pendingReward = GetReputation()
-	local rewardAtlas = pendingReward and "|A:ParagonReputation_Bag:0:0:0:0|a" or ""
 	local _, desc = GetFactionInfoByID(factionID)
 	local color = element.__owner.colors.reaction[standingID]
 
 	GameTooltip:SetText(name, color[1], color[2], color[3])
 	GameTooltip:AddLine(desc, nil, nil, nil, true)
 	if(cur ~= max) then
-		GameTooltip:AddLine(format("%s (%s / %s)  %s", standingText, BreakUpLargeNumbers(cur), BreakUpLargeNumbers(max), rewardAtlas), 1, 1, 1)
+		GameTooltip:AddLine(format("%s (%s / %s)", standingText, BreakUpLargeNumbers(cur), BreakUpLargeNumbers(max)), 1, 1, 1)
 	else
 		GameTooltip:AddLine(standingText, 1, 1, 1)
 	end
@@ -105,7 +104,7 @@ local function Update(self, event, unit)
 
 		if(element.colorStanding) then
 			local colors = self.colors.reaction[standingID]
-			element:SetStatusBarColor(colors[1], colors[2], colors[3])
+				element:SetStatusBarColor(colors[1], colors[2], colors[3])
 		end
 
 		if(element.Reward) then

You are also missing https://github.com/p3lim-wow/oUF_Reputation/blob/master/PARAGON.lua

commented

Thanks Rainrider. I thought it was a bug in the module.
Thanks for the pointers. I will look into making those changes then. :)