Save chest label when exiting formspec
authorZefram <zefram@fysh.org>
Thu, 24 Apr 2014 16:42:35 +0000 (17:42 +0100)
committerShadowNinja <shadowninja@minetest.net>
Thu, 24 Apr 2014 20:35:41 +0000 (16:35 -0400)
When using the form to edit a chest label, apply the edited label whenever the
form is submitted with the text field included, rather than only if the form's
specific "finished editing" button is used.  This supports the natural use of
<ret> to indicate that text editing is complete, which works with other text
editing forms such as that for signs.

technic_chests/register.lua

index 765a9a5d8061971cd2b0b17961087c01e64cfbe6..204ca3ceea8b745b8e450bfe57582515746260d2 100644 (file)
@@ -69,7 +69,7 @@ local function get_receive_fields(name, data)
                if fields.edit_infotext then
                        page = "edit_infotext"
                end
-               if fields.save_infotext then
+               if fields.infotext_box then
                        meta:set_string("infotext", fields.infotext_box)
                end
                local formspec = data.formspec