Guest User

Untitled

a guest
Nov 19th, 2025
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. ```lua
  2. if not aura_env.region.anchorIDs then aura_env.region.anchorIDs = {} end
  3.  
  4. function aura_env:ReadNote()
  5. aura_env.GUIDs = {}
  6.  
  7. local lineCount = 0
  8.  
  9. for _, line in LiquidWeakAuras:IterateNoteAssignment("Star") do
  10. local GUIDs = LiquidWeakAuras:LineToGUIDArray(line)
  11.  
  12. for _, GUID in ipairs(GUIDs) do
  13. local unit = aura_env.GUIDToUnit[GUID]
  14. local role = UnitGroupRolesAssigned(unit)
  15.  
  16. if role ~= "TANK" then
  17. tInsertUnique(aura_env.GUIDs, GUID)
  18. end
  19. end
  20.  
  21. if next(GUIDs) then
  22. lineCount = lineCount + 1
  23. end
  24.  
  25. -- This aura is disabled if more than a single line of names is provided
  26. -- In this case we assume the Starkiller Swings are hard assigned
  27. if lineCount > 1 then
  28. return false
  29. end
  30. end
  31.  
  32. local note = #aura_env.GUIDs > 0
  33.  
  34. -- Add any GUIDs that weren't on the note
  35. local GUIDsToAdd = {}
  36.  
  37. for unit in WA_IterateGroupMembers() do
  38. local GUID = UnitGUID(unit)
  39. local role = UnitGroupRolesAssigned(unit)
  40.  
  41. if role ~= "TANK" and not tContains(aura_env.GUIDs, GUID) then
  42. table.insert(GUIDsToAdd, GUID)
  43. end
  44. end
  45.  
  46. table.sort(GUIDsToAdd)
  47. tAppendAll(aura_env.GUIDs, GUIDsToAdd)
  48.  
  49. -- If no note was provided, sort based on GUID
  50. if not note then
  51. table.sort(aura_env.GUIDs)
  52. end
  53.  
  54. -- Remove any GUIDs after (and including) ours
  55. for index in ipairs_reverse(aura_env.GUIDs) do
  56. local removedGUID = table.remove(aura_env.GUIDs, index)
  57.  
  58. if removedGUID == WeakAuras.myGUID then break end
  59. end
  60.  
  61. return true
  62. end
  63.  
  64. function aura_env:CreatePrivateAuraAnchors()
  65. local region = aura_env.region
  66.  
  67. -- Remove existing anchor IDs
  68. for _, anchorID in pairs(region.anchorIDs) do
  69. C_UnitAuras.RemovePrivateAuraAnchor(anchorID)
  70. end
  71.  
  72. region.anchorIDs = {}
  73.  
  74. for _, GUID in pairs(aura_env.GUIDs) do
  75. local unit = aura_env.GUIDToUnit[GUID]
  76. local privateAnchorArgs = {
  77. unitToken = unit,
  78. auraIndex = 1,
  79. parent = region,
  80. showCountdownFrame = false,
  81. showCountdownNumbers = false,
  82. iconInfo = {
  83. iconAnchor = {
  84. point = "CENTER",
  85. relativeTo = region,
  86. relativePoint = "CENTER",
  87. offsetX = 0,
  88. offsetY = 0
  89. },
  90. iconWidth = region:GetWidth(),
  91. iconHeight = region:GetHeight()
  92. }
  93. }
  94.  
  95. region.anchorIDs[GUID] = C_UnitAuras.AddPrivateAuraAnchor(privateAnchorArgs)
  96. end
  97. end
  98.  
  99.  
  100. ```
Advertisement
Add Comment
Please, Sign In to add comment