ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Detect Faction and Map Names (https://www.esoui.com/forums/showthread.php?t=1137)

Sharlikran 04/24/14 12:49 PM

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

Garkin 04/25/14 07:09 AM

Quote:

Originally Posted by Sharlikran (Post 5660)
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".


All times are GMT -6. The time now is 08:55 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI