oUF Reputation

28.9k Downloads

Element not visible on entering world untill reputation window is shown

greven opened this issue ยท 2 comments

commented

If you open the Blizzard factions window and then reload the game without doing anything else, the reputation bar will show up.

From what I found out inspecting the code, problem seems to be with the API function GetSelectedFaction().

If you enter the world and ouput the result of this API call you will see the output is incorrect.
Do the same after having opened the reputation window and reload. The ouput will actually be the correct faction index. That means till the reputation window is opened this API call is returning the wrong information.

Line 6:
local name, _, standingID, min, max, value, _, _, _, _, _, _, _, factionID = GetFactionInfo(GetSelectedFaction())

Line 85 on the Visibility function:
local selectedFaction = GetSelectedFaction()

commented

GetSelectedFaction() refers to the faction you are selecting in the reputation window and not the faction you are watching. Since the Selected Faction at login is the "Other" header, GetFactionInfo will return completely wrong values until you manually select a faction.

This should fix the issue:

Line 6:
local name, standingID, min, max, value, factionID = GetWatchedFactionInfo()

Line 91:
elseif GetWatchedFactionInfo() ~= nil then

commented