Skip to content

Commit

Permalink
move implementation of UI button from @SwissalpS to custom repo (prep…
Browse files Browse the repository at this point in the history
…aration for pipeworks upstream switch)

(https://github.com/pandorabox-io/pipeworks/pull/4)
  • Loading branch information
NatureFreshMilk committed Nov 11, 2019
1 parent 40e7bc5 commit 8b4fbc3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pipeworks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,21 @@ minetest.register_chatcommand("pipeworks_stats", {
end
})

-- add "Done" button
-- idea and implementation originally by @SwissalpS
-- (https://github.com/pandorabox-io/pipeworks/commit/fe699d96213332c8dd5b9b7fd6fb0ec37eb3e500)
for i=1,10 do
minetest.override_item("pipeworks:teleport_tube_" .. i, {
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_int("dist", 0)
meta:set_string("formspec", "size[2.9.1,0.8]"..
"image[0,0;1,1;pipeworks_mese_sand_tube_inv.png]"..
"field[1.3,0.4;1,1;dist;radius;${dist}]"..
"button_exit[2,0.1;1,1;buttDone;Done]" ..
default.gui_bg..
default.gui_bg_img)
meta:set_string("infotext", "Adjustable Vacuuming Pneumatic Tube Segment")
end
})
end

2 comments on commit 8b4fbc3

@SwissalpS
Copy link
Contributor

@SwissalpS SwissalpS commented on 8b4fbc3 Nov 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

teleport_tube? isn't this about adjustable vacuum tubes?

Edit: pipeworks:mese_sand_tube_

@thomasrudin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, fixed in 4dff468

thanks 👍

Please sign in to comment.