add option to change size
This commit is contained in:
20
src/main.lua
20
src/main.lua
@@ -140,7 +140,7 @@ local function newdesign()
|
|||||||
end
|
end
|
||||||
write("Enter name: ")
|
write("Enter name: ")
|
||||||
local name = read()
|
local name = read()
|
||||||
if not fs.exists("designs/"..name) then
|
if not fs.exists("designs/"..name) or name == "" then
|
||||||
printError("Design not found!")
|
printError("Design not found!")
|
||||||
else
|
else
|
||||||
local file = fs.open("designs/"..name, "r")
|
local file = fs.open("designs/"..name, "r")
|
||||||
@@ -151,6 +151,24 @@ local function newdesign()
|
|||||||
buf = content["buf"]
|
buf = content["buf"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if action == 4 then -- change X size
|
||||||
|
reset()
|
||||||
|
write("Enter new X size: ")
|
||||||
|
local xsize = tonumber(read())
|
||||||
|
dimensions["x"] = xsize
|
||||||
|
end
|
||||||
|
if action == 5 then -- change floor amount
|
||||||
|
reset()
|
||||||
|
write("Enter new floor amount: ")
|
||||||
|
local ysize = tonumber(read())
|
||||||
|
dimensions["y"] = ysize
|
||||||
|
end
|
||||||
|
if action == 6 then -- change Z size
|
||||||
|
reset()
|
||||||
|
write("Enter new Z size: ")
|
||||||
|
local zsize = tonumber(read())
|
||||||
|
dimensions["z"] = zsize
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user