Advertisement
Translit

Untitled

Mar 16th, 2023
623
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.02 KB | None | 0 0
  1. -- Controls what types of spells this front-end displays
  2. aura_env.types = {
  3.     ["HEALING"]   = true,
  4. }
  5.  
  6. aura_env.indexes = {
  7.     --DRUID
  8.     [740] = 1, -- Tranquility
  9.     [33891] = 2, -- Incarnation: Tree of Life
  10.     --[319454] = 3, -- Heart of the Wild
  11.     --[102351] = 4, -- Cenarion Ward
  12.     --[203651] = 5, -- Overgrowth
  13.     --[197721] = 6, -- Flourish
  14.     --MONK
  15.     [115310] = 7, -- Revival
  16.     --[322118] = 8, -- Invoke Yu'lon, the Jade Serpent
  17.     --[325197] = 9, -- Invoke Chi-Ji, the Red Crane
  18.     --PALADIN
  19.     [633] = 10, -- Lay on Hands
  20.     [31884] = 11, -- Avenging Wrath
  21.     [216331] = 12, -- Avenging Crusader
  22.     [105809] = 13, -- Holy Avenger
  23.     [200025] = 14, -- Beacon of Virtue
  24.     --PRIEST
  25.     [15286] = 15, -- Vampiric Embrace
  26.     [64843] = 16, -- Divine Hymn
  27.     [265202] = 17, -- Holy Word: Salvation
  28.     [10060] = 18, -- Power Infusion
  29.     [47536] = 19, -- Rapture
  30.     [109964] = 20, -- Spirit Shell
  31.     [200183] = 21, -- Apotheosis
  32.     [246287] = 22, -- Evangelism
  33.     --SHAMAN
  34.     [108280] = 23, -- Healing Tide Totem
  35.     --[198838] = 24, -- Earthen Wall Totem
  36.     [108281] = 25, -- Ancestral Guidance
  37.     [114052] = 26, -- Ascendance
  38. }
  39.  
  40. local sort1 = function(a, b) return a.state.index < b.state.index end
  41. local sort2 = function(a, b) return a.state.expirationTime < b.state.expirationTime end
  42. local sort3 = function(a, b) return a.state.expirationTime > b.state.expirationTime end
  43. local c = aura_env.config
  44.  
  45. aura_env.sortAndOffset = function()
  46.     local spacing = c.spacing
  47.     local count = 0
  48.    
  49.     local byIndex = {}
  50.     local byExp = {}
  51.    
  52.     for k, v in pairs(WeakAuras.clones[aura_env.id]) do
  53.         if v.state and v.state.show and v.state.classColor and v.state.expirationTime then
  54.             local onCD = v.state.expirationTime - GetTime()
  55.             if onCD > 0 then
  56.                 table.insert(byExp, v)
  57.             elseif onCD <= 0 then
  58.                 table.insert(byIndex, v)
  59.             end
  60.         end
  61.     end
  62.    
  63.     table.sort(byIndex, sort1)
  64.    
  65.     if c.sorting == 1 then
  66.         table.sort(byExp, sort2)
  67.        
  68.     else
  69.         table.sort(byExp, sort3)
  70.     end
  71.    
  72.     for i, region in pairs(byIndex) do
  73.         if region.toShow then
  74.             local xOffset = 0
  75.             local yOffset = 0
  76.            
  77.             if c.direction == 1 then
  78.                 xOffset = 0
  79.                 yOffset = 0 + (region.height + spacing) * count
  80.             elseif c.direction == 2 then
  81.                 xOffset = 0
  82.                 yOffset = 0 - (region.height + spacing) * count
  83.             elseif c.direction == 3 then
  84.                 xOffset = 0 - (region.width + spacing) * count
  85.                 yOffset = 0
  86.             elseif c.direction == 4 then
  87.                 xOffset = 0 + (region.width + spacing) * count
  88.                 yOffset = 0
  89.             end
  90.            
  91.             region:SetAnchor("CENTER" , WeakAuras.regions[aura_env.id].region, "CENTER")
  92.             region:SetOffset(xOffset, yOffset)
  93.            
  94.             count = region.state.dead and count or count + 1
  95.         end
  96.     end
  97.    
  98.     for i, region in pairs(byExp) do
  99.         if region.toShow then
  100.             local xOffset = 0
  101.             local yOffset = 0
  102.            
  103.             if c.direction == 1 then
  104.                 xOffset = 0
  105.                 yOffset = 0 + (region.height + spacing) * count
  106.             elseif c.direction == 2 then
  107.                 xOffset = 0
  108.                 yOffset = 0 - (region.height + spacing) * count
  109.             elseif c.direction == 3 then
  110.                 xOffset = 0 - (region.width + spacing) * count
  111.                 yOffset = 0
  112.             elseif c.direction == 4 then
  113.                 xOffset = 0 + (region.width + spacing) * count
  114.                 yOffset = 0
  115.             end
  116.            
  117.             region:SetAnchor("CENTER" , WeakAuras.regions[aura_env.id].region, "CENTER")
  118.             region:SetOffset(xOffset, yOffset)
  119.            
  120.             count = region.state.dead and count or count + 1
  121.         end
  122.     end
  123. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement