View Single Post
06-10-10, 07:22 PM   #1
acapela
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 241
Identifying Faction Names?

i am trying to parse faction names out of Blizzard unit tooltips (canonically, the faction of a unit seems to occur right after the unit level, if it exists, and if it does not indicate the unit is flagged for PvP). however, it seems that the default tooltip also includes quest information, and perhaps other things, in that location. so my parsing is identifying "false positives".

i am looking for a way to determine whether a generic string contains a valid faction name. i see the GetFactionInfo() API, and i could cycle through all of that for the factions that the player "knows" about. but i doubt that covers everything.

can anyone suggest another API-oriented approach, or know of a global variable containing localized faction strings, or some such? all i need is a "quick" true/false test (basically a set membership test): does a given string contain a faction name? or, a reliable way to construct such a set.

i rummaged the MPQ lua without success.

thanks in advance.
__________________
Retired author/maintainer of Aloft (the nameplate addon)
http://www.wowinterface.com/download...AloftBeta.html
-----
Zippy said it best: "All life is a BLUR of Republicans and Meat!"
  Reply With Quote