Small refactor
Signed-off-by: Rahix <rahix@rahix.de>
This commit is contained in:
parent
50ae923ef7
commit
e8ec24dacc
1 changed files with 17 additions and 19 deletions
4
bc.lua
4
bc.lua
|
|
@ -280,8 +280,7 @@ function BaseControl:set(name, value)
|
||||||
local old = self.local_nouns[name]
|
local old = self.local_nouns[name]
|
||||||
self.local_nouns[name] = value
|
self.local_nouns[name] = value
|
||||||
|
|
||||||
if self.listeners[name] ~= nil then
|
for id, l in pairs(self.listeners[name] or {}) do
|
||||||
for id, l in pairs(self.listeners[name]) do
|
|
||||||
if (l.query.ty == Query.Change.ty and value ~= old)
|
if (l.query.ty == Query.Change.ty and value ~= old)
|
||||||
or (l.query.ty == Query.Rising.ty and value > old)
|
or (l.query.ty == Query.Rising.ty and value > old)
|
||||||
or (l.query.ty == Query.Falling.ty and value < old)
|
or (l.query.ty == Query.Falling.ty and value < old)
|
||||||
|
|
@ -302,7 +301,6 @@ function BaseControl:set(name, value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
elseif self.local_verbs[name] ~= nil then
|
elseif self.local_verbs[name] ~= nil then
|
||||||
if type(value) ~= "function" then
|
if type(value) ~= "function" then
|
||||||
error("\""..name.."\" can't be cast into a noun")
|
error("\""..name.."\" can't be cast into a noun")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue