-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.lua
65 lines (64 loc) · 1.47 KB
/
schema.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
local function angle(description, default)
return { type = "number", range = { min = -180, max = 180 }, description = description, default = default }
end
local range = function(description, default_min, default_max)
return {
type = "table",
entries = {
min = angle(description .. " (min)", default_min),
max = angle(description .. " (max)", default_max)
},
func = function(range)
if range.max < range.min then return "Minimum range value is not <= maximum range value" end
end
}
end
local model = {
type = "table",
entries = {
body = {
type = "table",
entries = {
turn_speed = {
type = "number",
range = { min_exclusive = 0, max = 1e3 },
description = "Body turn speed",
default = 0.2
}
}
},
head = {
type = "table",
entries = {
pitch = range("Head pitch", -60, 80),
yaw = range("Head yaw", -90, 90),
yaw_restricted = range("Head yaw restricted", 0, 45),
yaw_restriction = angle("Head yaw restriction", 60)
}
},
arm_right = {
type = "table",
entries = {
radius = angle("Right arm spin radius", 10),
speed = {
type = "number",
range = { min_exclusive = 0, max = 1e4 },
description = "Right arm spin speed",
default = 1e3
},
yaw = range("Right arm yaw", -30, 160)
}
}
}
}
return {
type = "table",
entries = {
default = model,
models = {
type = "table",
keys = { type = "string" },
description = "Other models, same format as `default` model"
}
}
}