Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------
- -- SOUL SHARDS BAR --
- -- Made by Kirihn-Area 52 --
- -- "The headless pigmy has terrible aim." --
- --------------------------------------------
- --SHARDS DISPLAY
- aura_env.TrackDoom = true --Read bellow
- aura_env.DisplayEmptyShards = true
- aura_env.Spacing = 3 --How much space between shards
- --[[
- 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 Affliction = {
- Base = "d7b3ff",
- Full = "ffba48",
- Spend = "ffba48"
- }
- local Demonology = {
- Base = "d7b3ff",
- Full = "ffba48",
- Spend = "ffba48",
- Doom = "600070"
- }
- local Destruction = {
- Base = "d7b3ff",
- Full = "ffba48",
- Spend = "ffba48"
- }
- local Xoroth = {--Only works when in Destruction spec
- Base = "d7b3ff",
- Full = "ffba48",
- Spend = "ffba48"
- }
- --SHARDS COUNT
- local ShardCountOnMiddle = true --Read bellow.
- local DisplayModes = { --Read bellow.
- Affliction = "simple",
- Demonology = "simple",
- Destruction = "simple"
- }
- 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 = "ff3200", --Use a hex code. This will also color partial Doom ticks.
- Text = "" --Text that will encapsulate the count. Read bellow for more information.
- }
- --[[
- ShardCountOnMiddle -> 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.
- DisplayModes -> If "simple", displays the count as '3' and '3.5'.
- If "full", displays the count as '3.0' and '3.5'.
- If "tens", displays the count as '30' and '35'.
- If false, will hide the display.
- 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 rhex, ghex, bhex = string.sub(hex, 1, 2), string.sub(hex, 3, 4), string.sub(hex, 5, 6)
- return {r = tonumber(rhex, 16)/255, g = tonumber(ghex, 16)/255, b = tonumber(bhex, 16)/255}
- end
- local p = {"Base", "Full", "Spend"}
- spec = specialization
- if spec == 1 then
- display = DisplayModes.Affliction
- p.Base = HexToRGBPerc(Affliction.Base)
- 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.Base = HexToRGBPerc(Demonology.Base)
- 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.Base = HexToRGBPerc(Xoroth.Base)
- p.Full = HexToRGBPerc(Xoroth.Full)
- p.Spend = HexToRGBPerc(Xoroth.Spend)
- else
- p.Base = HexToRGBPerc(Destruction.Base)
- p.Full = HexToRGBPerc(Destruction.Full)
- p.Spend = HexToRGBPerc(Destruction.Spend)
- 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
- else
- return ""
- end
- if Prediction.Enabled and consumed > 0 then
- local open, close = Prediction.Text, brackets[Prediction.Text] or Prediction.Text
- shards = "|cff"..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