Skip to content

Commit

Permalink
fix errorbar.. errors.. when using customize gameplay to... move... bars
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Mar 3, 2019
1 parent f372151 commit ca99351
Showing 1 changed file with 28 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,35 @@ local e =
DootCommand = function(self)
self:RemoveChild("DestroyMe")
self:RemoveChild("DestroyMe2")

-- basically we need the ewma version to exist inside this actor frame
-- for customize gameplay stuff, however it seems silly to have it running
-- visibility/nil/type checks if we aren't using it, so we can just remove
-- it if we're outside customize gameplay and errorbar is set to normal -mina
if not allowedCustomization and enabledErrorBar == 1 then
self:RemoveChild("WeightedBar")
end
end,
Def.Quad {
Name = "WeightedBar",
InitCommand = function(self)
if enabledErrorBar == 2 then
self:xy(MovableValues.ErrorBarX, MovableValues.ErrorBarY):zoomto(barWidth, MovableValues.ErrorBarHeight):diffusealpha(
1
):diffuse(getMainColor("enabled"))
else
self:visible(false)
end
end,
SpottedOffsetCommand = function(self)
ms.ok("asasd")
if enabledErrorBar == 2 and dvCur ~= nil then
avg = alpha * dvCur + (1 - alpha) * lastAvg
lastAvg = avg
self:x(MovableValues.ErrorBarX + avg * wscale)
end
end
},
Def.Quad {
Name = "Center",
InitCommand = function(self)
Expand Down Expand Up @@ -594,29 +622,6 @@ if enabledErrorBar == 1 then
end
end

if enabledErrorBar == 2 then
e[#e + 1] =
Def.Quad {
Name = "WeightedBar",
InitCommand = function(self)
if enabledErrorBar == 2 then
self:xy(MovableValues.ErrorBarX, MovableValues.ErrorBarY):zoomto(barWidth, MovableValues.ErrorBarHeight):diffusealpha(
1
):diffuse(getMainColor("enabled"))
else
self:visible(false)
end
end,
SpottedOffsetCommand = function(self)
if dvCur ~= nil then
avg = alpha * dvCur + (1 - alpha) * lastAvg
lastAvg = avg
self:x(MovableValues.ErrorBarX + avg * wscale)
end
end
}
end

-- Add the completed errorbar frame to the primary actor frame t if enabled
if enabledErrorBar ~= 0 then
t[#t + 1] = e
Expand Down

0 comments on commit ca99351

Please sign in to comment.