Better scroll and slider API

This commit is contained in:
Insality
2020-03-21 19:40:50 +03:00
parent c41957c751
commit b33efd692f
4 changed files with 59 additions and 8 deletions

View File

@@ -79,12 +79,14 @@ function M.on_input(self, action_id, action)
end
function M.set(self, value)
function M.set(self, value, is_silent)
value = helper.clamp(value, 0, 1)
gui.set_position(self.node, self.start_pos + self.dist * value)
self.value = value
on_change_value(self)
if not is_silent then
on_change_value(self)
end
end