nlist: add autdump infra
parent
f56aac926f
commit
1be602d8aa
|
@ -8,6 +8,7 @@ local mode=1 --1:add, 2:remove
|
|||
local nled_hud
|
||||
local edmode_wason=false
|
||||
nlist.selected=sl
|
||||
nlist.dumppos={}
|
||||
|
||||
local modname = minetest.get_current_modname()
|
||||
local modpath = minetest.get_modpath(modname)
|
||||
|
@ -40,6 +41,7 @@ function nlist.add(list,node)
|
|||
end
|
||||
str=str..','..node
|
||||
storage:set_string(list,str)
|
||||
ws.dcm('added '..str..' to list '..list)
|
||||
end
|
||||
|
||||
function nlist.remove(list,node)
|
||||
|
@ -58,6 +60,20 @@ function nlist.get(list)
|
|||
return arr
|
||||
end
|
||||
|
||||
function nlist.get_dumppos()
|
||||
local arr=minetest.deserialize(storage:get_string("dumppos"))
|
||||
if not arr then arr={} end
|
||||
nlist.dumppos=arr
|
||||
return arr
|
||||
end
|
||||
function nlist.set_dumppos(list,pos)
|
||||
nlist.dumppos=nlist.get_dumppos()
|
||||
nlist.dumppos[list]=pos
|
||||
storage:set_string('dumppos',minetest.serialize(nlist.dumppos))
|
||||
end
|
||||
|
||||
|
||||
|
||||
function nlist.get_lists()
|
||||
local ret={}
|
||||
for name, _ in pairs(storage:to_table().fields) do
|
||||
|
@ -151,6 +167,17 @@ minetest.register_chatcommand('nlrwi',{func=function() nlist.remove(sl,minetest.
|
|||
|
||||
minetest.register_chatcommand('nltodf',{func=function(p) todflist(tostring(p)) end})
|
||||
|
||||
|
||||
minetest.register_cheat("NlToDfXray",'nList',function()
|
||||
todflist('xray_nodes')
|
||||
end)
|
||||
minetest.register_cheat("NlToDfSearch",'nList',function()
|
||||
todflist('search_nodes')
|
||||
end)
|
||||
minetest.register_cheat("NlToDfEject",'nList',function()
|
||||
todflist('eject_nodes')
|
||||
end)
|
||||
|
||||
function nlist.get_mtnodes()
|
||||
local arr= {
|
||||
"default:3dtorch",
|
||||
|
|
Loading…
Reference in New Issue