Rewrite chests
authorShadowNinja <shadowninja@minetest.net>
Wed, 18 Dec 2013 00:15:20 +0000 (19:15 -0500)
committerShadowNinja <shadowninja@minetest.net>
Wed, 18 Dec 2013 00:15:20 +0000 (19:15 -0500)
125 files changed:
technic_chests/chest_commons.lua [deleted file]
technic_chests/common.lua [new file with mode: 0644]
technic_chests/copper_chest.lua
technic_chests/depends.txt
technic_chests/gold_chest.lua
technic_chests/init.lua
technic_chests/iron_chest.lua
technic_chests/mithril_chest.lua
technic_chests/register.lua [new file with mode: 0644]
technic_chests/silver_chest.lua
technic_chests/textures/technic_checkmark_icon.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_black.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_blue.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_brown.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_cyan.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_dark_green.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_dark_grey.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_green.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_grey.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_magenta.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_orange.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_pink.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_red.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_violet.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_white.png [new file with mode: 0644]
technic_chests/textures/technic_chest_overlay_yellow.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton0.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton1.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton10.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton11.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton12.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton13.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton14.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton15.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton2.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton3.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton4.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton5.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton6.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton7.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton8.png [new file with mode: 0644]
technic_chests/textures/technic_colorbutton9.png [new file with mode: 0644]
technic_chests/textures/technic_copper_chest_inventory.png [new file with mode: 0644]
technic_chests/textures/technic_copper_chest_lock_overlay.png [new file with mode: 0644]
technic_chests/textures/technic_copper_chest_locked.png [deleted file]
technic_chests/textures/technic_gold_chest_front.png
technic_chests/textures/technic_gold_chest_front_black.png [deleted file]
technic_chests/textures/technic_gold_chest_front_blue.png [deleted file]
technic_chests/textures/technic_gold_chest_front_brown.png [deleted file]
technic_chests/textures/technic_gold_chest_front_cyan.png [deleted file]
technic_chests/textures/technic_gold_chest_front_dark_green.png [deleted file]
technic_chests/textures/technic_gold_chest_front_dark_grey.png [deleted file]
technic_chests/textures/technic_gold_chest_front_green.png [deleted file]
technic_chests/textures/technic_gold_chest_front_grey.png [deleted file]
technic_chests/textures/technic_gold_chest_front_magenta.png [deleted file]
technic_chests/textures/technic_gold_chest_front_orange.png [deleted file]
technic_chests/textures/technic_gold_chest_front_pink.png [deleted file]
technic_chests/textures/technic_gold_chest_front_red.png [deleted file]
technic_chests/textures/technic_gold_chest_front_violet.png [deleted file]
technic_chests/textures/technic_gold_chest_front_white.png [deleted file]
technic_chests/textures/technic_gold_chest_front_yellow.png [deleted file]
technic_chests/textures/technic_gold_chest_inventory.png [new file with mode: 0644]
technic_chests/textures/technic_gold_chest_lock_overlay.png [new file with mode: 0644]
technic_chests/textures/technic_gold_chest_locked.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_black.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_blue.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_brown.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_cyan.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_dark_green.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_dark_grey.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_green.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_grey.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_magenta.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_orange.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_pink.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_red.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_violet.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_white.png [deleted file]
technic_chests/textures/technic_gold_chest_locked_yellow.png [deleted file]
technic_chests/textures/technic_iron_chest_inventory.png [new file with mode: 0644]
technic_chests/textures/technic_iron_chest_lock_overlay.png [new file with mode: 0644]
technic_chests/textures/technic_iron_chest_locked.png [deleted file]
technic_chests/textures/technic_mithril_chest_inventory.png [new file with mode: 0644]
technic_chests/textures/technic_mithril_chest_lock_overlay.png [new file with mode: 0644]
technic_chests/textures/technic_mithril_chest_locked.png [deleted file]
technic_chests/textures/technic_pencil_icon.png [new file with mode: 0644]
technic_chests/textures/technic_silver_chest_inventory.png [new file with mode: 0644]
technic_chests/textures/technic_silver_chest_lock_overlay.png [new file with mode: 0644]
technic_chests/textures/technic_silver_chest_locked.png [deleted file]
technic_chests/textures/technic_wooden_chest_inventory.png [new file with mode: 0644]
technic_chests/textures/x32/technic_copper_chest_locked.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_black.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_blue.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_brown.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_cyan.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_dark_green.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_dark_grey.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_green.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_grey.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_magenta.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_orange.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_pink.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_red.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_violet.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_white.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_front_yellow.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_black.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_blue.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_brown.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_cyan.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_dark_green.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_dark_grey.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_green.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_grey.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_magenta.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_orange.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_pink.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_red.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_violet.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_white.png [deleted file]
technic_chests/textures/x32/technic_gold_chest_locked_yellow.png [deleted file]
technic_chests/textures/x32/technic_iron_chest_locked.png [deleted file]
technic_chests/textures/x32/technic_mithril_chest_locked.png [deleted file]
technic_chests/textures/x32/technic_silver_chest_locked.png [deleted file]

diff --git a/technic_chests/chest_commons.lua b/technic_chests/chest_commons.lua
deleted file mode 100644 (file)
index 92827ab..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-chest_groups1 = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1}
-chest_groups2 = {snappy=2,choppy=2,oddly_breakable_by_hand=2,tubedevice=1,tubedevice_receiver=1,not_in_creative_inventory=1}
-
-tubes_properties = {insert_object=function(pos,node,stack,direction)
-                                       local meta=minetest.env:get_meta(pos)
-                                       local inv=meta:get_inventory()
-                                       return inv:add_item("main",stack)
-                               end,
-                               can_insert=function(pos,node,stack,direction)
-                                       local meta=minetest.env:get_meta(pos)
-                                       local inv=meta:get_inventory()
-                                       return inv:room_for_item("main",stack)
-                               end,
-                               input_inventory="main",
-                               connect_sides = {left=1, right=1, front=1, back=1, top=1, bottom=1},
-}
-
-chest_can_dig = function(pos,player)
-local meta = minetest.env:get_meta(pos);
-local inv = meta:get_inventory()
-return inv:is_empty("main")
-end
-
-def_allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
-local meta = minetest.env:get_meta(pos)
-if not has_locked_chest_privilege(meta, player) then
-       minetest.log("action", player:get_player_name()..
-       " tried to access a locked chest belonging to "..
-       meta:get_string("owner").." at "..
-       minetest.pos_to_string(pos))
-       return 0
-       end
-       return count
-end
-
-def_allow_metadata_inventory_put = function(pos, listname, index, stack, player)
-local meta = minetest.env:get_meta(pos)
-if not has_locked_chest_privilege(meta, player) then
-       minetest.log("action", player:get_player_name()..
-       " tried to access a locked chest belonging to "..
-       meta:get_string("owner").." at "..
-       minetest.pos_to_string(pos))
-       return 0
-end
-return stack:get_count()
-end
-
-def_allow_metadata_inventory_take = function(pos, listname, index, stack, player)
-local meta = minetest.env:get_meta(pos)
-if not has_locked_chest_privilege(meta, player) then
-       minetest.log("action", player:get_player_name()..
-       " tried to access a locked chest belonging to "..
-       meta:get_string("owner").." at "..
-       minetest.pos_to_string(pos))
-       return 0
-       end
-return stack:get_count()
-end
-
-def_on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
-       minetest.log("action", player:get_player_name()..
-       " moves stuff in locked chest at "..minetest.pos_to_string(pos))
-end
-
-def_on_metadata_inventory_put = function(pos, listname, index, stack, player)
-       minetest.log("action", player:get_player_name()..
-       " moves stuff to locked chest at "..minetest.pos_to_string(pos))
-end
-
-def_on_metadata_inventory_take = function(pos, listname, index, stack, player)
-       minetest.log("action", player:get_player_name()..
-       " takes stuff from locked chest at "..minetest.pos_to_string(pos))
-end
-
-function has_locked_chest_privilege(meta, player)
-       return player:get_player_name() == meta:get_string("owner")
-end
diff --git a/technic_chests/common.lua b/technic_chests/common.lua
new file mode 100644 (file)
index 0000000..86c0c38
--- /dev/null
@@ -0,0 +1,71 @@
+
+technic.chests.groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
+               tubedevice=1, tubedevice_receiver=1}
+technic.chests.groups_noinv = {snappy=2, choppy=2, oddly_breakable_by_hand=2,
+               tubedevice=1, tubedevice_receiver=1, not_in_creative_inventory=1}
+
+technic.chests.tube = {
+       insert_object = function(pos, node, stack, direction)
+               local meta = minetest.get_meta(pos)
+               local inv = meta:get_inventory()
+               return inv:add_item("main",stack)
+       end,
+       can_insert = function(pos, node, stack, direction)
+               local meta = minetest.get_meta(pos)
+               local inv = meta:get_inventory()
+               return inv:room_for_item("main",stack)
+       end,
+       input_inventory = "main",
+       connect_sides = {left=1, right=1, front=1, back=1, top=1, bottom=1},
+}
+
+technic.chests.can_dig = function(pos, player)
+       local meta = minetest.get_meta(pos)
+       local inv = meta:get_inventory()
+       return inv:is_empty("main")
+end
+
+local function inv_change(pos, count, player)
+       local meta = minetest.get_meta(pos)
+       if not has_locked_chest_privilege(meta, player) then
+               minetest.log("action", player:get_player_name()..
+                       " tried to access a locked chest belonging to "..
+                       meta:get_string("owner").." at "..
+                       minetest.pos_to_string(pos))
+               return 0
+       end
+       return count
+end
+
+function technic.chests.inv_move(pos, from_list, from_index, to_list, to_index, count, player)
+       return inv_change(pos, count, player)
+end
+function technic.chests.inv_put(pos, listname, index, stack, player)
+       return inv_change(pos, count, player)
+end
+function technic.chests.inv_take(pos, listname, index, stack, player)
+       return inv_change(pos, count, player)
+end
+
+function technic.chests.on_inv_move(pos, from_list, from_index, to_list, to_index, count, player)
+       minetest.log("action", player:get_player_name()..
+               " moves stuff in locked chest at "
+               ..minetest.pos_to_string(pos))
+end
+
+function technic.chests.on_inv_put(pos, listname, index, stack, player)
+       minetest.log("action", player:get_player_name()..
+               " puts stuff in to locked chest at "
+               ..minetest.pos_to_string(pos))
+end
+
+function technic.chests.on_inv_take(pos, listname, index, stack, player)
+       minetest.log("action", player:get_player_name()..
+               " takes stuff from locked chest at "
+               ..minetest.pos_to_string(pos))
+end
+
+function has_locked_chest_privilege(meta, player)
+       return player:get_player_name() == meta:get_string("owner")
+end
+
index 91efa96f72bd6217cbc8ef01c396f276bc05eef5..cba9e60a5fa47601b34a20c1630e9270bd7f0350 100644 (file)
@@ -24,80 +24,17 @@ minetest.register_craft({
        }
 })
 
-minetest.register_craftitem(":technic:copper_chest", {
-       description = "Copper Chest",
-       stack_max = 99,
+technic.chests:register("Copper", {
+       width = 10,
+       infotext = false,
+       color = false,
+       locked = false,
 })
-minetest.register_craftitem(":technic:copper_locked_chest", {
-       description = "Copper Locked Chest",
-       stack_max = 99,
-})
-
-minetest.register_node(":technic:copper_chest", {
-       description = "Copper Chest",
-       tiles = {"technic_copper_chest_top.png", "technic_copper_chest_top.png", "technic_copper_chest_side.png",
-               "technic_copper_chest_side.png", "technic_copper_chest_side.png", "technic_copper_chest_front.png"},
-       paramtype2 = "facedir",
-       groups = chest_groups1,
-       tube = tubes_properties,legacy_facedir_simple = true,
-       sounds = default.node_sound_wood_defaults(),
-       on_construct = function(pos)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",
-                               "invsize[10,10;]"..
-                               "label[0,0;Copper Chest]"..
-                               "list[current_name;main;0,1;10,4;]"..
-                               "list[current_player;main;0,6;8,4;]"..
-                               "background[-0.19,-0.25;10.4,10.75;ui_form_bg.png]"..
-                               "background[0,1;10,4;ui_copper_chest_inventory.png]"..
-                               "background[0,6;8,4;ui_main_inventory.png]")
-               meta:set_string("infotext", "Copper Chest")
-               local inv = meta:get_inventory()
-               inv:set_size("main", 10*4)
-       end,
 
-       can_dig = chest_can_dig,
-       on_metadata_inventory_move = def_on_metadata_inventory_move,
-       on_metadata_inventory_put = def_on_metadata_inventory_put,
-       on_metadata_inventory_take = def_on_metadata_inventory_take 
+technic.chests:register("Copper", {
+       width = 10,
+       infotext = false,
+       color = false,
+       locked = true,
 })
-  
-minetest.register_node(":technic:copper_locked_chest", {
-       description = "Copper Locked Chest",
-       tiles = {"technic_copper_chest_top.png", "technic_copper_chest_top.png", "technic_copper_chest_side.png",
-               "technic_copper_chest_side.png", "technic_copper_chest_side.png", "technic_copper_chest_locked.png"},
-       paramtype2 = "facedir",
-       groups = chest_groups1,
-       tube = tubes_properties,legacy_facedir_simple = true,
-       legacy_facedir_simple = true,
-       sounds = default.node_sound_wood_defaults(),
-       after_place_node = function(pos, placer)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("owner", placer:get_player_name() or "")
-               meta:set_string("infotext", "Copper Locked Chest (owned by "..
-                               meta:get_string("owner")..")")
-       end,
-       on_construct = function(pos)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",
-                               "invsize[10,10;]"..
-                               "label[0,0;Copper Locked Chest]"..
-                               "list[current_name;main;0,1;10,4;]"..
-                               "list[current_player;main;0,6;8,4;]"..
-                               "background[-0.19,-0.25;10.4,10.75;ui_form_bg.png]"..
-                               "background[0,1;10,4;ui_copper_chest_inventory.png]"..
-                               "background[0,6;8,4;ui_main_inventory.png]")
-               meta:set_string("infotext", "Copper Locked Chest")
-               meta:set_string("owner", "")
-               local inv = meta:get_inventory()
-               inv:set_size("main", 10*4)
-       end,
 
-       can_dig = chest_can_dig,
-       allow_metadata_inventory_move = def_allow_metadata_inventory_move,
-       allow_metadata_inventory_put = def_allow_metadata_inventory_put,
-       allow_metadata_inventory_take = def_allow_metadata_inventory_take,
-       on_metadata_inventory_move = def_on_metadata_inventory_move,
-       on_metadata_inventory_put = def_on_metadata_inventory_put,
-       on_metadata_inventory_take = def_on_metadata_inventory_take 
-})
index e02d92c1a49ba92e7bcc06c8b80eee8079bcf05d..d5cf46a1c59609351c5f00c21f6bf4169000ecc4 100644 (file)
@@ -1,3 +1,5 @@
 default
+technic
 moreores
 pipeworks
+
index 5c137d9241ac2d60d6275829d173fc36a24b0f19..7ba3f487b45450cb9d38753cc6ad46b76c78bf2a 100644 (file)
@@ -1,20 +1,19 @@
 local chest_mark_colors = {
-    {'_black','Black'},
-    {'_blue','Blue'}, 
-    {'_brown','Brown'},
-    {'_cyan','Cyan'},
-    {'_dark_green','Dark Green'},
-    {'_dark_grey','Dark Grey'},
-    {'_green','Green'},
-    {'_grey','Grey'},
-    {'_magenta','Magenta'},
-    {'_orange','Orange'},
-    {'_pink','Pink'},
-    {'_red','Red'},
-    {'_violet','Violet'},
-    {'_white','White'},
-    {'_yellow','Yellow'},
-    {'','None'}
+       'Black',
+       'Blue',
+       'Brown',
+       'Cyan',
+       'Dark Green',
+       'Dark Grey',
+       'Green',
+       'Grey',
+       'Magenta',
+       'Orange',
+       'Pink',
+       'Red',
+       'Violet',
+       'White',
+       'Yellow',
 }
 
 minetest.register_craft({
@@ -43,245 +42,17 @@ minetest.register_craft({
        }
 })
 
-minetest.register_craftitem(":technic:gold_chest", {
-       description = "Gold Chest",
-       stack_max = 99,
+technic.chests:register("Gold", {
+       width = 12,
+       infotext = true,
+       color = true,
+       locked = false,
 })
-minetest.register_craftitem(":technic:gold_locked_chest", {
-       description = "Gold Locked Chest",
-       stack_max = 99,
-})
-
-function get_pallette_buttons ()
-local buttons_string=""
-       for y=0,3,1 do
-               for x=0,3,1 do
-                       local file_name="ui_colorbutton"..(y*4+x)..".png"
-                       buttons_string=buttons_string.."image_button["..(9.2+x*.7)..","..(6+y*.7)..";.81,.81;"..file_name..";color_button"..(y*4+x)..";]"
-               end
-       end     
-return buttons_string
-end
-
-gold_chest_formspec    =       "invsize[12,10;]"..
-                                               "list[current_name;main;0,1;12,4;]"..
-                                               "list[current_player;main;0,6;8,4;]"..
-                                               "background[-0.19,-0.25;12.4,10.75;ui_form_bg.png]"..
-                                               "background[0,1;12,4;ui_gold_chest_inventory.png]"..
-                                               "background[0,6;8,4;ui_main_inventory.png]"..
-                                               get_pallette_buttons ()
-
-gold_chest_inv_size = 12*4
-
-minetest.register_node(":technic:gold_chest", {
-       description = "Gold Chest",
-       tiles = {"technic_gold_chest_top.png", "technic_gold_chest_top.png", "technic_gold_chest_side.png",
-               "technic_gold_chest_side.png", "technic_gold_chest_side.png", "technic_gold_chest_front.png"},
-       paramtype2 = "facedir",
-       groups = chest_groups1,
-       tube = tubes_properties,
-       legacy_facedir_simple = true,
-       sounds = default.node_sound_wood_defaults(),
-
-       on_construct = function(pos)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",gold_chest_formspec..
-                       "label[0,0;Gold Chest]"..
-                       "image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"..           
-                       "label[9.2,9;Color Filter: None")
-               meta:set_string("infotext", "Gold Chest")
-               local inv = meta:get_inventory()
-               inv:set_size("main", gold_chest_inv_size)
-       end,
-
-       can_dig = chest_can_dig,
-
-       on_receive_fields = function(pos, formname, fields, sender)
-        local meta = minetest.env:get_meta(pos)
-       local page="main"
-       if fields.edit_infotext then 
-                       page="edit_infotext"
-       end
-       if fields.save_infotext then 
-                       meta:set_string("infotext",fields.infotext_box)
-       end
-               local formspec = gold_chest_formspec.."label[0,0;Gold Chest]"
-               if page=="main" then
-                       formspec = formspec.."image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"
-                       formspec = formspec.."label[4,0;"..meta:get_string("infotext").."]"
-               end
-               if page=="edit_infotext" then
-                       formspec = formspec.."image_button[3.5,.1;.6,.6;ok_icon.png;save_infotext;]"
-                       formspec = formspec.."field[4.3,.2;6,1;infotext_box;Edit chest description:;"..meta:get_string("infotext").."]"
-               end                     
-               formspec = formspec .. "label[9.2,9;Color Filter: "..chest_mark_colors[check_color_buttons (pos,"technic:gold_chest",fields)][2].."]"           
-               meta:set_string("formspec",formspec)
-       end,
-
-       on_metadata_inventory_move = def_on_metadata_inventory_move,
-       on_metadata_inventory_put = def_on_metadata_inventory_put,
-       on_metadata_inventory_take = def_on_metadata_inventory_take 
-})
-
-for i=1,15,1 do
-minetest.register_node(":technic:gold_chest".. chest_mark_colors[i][1], {
-       description = "Gold Chest",
-       tiles = {"technic_gold_chest_top.png", "technic_gold_chest_top.png", "technic_gold_chest_side.png",
-               "technic_gold_chest_side.png", "technic_gold_chest_side.png", "technic_gold_chest_front"..chest_mark_colors[i][1]..".png"},
-       paramtype2 = "facedir",
-       groups = chest_groups2,
-       tube = tubes_properties,
-       legacy_facedir_simple = true,
-       sounds = default.node_sound_wood_defaults(),
-       drop = "technic:gold_chest",
-       can_dig =chest_can_dig,
-       
-       on_receive_fields = function(pos, formname, fields, sender)
-        local meta = minetest.env:get_meta(pos)
-        local page="main"
-       if fields.edit_infotext then 
-                       page="edit_infotext"
-       end
-       if fields.save_infotext then 
-                       meta:set_string("infotext",fields.infotext_box)
-       end
-               local formspec = gold_chest_formspec.."label[0,0;Gold Chest]"
-               if page=="main" then
-                       formspec = formspec.."image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"
-                       formspec = formspec.."label[4,0;"..meta:get_string("infotext").."]"
-               end
-               if page=="edit_infotext" then
-                       formspec = formspec.."image_button[3.5,.1;.6,.6;ok_icon.png;save_infotext;]"
-                       formspec = formspec.."field[4.3,.2;6,1;infotext_box;Edit chest description:;"..meta:get_string("infotext").."]"
-               end                     
-               formspec = formspec .. "label[9.2,9;Color Filter: "..chest_mark_colors[check_color_buttons (pos,"technic:gold_chest",fields)][2].."]"           
-               meta:set_string("formspec",formspec)
-       end,
-
-       on_metadata_inventory_move = def_on_metadata_inventory_move,
-       on_metadata_inventory_put = def_on_metadata_inventory_put,
-       on_metadata_inventory_take = def_on_metadata_inventory_take 
-})
-end
-
-minetest.register_node(":technic:gold_locked_chest", {
-       description = "Gold Locked Chest",
-       tiles = {"technic_gold_chest_top.png", "technic_gold_chest_top.png", "technic_gold_chest_side.png",
-               "technic_gold_chest_side.png", "technic_gold_chest_side.png", "technic_gold_chest_locked.png"},
-       paramtype2 = "facedir",
-       drop = "technic:gold_locked_chest",
-       groups = chest_groups1,
-       tube = tubes_properties,
-       legacy_facedir_simple = true,
-       sounds = default.node_sound_wood_defaults(),
-       after_place_node = function(pos, placer)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("owner", placer:get_player_name() or "")
-               meta:set_string("infotext", "Gold Locked Chest (owned by "..
-                               meta:get_string("owner")..")")
-       end,
-       on_construct = function(pos)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",
-                               gold_chest_formspec..
-                               "label[0,0;Gold Locked Chest]"..
-                               "image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"..
-                               "label[9.2,9;Color Filter: None")
-               meta:set_string("owner", "")
-               local inv = meta:get_inventory()
-               inv:set_size("main", gold_chest_inv_size)
-       end,
-
-       can_dig =chest_can_dig,
-
-       on_receive_fields = function(pos, formname, fields, sender)
-        local meta = minetest.env:get_meta(pos)
-       local formspec = gold_chest_formspec..
-                       "label[0,0;Gold Locked Chest]"
-               local page="main"
-       if fields.edit_infotext then 
-                       page="edit_infotext"
-       end
-       if fields.save_infotext then 
-                       meta:set_string("infotext",fields.infotext_box)
-       end
-               if page=="main" then
-                       formspec = formspec.."image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"
-                       formspec = formspec.."label[4,0;"..meta:get_string("infotext").."]"
-               end
-               if page=="edit_infotext" then
-                       formspec = formspec.."image_button[3.5,.1;.6,.6;ok_icon.png;save_infotext;]"
-                       formspec = formspec.."field[4.3,.2;6,1;infotext_box;Edit chest description:;"..meta:get_string("infotext").."]"
-               end     
-               formspec = formspec .. "label[9.2,9;Color Filter: "..chest_mark_colors[check_color_buttons (pos,"technic:gold_locked_chest",fields)][2].."]"            
-               meta:set_string("formspec",formspec)
-       end,
-
-       allow_metadata_inventory_move = def_allow_metadata_inventory_move,
-       allow_metadata_inventory_put = def_allow_metadata_inventory_put,
-       allow_metadata_inventory_take = def_allow_metadata_inventory_take,
-       on_metadata_inventory_move = def_on_metadata_inventory_move,
-       on_metadata_inventory_put = def_on_metadata_inventory_put,
-       on_metadata_inventory_take = def_on_metadata_inventory_take 
-})
-
-for i=1,15,1 do
-minetest.register_node(":technic:gold_locked_chest".. chest_mark_colors[i][1], {
-       description = "Gold Locked Chest",
-       tiles = {"technic_gold_chest_top.png", "technic_gold_chest_top.png", "technic_gold_chest_side.png",
-               "technic_gold_chest_side.png", "technic_gold_chest_side.png", "technic_gold_chest_locked"..chest_mark_colors[i][1]..".png"},
-       paramtype2 = "facedir",
-       drop = "technic:gold_locked_chest",
-       groups = chest_groups2,
-       tube = tubes_properties,
-       legacy_facedir_simple = true,
-       sounds = default.node_sound_wood_defaults(),
-       can_dig = chest_can_dig,
-
-       on_receive_fields = function(pos, formname, fields, sender)
-        local meta = minetest.env:get_meta(pos)
-       local formspec = gold_chest_formspec..
-                               "label[0,0;Gold Locked Chest]"
-       local page="main"
-       if fields.edit_infotext then 
-                       page="edit_infotext"
-       end
-       if fields.save_infotext then 
-                       meta:set_string("infotext",fields.infotext_box)
-       end
-               if page=="main" then
-                       formspec = formspec.."image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"
-                       formspec = formspec.."label[4,0;"..meta:get_string("infotext").."]"
-               end
-               if page=="edit_infotext" then
-                       formspec = formspec.."image_button[3.5,.1;.6,.6;ok_icon.png;save_infotext;]"
-                       formspec = formspec.."field[4.3,.2;6,1;infotext_box;Edit chest description:;"..meta:get_string("infotext").."]"
-               end                     
-               formspec = formspec .. "label[9.2,9;Color Filter: "..chest_mark_colors[check_color_buttons (pos,"technic:gold_locked_chest",fields)][2].."]"            
-               meta:set_string("formspec",formspec)
-       end,
 
-       allow_metadata_inventory_move = def_allow_metadata_inventory_move,
-       allow_metadata_inventory_put = def_allow_metadata_inventory_put,
-       allow_metadata_inventory_take = def_allow_metadata_inventory_take,
-       on_metadata_inventory_move = def_on_metadata_inventory_move,
-       on_metadata_inventory_put = def_on_metadata_inventory_put,
-       on_metadata_inventory_take = def_on_metadata_inventory_take 
+technic.chests:register("Gold", {
+       width = 12,
+       infotext = true,
+       color = true,
+       locked = true,
 })
-end
 
-function check_color_buttons (pos,chest_name,fields)
-       if fields.color_button15 then
-               hacky_swap_node(pos,chest_name)
-               return 16
-       end
-       for i=0,14,1 do
-               local button="color_button"..i
-               if fields[button] then
-                       hacky_swap_node(pos,chest_name..chest_mark_colors[i+1][1])
-                       return i+1
-               end
-       end
-       return 16
-end    
-       
index 1afbf547d67180e8776f9e4a65cdd798f4a4a77a..60030540d4b76210c48a426d6c276bc9491b6360 100644 (file)
@@ -2,12 +2,15 @@
 -- namespace: technic
 -- (c) 2012-2013 by RealBadAngel <mk@realbadangel.pl>
 
-modpath=minetest.get_modpath("technic_chests")
+modpath = minetest.get_modpath("technic_chests")
 
--- chests
-dofile(modpath.."/chest_commons.lua")
+technic.chests = {}
+
+dofile(modpath.."/common.lua")
+dofile(modpath.."/register.lua")
 dofile(modpath.."/iron_chest.lua")
 dofile(modpath.."/copper_chest.lua")
 dofile(modpath.."/silver_chest.lua")
 dofile(modpath.."/gold_chest.lua")
 dofile(modpath.."/mithril_chest.lua")
+
index 62a8ae345b9ceb539a44aed6fb4f100e9a5933b7..eb016c6624c5cf8866a8e3a7b052f212afb04d6b 100644 (file)
@@ -1,3 +1,4 @@
+
 minetest.register_craft({
        output = 'technic:iron_chest 1',
        recipe = {
@@ -24,80 +25,17 @@ minetest.register_craft({
        }
 })
 
-
-minetest.register_craftitem(":technic:iron_chest", {
-       description = "Iron Chest",
-       stack_max = 99,
-})
-minetest.register_craftitem(":technic:iron_locked_chest", {
-       description = "Iron Locked Chest",
-       stack_max = 99,
+technic.chests:register("Iron", {
+       width = 9,
+       infotext = false,
+       color = false,
+       locked = false,
 })
 
-minetest.register_node(":technic:iron_chest", {
-       description = "Iron Chest",
-       tiles = {"technic_iron_chest_top.png", "technic_iron_chest_top.png", "technic_iron_chest_side.png",
-               "technic_iron_chest_side.png", "technic_iron_chest_side.png", "technic_iron_chest_front.png"},
-       paramtype2 = "facedir",
-       groups = chest_groups1,
-       tube = tubes_properties,
-       legacy_facedir_simple = true,
-       sounds = default.node_sound_wood_defaults(),
-       on_construct = function(pos)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",
-                               "invsize[9,10;]"..
-                               "label[0,0;Iron Chest]"..
-                               "list[current_name;main;0,1;9,4;]"..
-                               "list[current_player;main;0,6;8,4;]"..
-                               "background[-0.19,-0.25;9.4,10.75;ui_form_bg.png]"..
-                               "background[0,1;9,4;ui_iron_chest_inventory.png]"..
-                               "background[0,6;8,4;ui_main_inventory.png]")
-               meta:set_string("infotext", "Iron Chest")
-               local inv = meta:get_inventory()
-               inv:set_size("main", 9*4)
-       end,
-       can_dig = chest_can_dig,
-       on_metadata_inventory_move = def_on_metadata_inventory_move,
-       on_metadata_inventory_put = def_on_metadata_inventory_put,
-       on_metadata_inventory_take = def_on_metadata_inventory_take 
+technic.chests:register("Iron", {
+       width = 9,
+       infotext = false,
+       color = false,
+       locked = true,
 })
 
-minetest.register_node(":technic:iron_locked_chest", {
-       description = "Iron Locked Chest",
-       tiles = {"technic_iron_chest_top.png", "technic_iron_chest_top.png", "technic_iron_chest_side.png",
-               "technic_iron_chest_side.png", "technic_iron_chest_side.png", "technic_iron_chest_locked.png"},
-       paramtype2 = "facedir",
-       groups = chest_groups1,
-       tube = tubes_properties,
-       legacy_facedir_simple = true,
-       sounds = default.node_sound_wood_defaults(),
-       after_place_node = function(pos, placer)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("owner", placer:get_player_name() or "")
-               meta:set_string("infotext", "Locked Iron Chest (owned by "..
-               meta:get_string("owner")..")")
-       end,
-       on_construct = function(pos)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",
-                               "invsize[9,10;]"..
-                               "label[0,0;Iron Locked Chest]"..
-                               "list[current_name;main;0,1;9,4;]"..
-                               "list[current_player;main;0,6;8,4;]"..
-                               "background[-0.19,-0.25;9.4,10.75;ui_form_bg.png]"..
-                               "background[0,1;9,4;ui_iron_chest_inventory.png]"..
-                               "background[0,6;8,4;ui_main_inventory.png]")
-               meta:set_string("infotext", "Iron Locked Chest")
-               meta:set_string("owner", "")
-               local inv = meta:get_inventory()
-               inv:set_size("main", 9*4)
-       end,
-       can_dig = chest_can_dig,
-       allow_metadata_inventory_move = def_allow_metadata_inventory_move,
-       allow_metadata_inventory_put = def_allow_metadata_inventory_put,
-       allow_metadata_inventory_take = def_allow_metadata_inventory_take,
-       on_metadata_inventory_move = def_on_metadata_inventory_move,
-       on_metadata_inventory_put = def_on_metadata_inventory_put,
-       on_metadata_inventory_take = def_on_metadata_inventory_take 
-})
index 892e48cd19b1fa991269e3898b0f300dd0944670..4c8b0c799014b98d5ce6b832d35ce6a7c44660f2 100644 (file)
@@ -24,130 +24,17 @@ minetest.register_craft({
        }
 })
 
-minetest.register_node(":technic:mithril_chest", {
-       description = "Mithril Chest",
-       tiles = {"technic_mithril_chest_top.png", "technic_mithril_chest_top.png", "technic_mithril_chest_side.png",
-               "technic_mithril_chest_side.png", "technic_mithril_chest_side.png", "technic_mithril_chest_front.png"},
-       paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
-       legacy_facedir_simple = true,
-       sounds = default.node_sound_wood_defaults(),
-       on_construct = function(pos)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",
-                               "invsize[13,10;]"..
-                               "label[0,0;Mithril Chest]"..
-                               "list[current_name;main;0,1;13,4;]"..
-                               "list[current_player;main;0,6;8,4;]"..
-                               "background[-0.19,-0.25;13.4,10.75;ui_form_bg.png]"..
-                               "background[0,1;13,4;ui_mithril_chest_inventory.png]"..
-                               "background[0,6;8,4;ui_main_inventory.png]")
-               meta:set_string("infotext", "Mithril Chest")
-               local inv = meta:get_inventory()
-               inv:set_size("main", 13*4)
-       end,
-       can_dig = function(pos,player)
-               local meta = minetest.env:get_meta(pos);
-               local inv = meta:get_inventory()
-               return inv:is_empty("main")
-       end,
-
-    on_metadata_inventory_move = function(pos, from_list, from_index,
-                       to_list, to_index, count, player)
-               minetest.log("action", player:get_player_name()..
-                               " moves stuff in chest at "..minetest.pos_to_string(pos))
-               return minetest.node_metadata_inventory_move_allow_all(
-                               pos, from_list, from_index, to_list, to_index, count, player)
-       end,
-    on_metadata_inventory_offer = function(pos, listname, index, stack, player)
-               minetest.log("action", player:get_player_name()..
-                               " moves stuff to chest at "..minetest.pos_to_string(pos))
-               return minetest.node_metadata_inventory_offer_allow_all(
-                               pos, listname, index, stack, player)
-       end,
-    on_metadata_inventory_take = function(pos, listname, index, stack, player)
-               minetest.log("action", player:get_player_name()..
-                               " takes stuff from chest at "..minetest.pos_to_string(pos))
-       end,
+technic.chests:register("Mithril", {
+       width = 13,
+       infotext = false,
+       color = false,
+       locked = false,
 })
 
-minetest.register_node(":technic:mithril_locked_chest", {
-       description = "Mithril Locked Chest",
-       tiles = {"technic_mithril_chest_top.png", "technic_mithril_chest_top.png", "technic_mithril_chest_side.png",
-               "technic_mithril_chest_side.png", "technic_mithril_chest_side.png", "technic_mithril_chest_locked.png"},
-       paramtype2 = "facedir",
-       groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
-       legacy_facedir_simple = true,
-       sounds = default.node_sound_wood_defaults(),
-       after_place_node = function(pos, placer)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("owner", placer:get_player_name() or "")
-               meta:set_string("infotext", "Mithril Locked Chest (owned by "..
-                               meta:get_string("owner")..")")
-       end,
-on_construct = function(pos)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",
-                               "invsize[13,10;]"..
-                               "label[0,0;Mithril Locked Chest]"..
-                               "list[current_name;main;0,1;13,4;]"..
-                               "list[current_player;main;0,6;8,4;]"..
-                               "background[-0.19,-0.25;13.4,10.75;ui_form_bg.png]"..
-                               "background[0,1;13,4;ui_mithril_chest_inventory.png]"..
-                               "background[0,6;8,4;ui_main_inventory.png]")
-               meta:set_string("infotext", "Mithril Locked Chest")
-               meta:set_string("owner", "")
-               local inv = meta:get_inventory()
-               inv:set_size("main", 13*4)
-       end,
-       can_dig = function(pos,player)
-               local meta = minetest.env:get_meta(pos);
-               local inv = meta:get_inventory()
-               return inv:is_empty("main")
-       end,
-       allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
-               local meta = minetest.env:get_meta(pos)
-               if not has_locked_chest_privilege(meta, player) then
-                       minetest.log("action", player:get_player_name()..
-                                       " tried to access a locked chest belonging to "..
-                                       meta:get_string("owner").." at "..
-                                       minetest.pos_to_string(pos))
-                       return 0
-               end
-               return count
-       end,
-    allow_metadata_inventory_put = function(pos, listname, index, stack, player)
-               local meta = minetest.env:get_meta(pos)
-               if not has_locked_chest_privilege(meta, player) then
-                       minetest.log("action", player:get_player_name()..
-                                       " tried to access a locked chest belonging to "..
-                                       meta:get_string("owner").." at "..
-                                       minetest.pos_to_string(pos))
-                       return 0
-               end
-               return stack:get_count()
-       end,
-    allow_metadata_inventory_take = function(pos, listname, index, stack, player)
-               local meta = minetest.env:get_meta(pos)
-               if not has_locked_chest_privilege(meta, player) then
-                       minetest.log("action", player:get_player_name()..
-                                       " tried to access a locked chest belonging to "..
-                                       meta:get_string("owner").." at "..
-                                       minetest.pos_to_string(pos))
-                       return 0
-               end
-               return stack:get_count()
-       end,
-       on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
-               minetest.log("action", player:get_player_name()..
-                               " moves stuff in locked chest at "..minetest.pos_to_string(pos))
-       end,
-    on_metadata_inventory_put = function(pos, listname, index, stack, player)
-               minetest.log("action", player:get_player_name()..
-                               " moves stuff to locked chest at "..minetest.pos_to_string(pos))
-       end,
-    on_metadata_inventory_take = function(pos, listname, index, stack, player)
-               minetest.log("action", player:get_player_name()..
-                               " takes stuff from locked chest at "..minetest.pos_to_string(pos))
-       end,
+technic.chests:register("Mithril", {
+       width = 13,
+       infotext = false,
+       color = false,
+       locked = true,
 })
+
diff --git a/technic_chests/register.lua b/technic_chests/register.lua
new file mode 100644 (file)
index 0000000..797c652
--- /dev/null
@@ -0,0 +1,175 @@
+
+local chest_mark_colors = {
+       'Black',
+       'Blue',
+       'Brown',
+       'Cyan',
+       'Dark Green',
+       'Dark Grey',
+       'Green',
+       'Grey',
+       'Magenta',
+       'Orange',
+       'Pink',
+       'Red',
+       'Violet',
+       'White',
+       'Yellow',
+}
+
+
+local function colorid_to_postfix(id)
+       return (chest_mark_colors[id] and "_"..chest_mark_colors[id] or ""):lower():gsub(" ", "_")
+end
+
+
+local function get_color_buttons()
+       local buttons_string = ""
+       for y = 0, 3 do
+               for x = 0, 3 do
+                       local file_name = "technic_colorbutton"..(y * 4 + x)..".png"
+                       buttons_string = buttons_string.."image_button["
+                               ..(8.1 + x * 0.7)..","..(6.1 + y * 0.7)
+                               ..";0.8,0.8;"..file_name..";color_button"
+                               ..(y * 4 + x + 1)..";]"
+               end
+       end
+       return buttons_string
+end
+
+
+local function check_color_buttons(pos, meta, chest_name, fields)
+       for i = 1, 16 do
+               if fields["color_button"..i] then
+                       technic.swap_node(pos, chest_name..colorid_to_postfix(i))
+                       meta:set_string("color", chest_mark_colors[i])
+                       return
+               end
+       end
+end
+
+
+local function get_receive_fields(name, data)
+       if not data.infotext and not data.color then
+               return nil
+       end
+       local lname = name:lower()
+       return function(pos, formname, fields, sender)
+               local meta = minetest.get_meta(pos)
+               local node = minetest.get_node(pos)
+               local page = "main"
+               if fields.edit_infotext then
+                       page = "edit_infotext"
+               end
+               if fields.save_infotext then
+                       meta:set_string("infotext", fields.infotext_box)
+               end
+               local formspec = data.formspec
+               local formspec_infotext = minetest.formspec_escape(meta:get_string("infotext"))
+               if page == "main" and data.infotext then
+                       formspec = formspec.."image_button[2.1,0.1;0.8,0.8;"
+                                       .."technic_pencil_icon.png;edit_infotext;]"
+                                       .."label[3,0;"..formspec_infotext.."]"
+               end
+               if page == "edit_infotext" then
+                       formspec = formspec.."image_button[2.1,0.1;0.8,0.8;"
+                                       .."technic_checkmark_icon.png;save_infotext;]"
+                                       .."field[3.3,0.2;4.8,1;"
+                                       .."infotext_box;Edit chest description:;"
+                                       ..formspec_infotext.."]"
+               end
+               if data.color then
+                       -- This sets the node
+                       local nn = "technic:"..lname..(data.locked and "_locked" or "").."_chest"
+                       check_color_buttons(pos, meta, nn, fields)
+                       local color = meta:get_string("color")
+                       formspec = formspec.."label[8.2,9;Color Filter: "..color.."]"
+               end
+               meta:set_string("formspec", formspec)
+       end
+end
+
+
+function technic.chests:register(name, data)
+       local lname = name:lower()
+
+       local width = math.max(data.color and 11 or 8, data.width)
+
+       local locked_after_place = nil
+       local front = {"technic_"..lname.."_chest_front.png"}
+       data.formspec = "invsize["..width..",10;]"..
+                       "label[0,0;"..name.." Chest]"..
+                       "list[current_name;main;0,1;"..width..",4;]"..
+                       "list[current_player;main;0,6;8,4;]"..
+                       "background[-0.19,-0.25;"..width..".4,10.75;ui_form_bg.png]"..
+                       "background[0,1;"..width..",4;technic_"..lname.."_chest_inventory.png]"..
+                       "background[0,6;8,4;ui_main_inventory.png]"
+       if data.color then
+               data.formspec = data.formspec..get_color_buttons()
+       end
+
+       if data.locked then
+               locked_after_place = function(pos, placer)
+                       local meta = minetest.get_meta(pos)
+                       meta:set_string("owner", placer:get_player_name() or "")
+                       meta:set_string("infotext", name.." Locked Chest (owned by "..
+                                       meta:get_string("owner")..")")
+               end
+               table.insert(front, "technic_"..lname.."_chest_lock_overlay.png")
+       end
+
+       local def = {
+               description = name..(data.locked and " Locked" or "").." Chest",
+               tiles = {"technic_"..lname.."_chest_top.png", "technic_"..lname.."_chest_top.png",
+                       "technic_"..lname.."_chest_side.png", "technic_"..lname.."_chest_side.png",
+                       "technic_"..lname.."_chest_side.png", table.concat(front, "^")},
+               paramtype2 = "facedir",
+               groups = self.groups,
+               tube = self.tube,
+               legacy_facedir_simple = true,
+               sounds = default.node_sound_wood_defaults(),
+               after_place_node = locked_after_place,
+               on_construct = function(pos)
+                       local meta = minetest.get_meta(pos)
+                       meta:set_string("formspec", data.formspec
+                               ..(data.color and "label[8.2,9;Color Filter: None" or "")
+                               ..(data.infotext and "image_button[2.1,0.1;0.8,0.8;"
+                                       .."technic_pencil_icon.png;edit_infotext;]" or ""))
+                       meta:set_string("infotext", name.." Chest")
+                       local inv = meta:get_inventory()
+                       inv:set_size("main", data.width * 4)
+               end,
+               can_dig = self.can_dig,
+               on_receive_fields = get_receive_fields(name, data),
+               on_metadata_inventory_move = self.on_inv_move,
+               on_metadata_inventory_put = self.on_inv_put,
+               on_metadata_inventory_take = self.on_inv_take,
+       }
+       if data.locked then
+               def.allow_metadata_inventory_move = self.inv_move
+               def.allow_metadata_inventory_put = self.inv_put
+               def.allow_metadata_inventory_take = self.inv_take
+       end
+
+       local nn = "technic:"..lname..(data.locked and "_locked" or "").."_chest"
+
+       minetest.register_node(":"..nn, def)
+
+       if data.color then
+               front[3] = front[2]
+               for i = 1, 15 do
+                       local postfix = colorid_to_postfix(i)
+                       local colordef = {}
+                       for k, v in pairs(def) do
+                               colordef[k] = v
+                       end
+                       colordef.drop = nn
+                       colordef.groups = self.groups_noinv
+                       front[2] = "technic_chest_overlay"..postfix..".png"
+                       colordef.tiles[6] = table.concat(front, "^")
+                       minetest.register_node(":"..nn..postfix, colordef)
+               end
+       end
+
+end
+
index 176e36fb51a29f82367feaf5c9a39e2663227918..fcc46d3a924404c5270c0adde5402dbeab4a44d6 100644 (file)
@@ -24,122 +24,17 @@ minetest.register_craft({
        }
 })
 
-minetest.register_craftitem(":technic:silver_chest", {
-       description = "Silver Chest",
-       stack_max = 99,
+technic.chests:register("Silver", {
+       width = 11,
+       infotext = true,
+       color = false,
+       locked = false,
 })
-minetest.register_craftitem(":technic:silver_locked_chest", {
-       description = "Silver Locked Chest",
-       stack_max = 99,
-})
-
-silver_chest_formspec = 
-                               "invsize[11,10;]"..
-                               "list[current_name;main;0,1;11,4;]"..
-                               "list[current_player;main;0,6;8,4;]"..
-                               "background[-0.19,-0.25;11.4,10.75;ui_form_bg.png]"..
-                               "background[0,1;11,4;ui_silver_chest_inventory.png]"..
-                               "background[0,6;8,4;ui_main_inventory.png]"
-                               
-minetest.register_node(":technic:silver_chest", {
-       description = "Silver Chest",
-       tiles = {"technic_silver_chest_top.png", "technic_silver_chest_top.png", "technic_silver_chest_side.png",
-               "technic_silver_chest_side.png", "technic_silver_chest_side.png", "technic_silver_chest_front.png"},
-       paramtype2 = "facedir",
-       groups = chest_groups1,
-       tube = tubes_properties,
-       legacy_facedir_simple = true,
-       sounds = default.node_sound_wood_defaults(),
-       on_construct = function(pos)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",
-                               silver_chest_formspec..
-                               "label[0,0;Silver Chest]"..
-                               "image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]")
-               meta:set_string("infotext", "Silver Chest")
-               local inv = meta:get_inventory()
-               inv:set_size("main", 11*4)
-       end,
-       can_dig = chest_can_dig,
-
-       on_receive_fields = function(pos, formname, fields, sender)
-        local meta = minetest.env:get_meta(pos)
-       local page="main"
-       if fields.edit_infotext then 
-                       page="edit_infotext"
-       end
-       if fields.save_infotext then 
-                       meta:set_string("infotext",fields.infotext_box)
-       end
-               local formspec = silver_chest_formspec.."label[0,0;Silver Chest]"
-               if page=="main" then
-                       formspec = formspec.."image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"
-                       formspec = formspec.."label[4,0;"..meta:get_string("infotext").."]"
-               end
-               if page=="edit_infotext" then
-                       formspec = formspec.."image_button[3.5,.1;.6,.6;ok_icon.png;save_infotext;]"
-                       formspec = formspec.."field[4.3,.2;6,1;infotext_box;Edit chest description:;"..meta:get_string("infotext").."]"
-               end                     
-               meta:set_string("formspec",formspec)
-       end,
 
-       on_metadata_inventory_move = def_on_metadata_inventory_move,
-       on_metadata_inventory_put = def_on_metadata_inventory_put,
-       on_metadata_inventory_take = def_on_metadata_inventory_take 
+technic.chests:register("Silver", {
+       width = 11,
+       infotext = true,
+       color = false,
+       locked = true,
 })
 
-minetest.register_node(":technic:silver_locked_chest", {
-       description = "Silver Locked Chest",
-       tiles = {"technic_silver_chest_top.png", "technic_silver_chest_top.png", "technic_silver_chest_side.png",
-               "technic_silver_chest_side.png", "technic_silver_chest_side.png", "technic_silver_chest_locked.png"},
-       paramtype2 = "facedir",
-       groups = chest_groups1,
-       tube = tubes_properties,
-       legacy_facedir_simple = true,
-       sounds = default.node_sound_wood_defaults(),
-       after_place_node = function(pos, placer)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("owner", placer:get_player_name() or "")
-               meta:set_string("infotext", "Silver Locked Chest (owned by "..
-                       meta:get_string("owner")..")")
-       end,
-       on_construct = function(pos)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",
-                               silver_chest_formspec..
-                               "label[0,0;Silver Locked Chest]"..
-                               "image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]")
-               meta:set_string("owner", "")
-               local inv = meta:get_inventory()
-               inv:set_size("main", 11*4)
-       end,
-       can_dig = chest_can_dig,
-
-       on_receive_fields = function(pos, formname, fields, sender)
-        local meta = minetest.env:get_meta(pos)
-       local page="main"
-       if fields.edit_infotext then 
-                       page="edit_infotext"
-       end
-       if fields.save_infotext then 
-                       meta:set_string("infotext",fields.infotext_box)
-       end
-               local formspec = silver_chest_formspec.."label[0,0;Silver Locked Chest]"
-               if page=="main" then
-                       formspec = formspec.."image_button[3.5,.1;.6,.6;pencil_icon.png;edit_infotext;]"
-                       formspec = formspec.."label[4,0;"..meta:get_string("infotext").."]"
-               end
-               if page=="edit_infotext" then
-                       formspec = formspec.."image_button[3.5,.1;.6,.6;ok_icon.png;save_infotext;]"
-                       formspec = formspec.."field[4.3,.2;6,1;infotext_box;Edit chest description:;"..meta:get_string("infotext").."]"
-               end                     
-               meta:set_string("formspec",formspec)
-       end,
-
-       allow_metadata_inventory_move = def_allow_metadata_inventory_move,
-       allow_metadata_inventory_put = def_allow_metadata_inventory_put,
-       allow_metadata_inventory_take = def_allow_metadata_inventory_take,
-       on_metadata_inventory_move = def_on_metadata_inventory_move,
-       on_metadata_inventory_put = def_on_metadata_inventory_put,
-       on_metadata_inventory_take = def_on_metadata_inventory_take 
-})
diff --git a/technic_chests/textures/technic_checkmark_icon.png b/technic_chests/textures/technic_checkmark_icon.png
new file mode 100644 (file)
index 0000000..369d294
Binary files /dev/null and b/technic_chests/textures/technic_checkmark_icon.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_black.png b/technic_chests/textures/technic_chest_overlay_black.png
new file mode 100644 (file)
index 0000000..fa25304
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_black.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_blue.png b/technic_chests/textures/technic_chest_overlay_blue.png
new file mode 100644 (file)
index 0000000..512cd4f
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_blue.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_brown.png b/technic_chests/textures/technic_chest_overlay_brown.png
new file mode 100644 (file)
index 0000000..64c1d55
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_brown.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_cyan.png b/technic_chests/textures/technic_chest_overlay_cyan.png
new file mode 100644 (file)
index 0000000..46732f4
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_cyan.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_dark_green.png b/technic_chests/textures/technic_chest_overlay_dark_green.png
new file mode 100644 (file)
index 0000000..941236b
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_dark_green.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_dark_grey.png b/technic_chests/textures/technic_chest_overlay_dark_grey.png
new file mode 100644 (file)
index 0000000..e6b8f77
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_dark_grey.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_green.png b/technic_chests/textures/technic_chest_overlay_green.png
new file mode 100644 (file)
index 0000000..4b9543f
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_green.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_grey.png b/technic_chests/textures/technic_chest_overlay_grey.png
new file mode 100644 (file)
index 0000000..8a1c9f0
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_grey.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_magenta.png b/technic_chests/textures/technic_chest_overlay_magenta.png
new file mode 100644 (file)
index 0000000..75b220d
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_magenta.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_orange.png b/technic_chests/textures/technic_chest_overlay_orange.png
new file mode 100644 (file)
index 0000000..02c095d
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_orange.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_pink.png b/technic_chests/textures/technic_chest_overlay_pink.png
new file mode 100644 (file)
index 0000000..0b6ccb4
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_pink.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_red.png b/technic_chests/textures/technic_chest_overlay_red.png
new file mode 100644 (file)
index 0000000..4b44642
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_red.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_violet.png b/technic_chests/textures/technic_chest_overlay_violet.png
new file mode 100644 (file)
index 0000000..89471f9
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_violet.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_white.png b/technic_chests/textures/technic_chest_overlay_white.png
new file mode 100644 (file)
index 0000000..b49e253
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_white.png differ
diff --git a/technic_chests/textures/technic_chest_overlay_yellow.png b/technic_chests/textures/technic_chest_overlay_yellow.png
new file mode 100644 (file)
index 0000000..d563257
Binary files /dev/null and b/technic_chests/textures/technic_chest_overlay_yellow.png differ
diff --git a/technic_chests/textures/technic_colorbutton0.png b/technic_chests/textures/technic_colorbutton0.png
new file mode 100644 (file)
index 0000000..35b7db2
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton0.png differ
diff --git a/technic_chests/textures/technic_colorbutton1.png b/technic_chests/textures/technic_colorbutton1.png
new file mode 100644 (file)
index 0000000..cbf095d
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton1.png differ
diff --git a/technic_chests/textures/technic_colorbutton10.png b/technic_chests/textures/technic_colorbutton10.png
new file mode 100644 (file)
index 0000000..8dfc5f0
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton10.png differ
diff --git a/technic_chests/textures/technic_colorbutton11.png b/technic_chests/textures/technic_colorbutton11.png
new file mode 100644 (file)
index 0000000..3b279e0
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton11.png differ
diff --git a/technic_chests/textures/technic_colorbutton12.png b/technic_chests/textures/technic_colorbutton12.png
new file mode 100644 (file)
index 0000000..a387b5f
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton12.png differ
diff --git a/technic_chests/textures/technic_colorbutton13.png b/technic_chests/textures/technic_colorbutton13.png
new file mode 100644 (file)
index 0000000..b1e7790
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton13.png differ
diff --git a/technic_chests/textures/technic_colorbutton14.png b/technic_chests/textures/technic_colorbutton14.png
new file mode 100644 (file)
index 0000000..c4ad486
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton14.png differ
diff --git a/technic_chests/textures/technic_colorbutton15.png b/technic_chests/textures/technic_colorbutton15.png
new file mode 100644 (file)
index 0000000..b7060d6
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton15.png differ
diff --git a/technic_chests/textures/technic_colorbutton2.png b/technic_chests/textures/technic_colorbutton2.png
new file mode 100644 (file)
index 0000000..caf1fc6
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton2.png differ
diff --git a/technic_chests/textures/technic_colorbutton3.png b/technic_chests/textures/technic_colorbutton3.png
new file mode 100644 (file)
index 0000000..6ac79a3
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton3.png differ
diff --git a/technic_chests/textures/technic_colorbutton4.png b/technic_chests/textures/technic_colorbutton4.png
new file mode 100644 (file)
index 0000000..dc43592
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton4.png differ
diff --git a/technic_chests/textures/technic_colorbutton5.png b/technic_chests/textures/technic_colorbutton5.png
new file mode 100644 (file)
index 0000000..98b8c67
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton5.png differ
diff --git a/technic_chests/textures/technic_colorbutton6.png b/technic_chests/textures/technic_colorbutton6.png
new file mode 100644 (file)
index 0000000..66478bc
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton6.png differ
diff --git a/technic_chests/textures/technic_colorbutton7.png b/technic_chests/textures/technic_colorbutton7.png
new file mode 100644 (file)
index 0000000..85f6b93
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton7.png differ
diff --git a/technic_chests/textures/technic_colorbutton8.png b/technic_chests/textures/technic_colorbutton8.png
new file mode 100644 (file)
index 0000000..868c35d
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton8.png differ
diff --git a/technic_chests/textures/technic_colorbutton9.png b/technic_chests/textures/technic_colorbutton9.png
new file mode 100644 (file)
index 0000000..50eac0b
Binary files /dev/null and b/technic_chests/textures/technic_colorbutton9.png differ
diff --git a/technic_chests/textures/technic_copper_chest_inventory.png b/technic_chests/textures/technic_copper_chest_inventory.png
new file mode 100644 (file)
index 0000000..273a867
Binary files /dev/null and b/technic_chests/textures/technic_copper_chest_inventory.png differ
diff --git a/technic_chests/textures/technic_copper_chest_lock_overlay.png b/technic_chests/textures/technic_copper_chest_lock_overlay.png
new file mode 100644 (file)
index 0000000..49f7f2a
Binary files /dev/null and b/technic_chests/textures/technic_copper_chest_lock_overlay.png differ
diff --git a/technic_chests/textures/technic_copper_chest_locked.png b/technic_chests/textures/technic_copper_chest_locked.png
deleted file mode 100644 (file)
index 971cd5f..0000000
Binary files a/technic_chests/textures/technic_copper_chest_locked.png and /dev/null differ
index 1bfb55bbfe5ac1fa4c15f12bea47fbf2a456617a..27036d729163ad4bbc40ff02e719be5e31669911 100644 (file)
Binary files a/technic_chests/textures/technic_gold_chest_front.png and b/technic_chests/textures/technic_gold_chest_front.png differ
diff --git a/technic_chests/textures/technic_gold_chest_front_black.png b/technic_chests/textures/technic_gold_chest_front_black.png
deleted file mode 100644 (file)
index d283830..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_black.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_blue.png b/technic_chests/textures/technic_gold_chest_front_blue.png
deleted file mode 100644 (file)
index dc3fdfd..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_blue.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_brown.png b/technic_chests/textures/technic_gold_chest_front_brown.png
deleted file mode 100644 (file)
index db2773e..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_brown.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_cyan.png b/technic_chests/textures/technic_gold_chest_front_cyan.png
deleted file mode 100644 (file)
index 80b5b89..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_cyan.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_dark_green.png b/technic_chests/textures/technic_gold_chest_front_dark_green.png
deleted file mode 100644 (file)
index 5c8ec63..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_dark_green.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_dark_grey.png b/technic_chests/textures/technic_gold_chest_front_dark_grey.png
deleted file mode 100644 (file)
index 799cb2d..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_dark_grey.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_green.png b/technic_chests/textures/technic_gold_chest_front_green.png
deleted file mode 100644 (file)
index 3632e93..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_green.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_grey.png b/technic_chests/textures/technic_gold_chest_front_grey.png
deleted file mode 100644 (file)
index 35ad8db..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_grey.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_magenta.png b/technic_chests/textures/technic_gold_chest_front_magenta.png
deleted file mode 100644 (file)
index 5c7a05c..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_magenta.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_orange.png b/technic_chests/textures/technic_gold_chest_front_orange.png
deleted file mode 100644 (file)
index bbf01cc..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_orange.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_pink.png b/technic_chests/textures/technic_gold_chest_front_pink.png
deleted file mode 100644 (file)
index aeedf35..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_pink.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_red.png b/technic_chests/textures/technic_gold_chest_front_red.png
deleted file mode 100644 (file)
index cf7cef6..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_red.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_violet.png b/technic_chests/textures/technic_gold_chest_front_violet.png
deleted file mode 100644 (file)
index b5b61c2..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_violet.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_white.png b/technic_chests/textures/technic_gold_chest_front_white.png
deleted file mode 100644 (file)
index 1b43cfe..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_white.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_front_yellow.png b/technic_chests/textures/technic_gold_chest_front_yellow.png
deleted file mode 100644 (file)
index bf572cf..0000000
Binary files a/technic_chests/textures/technic_gold_chest_front_yellow.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_inventory.png b/technic_chests/textures/technic_gold_chest_inventory.png
new file mode 100644 (file)
index 0000000..b19524b
Binary files /dev/null and b/technic_chests/textures/technic_gold_chest_inventory.png differ
diff --git a/technic_chests/textures/technic_gold_chest_lock_overlay.png b/technic_chests/textures/technic_gold_chest_lock_overlay.png
new file mode 100644 (file)
index 0000000..51dea71
Binary files /dev/null and b/technic_chests/textures/technic_gold_chest_lock_overlay.png differ
diff --git a/technic_chests/textures/technic_gold_chest_locked.png b/technic_chests/textures/technic_gold_chest_locked.png
deleted file mode 100644 (file)
index 15f1fe4..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_black.png b/technic_chests/textures/technic_gold_chest_locked_black.png
deleted file mode 100644 (file)
index a8ce91f..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_black.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_blue.png b/technic_chests/textures/technic_gold_chest_locked_blue.png
deleted file mode 100644 (file)
index 5a9c27e..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_blue.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_brown.png b/technic_chests/textures/technic_gold_chest_locked_brown.png
deleted file mode 100644 (file)
index a064e32..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_brown.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_cyan.png b/technic_chests/textures/technic_gold_chest_locked_cyan.png
deleted file mode 100644 (file)
index 95afa80..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_cyan.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_dark_green.png b/technic_chests/textures/technic_gold_chest_locked_dark_green.png
deleted file mode 100644 (file)
index 7c9e992..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_dark_green.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_dark_grey.png b/technic_chests/textures/technic_gold_chest_locked_dark_grey.png
deleted file mode 100644 (file)
index c19e9fd..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_dark_grey.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_green.png b/technic_chests/textures/technic_gold_chest_locked_green.png
deleted file mode 100644 (file)
index ce10afa..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_green.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_grey.png b/technic_chests/textures/technic_gold_chest_locked_grey.png
deleted file mode 100644 (file)
index 667ea20..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_grey.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_magenta.png b/technic_chests/textures/technic_gold_chest_locked_magenta.png
deleted file mode 100644 (file)
index fc8573a..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_magenta.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_orange.png b/technic_chests/textures/technic_gold_chest_locked_orange.png
deleted file mode 100644 (file)
index e1608bf..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_orange.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_pink.png b/technic_chests/textures/technic_gold_chest_locked_pink.png
deleted file mode 100644 (file)
index 4648e0e..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_pink.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_red.png b/technic_chests/textures/technic_gold_chest_locked_red.png
deleted file mode 100644 (file)
index e505ecb..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_red.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_violet.png b/technic_chests/textures/technic_gold_chest_locked_violet.png
deleted file mode 100644 (file)
index 1077099..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_violet.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_white.png b/technic_chests/textures/technic_gold_chest_locked_white.png
deleted file mode 100644 (file)
index e5a279d..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_white.png and /dev/null differ
diff --git a/technic_chests/textures/technic_gold_chest_locked_yellow.png b/technic_chests/textures/technic_gold_chest_locked_yellow.png
deleted file mode 100644 (file)
index 7b817f5..0000000
Binary files a/technic_chests/textures/technic_gold_chest_locked_yellow.png and /dev/null differ
diff --git a/technic_chests/textures/technic_iron_chest_inventory.png b/technic_chests/textures/technic_iron_chest_inventory.png
new file mode 100644 (file)
index 0000000..1785f88
Binary files /dev/null and b/technic_chests/textures/technic_iron_chest_inventory.png differ
diff --git a/technic_chests/textures/technic_iron_chest_lock_overlay.png b/technic_chests/textures/technic_iron_chest_lock_overlay.png
new file mode 100644 (file)
index 0000000..1750b82
Binary files /dev/null and b/technic_chests/textures/technic_iron_chest_lock_overlay.png differ
diff --git a/technic_chests/textures/technic_iron_chest_locked.png b/technic_chests/textures/technic_iron_chest_locked.png
deleted file mode 100644 (file)
index 74df3fd..0000000
Binary files a/technic_chests/textures/technic_iron_chest_locked.png and /dev/null differ
diff --git a/technic_chests/textures/technic_mithril_chest_inventory.png b/technic_chests/textures/technic_mithril_chest_inventory.png
new file mode 100644 (file)
index 0000000..9054775
Binary files /dev/null and b/technic_chests/textures/technic_mithril_chest_inventory.png differ
diff --git a/technic_chests/textures/technic_mithril_chest_lock_overlay.png b/technic_chests/textures/technic_mithril_chest_lock_overlay.png
new file mode 100644 (file)
index 0000000..d227c51
Binary files /dev/null and b/technic_chests/textures/technic_mithril_chest_lock_overlay.png differ
diff --git a/technic_chests/textures/technic_mithril_chest_locked.png b/technic_chests/textures/technic_mithril_chest_locked.png
deleted file mode 100644 (file)
index 2a48533..0000000
Binary files a/technic_chests/textures/technic_mithril_chest_locked.png and /dev/null differ
diff --git a/technic_chests/textures/technic_pencil_icon.png b/technic_chests/textures/technic_pencil_icon.png
new file mode 100644 (file)
index 0000000..8079ede
Binary files /dev/null and b/technic_chests/textures/technic_pencil_icon.png differ
diff --git a/technic_chests/textures/technic_silver_chest_inventory.png b/technic_chests/textures/technic_silver_chest_inventory.png
new file mode 100644 (file)
index 0000000..a61c4b9
Binary files /dev/null and b/technic_chests/textures/technic_silver_chest_inventory.png differ
diff --git a/technic_chests/textures/technic_silver_chest_lock_overlay.png b/technic_chests/textures/technic_silver_chest_lock_overlay.png
new file mode 100644 (file)
index 0000000..cb1bdb0
Binary files /dev/null and b/technic_chests/textures/technic_silver_chest_lock_overlay.png differ
diff --git a/technic_chests/textures/technic_silver_chest_locked.png b/technic_chests/textures/technic_silver_chest_locked.png
deleted file mode 100644 (file)
index 7d3b918..0000000
Binary files a/technic_chests/textures/technic_silver_chest_locked.png and /dev/null differ
diff --git a/technic_chests/textures/technic_wooden_chest_inventory.png b/technic_chests/textures/technic_wooden_chest_inventory.png
new file mode 100644 (file)
index 0000000..145d9d2
Binary files /dev/null and b/technic_chests/textures/technic_wooden_chest_inventory.png differ
diff --git a/technic_chests/textures/x32/technic_copper_chest_locked.png b/technic_chests/textures/x32/technic_copper_chest_locked.png
deleted file mode 100644 (file)
index 6d059e9..0000000
Binary files a/technic_chests/textures/x32/technic_copper_chest_locked.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_black.png b/technic_chests/textures/x32/technic_gold_chest_front_black.png
deleted file mode 100644 (file)
index 6d0fe5e..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_black.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_blue.png b/technic_chests/textures/x32/technic_gold_chest_front_blue.png
deleted file mode 100644 (file)
index 7efe651..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_blue.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_brown.png b/technic_chests/textures/x32/technic_gold_chest_front_brown.png
deleted file mode 100644 (file)
index 4f4f34e..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_brown.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_cyan.png b/technic_chests/textures/x32/technic_gold_chest_front_cyan.png
deleted file mode 100644 (file)
index e33d76d..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_cyan.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_dark_green.png b/technic_chests/textures/x32/technic_gold_chest_front_dark_green.png
deleted file mode 100644 (file)
index 3088bbf..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_dark_green.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_dark_grey.png b/technic_chests/textures/x32/technic_gold_chest_front_dark_grey.png
deleted file mode 100644 (file)
index 0aa03b4..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_dark_grey.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_green.png b/technic_chests/textures/x32/technic_gold_chest_front_green.png
deleted file mode 100644 (file)
index 30da993..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_green.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_grey.png b/technic_chests/textures/x32/technic_gold_chest_front_grey.png
deleted file mode 100644 (file)
index eae7e69..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_grey.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_magenta.png b/technic_chests/textures/x32/technic_gold_chest_front_magenta.png
deleted file mode 100644 (file)
index 6daed3b..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_magenta.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_orange.png b/technic_chests/textures/x32/technic_gold_chest_front_orange.png
deleted file mode 100644 (file)
index 085c102..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_orange.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_pink.png b/technic_chests/textures/x32/technic_gold_chest_front_pink.png
deleted file mode 100644 (file)
index eada4da..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_pink.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_red.png b/technic_chests/textures/x32/technic_gold_chest_front_red.png
deleted file mode 100644 (file)
index b67da7b..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_red.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_violet.png b/technic_chests/textures/x32/technic_gold_chest_front_violet.png
deleted file mode 100644 (file)
index b62011c..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_violet.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_white.png b/technic_chests/textures/x32/technic_gold_chest_front_white.png
deleted file mode 100644 (file)
index 76b5ebf..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_white.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_front_yellow.png b/technic_chests/textures/x32/technic_gold_chest_front_yellow.png
deleted file mode 100644 (file)
index b0ab9f4..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_front_yellow.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked.png b/technic_chests/textures/x32/technic_gold_chest_locked.png
deleted file mode 100644 (file)
index 91a8b73..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_black.png b/technic_chests/textures/x32/technic_gold_chest_locked_black.png
deleted file mode 100644 (file)
index 5a5a568..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_black.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_blue.png b/technic_chests/textures/x32/technic_gold_chest_locked_blue.png
deleted file mode 100644 (file)
index f369ebd..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_blue.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_brown.png b/technic_chests/textures/x32/technic_gold_chest_locked_brown.png
deleted file mode 100644 (file)
index a44a273..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_brown.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_cyan.png b/technic_chests/textures/x32/technic_gold_chest_locked_cyan.png
deleted file mode 100644 (file)
index f3ce7b6..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_cyan.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_dark_green.png b/technic_chests/textures/x32/technic_gold_chest_locked_dark_green.png
deleted file mode 100644 (file)
index 084dae5..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_dark_green.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_dark_grey.png b/technic_chests/textures/x32/technic_gold_chest_locked_dark_grey.png
deleted file mode 100644 (file)
index 629e33c..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_dark_grey.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_green.png b/technic_chests/textures/x32/technic_gold_chest_locked_green.png
deleted file mode 100644 (file)
index 9ea1818..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_green.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_grey.png b/technic_chests/textures/x32/technic_gold_chest_locked_grey.png
deleted file mode 100644 (file)
index c936d7c..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_grey.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_magenta.png b/technic_chests/textures/x32/technic_gold_chest_locked_magenta.png
deleted file mode 100644 (file)
index 4c97fa8..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_magenta.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_orange.png b/technic_chests/textures/x32/technic_gold_chest_locked_orange.png
deleted file mode 100644 (file)
index f6d5e90..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_orange.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_pink.png b/technic_chests/textures/x32/technic_gold_chest_locked_pink.png
deleted file mode 100644 (file)
index 4248c21..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_pink.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_red.png b/technic_chests/textures/x32/technic_gold_chest_locked_red.png
deleted file mode 100644 (file)
index 4bfe5d4..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_red.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_violet.png b/technic_chests/textures/x32/technic_gold_chest_locked_violet.png
deleted file mode 100644 (file)
index c9abe73..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_violet.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_white.png b/technic_chests/textures/x32/technic_gold_chest_locked_white.png
deleted file mode 100644 (file)
index 810abb9..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_white.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_gold_chest_locked_yellow.png b/technic_chests/textures/x32/technic_gold_chest_locked_yellow.png
deleted file mode 100644 (file)
index 2856165..0000000
Binary files a/technic_chests/textures/x32/technic_gold_chest_locked_yellow.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_iron_chest_locked.png b/technic_chests/textures/x32/technic_iron_chest_locked.png
deleted file mode 100644 (file)
index 6229487..0000000
Binary files a/technic_chests/textures/x32/technic_iron_chest_locked.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_mithril_chest_locked.png b/technic_chests/textures/x32/technic_mithril_chest_locked.png
deleted file mode 100644 (file)
index abff384..0000000
Binary files a/technic_chests/textures/x32/technic_mithril_chest_locked.png and /dev/null differ
diff --git a/technic_chests/textures/x32/technic_silver_chest_locked.png b/technic_chests/textures/x32/technic_silver_chest_locked.png
deleted file mode 100644 (file)
index 0f8b1f0..0000000
Binary files a/technic_chests/textures/x32/technic_silver_chest_locked.png and /dev/null differ