mapID = C_Map.GetBestMapForUnit("player") |
if(mapID) then |
x,y = C_Map.GetPlayerMapPosition(mapID,"player"):GetXY() |
if(x) then |
if(y) then |
playerCoords = format("%.1f, %.1f", x*100, y*100) |
end |
if(x and y) then |
playerCoords = format("%.1f, %.1f", x*100, y*100) |
end |
end |
end |
local colorlist = { |
['friendly'] = "00ff00", |
['arena'] = "ffff00", |
['sanctuary'] = "9999ff", |
} |
local function pvpColor(txt) |
local pvpType, isFFA, faction = GetZonePVPInfo() |
if(pvpType == "friendly") then |
col = "00ff00" |
elseif(pvpType == "hostile") then |
col = "ff0000" |
elseif(pvpType == "arena") then |
col = "ffff00" |
if(colorlist[pvpType]) then |
col = colorlist[pvpType] |
elseif(pvpType == "hostile" or pvpType == "combat" or pvpType=="contested") then |
if(faction == select(2,UnitFactionGroup('player'))) then |
col = "886600" |
else |
col = "ff0000" |
end |
elseif(pvpType == "sanctuary") then |
col = "9999ff" |
col = faction == select(2,UnitFactionGroup('player')) and "886600" or "ff0000" |
else |
return txt |
end |