summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorFaceDeer <derksenmobile@gmail.com>2017-01-06 12:07:27 -0700
committerFaceDeer <derksenmobile@gmail.com>2017-01-06 12:07:27 -0700
commit6af67133be0524a1482e512038c5c1267b0ba1b9 (patch)
tree161ca36b21401aec266ad0436721aa9f41fe85a7 /init.lua
parentf85e42b7fafa3697cca51ff257aa58d7cedaffc6 (diff)
Adding combined storage module
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua28
1 files changed, 27 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 1576130..91d7c7c 100644
--- a/init.lua
+++ b/init.lua
@@ -1,7 +1,8 @@
dofile( minetest.get_modpath( "digtron" ) .. "/util.lua" )
dofile( minetest.get_modpath( "digtron" ) .. "/pointset.lua" )
dofile( minetest.get_modpath( "digtron" ) .. "/entities.lua" )
-dofile( minetest.get_modpath( "digtron" ) .. "/node_misc.lua" ) -- contains inventory and structure nodes
+dofile( minetest.get_modpath( "digtron" ) .. "/node_misc.lua" ) -- contains structure and light nodes
+dofile( minetest.get_modpath( "digtron" ) .. "/node_storage.lua" ) -- contains inventory and fuel storage nodes
dofile( minetest.get_modpath( "digtron" ) .. "/node_diggers.lua" ) -- contains all diggers
dofile( minetest.get_modpath( "digtron" ) .. "/node_builders.lua" ) -- contains all builders (there's just one currently)
dofile( minetest.get_modpath( "digtron" ) .. "/node_controllers.lua" ) -- controllers
@@ -49,4 +50,29 @@ minetest.register_lbm({
meta:set_string("offset", offset)
meta:set_string("period", period)
end
+})
+
+minetest.register_lbm({
+ name = "digtron:fuelstore_upgrade",
+ nodenames = {"digtron:fuelstore"},
+ action = function(pos, node)
+ local meta = minetest.get_meta(pos)
+ local inv = meta:get_inventory()
+ local list = inv:get_list("main")
+ inv:set_list("main", {})
+ inv:set_list("fuel", list)
+ meta:set_string("formspec",
+ "size[8,9.3]" ..
+ default.gui_bg ..
+ default.gui_bg_img ..
+ default.gui_slots ..
+ "label[0,0;Fuel items]" ..
+ "list[current_name;fuel;0,0.6;8,4;]" ..
+ "list[current_player;main;0,5.15;8,1;]" ..
+ "list[current_player;main;0,6.38;8,3;8]" ..
+ "listring[current_name;fuel]" ..
+ "listring[current_player;main]" ..
+ default.get_hotbar_bg(0,5.15)
+ )
+ end
}) \ No newline at end of file