Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------
- -- SOUL SHARD BAR --
- -- Made by Kirin & Ipse --
- -- "The headless pigmy has terrible aim." --
- -- :PeepoHappy: --
- --------------------------------------------
- --SHARDS DISPLAY
- aura_env.DisplayEmptyShards = true
- -- Toggle empty shards
- aura_env.Spacing = 4
- -- How much space between shards
- aura_env.shardX, aura_env.shardY = 0, 0
- -- X, Y of the text on the bar
- aura_env.justifyH = "CENTER"
- -- Justify the text horizontally
- -- "CENTER", "LEFT" & "RIGHT"
- aura_env.justifyV = "MIDDLE"
- -- Justify the text vertically
- -- "MIDDLE", "TOP" & "BOTTOM"
- aura_env.position = "CENTER"
- -- the anchor point of the text
- -- "TOP", "RIGHT" "BOTTOM" & "LEFT": the center-points of the respective sides.
- -- "TOPRIGHT", "TOPLEFT", "BOTTOMLEFT" & "BOTTOMRIGHT": corners of the rectangle.
- -- "CENTER": the center point of the rectangle
- aura_env.manualPosition = false
- -- Edit the position of the bars manually
- -- x,y values for each bar
- aura_env.positions = {
- [1] = {x = -100, y = 0},
- [2] = {x = -20, y = 0},
- [3] = {x = 60, y = 0},
- [4] = {x = 120, y = 0},
- [5] = {x = 200, y = 0},
- }
- aura_env.specificShardColours = false
- -- Turns on colouring for each shard
- -- this will overwrite all over colours
- aura_env.TrackDoom = true
- --[[
- If TrackDoom is enabled, Doom timers will show up on the bars,
- and the shard count display for Demonology will be hidden.
- If you have suggestions for better managing the display of
- both numbers, please let me know.
- You can change the way Doom timers look by changing how Right
- Text looks like.
- ]]--
- --SHARDS COLORS
- --Provide hex values
- local specificShardsColours = {
- [1] = "ff7f00ff",
- [2] = "ff7f00ff",
- [3] = "ff7f00ff",
- [4] = "ff7f00ff",
- [5] = "ff7f00ff"
- }
- local Affliction = {
- Foreground = "ff6800ff",
- Background = "ff18003b",
- Full = "ff6432ff",
- Spend = "fff0beff"
- }
- local Demonology = {
- Foreground = "ff6800ff",
- Background = "ff18003b",
- Full = "ff6432ff",
- Spend = "fff0beff",
- Doom = "ffe600ff"
- }
- local Destruction = {
- Foreground = "ffffa000",
- Background = "ff7c4e00",
- Full = "ffff3c00",
- Spend = "ffffff64"
- }
- local Xoroth = {--Only works when in Destruction spec
- Foreground = "ff64f000",
- Background = "ff1e4900",
- Full = "ff007800",
- Spend = "ff00d2ff"
- }
- --SHARDS COUNT
- local ShardCountOnMiddle = false
- -- If false, will make the count appear on the latest shard.
- -- If true, empty shards are hidden, and you have fewer than 3 shards; the count will display on the latest shard.
- local DisplayModes = { --Read bellow.
- Affliction = false,
- Demonology = false,
- Destruction = "full"
- }
- -- "simple", displays the count as '3' and '3.5'.
- -- "full", displays the count as '3.0' and '3.5'.
- -- "tens", displays the count as '30' and '35'.
- -- "short", displays the amount of fragmants you have
- -- If false, will hide the display.
- local Prediction = {--What happens to the count when you are casting a spell that consumes shards.
- Enabled = true, --If false, everything else is ignored.
- Color = "ffff3200", --Use a hex code. This will also color partial Doom ticks.
- Text = "*" --Text that will encapsulate the count. Read bellow for more information.
- }
- --[[ Prediction.Text -> Brackets - such as {}, [], (), <>, and <<>> - will be correctly mirrored.
- For \, use "\\". For ", use '"' (single - double - single), and vice-versa.
- An empty string - i.e., inputing "" - is acceptable.
- Other unlisted characters will be used as is.
- ]]--
- --------------------------------
- --No touchrino from here forward
- --------------------------------
- aura_env.cost = 0
- aura_env.consuming = 0
- local display, spec = false, GetSpecialization()
- local brackets = {
- ["{"] = "}",
- ["}"] = "{",
- ["["] = "]",
- ["]"] = "[",
- ["("] = ")",
- [")"] = "(",
- ["<"] = ">",
- [">"] = "<",
- ["<<"] = ">>",
- [">>"] = "<<",
- }
- function aura_env.AdjustToSpec(specialization)
- local function HexToRGBPerc(hex)
- local string, tonumber = string, tonumber
- local ahex, rhex, ghex, bhex = string.sub(hex, 1, 2), string.sub(hex, 3, 4), string.sub(hex, 5, 6), string.sub(hex, 7, 8)
- return {a = tonumber(ahex, 16)/255, r = tonumber(rhex, 16)/255, g = tonumber(ghex, 16)/255, b = tonumber(bhex, 16)/255}
- end
- local p = {"Foreground", "Background", "Full", "Spend"}
- spec = specialization
- if spec == 1 then
- display = DisplayModes.Affliction
- p.Foreground = HexToRGBPerc(Affliction.Foreground)
- p.Background = HexToRGBPerc(Affliction.Background)
- p.Full = HexToRGBPerc(Affliction.Full)
- p.Spend = HexToRGBPerc(Affliction.Spend)
- elseif spec == 2 then
- if aura_env.TrackDoom then
- display = not IsPlayerSpell(265412) and DisplayModes.Demonology
- else
- display = DisplayModes.Demonology
- end
- p.Foreground = HexToRGBPerc(Demonology.Foreground)
- p.Background = HexToRGBPerc(Demonology.Background)
- p.Full = HexToRGBPerc(Demonology.Full)
- p.Spend = HexToRGBPerc(Demonology.Spend)
- p.Doom = HexToRGBPerc(Demonology.Doom)
- p.Partial = HexToRGBPerc(Prediction.Color)
- elseif spec == 3 then
- display = DisplayModes.Destruction
- if IsPlayerSpell(101508) then
- p.Foreground = HexToRGBPerc(Xoroth.Foreground)
- p.Background = HexToRGBPerc(Xoroth.Background)
- p.Full = HexToRGBPerc(Xoroth.Full)
- p.Spend = HexToRGBPerc(Xoroth.Spend)
- else
- p.Foreground = HexToRGBPerc(Destruction.Foreground)
- p.Background = HexToRGBPerc(Destruction.Background)
- p.Full = HexToRGBPerc(Destruction.Full)
- p.Spend = HexToRGBPerc(Destruction.Spend)
- end
- if aura_env.specificShardColours then
- p.Foreground1 = HexToRGBPerc(specificShardsColours[1])
- p.Foreground2 = HexToRGBPerc(specificShardsColours[2])
- p.Foreground3 = HexToRGBPerc(specificShardsColours[3])
- p.Foreground4 = HexToRGBPerc(specificShardsColours[4])
- p.Foreground5 = HexToRGBPerc(specificShardsColours[5])
- end
- end
- aura_env.Pallete = p
- end
- aura_env.AdjustToSpec(spec)
- function aura_env.FormatCount(pos, shards, consumed)
- if display then
- local match = ShardCountOnMiddle and 3 or math.floor(shards - 0.1) + 1
- if not aura_env.DisplayEmptyShards and ShardCountOnMiddle and shards <= 2 then
- match = shards
- end
- if pos == (match or math.floor(match - 0.1) + 1) then
- consumed = Prediction.Enabled and consumed or 0
- consumed = shards > consumed and consumed or shards
- if display == "simple" then
- shards = shards - consumed
- elseif display == "full" then
- shards = string.format("%.1f", shards - consumed)
- if shards == "0.0" then shards = 0 end
- elseif display == "tens" then
- shards = (shards - consumed)*10
- elseif display == "short" then
- shards = shards%1*10
- else
- return ""
- end
- if Prediction.Enabled and consumed > 0 then
- local open, close = Prediction.Text, brackets[Prediction.Text] or Prediction.Text
- shards = "|c"..Prediction.Color..open..shards..close.."|r"
- end
- return shards
- else
- return ""
- end
- else
- return ""
- end
- end
- aura_env.Doom = aura_env.Doom or {}
- aura_env.format = string.format
- function aura_env.nextDoom(dest1, dest2)
- return aura_env.Doom[dest1].exp < aura_env.Doom[dest2].exp
- end
- --I do not understand this
- local function orderednext(t, n)
- local key = t[t.__next]
- if not key then return end
- t.__next = t.__next + 1
- return key, t.__source[key]
- end
- function aura_env.orderedDoom(t, f)
- local keys, kn = {__source = t, __next = 1}, 1
- for k in pairs(t) do
- keys[kn], kn = k, kn + 1
- end
- table.sort(keys, f)
- return orderednext, keys
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement