View Single Post
04-25-19, 12:41 PM   #7
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
The conditions could look something like:
Lua Code:
  1. if event == "PLAYER_TARGET_CHANGED" then
  2.     local FactionTextures = {
  3.         Alliance = "Interface\\AddOns\\[TextureLocation]\\AllianceTexture",
  4.         Horde = "Interface\\AddOns\\[TextureLocation]\\HordeTexture",
  5.         FFA = "Interface\\AddOns\\[TextureLocation]\\NeutralTexture",
  6.     }
  7.     local player = UnitIsPVPFreeForAll("player")
  8.     local target = UnitIsPVPFreeForAll("target")
  9.     if player and target then -- both are FFA, maybe this is all you need.
  10.         -- Set the texture to FactionTextures.FFA
  11.         -- show the frame
  12.         return
  13.     end
  14.     player = UnitFactionGroup("player")
  15.     target = UnitFactionGroup("target")
  16.     if player ~= target and target ~= "Neutral" then
  17.         -- set the texture to FactionTextures[target]
  18.         -- show the frame
  19.     else -- target is same faction or neutral
  20.         -- hide the frame
  21.     end
  22. end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote