Merge changes made in technic_game
authorRealBadAngel <mk@realbadangel.pl>
Sat, 6 Jul 2013 08:35:48 +0000 (10:35 +0200)
committerRealBadAngel <mk@realbadangel.pl>
Sat, 6 Jul 2013 08:35:48 +0000 (10:35 +0200)
54 files changed:
item_drop/depends.txt [new file with mode: 0644]
item_drop/init.lua
item_drop/item_entity.lua
item_drop/item_entity_old.lua [new file with mode: 0644]
item_drop/sounds/item_drop_pickup.1.ogg
item_drop/sounds/item_drop_pickup.2.ogg
item_drop/sounds/item_drop_pickup.3.ogg
item_drop/sounds/item_drop_pickup.4.ogg
technic/alloy_furnace.lua
technic/battery_box.lua
technic/chainsaw.lua
technic/electric.lua
technic/electric_furnace.lua
technic/generator.lua
technic/grinder.lua
technic/mining_drill.lua
technic/mining_laser_mk1.lua
technic/music_player.lua
technic/tool_workshop.lua
technic/water_mill.lua
technic_chests/copper_chest.lua
technic_chests/gold_chest.lua
technic_chests/iron_chest.lua
technic_chests/mithril_chest.lua
technic_chests/silver_chest.lua
technic_worldgen/crafts.lua
unified_inventory/textures/ui_colorbutton0.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton1.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton10.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton11.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton12.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton13.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton14.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton15.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton2.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton3.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton4.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton5.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton6.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton7.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton8.png [new file with mode: 0644]
unified_inventory/textures/ui_colorbutton9.png [new file with mode: 0644]
unified_inventory/textures/ui_copper_chest_inventory.png [new file with mode: 0644]
unified_inventory/textures/ui_furnace_inventory.png
unified_inventory/textures/ui_gold_chest_inventory.png [new file with mode: 0644]
unified_inventory/textures/ui_iron_chest_inventory.png [new file with mode: 0644]
unified_inventory/textures/ui_lv_alloy_furnace.png [new file with mode: 0644]
unified_inventory/textures/ui_lv_battery_box.png [new file with mode: 0644]
unified_inventory/textures/ui_lv_electric_furnace.png [new file with mode: 0644]
unified_inventory/textures/ui_lv_grinder.png [new file with mode: 0644]
unified_inventory/textures/ui_main_inventory.png
unified_inventory/textures/ui_mithril_chest_inventory.png [new file with mode: 0644]
unified_inventory/textures/ui_silver_chest_inventory.png [new file with mode: 0644]
unified_inventory/textures/ui_wooden_chest_inventory.png

diff --git a/item_drop/depends.txt b/item_drop/depends.txt
new file mode 100644 (file)
index 0000000..b88d3ff
--- /dev/null
@@ -0,0 +1 @@
+technic
index 8cd3b14e0870229d2e38cdb92f19c1f52342d55a..54b617f79cb9fbf24654e9fe6df13850ee2d7121 100644 (file)
 dofile(minetest.get_modpath("item_drop").."/item_entity.lua")
 time_pick = 3
-minetest.register_globalstep(function(dtime)
-       for _,player in ipairs(minetest.get_connected_players()) do
-               local pos = player:getpos()
-               pos.y = pos.y+0.5
-               local inv = player:get_inventory()
-               for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 1)) do
-                       if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
-                               if inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
-                                       if object:get_luaentity().timer > time_pick then
-                                               inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
-                                               if object:get_luaentity().itemstring ~= "" then
-                                                       minetest.sound_play("item_drop_pickup", {
-                                                               to_player = player:get_player_name(),
-                                                       })
-                                               end
-                                               object:get_luaentity().itemstring = ""
-                                               object:remove()
-                                       end
-                               end
-                       end
-               end
-               
-               for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 3)) do
-                       if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
-                               --print(dump(object:getpos().y-player:getpos().y))
-                               if object:getpos().y-player:getpos().y > 0 then
-                                       if object:get_luaentity().collect then
-                                               if inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
-                                                       if object:get_luaentity().timer > time_pick then
-                                                               local pos1 = pos
-                                                               pos1.y = pos1.y+0.2
-                                                               local pos2 = object:getpos()
-                                                               local vec = {x=pos1.x-pos2.x, y=pos1.y-pos2.y, z=pos1.z-pos2.z}
-                                                               vec.x = vec.x*3
-                                                               vec.y = vec.y*3
-                                                               vec.z = vec.z*3
-                                                               object:setvelocity(vec)
-                                                               
-                                                               minetest.after(1, function(args)
-                                                                       local lua = object:get_luaentity()
-                                                                       if object == nil or lua == nil or lua.itemstring == nil then
-                                                                               return
-                                                                       end
-                                                                       if inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
-                                                                               inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
-                                                                               if object:get_luaentity().itemstring ~= "" then
-                                                                                       minetest.sound_play("item_drop_pickup", {
-                                                                                               to_player = player:get_player_name(),
-                                                                                       })
-                                                                               end
-                                                                               object:get_luaentity().itemstring = ""
-                                                                               object:remove()
-                                                                       else
-                                                                               object:setvelocity({x=0,y=0,z=0})
-                                                                       end
-                                                               end, {player, object})
+
+if technic.config:getBool("enable_item_pickup") then
+       minetest.register_globalstep(function(dtime)
+               for _,player in ipairs(minetest.get_connected_players()) do
+                       if player and player:get_hp() > 0 then
+                       local pos = player:getpos()
+                       pos.y = pos.y+0.5
+                       local inv = player:get_inventory()
+                       for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 2)) do
+                               if not object:is_player() and object:get_luaentity() then
+                                       local obj=object:get_luaentity()
+                                       if obj.name == "__builtin:item" then
+                                               if inv:room_for_item("main", ItemStack(obj.itemstring)) then
+                                                       if obj.timer > time_pick then
+                                                               inv:add_item("main", ItemStack(obj.itemstring))
+                                                               if obj.itemstring ~= "" then
+                                                                       minetest.sound_play("item_drop_pickup",{pos = pos, gain = 1.0, max_hear_distance = 10}) 
+                                                               end
+                                                               if object:get_luaentity() then
+                                                                       object:get_luaentity().itemstring = ""
+                                                                       object:remove()
+                                                               end
                                                        end
-                                                       
                                                end
-                                       else
-                                               minetest.after(0.5, function(entity)
-                                                       entity.collect = true
-                                               end, object:get_luaentity())
                                        end
                                end
                        end
+                       end
                end
-       end
-end)
+       end)
+end
 
-function minetest.handle_node_drops(pos, drops, digger)
-       for _,item in ipairs(drops) do
-               local count, name
-               if type(item) == "string" then
-                       count = 1
-                       name = item
-               else
-                       count = item:get_count()
-                       name = item:get_name()
-               end
-               for i=1,count do
-                       local obj = minetest.env:add_item(pos, name)
-                       if obj ~= nil then
-                               obj:get_luaentity().collect = true
-                               local x = math.random(1, 5)
-                               if math.random(1,2) == 1 then
-                                       x = -x
-                               end
-                               local z = math.random(1, 5)
-                               if math.random(1,2) == 1 then
-                                       z = -z
-                               end
-                               obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z})
-                               obj:get_luaentity().timer = time_pick
-                               -- FIXME this doesnt work for deactiveted objects
-                               if minetest.setting_get("remove_items") and tonumber(minetest.setting_get("remove_items")) then
-                                       minetest.after(tonumber(minetest.setting_get("remove_items")), function(obj)
-                                               obj:remove()
-                                       end, obj)
+if technic.config:getBool("enable_item_drop") then
+       function minetest.handle_node_drops(pos, drops, digger)
+               for _,item in ipairs(drops) do
+                       local count, name
+                       if type(item) == "string" then
+                               count = 1
+                               name = item
+                       else
+                               count = item:get_count()
+                               name = item:get_name()
+                       end
+                       for i=1,count do
+                               local obj = minetest.env:add_item(pos, name)
+                               if obj ~= nil then
+                                       obj:get_luaentity().collect = true
+                                       local x = math.random(1, 5)
+                                       if math.random(1,2) == 1 then
+                                               x = -x
+                                       end
+                                       local z = math.random(1, 5)
+                                       if math.random(1,2) == 1 then
+                                               z = -z
+                                       end
+                                       obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z})
+                                       obj:get_luaentity().timer = time_pick
+                                       -- FIXME this doesnt work for deactiveted objects
+                                       if minetest.setting_get("remove_items") and tonumber(minetest.setting_get("remove_items")) then
+                                               minetest.after(tonumber(minetest.setting_get("remove_items")), function(obj)
+                                                       obj:remove()
+                                               end, obj)
+                                       end
                                end
                        end
                end
        end
 end
+
 --[[
 minetest.register_on_dieplayer(function(name, pos)
        local inv = name:get_inventory()
@@ -137,4 +102,4 @@ minetest.register_on_dieplayer(function(name, pos)
        end
 end)
 ]]--
-print("DROPS LOADED!")
\ No newline at end of file
+print("DROPS LOADED!")
index 6e479a13a6ec823b6378da3c711f9f25ec619253..5da82852beb36c9eab36dca323154b4cdd4494e3 100644 (file)
@@ -24,7 +24,7 @@ minetest.register_entity(":__builtin:item", {
        itemstring = '',
        physical_state = true,
        timer = 0,
-       
+
        set_item = function(self, itemstring)
                self.itemstring = itemstring
                local stack = ItemStack(itemstring)
@@ -62,15 +62,21 @@ minetest.register_entity(":__builtin:item", {
                return minetest.serialize({
                        itemstring = self.itemstring,
                        always_collect = self.always_collect,
+                       timer = self.timer,
                })
        end,
 
-       on_activate = function(self, staticdata)
+       on_activate = function(self, staticdata, dtime_s)
                if string.sub(staticdata, 1, string.len("return")) == "return" then
                        local data = minetest.deserialize(staticdata)
                        if data and type(data) == "table" then
                                self.itemstring = data.itemstring
                                self.always_collect = data.always_collect
+                               self.timer = data.timer
+                               if not self.timer then
+                                       self.timer = 0
+                               end
+                               self.timer = self.timer+dtime_s
                        end
                else
                        self.itemstring = staticdata
@@ -80,18 +86,79 @@ minetest.register_entity(":__builtin:item", {
                self.object:setacceleration({x=0, y=-10, z=0})
                self:set_item(self.itemstring)
        end,
-
+       
        on_step = function(self, dtime)
+               local time = minetest.setting_get("remove_items")
+               if not time then
+                       time = 300
+               end
+               if not self.timer then
+                       self.timer = 0
+               end
                self.timer = self.timer + dtime
-               if (self.timer > 300) then
+               if time ~= 0 and (self.timer > time) then
                        self.object:remove()
                end
+               
                local p = self.object:getpos()
+               
+               local name = minetest.env:get_node(p).name
+               if name == "default:lava_flowing" or name == "default:lava_source" then
+                       minetest.sound_play("builtin_item_lava", {pos=self.object:getpos(),gain = 1.0, max_hear_distance = 10})
+                       self.object:remove()
+                       return
+               end
+               
+               if minetest.registered_nodes[name] and minetest.registered_nodes[name].liquidtype == "flowing" then
+                       get_flowing_dir = function(self)
+                               local pos = self.object:getpos()
+                               local param2 = minetest.env:get_node(pos).param2
+                               for i,d in ipairs({-1, 1, -1, 1}) do
+                                       if i<3 then
+                                               pos.x = pos.x+d
+                                       else
+                                               pos.z = pos.z+d
+                                       end
+                                       
+                                       local name = minetest.env:get_node(pos).name
+                                       local par2 = minetest.env:get_node(pos).param2
+                                       if name == "default:water_flowing" and par2 < param2 then
+                                               return pos
+                                       end
+                                       
+                                       if i<3 then
+                                               pos.x = pos.x-d
+                                       else
+                                               pos.z = pos.z-d
+                                       end
+                               end
+                       end
+                       
+                       local vec = get_flowing_dir(self)
+                       if vec then
+                               local v = self.object:getvelocity()
+                               if vec and vec.x-p.x > 0 then
+                                       self.object:setvelocity({x=0.5,y=v.y,z=0})
+                               elseif vec and vec.x-p.x < 0 then
+                                       self.object:setvelocity({x=-0.5,y=v.y,z=0})
+                               elseif vec and vec.z-p.z > 0 then
+                                       self.object:setvelocity({x=0,y=v.y,z=0.5})
+                               elseif vec and vec.z-p.z < 0 then
+                                       self.object:setvelocity({x=0,y=v.y,z=-0.5})
+                               end
+                               self.object:setacceleration({x=0, y=-10, z=0})
+                               self.physical_state = true
+                               self.object:set_properties({
+                                       physical = true
+                               })
+                               return
+                       end
+               end
+               
                p.y = p.y - 0.3
                local nn = minetest.env:get_node(p).name
-               -- If node is not registered or node is walkably solid and resting on nodebox
-               local v = self.object:getvelocity()
-               if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable and v.y == 0 then
+               -- If node is not registered or node is walkably solid
+               if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable then
                        if self.physical_state then
                                self.object:setvelocity({x=0,y=0,z=0})
                                self.object:setacceleration({x=0, y=0, z=0})
@@ -114,13 +181,12 @@ minetest.register_entity(":__builtin:item", {
 
        on_punch = function(self, hitter)
                if self.itemstring ~= '' then
-                       local left = hitter:get_inventory():add_item("main", self.itemstring)
-                       if not left:is_empty() then
-                               self.itemstring = left:to_string()
-                               return
-                       end
+                       hitter:get_inventory():add_item("main", self.itemstring)
                end
                self.object:remove()
        end,
 })
-print("ITEM ENTITY LOADED")
+
+if minetest.setting_get("log_mods") then
+       minetest.log("action", "builtin_item loaded")
+end
diff --git a/item_drop/item_entity_old.lua b/item_drop/item_entity_old.lua
new file mode 100644 (file)
index 0000000..6e479a1
--- /dev/null
@@ -0,0 +1,126 @@
+-- Minetest: builtin/item_entity.lua
+
+function minetest.spawn_item(pos, item)
+       -- Take item in any format
+       local stack = ItemStack(item)
+       local obj = minetest.env:add_entity(pos, "__builtin:item")
+       obj:get_luaentity():set_item(stack:to_string())
+       return obj
+end
+
+minetest.register_entity(":__builtin:item", {
+       initial_properties = {
+               hp_max = 1,
+               physical = true,
+               collisionbox = {-0.17,-0.17,-0.17, 0.17,0.17,0.17},
+               visual = "sprite",
+               visual_size = {x=0.5, y=0.5},
+               textures = {""},
+               spritediv = {x=1, y=1},
+               initial_sprite_basepos = {x=0, y=0},
+               is_visible = false,
+       },
+       
+       itemstring = '',
+       physical_state = true,
+       timer = 0,
+       
+       set_item = function(self, itemstring)
+               self.itemstring = itemstring
+               local stack = ItemStack(itemstring)
+               local itemtable = stack:to_table()
+               local itemname = nil
+               if itemtable then
+                       itemname = stack:to_table().name
+               end
+               local item_texture = nil
+               local item_type = ""
+               if minetest.registered_items[itemname] then
+                       item_texture = minetest.registered_items[itemname].inventory_image
+                       item_type = minetest.registered_items[itemname].type
+               end
+               prop = {
+                       is_visible = true,
+                       visual = "sprite",
+                       textures = {"unknown_item.png"}
+               }
+               if item_texture and item_texture ~= "" then
+                       prop.visual = "sprite"
+                       prop.textures = {item_texture}
+                       prop.visual_size = {x=0.50, y=0.50}
+               else
+                       prop.visual = "wielditem"
+                       prop.textures = {itemname}
+                       prop.visual_size = {x=0.20, y=0.20}
+                       prop.automatic_rotate = math.pi * 0.25
+               end
+               self.object:set_properties(prop)
+       end,
+
+       get_staticdata = function(self)
+               --return self.itemstring
+               return minetest.serialize({
+                       itemstring = self.itemstring,
+                       always_collect = self.always_collect,
+               })
+       end,
+
+       on_activate = function(self, staticdata)
+               if string.sub(staticdata, 1, string.len("return")) == "return" then
+                       local data = minetest.deserialize(staticdata)
+                       if data and type(data) == "table" then
+                               self.itemstring = data.itemstring
+                               self.always_collect = data.always_collect
+                       end
+               else
+                       self.itemstring = staticdata
+               end
+               self.object:set_armor_groups({immortal=1})
+               self.object:setvelocity({x=0, y=2, z=0})
+               self.object:setacceleration({x=0, y=-10, z=0})
+               self:set_item(self.itemstring)
+       end,
+
+       on_step = function(self, dtime)
+               self.timer = self.timer + dtime
+               if (self.timer > 300) then
+                       self.object:remove()
+               end
+               local p = self.object:getpos()
+               p.y = p.y - 0.3
+               local nn = minetest.env:get_node(p).name
+               -- If node is not registered or node is walkably solid and resting on nodebox
+               local v = self.object:getvelocity()
+               if not minetest.registered_nodes[nn] or minetest.registered_nodes[nn].walkable and v.y == 0 then
+                       if self.physical_state then
+                               self.object:setvelocity({x=0,y=0,z=0})
+                               self.object:setacceleration({x=0, y=0, z=0})
+                               self.physical_state = false
+                               self.object:set_properties({
+                                       physical = false
+                               })
+                       end
+               else
+                       if not self.physical_state then
+                               self.object:setvelocity({x=0,y=0,z=0})
+                               self.object:setacceleration({x=0, y=-10, z=0})
+                               self.physical_state = true
+                               self.object:set_properties({
+                                       physical = true
+                               })
+                       end
+               end
+       end,
+
+       on_punch = function(self, hitter)
+               if self.itemstring ~= '' then
+                       local left = hitter:get_inventory():add_item("main", self.itemstring)
+                       if not left:is_empty() then
+                               self.itemstring = left:to_string()
+                               return
+                       end
+               end
+               self.object:remove()
+       end,
+})
+print("ITEM ENTITY LOADED")
index 2ae432d59f31f18dd4f703ed84d9915bf65f9e28..f5ea6b9ed51a61a5d369e670599f50f0087aa9fa 100644 (file)
Binary files a/item_drop/sounds/item_drop_pickup.1.ogg and b/item_drop/sounds/item_drop_pickup.1.ogg differ
index f58bf08e00f206d3e433b28ddf2297d1ada1a853..0ed4869c6dd1cb1329924d9782de08769ac82054 100644 (file)
Binary files a/item_drop/sounds/item_drop_pickup.2.ogg and b/item_drop/sounds/item_drop_pickup.2.ogg differ
index cf57c94c7383d90e5e282e9b36a6c69f59688075..3e2d1e0b1f88257bd2c8e11db00524d7d17fd547 100644 (file)
Binary files a/item_drop/sounds/item_drop_pickup.3.ogg and b/item_drop/sounds/item_drop_pickup.3.ogg differ
index bfe99d9a37181071db8a5fa22214535ef850c31b..13430e2046c4f79fb27277fddd7bb22ada811c4c 100644 (file)
Binary files a/item_drop/sounds/item_drop_pickup.4.ogg and b/item_drop/sounds/item_drop_pickup.4.ogg differ
index 3982ab252cca7b6a87a2c980ff7d01f3a1b087ac..947963ea56859969e71b7ec0ef2220775d2108db 100644 (file)
@@ -10,8 +10,8 @@ minetest.register_craft({
 minetest.register_craft({
        output = 'technic:alloy_furnace',
        recipe = {
-               {'default:brick',       'default:brick',        'default:brick'},
-               {'default:brick',       '',                     'default:brick'},
+               {'default:brick', 'default:brick', 'default:brick'},
+               {'default:brick', '', 'default:brick'},
                {'default:steel_ingot', 'default:copper_ingot', 'default:steel_ingot'},
        }
 })
@@ -25,11 +25,14 @@ alloy_furnace_formspec =
        "list[current_name;src2;3,2;1,1;]"..
        "list[current_name;dst;5,1;2,2;]"..
        "list[current_player;main;0,5;8,4;]"..
-       "label[0,0;Electric Alloy Furnace]"..
-       "label[1,3;Power level]"
+       "label[0,0;LV Electric Alloy Furnace]"..
+       "label[1,3;Power level]"..
+       "background[-0.19,-0.25;8.4,9.75;ui_form_bg.png]"..
+       "background[0,0;8,4;ui_lv_alloy_furnace.png]"..
+       "background[0,5;8,4;ui_main_inventory.png]"
        
 minetest.register_node("technic:alloy_furnace", {
-       description = "Electric alloy furnace",
+       description = "LV Electric alloy furnace",
        tiles = {"technic_alloy_furnace_top.png", "technic_machine_bottom.png", "technic_alloy_furnace_side.png",
                "technic_alloy_furnace_side.png", "technic_alloy_furnace_side.png", "technic_alloy_furnace_front.png"},
        paramtype2 = "facedir",
@@ -106,15 +109,9 @@ minetest.register_abm({
                internal_EU_buffer_size=meta:get_float("internal_EU_buffer")
                local load = math.floor(internal_EU_buffer/2000 * 100)
                meta:set_string("formspec",
-                               "invsize[8,9;]"..
+                               alloy_furnace_formspec..
                                "image[1,1;1,2;technic_power_meter_bg.png^[lowpart:"..
-                                               (load)..":technic_power_meter_fg.png]"..
-                               "list[current_name;src;3,1;1,1;]"..
-                               "list[current_name;src2;3,2;1,1;]"..
-                               "list[current_name;dst;5,1;2,2;]"..
-                               "list[current_player;main;0,5;8,4;]"..
-                               "label[0,0;Electric Alloy Furnace]"..
-                               "label[1,3;Power level]")
+                                               (load)..":technic_power_meter_fg.png]")
 
                local inv = meta:get_inventory()
 
index 0e5c072c3066d74ff412c9b24f4dc766be3f8e0e..4921c472838d575740f74e6a600de58eda2d4146 100644 (file)
@@ -23,7 +23,7 @@ minetest.register_craft({
                           output = 'technic:battery 1',
                           recipe = {
                              {'default:wood', 'default:copper_ingot', 'default:wood'},
-                             {'default:wood', 'moreores:tin_ingot',   'default:wood'},
+                             {'default:wood', 'moreores:tin_ingot', 'default:wood'},
                              {'default:wood', 'default:copper_ingot', 'default:wood'},
                           }
                        })
@@ -51,16 +51,18 @@ minetest.register_craftitem("technic:battery_box", {
 
 
 battery_box_formspec =
-   "invsize[8,9;]"..
-   "image[1,1;1,2;technic_power_meter_bg.png]"..
-   "list[current_name;src;3,1;1,1;]"..
-   "image[4,1;1,1;technic_battery_reload.png]"..
-   "list[current_name;dst;5,1;1,1;]"..
-   "label[0,0;Battery box]"..
-   "label[3,0;Charge]"..
-   "label[5,0;Discharge]"..
-   "label[1,3;Power level]"..
-   "list[current_player;main;0,5;8,4;]"
+       "invsize[8,9;]"..
+       "image[1,1;1,2;technic_power_meter_bg.png]"..
+       "list[current_name;src;3,1;1,1;]"..
+       "list[current_name;dst;5,1;1,1;]"..
+       "label[0,0;LV Battery Box]"..
+       "label[3,0;Charge]"..
+       "label[5,0;Discharge]"..
+       "label[1,3;Power level]"..
+       "list[current_player;main;0,5;8,4;]"..
+       "background[-0.19,-0.25;8.4,9.75;ui_form_bg.png]"..
+       "background[0,0;8,4;ui_lv_battery_box.png]"..
+       "background[0,5;8,4;ui_main_inventory.png]"
 
 minetest.register_node(
    "technic:battery_box", {
index d73b59baab36cfae1ec15d96baa3dbfcf7fdeab1..5c10d7ce03de4357fdc35dec1b843452c38c947b 100644 (file)
@@ -33,8 +33,8 @@ minetest.register_craft({
         output = 'technic:chainsaw',
         recipe = {
                 {'technic:stainless_steel_ingot', 'technic:stainless_steel_ingot', 'technic:battery'},
-                {'technic:stainless_steel_ingot', 'technic:motor',                 'technic:battery'},
-                {'',                              '',                              'default:copper_ingot'},
+                {'technic:stainless_steel_ingot', 'technic:motor', 'technic:battery'},
+                {'','','default:copper_ingot'},
         }
 })
 
index b6406af5cf806c035c51c1b0297636fe677abea7..fc519de234d9356c2b164c9d4559d937ee6ea749 100644 (file)
@@ -22,7 +22,7 @@ minetest.register_craft({
        output = 'technic:battery 1',
        recipe = {
                {'default:wood', 'default:copper_ingot', 'default:wood'},
-               {'default:wood', 'moreores:tin_ingot',   'default:wood'},
+               {'default:wood', 'moreores:tin_ingot', 'default:wood'},
                {'default:wood', 'default:copper_ingot', 'default:wood'},
        }
 }) 
@@ -30,17 +30,17 @@ minetest.register_craft({
 minetest.register_craft({
        output = 'technic:battery_box 1',
        recipe = {
-               {'technic:battery',     'default:wood',         'technic:battery'},
-               {'technic:battery',     'default:copper_ingot', 'technic:battery'},
-               {'default:steel_ingot', 'default:steel_ingot',  'default:steel_ingot'},
+               {'technic:battery', 'default:wood', 'technic:battery'},
+               {'technic:battery', 'default:copper_ingot', 'technic:battery'},
+               {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
        }
 }) 
 
 minetest.register_craft({
        output = 'technic:electric_furnace',
        recipe = {
-               {'default:brick',       'default:brick',        'default:brick'},
-               {'default:brick',       '',                     'default:brick'},
+               {'default:brick', 'default:brick', 'default:brick'},
+               {'default:brick', '', 'default:brick'},
                {'default:steel_ingot', 'default:copper_ingot', 'default:steel_ingot'},
        }
 })
index e9d3236236da943abc02170862886bd8ed4d479d..df35fbe559ad704c5da456d76a43fac48d495427 100644 (file)
@@ -14,11 +14,14 @@ electric_furnace_formspec =
        "list[current_name;src;3,1;1,1;]"..
        "list[current_name;dst;5,1;2,2;]"..
        "list[current_player;main;0,5;8,4;]"..
-       "label[0,0;Electric Furnace]"..
-       "label[1,3;Power level]"
+       "label[0,0;LV Electric Furnace]"..
+       "label[1,3;Power level]"..
+       "background[-0.19,-0.25;8.4,9.75;ui_form_bg.png]"..
+       "background[0,0;8,4;ui_lv_electric_furnace.png]"..
+       "background[0,5;8,4;ui_main_inventory.png]"
        
 minetest.register_node("technic:electric_furnace", {
-       description = "Electric furnace",
+       description = "LV Electric Furnace",
        tiles = {"technic_electric_furnace_top.png", "technic_electric_furnace_bottom.png", "technic_electric_furnace_side.png",
                "technic_electric_furnace_side.png", "technic_electric_furnace_side.png", "technic_electric_furnace_front.png"},
        paramtype2 = "facedir",
@@ -32,7 +35,7 @@ minetest.register_node("technic:electric_furnace", {
                local meta = minetest.env:get_meta(pos)
                meta:set_float("technic_power_machine", 1)
                meta:set_string("formspec", electric_furnace_formspec)
-               meta:set_string("infotext", "Electric furnace")
+               meta:set_string("infotext", "Electric Furnace")
                local inv = meta:get_inventory()
                inv:set_size("src", 1)
                inv:set_size("dst", 4)
@@ -56,7 +59,7 @@ minetest.register_node("technic:electric_furnace", {
 })
 
 minetest.register_node("technic:electric_furnace_active", {
-       description = "Electric Furnace",
+       description = "LV Electric Furnace",
        tiles = {"technic_electric_furnace_top.png", "technic_electric_furnace_bottom.png", "technic_electric_furnace_side.png",
                "technic_electric_furnace_side.png", "technic_electric_furnace_side.png", "technic_electric_furnace_front_active.png"},
        paramtype2 = "facedir",
@@ -72,7 +75,7 @@ minetest.register_node("technic:electric_furnace_active", {
                local meta = minetest.env:get_meta(pos)
                meta:set_float("technic_power_machine", 1)
                meta:set_string("formspec", electric_furnace_formspec)
-               meta:set_string("infotext", "Electric furnace");
+               meta:set_string("infotext", "LV Electric Furnace");
                local inv = meta:get_inventory()
                inv:set_size("src", 1)
                inv:set_size("dst", 4)
@@ -104,14 +107,9 @@ minetest.register_abm({
                internal_EU_buffer_size=meta:get_float("internal_EU_buffer_size")
                local load = math.floor(internal_EU_buffer/internal_EU_buffer_size * 100)
                meta:set_string("formspec",
-                               "invsize[8,9;]"..
+                               electric_furnace_formspec..
                                "image[1,1;1,2;technic_power_meter_bg.png^[lowpart:"..
-                                       (load)..":technic_power_meter_fg.png]"..
-                               "list[current_name;src;3,1;1,1;]"..
-                               "list[current_name;dst;5,1;2,2;]"..
-                               "list[current_player;main;0,5;8,4;]"..
-                               "label[0,0;Electric Furnace]"..
-                               "label[1,3;Power level]")
+                                       (load)..":technic_power_meter_fg.png]")
 
                local inv = meta:get_inventory()
                
index d8f4d066dd4d57ac935fb656744aa5c8414c4822..4bd1687d08bb56152f0a618f4a1b865d4b665bae 100644 (file)
@@ -4,8 +4,8 @@ minetest.register_alias("generator", "technic:generator_active")
 minetest.register_craft({
        output = 'technic:generator',
        recipe = {
-               {'default:stone', 'default:stone',        'default:stone'},
-               {'default:stone', '',                     'default:stone'},
+               {'default:stone', 'default:stone', 'default:stone'},
+               {'default:stone', '', 'default:stone'},
                {'default:stone', 'default:copper_ingot', 'default:stone'},
        }
 })
index 88a50012c13fc80829baefd9f93ca54f8afd56dd..ff37aa0ca3184aca8308330fc11a6a01fccf4e1d 100644 (file)
@@ -29,7 +29,6 @@ register_grinder_recipe("default:copper_ingot","technic:copper_dust 1")
 register_grinder_recipe("default:gold_lump","technic:gold_dust 2")
 register_grinder_recipe("default:gold_ingot","technic:gold_dust 1")
 --register_grinder_recipe("default:bronze_ingot","technic:bronze_dust 1")  -- Dust does not exist yet
---register_grinder_recipe("home_decor:brass_ingot","technic:brass_dust 1") -- needs check for the mod
 register_grinder_recipe("moreores:tin_lump","technic:tin_dust 2")
 register_grinder_recipe("moreores:tin_ingot","technic:tin_dust 1")
 register_grinder_recipe("moreores:silver_lump","technic:silver_dust 2")
@@ -40,7 +39,7 @@ register_grinder_recipe("technic:chromium_lump","technic:chromium_dust 2")
 register_grinder_recipe("technic:chromium_ingot","technic:chromium_dust 1")
 register_grinder_recipe("technic:stainless_steel_ingot","stainless_steel_dust 1")
 register_grinder_recipe("technic:brass_ingot","technic:brass_dust 1")
-register_grinder_recipe("homedecor:brass_ingot","technic:brass_dust 1")
+register_grinder_recipe("homedecor:brass_ingot","technic:brass_dust 1") 
 register_grinder_recipe("technic:zinc_lump","technic:zinc_dust 2")
 register_grinder_recipe("technic:zinc_ingot","technic:zinc_dust 1")
 register_grinder_recipe("technic:coal_dust","dye:black 2")
@@ -186,8 +185,8 @@ minetest.register_craft({
        output = 'technic:grinder',
        recipe = {
                {'default:desert_stone', 'default:desert_stone', 'default:desert_stone'},
-               {'default:desert_stone', 'default:diamond',      'default:desert_stone'},
-               {'default:stone',        'default:copper_ingot', 'default:stone'},
+               {'default:desert_stone', 'default:diamond', 'default:desert_stone'},
+               {'default:stone', 'default:copper_ingot', 'default:stone'},
        }
 })
 
@@ -199,15 +198,18 @@ minetest.register_craftitem("technic:grinder", {
 grinder_formspec =
        "invsize[8,9;]"..
        "image[1,1;1,2;technic_power_meter_bg.png]"..
-       "label[0,0;Grinder]"..
+       "label[0,0;LV Grinder]"..
        "label[1,3;Power level]"..
        "list[current_name;src;3,1;1,1;]"..
        "list[current_name;dst;5,1;2,2;]"..
-       "list[current_player;main;0,5;8,4;]"
+       "list[current_player;main;0,5;8,4;]"..
+       "background[-0.19,-0.25;8.4,9.75;ui_form_bg.png]"..
+       "background[0,0;8,4;ui_lv_grinder.png]"..
+       "background[0,5;8,4;ui_main_inventory.png]"
 
 
 minetest.register_node("technic:grinder", {
-       description = "Grinder",
+       description = "LV Grinder",
        tiles = {"technic_lv_grinder_top.png", "technic_lv_grinder_bottom.png", "technic_lv_grinder_side.png",
                "technic_lv_grinder_side.png", "technic_lv_grinder_side.png", "technic_lv_grinder_front.png"},
        paramtype2 = "facedir",
@@ -279,15 +281,9 @@ minetest.register_abm({
 
        local load = math.floor((charge/max_charge)*100)
        meta:set_string("formspec",
-                               "invsize[8,9;]"..
+                               grinder_formspec..
                                "image[1,1;1,2;technic_power_meter_bg.png^[lowpart:"..
-                                               (load)..":technic_power_meter_fg.png]"..
-                               "label[0,0;Grinder]"..
-                               "label[1,3;Power level]"..
-                               "list[current_name;src;3,1;1,1;]"..
-                               "list[current_name;dst;5,1;2,2;]"..
-                               "list[current_player;main;0,5;8,4;]"
-                               )
+                                               (load)..":technic_power_meter_fg.png]")
 
                local inv = meta:get_inventory()
                local srclist = inv:get_list("src")
index 0dfcf10e238494de83556ba8d3d0c3fa3b67be58..498889b364abf5dbc458719abaf16cfbe2ce7ca3 100644 (file)
@@ -8,25 +8,25 @@ mining_drill_mk3_power_usage=1800
 minetest.register_craft({
        output = 'technic:mining_drill',
        recipe = {
-               {'technic:stainless_steel_ingot', 'technic:diamond_drill_head', 'technic:stainless_steel_ingot'},
-               {'technic:stainless_steel_ingot', 'technic:motor',              'technic:stainless_steel_ingot'},
-               {'',                              'technic:red_energy_crystal', 'default:copper_ingot'},
+               {'technic:stainless_steel_ingot',       'technic:diamond_drill_head',   'technic:stainless_steel_ingot'},
+               {'technic:stainless_steel_ingot',       'technic:motor',                                'technic:stainless_steel_ingot'},
+               {'',                                                            'technic:red_energy_crystal',   'moreores:copper_ingot'},
        }
 })
 minetest.register_craft({
        output = 'technic:mining_drill_mk2',
        recipe = {
-               {'technic:diamond_drill_head',    'technic:diamond_drill_head',   'technic:diamond_drill_head'},
-               {'technic:stainless_steel_ingot', 'technic:mining_drill',         'technic:stainless_steel_ingot'},
-               {'',                              'technic:green_energy_crystal', ''},
+               {'technic:diamond_drill_head',          'technic:diamond_drill_head',   'technic:diamond_drill_head'},
+               {'technic:stainless_steel_ingot',       'technic:mining_drill',                 'technic:stainless_steel_ingot'},
+               {'',                                                            'technic:green_energy_crystal', ''},
        }
 })
 minetest.register_craft({
        output = 'technic:mining_drill_mk3',
        recipe = {
-               {'technic:diamond_drill_head',    'technic:diamond_drill_head',  'technic:diamond_drill_head'},
-               {'technic:stainless_steel_ingot', 'technic:mining_drill_mk2',    'technic:stainless_steel_ingot'},
-               {'',                              'technic:blue_energy_crystal', ''},
+               {'technic:diamond_drill_head',          'technic:diamond_drill_head',   'technic:diamond_drill_head'},
+               {'technic:stainless_steel_ingot',       'technic:mining_drill_mk2',     'technic:stainless_steel_ingot'},
+               {'',                                                            'technic:blue_energy_crystal',  ''},
        }
 })
 
index 7b9c655fb4b2da0b786853954b0d486b5dddf3cd..39b3ad0300eb74029f401b6e3af9913d9b732916 100644 (file)
@@ -76,8 +76,8 @@ minetest.register_craft({
        output = 'technic:laser_mk1',
        recipe = {
                {'default:diamond', 'default:steel_ingot', 'technic:battery'},
-               {'',                'default:steel_ingot', 'technic:battery'},
-               {'',                '',                    'default:copper_ingot'},
+               {'', 'default:steel_ingot', 'technic:battery'},
+               {'', '', 'default:copper_ingot'},
        }
 })
 
index 34558b3e07b510ca698827f87edacb90e4fb69ef..3073bc197fe127c124c21f562b583ba0f8d39ba8 100644 (file)
@@ -2,9 +2,9 @@ minetest.register_alias("music_player", "technic:music_player")
 minetest.register_craft({
        output = 'technic:music_player',
        recipe = {
-               {'default:wood',    'default:wood',         'default:wood'},
-               {'default:diamond', 'default:diamond',      'default:diamond'},
-               {'default:stone',   'default:copper_ingot', 'default:stone'},
+               {'default:wood', 'default:wood', 'default:wood'},
+               {'default:diamond', 'default:diamond', 'default:diamond'},
+               {'default:stone', 'default:copper_ingot', 'default:stone'},
        }
 })
 
index 9a292b4551c85f02c6822473339224f56efe7b7a..6b7e74416314b376c259f87872a04caf3f8fd09e 100644 (file)
@@ -2,8 +2,8 @@ minetest.register_alias("tool_workshop", "technic:tool_workshop")
 minetest.register_craft({
        output = 'technic:tool_workshop',
        recipe = {
-               {'default:wood',  'default:wood',         'default:wood'},
-               {'default:wood',  'default:diamond',      'default:wood'},
+               {'default:wood', 'default:wood', 'default:wood'},
+               {'default:wood', 'default:diamond', 'default:wood'},
                {'default:stone', 'default:copper_ingot', 'default:stone'},
        }
 })
index 808923a13ed19fa5b84fbbc2f1204f33d55ecd5d..4760b27396392cf8239ca564986af65532647ae5 100644 (file)
@@ -3,8 +3,8 @@ minetest.register_alias("water_mill", "technic:water_mill")
 minetest.register_craft({
        output = 'technic:water_mill',
        recipe = {
-               {'default:stone', 'default:stone',        'default:stone'},
-               {'default:wood',  'default:diamond',      'default:wood'},
+               {'default:stone', 'default:stone', 'default:stone'},
+               {'default:wood', 'default:diamond', 'default:wood'},
                {'default:stone', 'default:copper_ingot', 'default:stone'},
        }
 })
index 44a42f31d7f0f49d2002a4cb7145e3393d8c7a85..91efa96f72bd6217cbc8ef01c396f276bc05eef5 100644 (file)
@@ -1,18 +1,18 @@
 minetest.register_craft({
        output = 'technic:copper_chest 1',
        recipe = {
-               {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
-               {'default:copper_ingot', 'technic:iron_chest',   'default:copper_ingot'},
-               {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
+               {'default:copper_ingot','default:copper_ingot','default:copper_ingot'},
+               {'default:copper_ingot','technic:iron_chest','default:copper_ingot'},
+               {'default:copper_ingot','default:copper_ingot','default:copper_ingot'},
        }
 })
 
 minetest.register_craft({
        output = 'technic:copper_locked_chest 1',
        recipe = {
-               {'default:copper_ingot', 'default:copper_ingot',      'default:copper_ingot'},
-               {'default:copper_ingot', 'technic:iron_locked_chest', 'default:copper_ingot'},
-               {'default:copper_ingot', 'default:copper_ingot',      'default:copper_ingot'},
+               {'default:copper_ingot','default:copper_ingot','default:copper_ingot'},
+               {'default:copper_ingot','technic:iron_locked_chest','default:copper_ingot'},
+               {'default:copper_ingot','default:copper_ingot','default:copper_ingot'},
        }
 })
 
@@ -44,9 +44,13 @@ minetest.register_node(":technic:copper_chest", {
        on_construct = function(pos)
                local meta = minetest.env:get_meta(pos)
                meta:set_string("formspec",
-                               "invsize[10,9;]"..
-                               "list[current_name;main;0,0;10,4;]"..
-                               "list[current_player;main;0,5;8,4;]")
+                               "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)
@@ -76,9 +80,13 @@ minetest.register_node(":technic:copper_locked_chest", {
        on_construct = function(pos)
                local meta = minetest.env:get_meta(pos)
                meta:set_string("formspec",
-                               "invsize[10,9;]"..
-                               "list[current_name;main;0,0;10,4;]"..
-                               "list[current_player;main;0,5;8,4;]")
+                               "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()
index 8dc1274e3102ab2343d977ad04d0904bbe6576bb..5c137d9241ac2d60d6275829d173fc36a24b0f19 100644 (file)
@@ -1,41 +1,42 @@
 local chest_mark_colors = {
-    '_black',
-    '_blue', 
-    '_brown',
-    '_cyan',
-    '_dark_green',
-    '_dark_grey',
-    '_green',
-    '_grey',
-    '_magenta',
-    '_orange',
-    '_pink',
-    '_red',
-    '_violet',
-    '_white',
-    '_yellow',
+    {'_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'}
 }
 
 minetest.register_craft({
-       output = 'technic:gold_chest 1',
+       output = 'technic:gold_chest',
        recipe = {
-               {'default:gold_ingot', 'default:gold_ingot',   'default:gold_ingot'},
-               {'default:gold_ingot', 'technic:silver_chest', 'default:gold_ingot'},
-               {'default:gold_ingot', 'default:gold_ingot',   'default:gold_ingot'},
+               {'default:gold_ingot','default:gold_ingot','default:gold_ingot'},
+               {'default:gold_ingot','technic:silver_chest','default:gold_ingot'},
+               {'default:gold_ingot','default:gold_ingot','default:gold_ingot'},
        }
 })
 
 minetest.register_craft({
-       output = 'technic:gold_locked_chest 1',
+       output = 'technic:gold_locked_chest',
        recipe = {
-               {'default:gold_ingot', 'default:gold_ingot',          'default:gold_ingot'},
-               {'default:gold_ingot', 'technic:silver_locked_chest', 'default:gold_ingot'},
-               {'default:gold_ingot', 'default:gold_ingot',          'default:gold_ingot'},
+               {'default:gold_ingot','default:gold_ingot','default:gold_ingot'},
+               {'default:gold_ingot','technic:silver_locked_chest','default:gold_ingot'},
+               {'default:gold_ingot','default:gold_ingot','default:gold_ingot'},
        }
 })
 
 minetest.register_craft({
-       output = 'technic:gold_locked_chest 1',
+       output = 'technic:gold_locked_chest',
        recipe = {
                {'default:steel_ingot'},
                {'technic:gold_chest'},
@@ -51,9 +52,24 @@ minetest.register_craftitem(":technic:gold_locked_chest", {
        stack_max = 99,
 })
 
-gold_chest_formspec    =       "invsize[12,9;]"..
-                                               "list[current_name;main;0,0;12,4;]"..
-                                               "list[current_player;main;0,5;8,4;]"
+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
 
@@ -69,7 +85,10 @@ minetest.register_node(":technic:gold_chest", {
 
        on_construct = function(pos)
                local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",gold_chest_formspec)
+               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)
@@ -77,16 +96,26 @@ minetest.register_node(":technic:gold_chest", {
 
        can_dig = chest_can_dig,
 
-       on_punch = function (pos, node, puncher)
-       chest_punched (pos,node,puncher);
-       end,
-
        on_receive_fields = function(pos, formname, fields, sender)
-       local meta = minetest.env:get_meta(pos);
-       fields.text = fields.text or ""
-       meta:set_string("text", fields.text)
-       meta:set_string("infotext", '"'..fields.text..'"')
-       meta:set_string("formspec",gold_chest_formspec)
+        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,
@@ -94,37 +123,39 @@ minetest.register_node(":technic:gold_chest", {
        on_metadata_inventory_take = def_on_metadata_inventory_take 
 })
 
-for i, state in ipairs(chest_mark_colors) do
-minetest.register_node(":technic:gold_chest".. state, {
+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"..state..".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",
-       on_construct = function(pos)
-               local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",gold_chest_formspec)
-               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_punch = function (pos, node, puncher)
-       chest_punched (pos,node,puncher);
-       end,
        
        on_receive_fields = function(pos, formname, fields, sender)
-        local meta = minetest.env:get_meta(pos);
-               fields.text = fields.text or ""
-               meta:set_string("text", fields.text)
-               meta:set_string("infotext", '"'..fields.text..'"')
-               meta:set_string("formspec",gold_chest_formspec)
+        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,
@@ -151,8 +182,11 @@ minetest.register_node(":technic:gold_locked_chest", {
        end,
        on_construct = function(pos)
                local meta = minetest.env:get_meta(pos)
-               meta:set_string("formspec",gold_chest_formspec)
-               meta:set_string("infotext", "Gold Locked Chest")
+               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)
@@ -160,19 +194,27 @@ minetest.register_node(":technic:gold_locked_chest", {
 
        can_dig =chest_can_dig,
 
-       on_punch = function (pos, node, puncher)
-               local meta = minetest.env:get_meta(pos);
-               if (has_locked_chest_privilege(meta, puncher)) then
-                       locked_chest_punched (pos,node,puncher);
-               end
-       end,
-       
        on_receive_fields = function(pos, formname, fields, sender)
-               local meta = minetest.env:get_meta(pos);
-               fields.text = fields.text or ""
-               meta:set_string("text", fields.text)
-               meta:set_string("infotext", '"'..fields.text..'"')
-               meta:set_string("formspec",gold_chest_formspec)
+        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,
@@ -183,47 +225,40 @@ minetest.register_node(":technic:gold_locked_chest", {
        on_metadata_inventory_take = def_on_metadata_inventory_take 
 })
 
-for i, state in ipairs(chest_mark_colors) do
-minetest.register_node(":technic:gold_locked_chest".. state, {
+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"..state..".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(),
-       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)
-               meta:set_string("infotext", "Gold Locked Chest")
-               meta:set_string("owner", "")
-               local inv = meta:get_inventory()
-               inv:set_size("main", gold_chest_inv_size)
-       end,
-
        can_dig = chest_can_dig,
 
-       on_punch = function (pos, node, puncher)
-               local meta = minetest.env:get_meta(pos);
-               if (has_locked_chest_privilege(meta, puncher)) then
-               locked_chest_punched (pos,node,puncher);
-               end
-       end,
-
        on_receive_fields = function(pos, formname, fields, sender)
-               local meta = minetest.env:get_meta(pos);
-               fields.text = fields.text or ""
-               meta:set_string("text", fields.text)
-               meta:set_string("infotext", '"'..fields.text..'"')
-               meta:set_string("formspec",gold_chest_formspec)
+        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,
@@ -235,232 +270,18 @@ minetest.register_node(":technic:gold_locked_chest".. state, {
 })
 end
 
-function chest_punched (pos,node,puncher)
-       
-       local player_tool = puncher:get_wielded_item();
-       local item=player_tool:get_name();
-       if item == "dye:black" then
-               if (hacky_swap_node(pos,"technic:gold_chest_black")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:blue" then
-               if (hacky_swap_node(pos,"technic:gold_chest_blue")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:brown" then
-               if (hacky_swap_node(pos,"technic:gold_chest_brown")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:cyan" then
-               if (hacky_swap_node(pos,"technic:gold_chest_cyan")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:dark_green" then
-               if (hacky_swap_node(pos,"technic:gold_chest_dark_green")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:dark_grey" then
-               if (hacky_swap_node(pos,"technic:gold_chest_dark_grey")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:green" then
-               if (hacky_swap_node(pos,"technic:gold_chest_green")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:grey" then
-               if (hacky_swap_node(pos,"technic:gold_chest_grey")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:magenta" then
-               if (hacky_swap_node(pos,"technic:gold_chest_magenta")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:orange" then
-               if (hacky_swap_node(pos,"technic:gold_chest_orange")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:pink" then
-               if (hacky_swap_node(pos,"technic:gold_chest_pink")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:red" then
-               if (hacky_swap_node(pos,"technic:gold_chest_red")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:violet" then
-               if (hacky_swap_node(pos,"technic:gold_chest_violet")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:white" then
-               if (hacky_swap_node(pos,"technic:gold_chest_white")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:yellow" then
-               if (hacky_swap_node(pos,"technic:gold_chest_yellow")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-
-               local meta = minetest.env:get_meta(pos);
-                meta:set_string("formspec", "hack:sign_text_input")
+function check_color_buttons (pos,chest_name,fields)
+       if fields.color_button15 then
+               hacky_swap_node(pos,chest_name)
+               return 16
        end
-
-
-function locked_chest_punched (pos,node,puncher)
-       
-       local player_tool = puncher:get_wielded_item();
-       local item=player_tool:get_name();
-       if item == "dye:black" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_black")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:blue" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_blue")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:brown" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_brown")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:cyan" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_cyan")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:dark_green" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_dark_green")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:dark_grey" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_dark_grey")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:green" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_green")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:grey" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_grey")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  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
-       if item == "dye:magenta" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_magenta")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:orange" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_orange")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:pink" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_pink")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:red" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_red")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:violet" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_violet")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:white" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_white")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-       if item == "dye:yellow" then
-               if (hacky_swap_node(pos,"technic:gold_locked_chest_yellow")) then
-                       player_tool:take_item(1);
-                       puncher:set_wielded_item(player_tool);
-                       return
-                  end
-               end
-
-               local meta = minetest.env:get_meta(pos);
-                meta:set_string("formspec", "hack:sign_text_input")
        end
+       return 16
+end    
        
index 3b71dfd89a61abf43dac65c55559d8e6712b1495..62a8ae345b9ceb539a44aed6fb4f100e9a5933b7 100644 (file)
@@ -46,9 +46,13 @@ minetest.register_node(":technic:iron_chest", {
        on_construct = function(pos)
                local meta = minetest.env:get_meta(pos)
                meta:set_string("formspec",
-                               "invsize[9,9;]"..
-                               "list[current_name;main;0,0;9,4;]"..
-                               "list[current_player;main;0,5;8,4;]")
+                               "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)
@@ -72,14 +76,18 @@ minetest.register_node(":technic:iron_locked_chest", {
                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")..")")
+               meta:get_string("owner")..")")
        end,
        on_construct = function(pos)
                local meta = minetest.env:get_meta(pos)
                meta:set_string("formspec",
-                               "invsize[9,9;]"..
-                               "list[current_name;main;0,0;9,4;]"..
-                               "list[current_player;main;0,5;8,4;]")
+                               "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()
index d173ab97649457ad5d5b0dfcf8e5f96701183020..892e48cd19b1fa991269e3898b0f300dd0944670 100644 (file)
@@ -35,9 +35,13 @@ minetest.register_node(":technic:mithril_chest", {
        on_construct = function(pos)
                local meta = minetest.env:get_meta(pos)
                meta:set_string("formspec",
-                               "invsize[13,9;]"..
-                               "list[current_name;main;0,0;13,4;]"..
-                               "list[current_player;main;0,5;8,4;]")
+                               "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)
@@ -84,9 +88,13 @@ minetest.register_node(":technic:mithril_locked_chest", {
 on_construct = function(pos)
                local meta = minetest.env:get_meta(pos)
                meta:set_string("formspec",
-                               "invsize[13,9;]"..
-                               "list[current_name;main;0,0;13,4;]"..
-                               "list[current_player;main;0,5;8,4;]")
+                               "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()
index 3df092aad552c97cb256842e45bdc30accad7d1a..176e36fb51a29f82367feaf5c9a39e2663227918 100644 (file)
@@ -1,5 +1,5 @@
 minetest.register_craft({
-       output = 'technic:silver_chest 1',
+       output = 'technic:silver_chest',
        recipe = {
                {'moreores:silver_ingot','moreores:silver_ingot','moreores:silver_ingot'},
                {'moreores:silver_ingot','technic:copper_chest','moreores:silver_ingot'},
@@ -8,7 +8,7 @@ minetest.register_craft({
 })
 
 minetest.register_craft({
-       output = 'technic:silver_locked_chest 1',
+       output = 'technic:silver_locked_chest',
        recipe = {
                {'moreores:silver_ingot','moreores:silver_ingot','moreores:silver_ingot'},
                {'moreores:silver_ingot','technic:copper_locked_chest','moreores:silver_ingot'},
@@ -17,7 +17,7 @@ minetest.register_craft({
 })
 
 minetest.register_craft({
-       output = 'technic:silver_locked_chest 1',
+       output = 'technic:silver_locked_chest',
        recipe = {
                {'default:steel_ingot'},
                {'technic:silver_chest'},
@@ -33,6 +33,14 @@ minetest.register_craftitem(":technic: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",
@@ -45,30 +53,34 @@ minetest.register_node(":technic:silver_chest", {
        on_construct = function(pos)
                local meta = minetest.env:get_meta(pos)
                meta:set_string("formspec",
-                               "invsize[11,9;]"..
-                               "list[current_name;main;0,0;11,4;]"..
-                               "list[current_player;main;0,5;8,4;]")
+                               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_punch = function (pos, node, puncher)
-               local meta = minetest.env:get_meta(pos);
-                meta:set_string("formspec", "hack:sign_text_input")
-       end,
-       
        on_receive_fields = function(pos, formname, fields, sender)
-        local meta = minetest.env:get_meta(pos);
-               fields.text = fields.text or ""
-               meta:set_string("text", fields.text)
-               meta:set_string("infotext", '"'..fields.text..'"')
-
-               meta:set_string("formspec",
-                               "invsize[11,9;]"..
-                               "list[current_name;main;0,0;11,4;]"..
-                               "list[current_player;main;0,5;8,4;]")
+        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,
@@ -94,34 +106,36 @@ minetest.register_node(":technic:silver_locked_chest", {
        on_construct = function(pos)
                local meta = minetest.env:get_meta(pos)
                meta:set_string("formspec",
-                               "invsize[11,9;]"..
-                               "list[current_name;main;0,0;11,4;]"..
-                               "list[current_player;main;0,5;8,4;]")
-               meta:set_string("infotext", "Silver Locked Chest")
+                               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_punch = function (pos, node, puncher)
-               local meta = minetest.env:get_meta(pos);
-                meta:set_string("formspec", "hack:sign_text_input")
-       end,
-       
        on_receive_fields = function(pos, formname, fields, sender)
-        local meta = minetest.env:get_meta(pos);
-               fields.text = fields.text or ""
-               meta:set_string("text", fields.text)
-               meta:set_string("infotext", '"'..fields.text..'"')
-
-               meta:set_string("formspec",
-                               "invsize[11,9;]"..
-                               "list[current_name;main;0,0;11,4;]"..
-                               "list[current_player;main;0,5;8,4;]")
+        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,
index 668b6597613cf59dcc2d4cb31ba80566172ba30e..a601b7f0f61179463efc97b66024bc41e5b3d4d2 100644 (file)
@@ -31,10 +31,9 @@ minetest.register_craftitem( ":technic:stainless_steel_ingot", {
        inventory_image = "technic_stainless_steel_ingot.png",
 })
 
-minetest.register_craftitem( ":technic:brass_ingot", {
+minetest.register_craftitem( ":group:brass_ingot", {
        description = "Brass Ingot",
        inventory_image = "technic_brass_ingot.png",
-       groups = {brass_ingot=1}
 })
 
 minetest.register_craft({
@@ -86,14 +85,14 @@ minetest.register_craft({
 })
 
 minetest.register_craft({
-       output = "node technic:brass_block",
+       output = "node group:brass_block",
        recipe = {{"group:brass_ingot", "group:brass_ingot", "group:brass_ingot"},
                  {"group:brass_ingot", "group:brass_ingot", "group:brass_ingot"},
                  {"group:brass_ingot", "group:brass_ingot", "group:brass_ingot"}}
 })
 
 minetest.register_craft({
-       output = "craft technic:brass_ingot 9",
+       output = "craft group:brass_ingot 9",
        recipe = {{"group:brass_block"}}
 })
 
diff --git a/unified_inventory/textures/ui_colorbutton0.png b/unified_inventory/textures/ui_colorbutton0.png
new file mode 100644 (file)
index 0000000..35b7db2
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton0.png differ
diff --git a/unified_inventory/textures/ui_colorbutton1.png b/unified_inventory/textures/ui_colorbutton1.png
new file mode 100644 (file)
index 0000000..cbf095d
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton1.png differ
diff --git a/unified_inventory/textures/ui_colorbutton10.png b/unified_inventory/textures/ui_colorbutton10.png
new file mode 100644 (file)
index 0000000..8dfc5f0
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton10.png differ
diff --git a/unified_inventory/textures/ui_colorbutton11.png b/unified_inventory/textures/ui_colorbutton11.png
new file mode 100644 (file)
index 0000000..3b279e0
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton11.png differ
diff --git a/unified_inventory/textures/ui_colorbutton12.png b/unified_inventory/textures/ui_colorbutton12.png
new file mode 100644 (file)
index 0000000..a387b5f
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton12.png differ
diff --git a/unified_inventory/textures/ui_colorbutton13.png b/unified_inventory/textures/ui_colorbutton13.png
new file mode 100644 (file)
index 0000000..b1e7790
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton13.png differ
diff --git a/unified_inventory/textures/ui_colorbutton14.png b/unified_inventory/textures/ui_colorbutton14.png
new file mode 100644 (file)
index 0000000..c4ad486
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton14.png differ
diff --git a/unified_inventory/textures/ui_colorbutton15.png b/unified_inventory/textures/ui_colorbutton15.png
new file mode 100644 (file)
index 0000000..b7060d6
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton15.png differ
diff --git a/unified_inventory/textures/ui_colorbutton2.png b/unified_inventory/textures/ui_colorbutton2.png
new file mode 100644 (file)
index 0000000..caf1fc6
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton2.png differ
diff --git a/unified_inventory/textures/ui_colorbutton3.png b/unified_inventory/textures/ui_colorbutton3.png
new file mode 100644 (file)
index 0000000..6ac79a3
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton3.png differ
diff --git a/unified_inventory/textures/ui_colorbutton4.png b/unified_inventory/textures/ui_colorbutton4.png
new file mode 100644 (file)
index 0000000..dc43592
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton4.png differ
diff --git a/unified_inventory/textures/ui_colorbutton5.png b/unified_inventory/textures/ui_colorbutton5.png
new file mode 100644 (file)
index 0000000..98b8c67
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton5.png differ
diff --git a/unified_inventory/textures/ui_colorbutton6.png b/unified_inventory/textures/ui_colorbutton6.png
new file mode 100644 (file)
index 0000000..66478bc
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton6.png differ
diff --git a/unified_inventory/textures/ui_colorbutton7.png b/unified_inventory/textures/ui_colorbutton7.png
new file mode 100644 (file)
index 0000000..85f6b93
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton7.png differ
diff --git a/unified_inventory/textures/ui_colorbutton8.png b/unified_inventory/textures/ui_colorbutton8.png
new file mode 100644 (file)
index 0000000..868c35d
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton8.png differ
diff --git a/unified_inventory/textures/ui_colorbutton9.png b/unified_inventory/textures/ui_colorbutton9.png
new file mode 100644 (file)
index 0000000..50eac0b
Binary files /dev/null and b/unified_inventory/textures/ui_colorbutton9.png differ
diff --git a/unified_inventory/textures/ui_copper_chest_inventory.png b/unified_inventory/textures/ui_copper_chest_inventory.png
new file mode 100644 (file)
index 0000000..debc9fc
Binary files /dev/null and b/unified_inventory/textures/ui_copper_chest_inventory.png differ
index 410e2b288f8320eea79c8912075f837aecea8d08..ce84efb1338886456d54b69d105c3ecd0db191d8 100644 (file)
Binary files a/unified_inventory/textures/ui_furnace_inventory.png and b/unified_inventory/textures/ui_furnace_inventory.png differ
diff --git a/unified_inventory/textures/ui_gold_chest_inventory.png b/unified_inventory/textures/ui_gold_chest_inventory.png
new file mode 100644 (file)
index 0000000..b19524b
Binary files /dev/null and b/unified_inventory/textures/ui_gold_chest_inventory.png differ
diff --git a/unified_inventory/textures/ui_iron_chest_inventory.png b/unified_inventory/textures/ui_iron_chest_inventory.png
new file mode 100644 (file)
index 0000000..1785f88
Binary files /dev/null and b/unified_inventory/textures/ui_iron_chest_inventory.png differ
diff --git a/unified_inventory/textures/ui_lv_alloy_furnace.png b/unified_inventory/textures/ui_lv_alloy_furnace.png
new file mode 100644 (file)
index 0000000..3b98650
Binary files /dev/null and b/unified_inventory/textures/ui_lv_alloy_furnace.png differ
diff --git a/unified_inventory/textures/ui_lv_battery_box.png b/unified_inventory/textures/ui_lv_battery_box.png
new file mode 100644 (file)
index 0000000..61c55de
Binary files /dev/null and b/unified_inventory/textures/ui_lv_battery_box.png differ
diff --git a/unified_inventory/textures/ui_lv_electric_furnace.png b/unified_inventory/textures/ui_lv_electric_furnace.png
new file mode 100644 (file)
index 0000000..a91b241
Binary files /dev/null and b/unified_inventory/textures/ui_lv_electric_furnace.png differ
diff --git a/unified_inventory/textures/ui_lv_grinder.png b/unified_inventory/textures/ui_lv_grinder.png
new file mode 100644 (file)
index 0000000..7af5155
Binary files /dev/null and b/unified_inventory/textures/ui_lv_grinder.png differ
index d17d5384f14dbaadc410fcd37c566bc9e78f9294..b65dabbb60f030c03ec60d1dde4dfd60f296d5c7 100644 (file)
Binary files a/unified_inventory/textures/ui_main_inventory.png and b/unified_inventory/textures/ui_main_inventory.png differ
diff --git a/unified_inventory/textures/ui_mithril_chest_inventory.png b/unified_inventory/textures/ui_mithril_chest_inventory.png
new file mode 100644 (file)
index 0000000..9054775
Binary files /dev/null and b/unified_inventory/textures/ui_mithril_chest_inventory.png differ
diff --git a/unified_inventory/textures/ui_silver_chest_inventory.png b/unified_inventory/textures/ui_silver_chest_inventory.png
new file mode 100644 (file)
index 0000000..a61c4b9
Binary files /dev/null and b/unified_inventory/textures/ui_silver_chest_inventory.png differ
index 2456f6e97ef0e2e46437d96d515048e4ae0e9464..145d9d2230834dc48b93bdfd708fad790ac5e82c 100644 (file)
Binary files a/unified_inventory/textures/ui_wooden_chest_inventory.png and b/unified_inventory/textures/ui_wooden_chest_inventory.png differ