Faction Addict

Description:Faction Addict is a stand-alone addon that provides additional faction information to your characters working towards faction based achievements. Intended for those players who work on gaining exalted with many factions but also helpful to those that do not. There are in game achievements for being exalted with 1, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, and 60 factions respectively.

Faction Addict also provides a reputation logging system that allows the player to see what reputation gains they have made in the current and previous sessions.

Use slash commands /fa or /factionaddict or click the new button on the upper right corner of your characters reputation panel to open and/or close the addon window.

Usage: (slash commands)

/fa

/factionaddict

*click button* on upper right corder of character's reputation page

Features:

Factions - Shows all factions - including those not "known" by your character.

Log - Reputation gain logging - shows reputation gains your characters has made in the current and previous sessions.

Faction info panel - click on a faction in the addon to see more specific info.

Exalted Count - Shows count of exalted factions and how many required for next achievement.

Exalted Achievements Tooltip - Show which character earned which achievement on what date

Display Ordering - Faction display can be ordered by % to exalted or faction name.

v1.27 (2015-01-06)
------------------
* 'Last Gain' entry at the top of the Log page of the addon has been modified to better accomodate long faction names. For example - displaying 'Steamwheedle Preservation Society' would cause the gain digits to be chopped off. Now long faction names will be truncated so that at least 4 gain digits can be displayed on that line.

v1.25 (2014-11-25)
------------------
* BUGFIX: Auto-Change Reputation Bar - auto-change would not work if the Faction Addict window had not been opened prior to there being a CHAT_MSG_COMBAT_FACTION_CHANGE event. (for example - 'Reputation with Lower City increased by 300.' in the chat) Changed to make sure required data is loaded prior to addon window being opened.

v1.23 (2014-11-11)
------------------
* NEW FEATURE: a search feature has been added to the main factions tab. Click the search icon in the top right of the addon (next to standing filter) to toggle the search field

v1.22 (2014-10-28)
------------------
* BUGFIX: exalted achievements tooltip - there was a case where character name was not returned by server when getting achievement data causing the name to be blank () in tooltip. This usually occurs on lower lever characters with few addons where the character loads into the game very quickly.

v1.21 (2014-10-27)
------------------
* German Localization Added - All credit and thanks to Harry! for submitting the changes for the german [deDE] localization.
* Exalted Achievements Tooltip UPDATED! - Now more easily tell which character on your account earned which exalted achievement and the date it was earned. To show this summary tooltip hover the mouse over the Next/Shown/Exalted text at the bottom of the main addon tab.

v1.20 (2014-10-24)
------------------
* BUGFIX: fix for error 'attempt to concatenate local faction a nil value' - lua error when the first reputation gain of the sessions was for your guild

v1.19 (2014-10-14)
------------------
* BUGFIX: fix for error 'attempt to concatenate upvalue lfgBonusFactionID' if you were seeing that one

v1.18 (2014-10-14)
------------------
* Added 'Star' indicator from default UI to support LFG Bonus Faction
* [ESC] will now close the addon with all other UI elements.
* Clean up some unnecessary table allocations.
* Force data update on PLAYER_LOGIN event - client was not getting all faction data on initial addon load
* Other minor bugfixes

v1.12 (2013-04-06)
------------------
* New Feature! - Auto-Change Reputation Bar - reputation bar will now auto-change to faction that had last gain, not including your guild faction gains. This feature can be turned on/off via the config tab.
* New Feature! - Hide Inactive Factions - Faction display will hide any factions your mark as inactive in the default reputation ui. (Click 'Move to Inactive') This feature can be turned on/off via the config tab.
* Much credit to Phanx for help on this update. Thanks Phanx!

v1.11 (2013-03-28)
------------------
* Added indicator on reputation bars for account wide 'bonus reputation'. This is the bonus unlocked when you buy the various Grand Commendations from faction quartermasters. (Same indicator as used in the default ui)
* NOTE - 'Champion a faction' star indicators still to be added in future release

v1.06 (2012-8-28)
------------------
* Changes to support Mists of Pandaria, client 5.0.4.
* Added many new factions identified in MoP. More sorting and config options will be added for them in the future.

I don't know why Blizzard designs APIs like this... the pet journal is the same, but infinitely worse. Anyway, a simple flag to prevent recursion should be sufficient. I updated my previous code and combined them:

You can continue to call UpdateInactiveFactionList() in response to UPDATE_FACTION; it won't run again if it's already in the middle of a run. SetWatchedFactionByID(factionID) will still trigger the events, but won't cause UpdateInactiveFactionList to run while it's running. Instead of a table lookup to determine if a faction is inactive, call IsFactionInactive(factionID).

With the latter, you just need to call the UpdateInactiveFactionsList function in response to the UPDATE_FACTION event, and then you can check InactiveFactions[factionID] to see if a particular faction should be ignored...

Hi Phanx. I was able to implement the auto-change reputation bar without issue. However having some problem with inactive factions.

The problem is that UpdateInactiveFactionsList itself generates multiple UPDATE_FACTION events as the headers are expanded and collapsed. So the whole thing kind of recurses on itself and stack overflows when you call it in response to an UPDATE_FACTION event. I had a thought of unregistering that event handler while in the function but seems a bit risky. Any thoughts?

With the latter, you just need to call the UpdateInactiveFactionsList function in response to the UPDATE_FACTION event, and then you can check InactiveFactions[factionID] to see if a particular faction should be ignored:

Code:

if InactiveFactions[factionID] then
-- don't display
else
-- display
end

Both functions will have no visible impact on the state of the default faction panel, so even if the user is currently viewing it, they won't notice the headers being collapsed/expanded.

This is somewhat difficult with the current implementation of Faction Addict. FA was written to be independent of the default reputation UI. That means it can only use faction APIs that pass faction ID and can't really use those that pass a faction INDEX. When I looked into workaround sometime back for mapping INDEXes to IDs I realized that the indexes keep changing based on what is currently displayed and/or folded/unfolded in the default display. It added a level of complexity that I didn't want to deal with.

This is also why I've not been able to easily implement the quick change reputation bar as SetWatchedFactionIndex(index) uses the indexes instead of Faction IDs.

It is more likely that I would implement custom standalone active/inactive and reputatation bar features into the addon than try to find a workaround with the indexes. But it will take some time.

Thanks!

Originally Posted by Phanx

Could you add an option to not display factions the player has moved to the Inactive group? When you're scanning the faction list, just check the text of each header you encounter against the FACTION_INACTIVE global. If it's a match, stop the scan; all the remaining factions are in the Inactive group.

This would help keep the list clean. For example, I don't need to see Forest Hozen at the top of the list (99.52% Revered)... Blizzard failed to consider that not all players are guilded (with the +rep bonus from their guild) when setting the rep rewards for those quests, and didn't fix it until after I'd already leveled through Jade Forest and done all the quests, so I can never gain any more rep with them to get Exalted. Then there are some factions that are just totally useless, like the Gelkis and Magram Clan Centaur from the level 30 quests in Desolace back in Vanilla... I'm not even sure those quests exist anymore.

Could you add an option to not display factions the player has moved to the Inactive group? When you're scanning the faction list, just check the text of each header you encounter against the FACTION_INACTIVE global. If it's a match, stop the scan; all the remaining factions are in the Inactive group.

This would help keep the list clean. For example, I don't need to see Forest Hozen at the top of the list (99.52% Revered)... Blizzard failed to consider that not all players are guilded (with the +rep bonus from their guild) when setting the rep rewards for those quests, and didn't fix it until after I'd already leveled through Jade Forest and done all the quests, so I can never gain any more rep with them to get Exalted. Then there are some factions that are just totally useless, like the Gelkis and Magram Clan Centaur from the level 30 quests in Desolace back in Vanilla... I'm not even sure those quests exist anymore.

Haven't started using it yet, but reading the blurbs make me pretty sure I want to.

One tracking feature that would be useful would be to track the guild achievement for 55 exalted reps. Even BETTER would be if it had a way to figure out if anyone else in your guild (for whatever value of 'anyone else' is accessable to the API level) is closer than you to ones that are needed.

Of course, going the latter way makes one think of lots of features for Guild Achievement Addict. I just haven't gotten around to examining the API for access to guild member info. Right now, my guild on Elune doesn't seem to exist to the Armory, so there's more desire for me to get info via addons.