diff --git a/mods/pipeworks/common.lua b/mods/pipeworks/common.lua index b50b7337..9be13d00 100755 --- a/mods/pipeworks/common.lua +++ b/mods/pipeworks/common.lua @@ -126,9 +126,18 @@ end function fs_helpers.cycling_button(meta, base, meta_name, values) local current_value = meta:get_int(meta_name) local new_value = (current_value + 1) % (#values) - local text = values[current_value + 1] + local val = values[current_value + 1] + local text + local texture_name = nil + --when we get a table, we know the caller wants an image_button + if type(val) == "table" then + text = val["text"] + texture_name = val["texture"] + else + text = val + end local field = "fs_helpers_cycling:"..new_value..":"..meta_name - return base..";"..field..";"..minetest.formspec_escape(text).."]" + return base..";"..(texture_name and texture_name..";" or "")..field..";"..minetest.formspec_escape(text).."]" end --------- diff --git a/mods/pipeworks/teleport_tube.lua b/mods/pipeworks/teleport_tube.lua index 99b71a1f..5c2a7dea 100644 --- a/mods/pipeworks/teleport_tube.lua +++ b/mods/pipeworks/teleport_tube.lua @@ -1,53 +1,76 @@ - local filename=minetest.get_worldpath() .. "/teleport_tubes" -local function read_file() - local f = io.open(filename, "r") - if f == nil then return {} end - local t = f:read("*all") - f:close() - if t == "" or t == nil then return {} end - return minetest.deserialize(t) +local tp_tube_db = nil -- nil forces a read +local tp_tube_db_version = 2.0 + +local function hash(pos) + return string.format("%d", minetest.hash_node_position(pos)) end -local function write_file(tbl) - local f = io.open(filename, "w") - f:write(minetest.serialize(tbl)) - f:close() +local function save_tube_db() + local file, err = io.open(filename, "w") + if file then + tp_tube_db.version = tp_tube_db_version + file:write(minetest.serialize(tp_tube_db)) + tp_tube_db.version = nil + io.close(file) + else + error(err) + end end -local function update_pos_in_file(pos) - local tbl=read_file() - for _, val in ipairs(tbl) do - if val.x == pos.x and val.y == pos.y and val.z == pos.z then - local meta = minetest.get_meta(val) - val.channel = meta:get_string("channel") - val.cr = meta:get_int("can_receive") +local function migrate_tube_db() + local tmp_db = {} + tp_tube_db.version = nil + for key, val in pairs(tp_tube_db) do + if(val.channel ~= "") then -- skip unconfigured tubes + tmp_db[hash(val)] = val + end + end + tp_tube_db = tmp_db + save_tube_db() +end + +local function read_tube_db() + local file = io.open(filename, "r") + if file ~= nil then + local file_content = file:read("*all") + io.close(file) + + if file_content and file_content ~= "" then + tp_tube_db = minetest.deserialize(file_content) + if(not tp_tube_db.version or tonumber(tp_tube_db.version) < tp_tube_db_version) then + migrate_tube_db() + end + tp_tube_db.version = nil -- we add it back when saving + return tp_tube_db -- we read sucessfully end end - write_file(tbl) + tp_tube_db = {} + return tp_tube_db end -local function add_tube_in_file(pos,channel, cr) - local tbl=read_file() - for _,val in ipairs(tbl) do - if val.x==pos.x and val.y==pos.y and val.z==pos.z then - return - end +-- updates or adds a tube +local function set_tube(pos, channel, can_receive) + local tubes = tp_tube_db or read_tube_db() + local hash = hash(pos) + local tube = tubes[hash] + if tube then + tube.channel = channel + tube.cr = can_receive + save_tube_db() + return end - table.insert(tbl,{x=pos.x,y=pos.y,z=pos.z,channel=channel,cr=cr}) - write_file(tbl) + + -- we haven't found any tp tube to update, so lets add it + tp_tube_db[hash] = {x=pos.x,y=pos.y,z=pos.z,channel=channel,cr=can_receive} + save_tube_db() end -local function remove_tube_in_file(pos) - local tbl = read_file() - local newtbl = {} - for _, val in ipairs(tbl) do - if val.x ~= pos.x or val.y ~= pos.y or val.z ~= pos.z then - table.insert(newtbl, val) - end - end - write_file(newtbl) +local function remove_tube(pos) + local tubes = tp_tube_db or read_tube_db() + tubes[hash(pos)] = nil + save_tube_db() end local function read_node_with_vm(pos) @@ -58,39 +81,28 @@ local function read_node_with_vm(pos) return minetest.get_name_from_content_id(data[area:index(pos.x, pos.y, pos.z)]) end -local function get_tubes_in_file(pos,channel) - local tbl = read_file() - local newtbl = {} - local changed = false - for _, val in ipairs(tbl) do - local meta = minetest.get_meta(val) - local name = read_node_with_vm(val) - local is_loaded = (minetest.get_node_or_nil(val) ~= nil) - local is_teleport_tube = minetest.registered_nodes[name] and minetest.registered_nodes[name].is_teleport_tube - if is_teleport_tube then - if is_loaded and (val.channel ~= meta:get_string("channel") or val.cr ~= meta:get_int("can_receive")) then - val.channel = meta:get_string("channel") - val.cr = meta:get_int("can_receive") - changed = true - end - if val.cr == 1 and val.channel == channel and (val.x ~= pos.x or val.y ~= pos.y or val.z ~= pos.z) then - table.insert(newtbl, val) - end - else - val.to_remove = true - changed = true - end - end - if changed then - local updated = {} - for _, val in ipairs(tbl) do - if not val.to_remove then - table.insert(updated, val) +local function get_receivers(pos, channel) + local tubes = tp_tube_db or read_tube_db() + local receivers = {} + local dirty = false + for key, val in pairs(tubes) do + -- skip all non-receivers and the tube that it came from as early as possible, as this is called often + if (val.cr == 1 and val.channel == channel and (val.x ~= pos.x or val.y ~= pos.y or val.z ~= pos.z)) then + local is_loaded = (minetest.get_node_or_nil(val) ~= nil) + local node_name = is_loaded and minetest.get_node(pos).name or read_node_with_vm(val) + + if minetest.registered_nodes[node_name] and minetest.registered_nodes[node_name].is_teleport_tube then + table.insert(receivers, val) + else + tp_tube_db[key] = nil + dirty = true end end - write_file(updated) end - return newtbl + if dirty then + save_tube_db() + end + return receivers end local teleport_noctr_textures={"pipeworks_teleport_tube_noctr.png","pipeworks_teleport_tube_noctr.png","pipeworks_teleport_tube_noctr.png", @@ -102,11 +114,11 @@ local teleport_end_textures={"pipeworks_teleport_tube_end.png","pipeworks_telepo local teleport_short_texture="pipeworks_teleport_tube_short.png" local teleport_inv_texture="pipeworks_teleport_tube_inv.png" -local function set_teleport_tube_formspec(meta) - local cr = meta:get_int("can_receive") ~= 0 +local function set_teleport_tube_formspec(meta, can_receive) + local cr = (can_receive ~= 0) meta:set_string("formspec","size[10.5,1;]".. - "field[0,0.5;7,1;channel;Channel:;${channel}]".. - "button[8,0;2.5,1;"..(cr and "cr0" or "cr1")..";".. + "field[0,0.5;7,1;channel;Channel:;${channel}]".. + "button[8,0;2.5,1;"..(cr and "cr0" or "cr1")..";".. (cr and "Send and Receive" or "Send only").."]") end @@ -118,10 +130,13 @@ pipeworks.register_tube("pipeworks:teleport_tube","Teleporting Pneumatic Tube Se velocity.x = 0 velocity.y = 0 velocity.z = 0 - local meta = minetest.get_meta(pos) - local channel = meta:get_string("channel") - local target = get_tubes_in_file(pos,channel) + + local channel = minetest.get_meta(pos):get_string("channel") + if channel == "" then return {} end + + local target = get_receivers(pos, channel) if target[1] == nil then return {} end + local d = math.random(1,#target) pos.x = target[d].x pos.y = target[d].y @@ -131,50 +146,79 @@ pipeworks.register_tube("pipeworks:teleport_tube","Teleporting Pneumatic Tube Se }, on_construct = function(pos) local meta = minetest.get_meta(pos) - meta:set_string("channel","") - meta:set_int("can_receive",1) - add_tube_in_file(pos,"") - set_teleport_tube_formspec(meta) + meta:set_int("can_receive", 1) + set_teleport_tube_formspec(meta, 1) end, on_receive_fields = function(pos,formname,fields,sender) + if not fields.channel then + return -- ignore escaping or clientside manipulation of the form + end + local meta = minetest.get_meta(pos) - - --check for private channels - if fields.channel ~= nil then + local can_receive = meta:get_int("can_receive") + + -- check for private channels each time before actually changing anything + -- to not even allow switching between can_receive states of private channels + if fields.channel ~= "" then + local sender_name = sender:get_player_name() local name, mode = fields.channel:match("^([^:;]+)([:;])") - if name and mode and name ~= sender:get_player_name() then - + if name and mode and name ~= sender_name then --channels starting with '[name]:' can only be used by the named player if mode == ":" then - minetest.chat_send_player(sender:get_player_name(), "Sorry, channel '"..fields.channel.."' is reserved for exclusive use by "..name) + minetest.chat_send_player(sender_name, "Sorry, channel '"..fields.channel.."' is reserved for exclusive use by "..name) return --channels starting with '[name];' can be used by other players, but cannot be received from - elseif mode == ";" and (fields.cr1 or (meta:get_int("can_receive") ~= 0 and not fields.cr0)) then - minetest.chat_send_player(sender:get_player_name(), "Sorry, receiving from channel '"..fields.channel.."' is reserved for "..name) + elseif mode == ";" and (fields.cr1 or (can_receive ~= 0 and not fields.cr0)) then + minetest.chat_send_player(sender_name, "Sorry, receiving from channel '"..fields.channel.."' is reserved for "..name) return end end end - - if fields.channel==nil then fields.channel=meta:get_string("channel") end - meta:set_string("channel",fields.channel) - remove_tube_in_file(pos) - if fields.cr0 then meta:set_int("can_receive", 0) end - if fields.cr1 then meta:set_int("can_receive", 1) end - local cr = meta:get_int("can_receive") - add_tube_in_file(pos, fields.channel, meta:get_int("can_receive")) - set_teleport_tube_formspec(meta) + + local dirty = false + + -- test if a can_receive button was pressed + if fields.cr0 and can_receive ~= 0 then + can_receive = 0 + meta:set_int("can_receive", can_receive) + dirty = true + elseif fields.cr1 and can_receive ~= 1 then + can_receive = 1 + meta:set_int("can_receive", can_receive) + dirty = true + end + + -- was the channel changed? + local channel = meta:get_string("channel") + if fields.channel ~= channel then + channel = fields.channel + meta:set_string("channel", channel) + dirty = true + end + + -- save if we changed something, handle the empty channel while we're at it + if dirty then + if channel ~= "" then + set_tube(pos, channel, can_receive) + else + -- remove empty channel tubes, to not have to search through them + remove_tube(pos) + end + set_teleport_tube_formspec(meta, can_receive) + end end, on_destruct = function(pos) - remove_tube_in_file(pos) - end}) + remove_tube(pos) + end +}) if minetest.get_modpath("mesecons_mvps") ~= nil then mesecon.register_on_mvps_move(function(moved_nodes) for _, n in ipairs(moved_nodes) do if string.find(n.node.name, "pipeworks:teleport_tube") ~= nil then - update_pos_in_file(n.pos) + local meta = minetest.get_meta(n.pos) + set_tube(n.pos, meta:get_string("channel"), meta:get_int("can_receive")) end end end) diff --git a/mods/pipeworks/textures/homedecor_oil_extract.png b/mods/pipeworks/textures/homedecor_oil_extract.png index ef0f8969..48e6dffd 100644 Binary files a/mods/pipeworks/textures/homedecor_oil_extract.png and b/mods/pipeworks/textures/homedecor_oil_extract.png differ diff --git a/mods/pipeworks/textures/homedecor_paraffin.png b/mods/pipeworks/textures/homedecor_paraffin.png index 5f983004..77d2bbd1 100644 Binary files a/mods/pipeworks/textures/homedecor_paraffin.png and b/mods/pipeworks/textures/homedecor_paraffin.png differ diff --git a/mods/pipeworks/textures/homedecor_plastic_sheeting.png b/mods/pipeworks/textures/homedecor_plastic_sheeting.png index fea8773e..034dcc2f 100644 Binary files a/mods/pipeworks/textures/homedecor_plastic_sheeting.png and b/mods/pipeworks/textures/homedecor_plastic_sheeting.png differ diff --git a/mods/pipeworks/textures/pipeworks_accelerator_tube_end.png b/mods/pipeworks/textures/pipeworks_accelerator_tube_end.png index a3dd09af..f841d20f 100644 Binary files a/mods/pipeworks/textures/pipeworks_accelerator_tube_end.png and b/mods/pipeworks/textures/pipeworks_accelerator_tube_end.png differ diff --git a/mods/pipeworks/textures/pipeworks_accelerator_tube_inv.png b/mods/pipeworks/textures/pipeworks_accelerator_tube_inv.png index 6cc2937d..3f680824 100644 Binary files a/mods/pipeworks/textures/pipeworks_accelerator_tube_inv.png and b/mods/pipeworks/textures/pipeworks_accelerator_tube_inv.png differ diff --git a/mods/pipeworks/textures/pipeworks_black.png b/mods/pipeworks/textures/pipeworks_black.png index ada83a44..34afad80 100644 Binary files a/mods/pipeworks/textures/pipeworks_black.png and b/mods/pipeworks/textures/pipeworks_black.png differ diff --git a/mods/pipeworks/textures/pipeworks_blue.png b/mods/pipeworks/textures/pipeworks_blue.png index c063ae1e..64c8a6f8 100644 Binary files a/mods/pipeworks/textures/pipeworks_blue.png and b/mods/pipeworks/textures/pipeworks_blue.png differ diff --git a/mods/pipeworks/textures/pipeworks_button_off.png b/mods/pipeworks/textures/pipeworks_button_off.png new file mode 100644 index 00000000..1933742d Binary files /dev/null and b/mods/pipeworks/textures/pipeworks_button_off.png differ diff --git a/mods/pipeworks/textures/pipeworks_button_on.png b/mods/pipeworks/textures/pipeworks_button_on.png new file mode 100644 index 00000000..bb34cebe Binary files /dev/null and b/mods/pipeworks/textures/pipeworks_button_on.png differ diff --git a/mods/pipeworks/textures/pipeworks_conductor_tube_end.png b/mods/pipeworks/textures/pipeworks_conductor_tube_end.png index a0d6915c..49bf788b 100644 Binary files a/mods/pipeworks/textures/pipeworks_conductor_tube_end.png and b/mods/pipeworks/textures/pipeworks_conductor_tube_end.png differ diff --git a/mods/pipeworks/textures/pipeworks_conductor_tube_inv.png b/mods/pipeworks/textures/pipeworks_conductor_tube_inv.png index 5db1153e..bffb5aef 100644 Binary files a/mods/pipeworks/textures/pipeworks_conductor_tube_inv.png and b/mods/pipeworks/textures/pipeworks_conductor_tube_inv.png differ diff --git a/mods/pipeworks/textures/pipeworks_conductor_tube_noctr.png b/mods/pipeworks/textures/pipeworks_conductor_tube_noctr.png index cc03245e..2cbd109d 100644 Binary files a/mods/pipeworks/textures/pipeworks_conductor_tube_noctr.png and b/mods/pipeworks/textures/pipeworks_conductor_tube_noctr.png differ diff --git a/mods/pipeworks/textures/pipeworks_conductor_tube_on_end.png b/mods/pipeworks/textures/pipeworks_conductor_tube_on_end.png index a70d988b..1fd0c53f 100644 Binary files a/mods/pipeworks/textures/pipeworks_conductor_tube_on_end.png and b/mods/pipeworks/textures/pipeworks_conductor_tube_on_end.png differ diff --git a/mods/pipeworks/textures/pipeworks_conductor_tube_on_noctr.png b/mods/pipeworks/textures/pipeworks_conductor_tube_on_noctr.png index 30edb603..934ca1dd 100644 Binary files a/mods/pipeworks/textures/pipeworks_conductor_tube_on_noctr.png and b/mods/pipeworks/textures/pipeworks_conductor_tube_on_noctr.png differ diff --git a/mods/pipeworks/textures/pipeworks_conductor_tube_on_plain.png b/mods/pipeworks/textures/pipeworks_conductor_tube_on_plain.png index 1aaa15bc..ecf3eaaf 100644 Binary files a/mods/pipeworks/textures/pipeworks_conductor_tube_on_plain.png and b/mods/pipeworks/textures/pipeworks_conductor_tube_on_plain.png differ diff --git a/mods/pipeworks/textures/pipeworks_conductor_tube_plain.png b/mods/pipeworks/textures/pipeworks_conductor_tube_plain.png index b432dc42..2c4ad996 100644 Binary files a/mods/pipeworks/textures/pipeworks_conductor_tube_plain.png and b/mods/pipeworks/textures/pipeworks_conductor_tube_plain.png differ diff --git a/mods/pipeworks/textures/pipeworks_conductor_tube_short.png b/mods/pipeworks/textures/pipeworks_conductor_tube_short.png index 0c4b1d2b..7ec809a6 100644 Binary files a/mods/pipeworks/textures/pipeworks_conductor_tube_short.png and b/mods/pipeworks/textures/pipeworks_conductor_tube_short.png differ diff --git a/mods/pipeworks/textures/pipeworks_crossing_tube_end.png b/mods/pipeworks/textures/pipeworks_crossing_tube_end.png index f708b05b..7b51ce31 100644 Binary files a/mods/pipeworks/textures/pipeworks_crossing_tube_end.png and b/mods/pipeworks/textures/pipeworks_crossing_tube_end.png differ diff --git a/mods/pipeworks/textures/pipeworks_crossing_tube_inv.png b/mods/pipeworks/textures/pipeworks_crossing_tube_inv.png index 8f24d1a5..a547f05f 100644 Binary files a/mods/pipeworks/textures/pipeworks_crossing_tube_inv.png and b/mods/pipeworks/textures/pipeworks_crossing_tube_inv.png differ diff --git a/mods/pipeworks/textures/pipeworks_crossing_tube_noctr.png b/mods/pipeworks/textures/pipeworks_crossing_tube_noctr.png index f4a75c94..fdef1be4 100644 Binary files a/mods/pipeworks/textures/pipeworks_crossing_tube_noctr.png and b/mods/pipeworks/textures/pipeworks_crossing_tube_noctr.png differ diff --git a/mods/pipeworks/textures/pipeworks_crossing_tube_plain.png b/mods/pipeworks/textures/pipeworks_crossing_tube_plain.png index 68d1fc89..385c7e77 100644 Binary files a/mods/pipeworks/textures/pipeworks_crossing_tube_plain.png and b/mods/pipeworks/textures/pipeworks_crossing_tube_plain.png differ diff --git a/mods/pipeworks/textures/pipeworks_crossing_tube_short.png b/mods/pipeworks/textures/pipeworks_crossing_tube_short.png index 1c5e39f8..ef191de7 100644 Binary files a/mods/pipeworks/textures/pipeworks_crossing_tube_short.png and b/mods/pipeworks/textures/pipeworks_crossing_tube_short.png differ diff --git a/mods/pipeworks/textures/pipeworks_deployer_back.png b/mods/pipeworks/textures/pipeworks_deployer_back.png index 2bac175f..4e08be38 100644 Binary files a/mods/pipeworks/textures/pipeworks_deployer_back.png and b/mods/pipeworks/textures/pipeworks_deployer_back.png differ diff --git a/mods/pipeworks/textures/pipeworks_deployer_bottom.png b/mods/pipeworks/textures/pipeworks_deployer_bottom.png index 763a7bd0..b5ebd436 100644 Binary files a/mods/pipeworks/textures/pipeworks_deployer_bottom.png and b/mods/pipeworks/textures/pipeworks_deployer_bottom.png differ diff --git a/mods/pipeworks/textures/pipeworks_deployer_side.png b/mods/pipeworks/textures/pipeworks_deployer_side.png index f3ede415..2527f6e6 100644 Binary files a/mods/pipeworks/textures/pipeworks_deployer_side.png and b/mods/pipeworks/textures/pipeworks_deployer_side.png differ diff --git a/mods/pipeworks/textures/pipeworks_deployer_side1.png b/mods/pipeworks/textures/pipeworks_deployer_side1.png index f3ede415..2527f6e6 100644 Binary files a/mods/pipeworks/textures/pipeworks_deployer_side1.png and b/mods/pipeworks/textures/pipeworks_deployer_side1.png differ diff --git a/mods/pipeworks/textures/pipeworks_deployer_side2.png b/mods/pipeworks/textures/pipeworks_deployer_side2.png index 0b31eecf..032d471e 100644 Binary files a/mods/pipeworks/textures/pipeworks_deployer_side2.png and b/mods/pipeworks/textures/pipeworks_deployer_side2.png differ diff --git a/mods/pipeworks/textures/pipeworks_deployer_top.png b/mods/pipeworks/textures/pipeworks_deployer_top.png index 1a78cc95..6e3f9d09 100644 Binary files a/mods/pipeworks/textures/pipeworks_deployer_top.png and b/mods/pipeworks/textures/pipeworks_deployer_top.png differ diff --git a/mods/pipeworks/textures/pipeworks_detector_tube_end.png b/mods/pipeworks/textures/pipeworks_detector_tube_end.png index ef0d5feb..e9d01bae 100644 Binary files a/mods/pipeworks/textures/pipeworks_detector_tube_end.png and b/mods/pipeworks/textures/pipeworks_detector_tube_end.png differ diff --git a/mods/pipeworks/textures/pipeworks_detector_tube_inv.png b/mods/pipeworks/textures/pipeworks_detector_tube_inv.png index b6cadb93..84cae455 100644 Binary files a/mods/pipeworks/textures/pipeworks_detector_tube_inv.png and b/mods/pipeworks/textures/pipeworks_detector_tube_inv.png differ diff --git a/mods/pipeworks/textures/pipeworks_detector_tube_noctr.png b/mods/pipeworks/textures/pipeworks_detector_tube_noctr.png index c415d770..6f078863 100644 Binary files a/mods/pipeworks/textures/pipeworks_detector_tube_noctr.png and b/mods/pipeworks/textures/pipeworks_detector_tube_noctr.png differ diff --git a/mods/pipeworks/textures/pipeworks_detector_tube_short.png b/mods/pipeworks/textures/pipeworks_detector_tube_short.png index ad5e0349..6729c532 100644 Binary files a/mods/pipeworks/textures/pipeworks_detector_tube_short.png and b/mods/pipeworks/textures/pipeworks_detector_tube_short.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_back.png b/mods/pipeworks/textures/pipeworks_dispenser_back.png index f4fade2b..ce447bd4 100644 Binary files a/mods/pipeworks/textures/pipeworks_dispenser_back.png and b/mods/pipeworks/textures/pipeworks_dispenser_back.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_bottom.png b/mods/pipeworks/textures/pipeworks_dispenser_bottom.png index 35416de2..16dc5847 100644 Binary files a/mods/pipeworks/textures/pipeworks_dispenser_bottom.png and b/mods/pipeworks/textures/pipeworks_dispenser_bottom.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_front_off.png b/mods/pipeworks/textures/pipeworks_dispenser_front_off.png index 4fc0017a..b0c9e4a0 100644 Binary files a/mods/pipeworks/textures/pipeworks_dispenser_front_off.png and b/mods/pipeworks/textures/pipeworks_dispenser_front_off.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_front_on.png b/mods/pipeworks/textures/pipeworks_dispenser_front_on.png index 36f7f0b5..c9fff11e 100644 Binary files a/mods/pipeworks/textures/pipeworks_dispenser_front_on.png and b/mods/pipeworks/textures/pipeworks_dispenser_front_on.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_side1.png b/mods/pipeworks/textures/pipeworks_dispenser_side1.png index 56e8973b..bd178528 100644 Binary files a/mods/pipeworks/textures/pipeworks_dispenser_side1.png and b/mods/pipeworks/textures/pipeworks_dispenser_side1.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_side2.png b/mods/pipeworks/textures/pipeworks_dispenser_side2.png index 8f306b28..005d9a5e 100644 Binary files a/mods/pipeworks/textures/pipeworks_dispenser_side2.png and b/mods/pipeworks/textures/pipeworks_dispenser_side2.png differ diff --git a/mods/pipeworks/textures/pipeworks_dispenser_top.png b/mods/pipeworks/textures/pipeworks_dispenser_top.png index 8d6f9d0e..7dd49adb 100644 Binary files a/mods/pipeworks/textures/pipeworks_dispenser_top.png and b/mods/pipeworks/textures/pipeworks_dispenser_top.png differ diff --git a/mods/pipeworks/textures/pipeworks_entry_panel.png b/mods/pipeworks/textures/pipeworks_entry_panel.png index 42aba4a0..040f4083 100644 Binary files a/mods/pipeworks/textures/pipeworks_entry_panel.png and b/mods/pipeworks/textures/pipeworks_entry_panel.png differ diff --git a/mods/pipeworks/textures/pipeworks_flow_sensor_off.png b/mods/pipeworks/textures/pipeworks_flow_sensor_off.png index 91beee48..10c68464 100644 Binary files a/mods/pipeworks/textures/pipeworks_flow_sensor_off.png and b/mods/pipeworks/textures/pipeworks_flow_sensor_off.png differ diff --git a/mods/pipeworks/textures/pipeworks_flow_sensor_on.png b/mods/pipeworks/textures/pipeworks_flow_sensor_on.png index 5c147fac..03e054a6 100644 Binary files a/mods/pipeworks/textures/pipeworks_flow_sensor_on.png and b/mods/pipeworks/textures/pipeworks_flow_sensor_on.png differ diff --git a/mods/pipeworks/textures/pipeworks_fountainhead.png b/mods/pipeworks/textures/pipeworks_fountainhead.png index 516bd2ff..4affa696 100644 Binary files a/mods/pipeworks/textures/pipeworks_fountainhead.png and b/mods/pipeworks/textures/pipeworks_fountainhead.png differ diff --git a/mods/pipeworks/textures/pipeworks_grating_sides.png b/mods/pipeworks/textures/pipeworks_grating_sides.png index 615965ba..a8b0b094 100644 Binary files a/mods/pipeworks/textures/pipeworks_grating_sides.png and b/mods/pipeworks/textures/pipeworks_grating_sides.png differ diff --git a/mods/pipeworks/textures/pipeworks_grating_top.png b/mods/pipeworks/textures/pipeworks_grating_top.png index 7219861b..e56cf3ae 100644 Binary files a/mods/pipeworks/textures/pipeworks_grating_top.png and b/mods/pipeworks/textures/pipeworks_grating_top.png differ diff --git a/mods/pipeworks/textures/pipeworks_green.png b/mods/pipeworks/textures/pipeworks_green.png index 2e4939d0..3f42f9f0 100644 Binary files a/mods/pipeworks/textures/pipeworks_green.png and b/mods/pipeworks/textures/pipeworks_green.png differ diff --git a/mods/pipeworks/textures/pipeworks_mese_sand_tube_end.png b/mods/pipeworks/textures/pipeworks_mese_sand_tube_end.png index b044d736..d8e7c37f 100644 Binary files a/mods/pipeworks/textures/pipeworks_mese_sand_tube_end.png and b/mods/pipeworks/textures/pipeworks_mese_sand_tube_end.png differ diff --git a/mods/pipeworks/textures/pipeworks_mese_sand_tube_inv.png b/mods/pipeworks/textures/pipeworks_mese_sand_tube_inv.png index 8829422d..c2471db1 100644 Binary files a/mods/pipeworks/textures/pipeworks_mese_sand_tube_inv.png and b/mods/pipeworks/textures/pipeworks_mese_sand_tube_inv.png differ diff --git a/mods/pipeworks/textures/pipeworks_mese_sand_tube_plain.png b/mods/pipeworks/textures/pipeworks_mese_sand_tube_plain.png index ff0a1070..aa0b3996 100644 Binary files a/mods/pipeworks/textures/pipeworks_mese_sand_tube_plain.png and b/mods/pipeworks/textures/pipeworks_mese_sand_tube_plain.png differ diff --git a/mods/pipeworks/textures/pipeworks_mese_sand_tube_short.png b/mods/pipeworks/textures/pipeworks_mese_sand_tube_short.png index 2defd5de..a0eeedf8 100644 Binary files a/mods/pipeworks/textures/pipeworks_mese_sand_tube_short.png and b/mods/pipeworks/textures/pipeworks_mese_sand_tube_short.png differ diff --git a/mods/pipeworks/textures/pipeworks_mese_tube_end.png b/mods/pipeworks/textures/pipeworks_mese_tube_end.png index e4b677d0..3b15d7a8 100644 Binary files a/mods/pipeworks/textures/pipeworks_mese_tube_end.png and b/mods/pipeworks/textures/pipeworks_mese_tube_end.png differ diff --git a/mods/pipeworks/textures/pipeworks_mese_tube_inv.png b/mods/pipeworks/textures/pipeworks_mese_tube_inv.png index 123d9f73..9b3c5a62 100644 Binary files a/mods/pipeworks/textures/pipeworks_mese_tube_inv.png and b/mods/pipeworks/textures/pipeworks_mese_tube_inv.png differ diff --git a/mods/pipeworks/textures/pipeworks_mese_tube_plain_3.png b/mods/pipeworks/textures/pipeworks_mese_tube_plain_3.png index c7af0cf3..820597b3 100644 Binary files a/mods/pipeworks/textures/pipeworks_mese_tube_plain_3.png and b/mods/pipeworks/textures/pipeworks_mese_tube_plain_3.png differ diff --git a/mods/pipeworks/textures/pipeworks_mese_tube_plain_6.png b/mods/pipeworks/textures/pipeworks_mese_tube_plain_6.png index efd85a51..863059fb 100644 Binary files a/mods/pipeworks/textures/pipeworks_mese_tube_plain_6.png and b/mods/pipeworks/textures/pipeworks_mese_tube_plain_6.png differ diff --git a/mods/pipeworks/textures/pipeworks_nodebreaker_back.png b/mods/pipeworks/textures/pipeworks_nodebreaker_back.png index 6337d40e..e964bdfe 100644 Binary files a/mods/pipeworks/textures/pipeworks_nodebreaker_back.png and b/mods/pipeworks/textures/pipeworks_nodebreaker_back.png differ diff --git a/mods/pipeworks/textures/pipeworks_nodebreaker_bottom_off.png b/mods/pipeworks/textures/pipeworks_nodebreaker_bottom_off.png index 133be48d..c7a48d44 100644 Binary files a/mods/pipeworks/textures/pipeworks_nodebreaker_bottom_off.png and b/mods/pipeworks/textures/pipeworks_nodebreaker_bottom_off.png differ diff --git a/mods/pipeworks/textures/pipeworks_nodebreaker_bottom_on.png b/mods/pipeworks/textures/pipeworks_nodebreaker_bottom_on.png index b21c261b..e14ca32a 100644 Binary files a/mods/pipeworks/textures/pipeworks_nodebreaker_bottom_on.png and b/mods/pipeworks/textures/pipeworks_nodebreaker_bottom_on.png differ diff --git a/mods/pipeworks/textures/pipeworks_nodebreaker_front_off.png b/mods/pipeworks/textures/pipeworks_nodebreaker_front_off.png index cab8bf9c..36a5a50b 100644 Binary files a/mods/pipeworks/textures/pipeworks_nodebreaker_front_off.png and b/mods/pipeworks/textures/pipeworks_nodebreaker_front_off.png differ diff --git a/mods/pipeworks/textures/pipeworks_nodebreaker_front_on.png b/mods/pipeworks/textures/pipeworks_nodebreaker_front_on.png index 82ebd3ae..bf7fe702 100644 Binary files a/mods/pipeworks/textures/pipeworks_nodebreaker_front_on.png and b/mods/pipeworks/textures/pipeworks_nodebreaker_front_on.png differ diff --git a/mods/pipeworks/textures/pipeworks_nodebreaker_side1_off.png b/mods/pipeworks/textures/pipeworks_nodebreaker_side1_off.png index ec0a00f0..30769faa 100644 Binary files a/mods/pipeworks/textures/pipeworks_nodebreaker_side1_off.png and b/mods/pipeworks/textures/pipeworks_nodebreaker_side1_off.png differ diff --git a/mods/pipeworks/textures/pipeworks_nodebreaker_side1_on.png b/mods/pipeworks/textures/pipeworks_nodebreaker_side1_on.png index 9dace63b..ff0a893c 100644 Binary files a/mods/pipeworks/textures/pipeworks_nodebreaker_side1_on.png and b/mods/pipeworks/textures/pipeworks_nodebreaker_side1_on.png differ diff --git a/mods/pipeworks/textures/pipeworks_nodebreaker_side2_off.png b/mods/pipeworks/textures/pipeworks_nodebreaker_side2_off.png index 8320646e..babb6812 100644 Binary files a/mods/pipeworks/textures/pipeworks_nodebreaker_side2_off.png and b/mods/pipeworks/textures/pipeworks_nodebreaker_side2_off.png differ diff --git a/mods/pipeworks/textures/pipeworks_nodebreaker_side2_on.png b/mods/pipeworks/textures/pipeworks_nodebreaker_side2_on.png index 467a1fca..ed0e12e0 100644 Binary files a/mods/pipeworks/textures/pipeworks_nodebreaker_side2_on.png and b/mods/pipeworks/textures/pipeworks_nodebreaker_side2_on.png differ diff --git a/mods/pipeworks/textures/pipeworks_nodebreaker_top_off.png b/mods/pipeworks/textures/pipeworks_nodebreaker_top_off.png index 8e5a1cd9..fb86b957 100644 Binary files a/mods/pipeworks/textures/pipeworks_nodebreaker_top_off.png and b/mods/pipeworks/textures/pipeworks_nodebreaker_top_off.png differ diff --git a/mods/pipeworks/textures/pipeworks_nodebreaker_top_on.png b/mods/pipeworks/textures/pipeworks_nodebreaker_top_on.png index 8fca4713..97da74d6 100644 Binary files a/mods/pipeworks/textures/pipeworks_nodebreaker_top_on.png and b/mods/pipeworks/textures/pipeworks_nodebreaker_top_on.png differ diff --git a/mods/pipeworks/textures/pipeworks_one_way_tube_input.png b/mods/pipeworks/textures/pipeworks_one_way_tube_input.png index 3968c0d7..0226ceff 100644 Binary files a/mods/pipeworks/textures/pipeworks_one_way_tube_input.png and b/mods/pipeworks/textures/pipeworks_one_way_tube_input.png differ diff --git a/mods/pipeworks/textures/pipeworks_one_way_tube_output.png b/mods/pipeworks/textures/pipeworks_one_way_tube_output.png index 7dc5910a..0226ceff 100644 Binary files a/mods/pipeworks/textures/pipeworks_one_way_tube_output.png and b/mods/pipeworks/textures/pipeworks_one_way_tube_output.png differ diff --git a/mods/pipeworks/textures/pipeworks_one_way_tube_side.png b/mods/pipeworks/textures/pipeworks_one_way_tube_side.png index 044e4f44..174b133f 100644 Binary files a/mods/pipeworks/textures/pipeworks_one_way_tube_side.png and b/mods/pipeworks/textures/pipeworks_one_way_tube_side.png differ diff --git a/mods/pipeworks/textures/pipeworks_one_way_tube_top.png b/mods/pipeworks/textures/pipeworks_one_way_tube_top.png index bb54e45f..9b9be738 100644 Binary files a/mods/pipeworks/textures/pipeworks_one_way_tube_top.png and b/mods/pipeworks/textures/pipeworks_one_way_tube_top.png differ diff --git a/mods/pipeworks/textures/pipeworks_pipe_3_empty.png b/mods/pipeworks/textures/pipeworks_pipe_3_empty.png index 29630b75..d13ec770 100644 Binary files a/mods/pipeworks/textures/pipeworks_pipe_3_empty.png and b/mods/pipeworks/textures/pipeworks_pipe_3_empty.png differ diff --git a/mods/pipeworks/textures/pipeworks_pipe_3_loaded.png b/mods/pipeworks/textures/pipeworks_pipe_3_loaded.png index e76b73c6..c086e19a 100644 Binary files a/mods/pipeworks/textures/pipeworks_pipe_3_loaded.png and b/mods/pipeworks/textures/pipeworks_pipe_3_loaded.png differ diff --git a/mods/pipeworks/textures/pipeworks_pipe_inv.png b/mods/pipeworks/textures/pipeworks_pipe_inv.png index 821ec4b6..aeec3930 100644 Binary files a/mods/pipeworks/textures/pipeworks_pipe_inv.png and b/mods/pipeworks/textures/pipeworks_pipe_inv.png differ diff --git a/mods/pipeworks/textures/pipeworks_pipe_plain.png b/mods/pipeworks/textures/pipeworks_pipe_plain.png index e43e5275..7cbc11b0 100644 Binary files a/mods/pipeworks/textures/pipeworks_pipe_plain.png and b/mods/pipeworks/textures/pipeworks_pipe_plain.png differ diff --git a/mods/pipeworks/textures/pipeworks_pump_off.png b/mods/pipeworks/textures/pipeworks_pump_off.png index 48b5bfdd..3dbd2b07 100644 Binary files a/mods/pipeworks/textures/pipeworks_pump_off.png and b/mods/pipeworks/textures/pipeworks_pump_off.png differ diff --git a/mods/pipeworks/textures/pipeworks_pump_on.png b/mods/pipeworks/textures/pipeworks_pump_on.png index 9df54a03..7c16d5d2 100644 Binary files a/mods/pipeworks/textures/pipeworks_pump_on.png and b/mods/pipeworks/textures/pipeworks_pump_on.png differ diff --git a/mods/pipeworks/textures/pipeworks_red.png b/mods/pipeworks/textures/pipeworks_red.png index 05ccc05d..33812bda 100644 Binary files a/mods/pipeworks/textures/pipeworks_red.png and b/mods/pipeworks/textures/pipeworks_red.png differ diff --git a/mods/pipeworks/textures/pipeworks_sand_tube_end.png b/mods/pipeworks/textures/pipeworks_sand_tube_end.png index 3c4db022..16945daf 100644 Binary files a/mods/pipeworks/textures/pipeworks_sand_tube_end.png and b/mods/pipeworks/textures/pipeworks_sand_tube_end.png differ diff --git a/mods/pipeworks/textures/pipeworks_sand_tube_inv.png b/mods/pipeworks/textures/pipeworks_sand_tube_inv.png index e1c46b9d..aa2a72a9 100644 Binary files a/mods/pipeworks/textures/pipeworks_sand_tube_inv.png and b/mods/pipeworks/textures/pipeworks_sand_tube_inv.png differ diff --git a/mods/pipeworks/textures/pipeworks_sand_tube_short.png b/mods/pipeworks/textures/pipeworks_sand_tube_short.png index 9cfc124e..89c47136 100644 Binary files a/mods/pipeworks/textures/pipeworks_sand_tube_short.png and b/mods/pipeworks/textures/pipeworks_sand_tube_short.png differ diff --git a/mods/pipeworks/textures/pipeworks_spigot.png b/mods/pipeworks/textures/pipeworks_spigot.png index 12ae1f62..a79dbf82 100644 Binary files a/mods/pipeworks/textures/pipeworks_spigot.png and b/mods/pipeworks/textures/pipeworks_spigot.png differ diff --git a/mods/pipeworks/textures/pipeworks_storage_tank_back.png b/mods/pipeworks/textures/pipeworks_storage_tank_back.png index cf7f2451..3b6a16bb 100644 Binary files a/mods/pipeworks/textures/pipeworks_storage_tank_back.png and b/mods/pipeworks/textures/pipeworks_storage_tank_back.png differ diff --git a/mods/pipeworks/textures/pipeworks_storage_tank_fittings.png b/mods/pipeworks/textures/pipeworks_storage_tank_fittings.png index d694fad6..f3b8b243 100644 Binary files a/mods/pipeworks/textures/pipeworks_storage_tank_fittings.png and b/mods/pipeworks/textures/pipeworks_storage_tank_fittings.png differ diff --git a/mods/pipeworks/textures/pipeworks_storage_tank_front_10.png b/mods/pipeworks/textures/pipeworks_storage_tank_front_10.png index 6456afeb..f48a738d 100644 Binary files a/mods/pipeworks/textures/pipeworks_storage_tank_front_10.png and b/mods/pipeworks/textures/pipeworks_storage_tank_front_10.png differ diff --git a/mods/pipeworks/textures/pipeworks_storage_tank_front_2.png b/mods/pipeworks/textures/pipeworks_storage_tank_front_2.png index 89a4412f..a36bc240 100644 Binary files a/mods/pipeworks/textures/pipeworks_storage_tank_front_2.png and b/mods/pipeworks/textures/pipeworks_storage_tank_front_2.png differ diff --git a/mods/pipeworks/textures/pipeworks_storage_tank_front_4.png b/mods/pipeworks/textures/pipeworks_storage_tank_front_4.png index 25e43d34..47d9669e 100644 Binary files a/mods/pipeworks/textures/pipeworks_storage_tank_front_4.png and b/mods/pipeworks/textures/pipeworks_storage_tank_front_4.png differ diff --git a/mods/pipeworks/textures/pipeworks_storage_tank_front_5.png b/mods/pipeworks/textures/pipeworks_storage_tank_front_5.png index f51d113e..17eaf698 100644 Binary files a/mods/pipeworks/textures/pipeworks_storage_tank_front_5.png and b/mods/pipeworks/textures/pipeworks_storage_tank_front_5.png differ diff --git a/mods/pipeworks/textures/pipeworks_storage_tank_front_6.png b/mods/pipeworks/textures/pipeworks_storage_tank_front_6.png index c21115e9..77619e38 100644 Binary files a/mods/pipeworks/textures/pipeworks_storage_tank_front_6.png and b/mods/pipeworks/textures/pipeworks_storage_tank_front_6.png differ diff --git a/mods/pipeworks/textures/pipeworks_storage_tank_front_7.png b/mods/pipeworks/textures/pipeworks_storage_tank_front_7.png index aa7c6655..ffebf9ba 100644 Binary files a/mods/pipeworks/textures/pipeworks_storage_tank_front_7.png and b/mods/pipeworks/textures/pipeworks_storage_tank_front_7.png differ diff --git a/mods/pipeworks/textures/pipeworks_storage_tank_front_8.png b/mods/pipeworks/textures/pipeworks_storage_tank_front_8.png index 5598e596..4974a826 100644 Binary files a/mods/pipeworks/textures/pipeworks_storage_tank_front_8.png and b/mods/pipeworks/textures/pipeworks_storage_tank_front_8.png differ diff --git a/mods/pipeworks/textures/pipeworks_storage_tank_front_9.png b/mods/pipeworks/textures/pipeworks_storage_tank_front_9.png index b0f750d1..87b6d79f 100644 Binary files a/mods/pipeworks/textures/pipeworks_storage_tank_front_9.png and b/mods/pipeworks/textures/pipeworks_storage_tank_front_9.png differ diff --git a/mods/pipeworks/textures/pipeworks_teleport_tube_end.png b/mods/pipeworks/textures/pipeworks_teleport_tube_end.png index d3df799b..09ee3fb4 100644 Binary files a/mods/pipeworks/textures/pipeworks_teleport_tube_end.png and b/mods/pipeworks/textures/pipeworks_teleport_tube_end.png differ diff --git a/mods/pipeworks/textures/pipeworks_teleport_tube_inv.png b/mods/pipeworks/textures/pipeworks_teleport_tube_inv.png index 653afbbf..305d867c 100644 Binary files a/mods/pipeworks/textures/pipeworks_teleport_tube_inv.png and b/mods/pipeworks/textures/pipeworks_teleport_tube_inv.png differ diff --git a/mods/pipeworks/textures/pipeworks_testobject.png b/mods/pipeworks/textures/pipeworks_testobject.png index 2c675618..5e26cbe6 100644 Binary files a/mods/pipeworks/textures/pipeworks_testobject.png and b/mods/pipeworks/textures/pipeworks_testobject.png differ diff --git a/mods/pipeworks/textures/pipeworks_trashcan_bottom.png b/mods/pipeworks/textures/pipeworks_trashcan_bottom.png index a50c7892..91fd944b 100644 Binary files a/mods/pipeworks/textures/pipeworks_trashcan_bottom.png and b/mods/pipeworks/textures/pipeworks_trashcan_bottom.png differ diff --git a/mods/pipeworks/textures/pipeworks_trashcan_side.png b/mods/pipeworks/textures/pipeworks_trashcan_side.png index 7b081bfa..cf0a3bff 100644 Binary files a/mods/pipeworks/textures/pipeworks_trashcan_side.png and b/mods/pipeworks/textures/pipeworks_trashcan_side.png differ diff --git a/mods/pipeworks/textures/pipeworks_tube_connection_metallic.png b/mods/pipeworks/textures/pipeworks_tube_connection_metallic.png index 86a74c6c..10becfe0 100644 Binary files a/mods/pipeworks/textures/pipeworks_tube_connection_metallic.png and b/mods/pipeworks/textures/pipeworks_tube_connection_metallic.png differ diff --git a/mods/pipeworks/textures/pipeworks_tube_connection_stony.png b/mods/pipeworks/textures/pipeworks_tube_connection_stony.png index 1e72d81c..78a99798 100644 Binary files a/mods/pipeworks/textures/pipeworks_tube_connection_stony.png and b/mods/pipeworks/textures/pipeworks_tube_connection_stony.png differ diff --git a/mods/pipeworks/textures/pipeworks_tube_connection_wooden.png b/mods/pipeworks/textures/pipeworks_tube_connection_wooden.png index c20cd7d5..36548df9 100644 Binary files a/mods/pipeworks/textures/pipeworks_tube_connection_wooden.png and b/mods/pipeworks/textures/pipeworks_tube_connection_wooden.png differ diff --git a/mods/pipeworks/textures/pipeworks_tube_end.png b/mods/pipeworks/textures/pipeworks_tube_end.png index ef0d5feb..e9d01bae 100644 Binary files a/mods/pipeworks/textures/pipeworks_tube_end.png and b/mods/pipeworks/textures/pipeworks_tube_end.png differ diff --git a/mods/pipeworks/textures/pipeworks_tube_inv.png b/mods/pipeworks/textures/pipeworks_tube_inv.png index d24d61cc..51c728d8 100644 Binary files a/mods/pipeworks/textures/pipeworks_tube_inv.png and b/mods/pipeworks/textures/pipeworks_tube_inv.png differ diff --git a/mods/pipeworks/textures/pipeworks_tube_noctr.png b/mods/pipeworks/textures/pipeworks_tube_noctr.png index c415d770..6f078863 100644 Binary files a/mods/pipeworks/textures/pipeworks_tube_noctr.png and b/mods/pipeworks/textures/pipeworks_tube_noctr.png differ diff --git a/mods/pipeworks/textures/pipeworks_tube_plain.png b/mods/pipeworks/textures/pipeworks_tube_plain.png index a5022d84..9d6442b2 100644 Binary files a/mods/pipeworks/textures/pipeworks_tube_plain.png and b/mods/pipeworks/textures/pipeworks_tube_plain.png differ diff --git a/mods/pipeworks/textures/pipeworks_tube_short.png b/mods/pipeworks/textures/pipeworks_tube_short.png index ad5e0349..6729c532 100644 Binary files a/mods/pipeworks/textures/pipeworks_tube_short.png and b/mods/pipeworks/textures/pipeworks_tube_short.png differ diff --git a/mods/pipeworks/textures/pipeworks_tube_transparent.png b/mods/pipeworks/textures/pipeworks_tube_transparent.png index 10e89078..52a83483 100644 Binary files a/mods/pipeworks/textures/pipeworks_tube_transparent.png and b/mods/pipeworks/textures/pipeworks_tube_transparent.png differ diff --git a/mods/pipeworks/textures/pipeworks_valve.png b/mods/pipeworks/textures/pipeworks_valve.png index 8d3f578f..60ef960e 100644 Binary files a/mods/pipeworks/textures/pipeworks_valve.png and b/mods/pipeworks/textures/pipeworks_valve.png differ diff --git a/mods/pipeworks/textures/pipeworks_white.png b/mods/pipeworks/textures/pipeworks_white.png index 64386eb4..faf0ec13 100644 Binary files a/mods/pipeworks/textures/pipeworks_white.png and b/mods/pipeworks/textures/pipeworks_white.png differ diff --git a/mods/pipeworks/textures/pipeworks_yellow.png b/mods/pipeworks/textures/pipeworks_yellow.png index 44ea445a..ce1af411 100644 Binary files a/mods/pipeworks/textures/pipeworks_yellow.png and b/mods/pipeworks/textures/pipeworks_yellow.png differ diff --git a/mods/pipeworks/tubes.lua b/mods/pipeworks/tubes.lua index 149e78e2..39323a24 100755 --- a/mods/pipeworks/tubes.lua +++ b/mods/pipeworks/tubes.lua @@ -249,6 +249,12 @@ if pipeworks.enable_mese_tube then end end end + local buttons_formspec = "" + for i = 0, 5 do + buttons_formspec = buttons_formspec .. fs_helpers.cycling_button(meta, + "image_button[7,"..(i)..";1,1", "l"..(i+1).."s", + {{text="",texture="pipeworks_button_off.png"}, {text="",texture="pipeworks_button_on.png"}}) + end meta:set_string("formspec", "size[8,11]".. "list[current_name;line1;1,0;6,1;]".. @@ -263,43 +269,37 @@ if pipeworks.enable_mese_tube then "image[0,3;1,1;pipeworks_yellow.png]".. "image[0,4;1,1;pipeworks_blue.png]".. "image[0,5;1,1;pipeworks_red.png]".. - fs_helpers.cycling_button(meta, "button[7,0;1,1", "l1s", {"Off", "On"}).. - fs_helpers.cycling_button(meta, "button[7,1;1,1", "l2s", {"Off", "On"}).. - fs_helpers.cycling_button(meta, "button[7,2;1,1", "l3s", {"Off", "On"}).. - fs_helpers.cycling_button(meta, "button[7,3;1,1", "l4s", {"Off", "On"}).. - fs_helpers.cycling_button(meta, "button[7,4;1,1", "l5s", {"Off", "On"}).. - fs_helpers.cycling_button(meta, "button[7,5;1,1", "l6s", {"Off", "On"}).. + buttons_formspec.. "list[current_player;main;0,7;8,4;]") end pipeworks.register_tube("pipeworks:mese_tube", "Sorting Pneumatic Tube Segment", mese_plain_textures, mese_noctr_textures, mese_end_textures, mese_short_texture, mese_inv_texture, {tube = {can_go = function(pos, node, velocity, stack) - local tbl = {} + local tbl, tbln = {}, 0 + local found, foundn = {}, 0 local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - local found = false local name = stack:get_name() for i, vect in ipairs(pipeworks.meseadjlist) do - if meta:get_int("l"..tostring(i).."s") == 1 then - for _, st in ipairs(inv:get_list("line"..tostring(i))) do - if st:get_name() == name then - found = true - table.insert(tbl, vect) - break + if meta:get_int("l"..i.."s") == 1 then + local invname = "line"..i + local is_empty = true + for _, st in ipairs(inv:get_list(invname)) do + if not st:is_empty() then + is_empty = false + if st:get_name() == name then + foundn = foundn + 1 + found[foundn] = vect + end end end + if is_empty then + tbln = tbln + 1 + tbl[tbln] = vect + end end end - if found == false then - for i, vect in ipairs(pipeworks.meseadjlist) do - if meta:get_int("l"..tostring(i).."s") == 1 then - if inv:is_empty("line"..tostring(i)) then - table.insert(tbl, vect) - end - end - end - end - return tbl + return (foundn > 0) and found or tbl end}, on_construct = function(pos) local meta = minetest.get_meta(pos)