Improve repairkit for pumps

This commit is contained in:
Joachim Stolberg 2022-09-10 20:42:31 +02:00
parent 680f411e04
commit 9f38cef427
6 changed files with 21 additions and 7 deletions

View File

@ -53,7 +53,7 @@ local function ta4_formspec(self, pos, nvm)
"box[0,-0.1;7.8,0.5;#c6e8ff]".. "box[0,-0.1;7.8,0.5;#c6e8ff]"..
"label[3,-0.1;"..minetest.colorize("#000000", S("Pusher")).."]".. "label[3,-0.1;"..minetest.colorize("#000000", S("Pusher")).."]"..
techage.question_mark_help(7.5, S("Optionally configure\nthe pusher with one item")).. techage.question_mark_help(7.5, S("Optionally configure\nthe pusher with one item"))..
techage.wrench_image(7.4, -0.05) .. techage.wrench_image(7.4, -0.05) ..
"list[context;main;3.5,0.8;1,1;]".. "list[context;main;3.5,0.8;1,1;]"..
"image_button[3.5,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. "image_button[3.5,2;1,1;".. self:get_state_button_image(nvm) ..";state_button;]"..
"tooltip[3.5,2;1,1;"..self:get_state_tooltip(nvm).."]".. "tooltip[3.5,2;1,1;"..self:get_state_tooltip(nvm).."]"..
@ -123,7 +123,7 @@ end
local function pushing(pos, crd, meta, nvm) local function pushing(pos, crd, meta, nvm)
local pull_dir = meta:get_int("pull_dir") local pull_dir = meta:get_int("pull_dir")
local push_dir = meta:get_int("push_dir") local push_dir = meta:get_int("push_dir")
if not nvm.limit then if not nvm.limit then
local num = nvm.item_count or nvm.num_items or crd.num_items local num = nvm.item_count or nvm.num_items or crd.num_items
num = push(pos, crd, meta, nvm, pull_dir, push_dir, num) num = push(pos, crd, meta, nvm, pull_dir, push_dir, num)

View File

@ -86,7 +86,7 @@ local function pumping(pos, nvm, state, capa)
local mem = techage.get_mem(pos) local mem = techage.get_mem(pos)
mem.dbg_cycles = (mem.dbg_cycles or 0) - 1 mem.dbg_cycles = (mem.dbg_cycles or 0) - 1
local outdir = M(pos):get_int("outdir") local outdir = M(pos):get_int("outdir")
if not nvm.limit then if not nvm.limit then
local num = pump(pos, mem, nvm, state, outdir, capa) local num = pump(pos, mem, nvm, state, outdir, capa)
if num > 0 then if num > 0 then

View File

@ -1098,6 +1098,8 @@ Biome=Biom
Node owner=Blockbesitzer Node owner=Blockbesitzer
Position=Position Position=Position
Position temperature=Positionstemperatur Position temperature=Positionstemperatur
Pump connected to no/empty tank(s).=Pumpe an keine/leere Tank(s) angeschlossen.
Pump connected to tank(s) with: @1=Pumpe an Tank(s) angeschlossen mit: @1
TechAge Info Tool (use @= read status info)=TechAge Info Werkzeug TechAge Info Tool (use @= read status info)=TechAge Info Werkzeug
TechAge Repair Kit=TechAge Reparaturset TechAge Repair Kit=TechAge Reparaturset

View File

@ -1098,6 +1098,8 @@ Biome=
Node owner= Node owner=
Position= Position=
Position temperature= Position temperature=
Pump connected to no/empty tank(s).=
Pump connected to tank(s) with: @1=
TechAge Info Tool (use @= read status info)= TechAge Info Tool (use @= read status info)=
TechAge Repair Kit= TechAge Repair Kit=

View File

@ -197,8 +197,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end) end)
register_signallamp("techage:signal_lamp", register_signallamp("techage:signal_lamp",
S("TechAge Signal Lamp"), S("TechAge Signal Lamp"),
{"techage_signal_lamp.png^[colorize:#000000:100"}, {"techage_signal_lamp.png^[colorize:#000000:100"},
{ {
type = "fixed", type = "fixed",
@ -209,8 +209,8 @@ register_signallamp("techage:signal_lamp",
} }
) )
register_signallamp("techage:signal_lamp2", register_signallamp("techage:signal_lamp2",
S("TechAge Signal Lamp 2 "), S("TechAge Signal Lamp 2 "),
{"techage_signallamp2.png"} {"techage_signallamp2.png"}
) )

View File

@ -115,6 +115,16 @@ local function read_state(itemstack, user, pointed_thing)
if owner ~= "" then if owner ~= "" then
minetest.chat_send_player(user:get_player_name(), S("Node owner")..": "..owner.." ") minetest.chat_send_player(user:get_player_name(), S("Node owner")..": "..owner.." ")
end end
if ndef and ndef.networks and ndef.networks.pipe2 and ndef.networks.pipe2.ntype == "pump" then
local tbl = networks.liquid.get_liquids(pos, Pipe2)
if #tbl > 0 then
local names = table.concat(tbl, ", ")
minetest.chat_send_player(user:get_player_name(), S("Pump connected to tank(s) with: @1", names))
else
minetest.chat_send_player(user:get_player_name(), S("Pump connected to no/empty tank(s)."))
end
end
minetest.chat_send_player(user:get_player_name(), S("Position")..": "..minetest.pos_to_string(pos).." ") minetest.chat_send_player(user:get_player_name(), S("Position")..": "..minetest.pos_to_string(pos).." ")
itemstack:add_wear(65636/200) itemstack:add_wear(65636/200)
return itemstack return itemstack