Thread Tools Display Modes
04/24/14, 12:49 PM   #1
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 650
Detect Faction and Map Names

I am trying to limit the number of information in HarvestMap based on Faction and Map name. Is there a way to detect your faction such that I can say if you are in Such and Such Faction then your list of map names is Such and Such. Then if you were importing Eshoead data it would limit the information imported.

Edit: Never mind it's, Alliance, not Faction.

GetUnitAlliance(string unitTag)
Returns: integer alliance

Last edited by Sharlikran : 04/24/14 at 01:06 PM.
  Reply With Quote
04/25/14, 07:09 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Sharlikran View Post
I am trying to limit the number of information in HarvestMap based on Faction and Map name. Is there a way to detect your faction such that I can say if you are in Such and Such Faction then your list of map names is Such and Such. Then if you were importing Eshoead data it would limit the information imported.

Edit: Never mind it's, Alliance, not Faction.

GetUnitAlliance(string unitTag)
Returns: integer alliance
I'm not sure if it is good idea, as in veteran content you have access to all maps.

But:
local alliance = GetUnitAlliance("player")

valid alliance values are:
ALLIANCE_NONE = 0
ALLIANCE_ALDMERI_DOMINION = 1
ALLIANCE_EBONHEART_PACT = 2
ALLIANCE_DAGGRTFALL_COVENANT = 3

Alliance names:
GetString("SI_SHORT_ALLIANCE", aliiance)
--returns localized short names such as "Dominion", "Pact" or "Covenant".

GetString("SI_ALLIANCE", alliance)
GetAllianceName(alliance)
GetColoredAllianceName(alliance)
--returns localized names such as "Aldmeri Dominion", "Ebonheart Pact", "Daggerfall Covenant".

Note: To be sure that localized alliance names does not contain any control characters (^) you can use zo_strformat(SI_ALLIANCE_NAME, allianceName)

Alliance symbols:
GetAllianceTexture(alliance) --("EsoUI/Art/AvA/AvA_HUD_emblem_aldmeri.dds", ...)
GetAllianceSymbolIcon(alliance) --black&white symbol, 32x32 pixels
GetLargeAllianceSymbolIcon(alliance) --black&white symbol, 64x64 pixels
GetAllianceBannerIcon(alliance) --colored flag, 256x512 pixels

Alliance colors:
local color = GetAllianceColor(alliance)
--color:UnpackRGB() returns table {r, g, b}
--color:UnpackRGBA() returns table {r, g, b, a }
--color:Colorize(text) returns string with color code - i.e. "|cFFFFFFmy colored text|r".
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Detect Faction and Map Names


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off