Implement copper cable

This commit is contained in:
2023-03-11 16:52:51 +01:00
parent 9d89c588ee
commit 4e7499279c
5 changed files with 126 additions and 32 deletions

View File

@@ -36,8 +36,16 @@ local function inspectNode(pos,playerName)
"field[0.5,5.4;2,0.5;powerAmount;"..S("Power Amount")..";"..powerAmount.."]",
"field[0.5,6.2;2,0.5;powerIOConfig;"..S("Power IO Config")..";"..powerIOConfig.."]",
"button[0.5,6.8;2,0.5;update;"..S("Update").."]",
"button[4.2,1.25;2.8,0.5;triggerNeighbours;"..S("Trigger Neighbours").."]"
"button[4.2,1.25;2.8,0.5;triggerNeighbours;"..S("Trigger Neighbours").."]",
"label[4.2,2.25;"..S("Connections:").."]"
}
local connections=industrialtest.api.getConnections(pos)
local sides={"X-","X+","Y-","Y+","Z-","Z+"}
local sideString=""
for _,value in ipairs(connections) do
sideString=sideString..sides[value].." "
end
table.insert(formspec,"label[4.2,2.65;"..sideString.."]")
powerStorageInspectorContext[playerName]=pos
minetest.show_formspec(playerName,"industrialtest:power_storage_inspector_formspec",table.concat(formspec,""))
end