Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. function BattlegroundTargets:CheckFaction()
  2. local faction = UnitFactionGroup("player")
  3. if faction == "Horde" then
  4. playerFactionDEF = 0 -- Horde
  5. oppositeFactionDEF = 1 -- Alliance
  6. -- BattlegroundTargets:UnregisterEvent("NEUTRAL_FACTION_SELECT_RESULT")
  7. elseif faction == "Alliance" then
  8. playerFactionDEF = 1 -- Alliance
  9. oppositeFactionDEF = 0 -- Horde
  10. -- BattlegroundTargets:UnregisterEvent("NEUTRAL_FACTION_SELECT_RESULT")
  11. elseif faction == "Neutral" then
  12. playerFactionDEF = 2 -- Neutral (eg.: Pandaren)
  13. oppositeFactionDEF = 2 -- Neutral (eg.: Pandaren)
  14. -- BattlegroundTargets:RegisterEvent("NEUTRAL_FACTION_SELECT_RESULT")
  15. else
  16. --Print("ERROR", "unknown faction", locale, faction)
  17. playerFactionDEF = 1 -- Dummy
  18. oppositeFactionDEF = 0 -- Dummy
  19. end
  20. playerFactionBG = playerFactionDEF
  21. oppositeFactionBG = oppositeFactionDEF
  22.  
  23. if playerFactionDEF == 0 then -- setup_flag_texture
  24. Textures.flagTexture = "Interface\\WorldStateFrame\\HordeFlag"
  25. Textures.cartTexture = "Interface\\Minimap\\Vehicle-SilvershardMines-MineCartRed"
  26. if GVAR.FriendSummary and GVAR.FriendSummary.Logo1 then -- summary_flag_texture - 12 - initial reset
  27. GVAR.FriendSummary.Logo1:SetTexture("Interface\\FriendsFrame\\PlusManz-Horde")
  28. GVAR.EnemySummary.Logo1:SetTexture("Interface\\FriendsFrame\\PlusManz-Horde")
  29. GVAR.FriendSummary.Logo2:SetTexture("Interface\\FriendsFrame\\PlusManz-Alliance")
  30. GVAR.EnemySummary.Logo2:SetTexture("Interface\\FriendsFrame\\PlusManz-Alliance")
  31. end
  32. elseif playerFactionDEF == 1 then
  33. Textures.flagTexture = "Interface\\WorldStateFrame\\AllianceFlag"
  34. Textures.cartTexture = "Interface\\Minimap\\Vehicle-SilvershardMines-MineCartBlue"
  35. if GVAR.FriendSummary and GVAR.FriendSummary.Logo1 then -- summary_flag_texture - 12 - initial reset
  36. GVAR.FriendSummary.Logo1:SetTexture("Interface\\FriendsFrame\\PlusManz-Alliance")
  37. GVAR.EnemySummary.Logo1:SetTexture("Interface\\FriendsFrame\\PlusManz-Alliance")
  38. GVAR.FriendSummary.Logo2:SetTexture("Interface\\FriendsFrame\\PlusManz-Horde")
  39. GVAR.EnemySummary.Logo2:SetTexture("Interface\\FriendsFrame\\PlusManz-Horde")
  40. end
  41. else
  42. Textures.flagTexture = "Interface\\WorldStateFrame\\ColumnIcon-FlagCapture2" -- neutral_flag
  43. Textures.cartTexture = "Interface\\Minimap\\Vehicle-SilvershardMines-MineCart" -- neutral_flag
  44. end
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement