add small progress thing in fill
This commit is contained in:
@@ -90,14 +90,21 @@ local function fill(ntype, x,y,z, buf, sx,sz)
|
|||||||
|
|
||||||
local neighbors = fill_getneighbors(x,y,z, sx,sz, inittype,buf)
|
local neighbors = fill_getneighbors(x,y,z, sx,sz, inittype,buf)
|
||||||
buf[posasstring(x,y,z)] = ntype
|
buf[posasstring(x,y,z)] = ntype
|
||||||
|
local processed = 0
|
||||||
|
local totalneighbors = #neighbors
|
||||||
|
term.setcol(colors.white, colors.black)
|
||||||
while #neighbors > 0 do
|
while #neighbors > 0 do
|
||||||
|
term.setCursorPos(1,1)
|
||||||
|
term.write(tostring(processed).."/"..tostring(#totalneighbors))
|
||||||
local cn = table.remove(neighbors, 1)
|
local cn = table.remove(neighbors, 1)
|
||||||
local cx,cz = cn[1],cn[2]
|
local cx,cz = cn[1],cn[2]
|
||||||
local newneigh = fill_getneighbors(cx,y,cz, sx,sz, inittype,buf)
|
local newneigh = fill_getneighbors(cx,y,cz, sx,sz, inittype,buf)
|
||||||
for _,v in pairs(newneigh) do
|
for _,v in pairs(newneigh) do
|
||||||
table.insert(neighbors, v)
|
table.insert(neighbors, v)
|
||||||
|
totalneighbors = totalneighbors + 1
|
||||||
end
|
end
|
||||||
buf[posasstring(cx,y,cz)] = ntype
|
buf[posasstring(cx,y,cz)] = ntype
|
||||||
|
processed = processed + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function newdesign()
|
local function newdesign()
|
||||||
|
|||||||
Reference in New Issue
Block a user