It can b easily made to right click and have input text form for any object. Like sign or teleport pad[mod].
But i do need to call that input function directly, because right click option is already occupied (and there's no shift_right_click)
I want to have on_punch and within it call the input form.
Was foolin around a bit and havent found a solution. Could just dig the source, but maybe someone already knows the straight answer? function name and parameters :)
Edit: i found a solution, is workin, but not so elegant i think....
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[12,9;]"..
"list[current_name;main;0,0;12,4;]"..
"list[current_player;main;0,5;8,4;]")
end,
After a node is punched i change formspec to be sign like. Next right click will pop up input form, and after receive i restore original formspec of the object (chest in this example).
this is how it works:
http://www.youtube.com/watch?v=FN3sbRsOYWo&feature=youtu.be
Anybody with another idea/solution?