- Ticket #166: add 'toggle spark option on Streamer plugin'.

- Fixed a random error '1263' which some users were getting.
This commit is contained in:
Tercio
2017-01-30 11:21:32 -02:00
parent da8cd0359e
commit 183bc0bdd1
4 changed files with 47 additions and 15 deletions
+40 -5
View File
@@ -402,7 +402,13 @@ local function CreatePluginFrames()
end
line.statusbar:SetValue (percent)
line.spark:Show()
if (StreamOverlay.db.use_spark) then
line.spark:Show()
else
line.spark:Hide()
end
if (castinfo.Success) then
line.spark:SetVertexColor (1, 1, 1, 0.4)
line.spark:SetPoint ("left", line.statusbar, "left", (line.statusbar:GetWidth() / 100 * percent) - 8, 0)
@@ -902,7 +908,11 @@ listener.track_spell_cast = function()
percent = math.abs (percent - 100)
castinfo.Percent = percent
line.statusbar:SetValue (percent)
line.spark:Show()
if (StreamOverlay.db.use_spark) then
line.spark:Show()
else
line.spark:Hide()
end
line.spark:SetVertexColor (1, 1, 1, 0.5 + (percent/100))
line.spark:SetVertexColor (1, 1, 1, 1)
line.spark:SetPoint ("left", line.statusbar, "left", (line.statusbar:GetWidth() / 100 * percent) - 6, 0)
@@ -921,7 +931,11 @@ listener.track_spell_cast = function()
local percent = current / diff * 100
castinfo.Percent = percent
line.statusbar:SetValue (percent)
line.spark:Show()
if (StreamOverlay.db.use_spark) then
line.spark:Show()
else
line.spark:Hide()
end
line.spark:SetVertexColor (1, 1, 1, 0.5 + (percent/100))
line.spark:SetPoint ("left", line.statusbar, "left", (line.statusbar:GetWidth() / 100 * percent) - 6, 0)
end
@@ -945,7 +959,13 @@ listener.track_spell_cast = function()
local percent = current / diff * 100
castinfo.Percent = percent
line.statusbar:SetValue (percent)
line.spark:Show()
if (StreamOverlay.db.use_spark) then
line.spark:Show()
else
line.spark:Hide()
end
line.spark:SetVertexColor (1, 1, 1, 0.5 + (percent/100))
line.spark:SetPoint ("left", line.statusbar, "left", (line.statusbar:GetWidth() / 100 * percent) - 6, 0)
end
@@ -1717,7 +1737,20 @@ function StreamOverlay.OpenOptionsPanel()
desc = "How high the frame is placed in your interface, high values makes it be shown above backpack, talents frame, etc.",
name = "Window Strata"
},
{type = "space"},
{
type = "toggle",
name = "Show Spark",
desc = "Show or hide the spark at bars",
order = 1,
get = function() return StreamOverlay.db.use_spark end,
set = function (self, val)
StreamOverlay.db.use_spark = not StreamOverlay.db.use_spark
end,
},
}
@@ -1848,6 +1881,8 @@ function StreamOverlay:OnEvent (_, event, ...)
minimap = {hide = false, radius = 160, minimapPos = 160},
use_spark = true,
per_second = {
enabled = false,
size = 32,