Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```lua
- if not aura_env.region.anchorIDs then aura_env.region.anchorIDs = {} end
- function aura_env:ReadNote()
- aura_env.GUIDs = {}
- local lineCount = 0
- for _, line in LiquidWeakAuras:IterateNoteAssignment("Star") do
- local GUIDs = LiquidWeakAuras:LineToGUIDArray(line)
- for _, GUID in ipairs(GUIDs) do
- local unit = aura_env.GUIDToUnit[GUID]
- local role = UnitGroupRolesAssigned(unit)
- if role ~= "TANK" then
- tInsertUnique(aura_env.GUIDs, GUID)
- end
- end
- if next(GUIDs) then
- lineCount = lineCount + 1
- end
- -- This aura is disabled if more than a single line of names is provided
- -- In this case we assume the Starkiller Swings are hard assigned
- if lineCount > 1 then
- return false
- end
- end
- local note = #aura_env.GUIDs > 0
- -- Add any GUIDs that weren't on the note
- local GUIDsToAdd = {}
- for unit in WA_IterateGroupMembers() do
- local GUID = UnitGUID(unit)
- local role = UnitGroupRolesAssigned(unit)
- if role ~= "TANK" and not tContains(aura_env.GUIDs, GUID) then
- table.insert(GUIDsToAdd, GUID)
- end
- end
- table.sort(GUIDsToAdd)
- tAppendAll(aura_env.GUIDs, GUIDsToAdd)
- -- If no note was provided, sort based on GUID
- if not note then
- table.sort(aura_env.GUIDs)
- end
- -- Remove any GUIDs after (and including) ours
- for index in ipairs_reverse(aura_env.GUIDs) do
- local removedGUID = table.remove(aura_env.GUIDs, index)
- if removedGUID == WeakAuras.myGUID then break end
- end
- return true
- end
- function aura_env:CreatePrivateAuraAnchors()
- local region = aura_env.region
- -- Remove existing anchor IDs
- for _, anchorID in pairs(region.anchorIDs) do
- C_UnitAuras.RemovePrivateAuraAnchor(anchorID)
- end
- region.anchorIDs = {}
- for _, GUID in pairs(aura_env.GUIDs) do
- local unit = aura_env.GUIDToUnit[GUID]
- local privateAnchorArgs = {
- unitToken = unit,
- auraIndex = 1,
- parent = region,
- showCountdownFrame = false,
- showCountdownNumbers = false,
- iconInfo = {
- iconAnchor = {
- point = "CENTER",
- relativeTo = region,
- relativePoint = "CENTER",
- offsetX = 0,
- offsetY = 0
- },
- iconWidth = region:GetWidth(),
- iconHeight = region:GetHeight()
- }
- }
- region.anchorIDs[GUID] = C_UnitAuras.AddPrivateAuraAnchor(privateAnchorArgs)
- end
- end
- ```
Advertisement
Add Comment
Please, Sign In to add comment