summaryrefslogtreecommitdiff
path: root/controllerfw.lua
diff options
context:
space:
mode:
authorcheapie <cheapiephp@gmail.com>2026-07-10 12:24:34 -0500
committercheapie <cheapiephp@gmail.com>2026-07-10 12:24:34 -0500
commit8702321ec72972a1e0ad2b9a8d3dcd4b515d9658 (patch)
tree23a8d40a1bd09a4d3a21dceee3f81231229ad255 /controllerfw.lua
parent0dfd371e1ca3d5b73fb1ea0b41adfccd8db01aef (diff)
downloadcelevator-8702321ec72972a1e0ad2b9a8d3dcd4b515d9658.tar
celevator-8702321ec72972a1e0ad2b9a8d3dcd4b515d9658.tar.gz
celevator-8702321ec72972a1e0ad2b9a8d3dcd4b515d9658.tar.bz2
celevator-8702321ec72972a1e0ad2b9a8d3dcd4b515d9658.tar.xz
celevator-8702321ec72972a1e0ad2b9a8d3dcd4b515d9658.zip
Improve floor table editing
Diffstat (limited to 'controllerfw.lua')
-rw-r--r--controllerfw.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/controllerfw.lua b/controllerfw.lua
index 73c6206..9962c52 100644
--- a/controllerfw.lua
+++ b/controllerfw.lua
@@ -369,8 +369,9 @@ elseif event.type == "ui" then
elseif event.fields.edit then
mem.screenstate = (mem.screenstate == "oobe_floortable" and "oobe_floortable_edit" or "floortable_edit")
elseif event.fields.add and #mem.params.floornames < maxfloors then
- table.insert(mem.params.floorheights,5)
- table.insert(mem.params.floornames,tostring(#mem.params.floornames+1))
+ table.insert(mem.params.floorheights,mem.params.floorheights[#mem.params.floorheights] or 5)
+ local previous = tonumber(mem.params.floornames[#mem.params.floornames]) or #mem.params.floornames
+ table.insert(mem.params.floornames,tostring(math.floor(previous)+1))
elseif event.fields.remove and #mem.params.floornames > 2 then
table.remove(mem.params.floorheights,mem.editingfloor)
table.remove(mem.params.floornames,mem.editingfloor)