Schema: Fix settingtypes ranges

This commit is contained in:
Lars Mueller 2022-05-13 11:56:12 +02:00
parent d2656f08de
commit fb89c85c66

@ -31,9 +31,9 @@ function generate_settingtypes(self)
settingtype = "string" settingtype = "string"
elseif typ == "number" then elseif typ == "number" then
settingtype = self.int and "int" or "float" settingtype = self.int and "int" or "float"
if self.min or self.max then if self.range and (self.range.min or self.range.max) then
-- TODO handle exclusive min/max -- TODO handle exclusive min/max
type_args = (self.int and "%d %d" or "%f %f"):format(self.min or (2 ^ -30), self.max or (2 ^ 30)) type_args = (self.int and "%d %d" or "%f %f"):format(self.range.min or (2 ^ -30), self.range.max or (2 ^ 30))
end end
elseif typ == "table" then elseif typ == "table" then
local settings = {} local settings = {}