revisit Faction Reputation
Discovered and integrated the previously undocumented GetFactionInfoByID API call, allowing removal of a workaround table that was no longer needed. Also verified faction localizations across common client faction.dbc files and cleaned up Cataclysm factions that were incorrectly included in the 3.3.5a version of the LibBabble library.
This commit is contained in:
+19
-125
@@ -1690,29 +1690,24 @@ Private.ExecEnv.GetFactionDataByIndex = function(index)
|
||||
end
|
||||
|
||||
Private.ExecEnv.GetFactionDataByID = function(ID)
|
||||
local factionName = ID and Private.id_to_faction[ID]
|
||||
if factionName then
|
||||
for index = 1, GetNumFactions() do
|
||||
local name, description, standingID, barMin, barMax, barValue, atWarWith, canToggleAtWar, isHeader, isCollapsed, hasRep, isWatched, isChild = GetFactionInfo(index)
|
||||
if name == factionName then
|
||||
return {
|
||||
factionID = ID,
|
||||
name = name,
|
||||
description = description,
|
||||
reaction = standingID,
|
||||
currentReactionThreshold = barMin,
|
||||
nextReactionThreshold = barMax,
|
||||
currentStanding = barValue,
|
||||
atWarWith = atWarWith or false,
|
||||
canToggleAtWar = canToggleAtWar,
|
||||
isChild = isChild,
|
||||
isHeader = isHeader,
|
||||
isHeaderWithRep = hasRep,
|
||||
isCollapsed = isCollapsed,
|
||||
isWatched = isWatched,
|
||||
}
|
||||
end
|
||||
end
|
||||
local name, description, standingID, barMin, barMax, barValue, atWarWith, canToggleAtWar, isHeader, isCollapsed, hasRep, isWatched, isChild = GetFactionInfoByID(ID or 0)
|
||||
if name then
|
||||
return {
|
||||
factionID = ID,
|
||||
name = name,
|
||||
description = description,
|
||||
reaction = standingID,
|
||||
currentReactionThreshold = barMin,
|
||||
nextReactionThreshold = barMax,
|
||||
currentStanding = barValue,
|
||||
atWarWith = atWarWith or false,
|
||||
canToggleAtWar = canToggleAtWar,
|
||||
isChild = isChild,
|
||||
isHeader = isHeader,
|
||||
isHeaderWithRep = hasRep,
|
||||
isCollapsed = isCollapsed,
|
||||
isWatched = isWatched,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3754,100 +3749,10 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
Private.id_to_faction = {
|
||||
["21"] = L["Booty Bay"],
|
||||
["47"] = L["Ironforge"],
|
||||
["54"] = L["Gnomeregan"],
|
||||
["59"] = L["Thorium Brotherhood"],
|
||||
["67"] = L["Horde"],
|
||||
["68"] = L["Undercity"],
|
||||
["69"] = L["Darnassus"],
|
||||
["70"] = L["Syndicate"],
|
||||
["72"] = L["Stormwind"],
|
||||
["76"] = L["Orgrimmar"],
|
||||
["81"] = L["Thunder Bluff"],
|
||||
["87"] = L["Bloodsail Buccaneers"],
|
||||
["92"] = L["Gelkis Clan Centaur"],
|
||||
["93"] = L["Magram Clan Centaur"],
|
||||
["270"] = L["Zandalar Tribe"],
|
||||
["349"] = L["Ravenholdt"],
|
||||
["369"] = L["Gadgetzan"],
|
||||
["469"] = L["Alliance"],
|
||||
["470"] = L["Ratchet"],
|
||||
["509"] = L["The League of Arathor"],
|
||||
["510"] = L["The Defilers"],
|
||||
["529"] = L["Argent Dawn"],
|
||||
["530"] = L["Darkspear Trolls"],
|
||||
["576"] = L["Timbermaw Hold"],
|
||||
["577"] = L["Everlook"],
|
||||
["589"] = L["Wintersaber Trainers"],
|
||||
["609"] = L["Cenarion Circle"],
|
||||
["729"] = L["Frostwolf Clan"],
|
||||
["730"] = L["Stormpike Guard"],
|
||||
["749"] = L["Hydraxian Waterlords"],
|
||||
["809"] = L["Shen'dralar"],
|
||||
["889"] = L["Warsong Outriders"],
|
||||
["890"] = L["Silverwing Sentinels"],
|
||||
["909"] = L["Darkmoon Faire"],
|
||||
["910"] = L["Brood of Nozdormu"],
|
||||
["911"] = L["Silvermoon City"],
|
||||
["922"] = L["Tranquillien"],
|
||||
["930"] = L["Exodar"],
|
||||
["932"] = L["The Aldor"],
|
||||
["933"] = L["The Consortium"],
|
||||
["934"] = L["The Scryers"],
|
||||
["935"] = L["The Sha'tar"],
|
||||
["941"] = L["The Mag'har"],
|
||||
["942"] = L["Cenarion Expedition"],
|
||||
["946"] = L["Honor Hold"],
|
||||
["947"] = L["Thrallmar"],
|
||||
["967"] = L["The Violet Eye"],
|
||||
["970"] = L["Sporeggar"],
|
||||
["978"] = L["Kurenai"],
|
||||
["989"] = L["Keepers of Time"],
|
||||
["990"] = L["The Scale of the Sands"],
|
||||
["1011"] = L["Lower City"],
|
||||
["1012"] = L["Ashtongue Deathsworn"],
|
||||
["1015"] = L["Netherwing"],
|
||||
["1031"] = L["Sha'tari Skyguard"],
|
||||
["1037"] = L["Alliance Vanguard"],
|
||||
["1038"] = L["Ogri'la"],
|
||||
["1050"] = L["Valiance Expedition"],
|
||||
["1052"] = L["Horde Expedition"],
|
||||
["1064"] = L["The Taunka"],
|
||||
["1067"] = L["The Hand of Vengeance"],
|
||||
["1068"] = L["Explorers' League"],
|
||||
["1073"] = L["The Kalu'ak"],
|
||||
["1077"] = L["Shattered Sun Offensive"],
|
||||
["1085"] = L["Warsong Offensive"],
|
||||
["1090"] = L["Kirin Tor"],
|
||||
["1091"] = L["The Wyrmrest Accord"],
|
||||
["1094"] = L["The Silver Covenant"],
|
||||
["1098"] = L["Knights of the Ebon Blade"],
|
||||
["1104"] = L["Frenzyheart Tribe"],
|
||||
["1105"] = L["The Oracles"],
|
||||
["1106"] = L["Argent Crusade"],
|
||||
["1119"] = L["The Sons of Hodir"],
|
||||
["1124"] = L["The Sunreavers"],
|
||||
["1126"] = L["The Frostborn"],
|
||||
["1133"] = L["Bilgewater Cartel"],
|
||||
["1134"] = L["Gilneas"],
|
||||
["1135"] = L["The Earthen Ring"],
|
||||
["1156"] = L["The Ashen Verdict"],
|
||||
["1158"] = L["Guardians of Hyjal"],
|
||||
["1171"] = L["Therazane"],
|
||||
["1172"] = L["Dragonmaw Clan"],
|
||||
["1173"] = L["Ramkahen"],
|
||||
["1174"] = L["Wildhammer Clan"],
|
||||
["1177"] = L["Baradin's Wardens"],
|
||||
["1178"] = L["Hellscream's Reach"],
|
||||
["10000"] = L["Winterfin Retreat"],
|
||||
}
|
||||
|
||||
Private.faction_to_id = {
|
||||
[L["Booty Bay"]] = 21,
|
||||
[L["Ironforge"]] = 47,
|
||||
[L["Gnomeregan"]] = 54,
|
||||
[L["Gnomeregan Exiles"]] = 54,
|
||||
[L["Thorium Brotherhood"]] = 59,
|
||||
[L["Horde"]] = 67,
|
||||
[L["Undercity"]] = 68,
|
||||
@@ -3920,18 +3825,7 @@ Private.faction_to_id = {
|
||||
[L["The Sons of Hodir"]] = 1119,
|
||||
[L["The Sunreavers"]] = 1124,
|
||||
[L["The Frostborn"]] = 1126,
|
||||
[L["Bilgewater Cartel"]] = 1133,
|
||||
[L["Gilneas"]] = 1134,
|
||||
[L["The Earthen Ring"]] = 1135,
|
||||
[L["The Ashen Verdict"]] = 1156,
|
||||
[L["Guardians of Hyjal"]] = 1158,
|
||||
[L["Therazane"]] = 1171,
|
||||
[L["Dragonmaw Clan"]] = 1172,
|
||||
[L["Ramkahen"]] = 1173,
|
||||
[L["Wildhammer Clan"]] = 1174,
|
||||
[L["Baradin's Wardens"]] = 1177,
|
||||
[L["Hellscream's Reach"]] = 1178,
|
||||
[L["Winterfin Retreat"]] = 10000,
|
||||
}
|
||||
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user