Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
fix broken status button editor
Browse files Browse the repository at this point in the history
  • Loading branch information
brittyazel committed Dec 16, 2018
1 parent ea8b5a6 commit a95855e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Neuron-GUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4230,11 +4230,11 @@ function NeuronGUI:StatusBarEditorUpdate(reset)
yoff = yoff-yoff1
end

if (Neuron.NeuronStatusBar[f.func]) then
if (sb[f.func]) then
if (f.format) then
f.edit:SetText(string.format(f.format, Neuron.NeuronStatusBar[f.func](Neuron.NeuronStatusBar, sb, nil, true, true)*f.mult)..f.endtext)
f.edit:SetText(string.format(f.format, sb[f.func](sb, nil, true, true)*f.mult)..f.endtext)
else
f.edit:SetText(Neuron.NeuronStatusBar[f.func](Neuron.NeuronStatusBar, sb, nil, true, true) or "")
f.edit:SetText(sb[f.func](sb, nil, true, true) or "")
end
f.edit:SetCursorPosition(0)
end
Expand Down Expand Up @@ -4317,7 +4317,7 @@ function NeuronGUI:SB_chkOptionOnClick(frame)
local sb = Neuron.CurrentObject

if (sb) then
Neuron.NeuronStatusBar[frame.func](Neuron.NeuronStatusBar, sb, frame, frame:GetChecked())
sb[frame.func](sb, frame, frame:GetChecked())
end

end
Expand Down Expand Up @@ -4387,7 +4387,7 @@ function NeuronGUI:SB_adjOptionOnTextChanged(edit, frame)

elseif (frame.method == 2) then

Neuron.NeuronStatusBar[frame.func](Neuron.NeuronStatusBar, sb, edit.value, true)
sb[frame.func](sb, edit.value, true)

edit:HighlightText(0,0)
end
Expand All @@ -4407,7 +4407,7 @@ function NeuronGUI:SB_adjOptionOnEditFocusLost(edit, frame)

if (frame.method == 1) then

Neuron.NeuronStatusBar[frame.func](Neuron.NeuronStatusBar, sb, edit:GetText(), true)
sb[frame.func](sb, edit:GetText(), true)

elseif (frame.method == 2) then

Expand All @@ -4424,7 +4424,7 @@ function NeuronGUI:SB_adjOptionAdd(frame, onupdate)

if (sb) then

local num = Neuron.NeuronStatusBar[frame.func](Neuron.NeuronStatusBar, sb, nil, true, true)
local num = sb[frame.func](sb, nil, true, true)

if (num == L["Off"] or num == "---") then
num = 0
Expand All @@ -4436,7 +4436,7 @@ function NeuronGUI:SB_adjOptionAdd(frame, onupdate)

if (frame.max and num >= frame.max) then

Neuron.NeuronStatusBar[frame.func](Neuron.NeuronStatusBar, sb, frame.max, true, nil, onupdate)
sb[frame.func](sb, frame.max, true, nil, onupdate)

if (onupdate) then
if (frame.format) then
Expand All @@ -4446,7 +4446,7 @@ function NeuronGUI:SB_adjOptionAdd(frame, onupdate)
end
end
else
Neuron.NeuronStatusBar[frame.func](Neuron.NeuronStatusBar, sb, num+frame.inc, true, nil, onupdate)
sb[frame.func](sb, num+frame.inc, true, nil, onupdate)

if (onupdate) then
if (frame.format) then
Expand All @@ -4469,7 +4469,7 @@ function NeuronGUI:SB_adjOptionSub(frame, onupdate)

if (sb) then

local num = Neuron.NeuronStatusBar[frame.func](Neuron.NeuronStatusBar, sb, nil, true, true)
local num = sb[frame.func](sb, nil, true, true)

if (num == L["Off"] or num == "---") then
num = 0
Expand All @@ -4481,7 +4481,7 @@ function NeuronGUI:SB_adjOptionSub(frame, onupdate)

if (frame.min and num <= frame.min) then

Neuron.NeuronStatusBar[frame.func](Neuron.NeuronStatusBar, sb, frame.min, true, nil, onupdate)
sb[frame.func](sb, frame.min, true, nil, onupdate)

if (onupdate) then
if (frame.format) then
Expand All @@ -4491,7 +4491,7 @@ function NeuronGUI:SB_adjOptionSub(frame, onupdate)
end
end
else
Neuron.NeuronStatusBar[frame.func](Neuron.NeuronStatusBar, sb, num-frame.inc, true, nil, onupdate)
sb[frame.func](sb, num-frame.inc, true, nil, onupdate)

if (onupdate) then
if (frame.format) then
Expand Down

0 comments on commit a95855e

Please sign in to comment.