WoW:API GetFactionInfo: Difference between revisions

m (Added isWatched return value)
Line 1: Line 1:
<center>'''GetFactionInfo''' - ''Documentation by [[User:Ulic|Ulic]]''</center>
{{wowapi}} __NOTOC__
 


Get's details for a specific faction/faction header.
Get's details for a specific faction/faction header.
Line 5: Line 6:
  name, description, standingId, bottomValue, topValue, earnedValue, atWarWith,
  name, description, standingId, bottomValue, topValue, earnedValue, atWarWith,
   canToggleAtWar, isHeader, isCollapsed, isWatched = GetFactionInfo(factionIndex)
   canToggleAtWar, isHeader, isCollapsed, isWatched = GetFactionInfo(factionIndex)
== Parameters ==
== Parameters ==
=== Arguments ===
=== Arguments ===
Line 11: Line 13:
:;factionIndex : Integer - The row of the faction display to request information from.
:;factionIndex : Integer - The row of the faction display to request information from.
=== Returns ===
=== Returns ===
:name, description, standingId, bottomValue, topValue, earnedValue, atWarWith, canToggleAtWar, isHeader, isCollapsed
:name, description, standingId, bottomValue, topValue, earnedValue, atWarWith, canToggleAtWar, isHeader, isCollapsed, isWatched


:;name : String - The display name/label for this row.
:;name : String - The display name/label for this row.
Line 24: Line 26:
:;isCollapsed : Flag - 1 if this row is a collapsed header row, nil otherwise.
:;isCollapsed : Flag - 1 if this row is a collapsed header row, nil otherwise.
:;isWatched : Flag - 1 if this faction is being watched (faction progress bar in default UI), nil otherwise.
:;isWatched : Flag - 1 if this faction is being watched (faction progress bar in default UI), nil otherwise.
== Notes ==
Thanks to [[User:Flickering|Flickering]] for cleaning up the formatting.


----
 
{{WoW API}}
== Example ==
for factionIndex = 1, GetNumFactions() do
  name, description, standingId, bottomValue, topValue, earnedValue, atWarWith,
    canToggleAtWar, isHeader, isCollapsed, isWatched = GetFactionInfo(factionIndex)
  if isHeader == nil then
      DEFAULT_CHAT_FRAME:AddMessage("Faction: " .. name .. " - " .. earnedValue)
  end
end
 
====Result====
:Prints each faction's name and earned value.
Faction: Cenarion Circle - 2785
Faction: Argent Dawn - 405
Faction: Thunder Bluff - 15042
 
[[Category:World of Warcraft API]]
Anonymous user