add small progress thing in fill

This commit is contained in:
justuswolff
2026-02-17 21:58:22 +01:00
parent a80ddd3126
commit a7953e499c

View File

@@ -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)
buf[posasstring(x,y,z)] = ntype
local processed = 0
local totalneighbors = #neighbors
term.setcol(colors.white, colors.black)
while #neighbors > 0 do
term.setCursorPos(1,1)
term.write(tostring(processed).."/"..tostring(#totalneighbors))
local cn = table.remove(neighbors, 1)
local cx,cz = cn[1],cn[2]
local newneigh = fill_getneighbors(cx,y,cz, sx,sz, inittype,buf)
for _,v in pairs(newneigh) do
table.insert(neighbors, v)
totalneighbors = totalneighbors + 1
end
buf[posasstring(cx,y,cz)] = ntype
processed = processed + 1
end
end
local function newdesign()