word-wrap book text
authortenplus1 <tenplus1@users.noreply.github.com>
Sun, 7 Jun 2015 17:48:32 +0000 (18:48 +0100)
committerest31 <MTest31@outlook.com>
Mon, 8 Jun 2015 14:29:44 +0000 (16:29 +0200)
This change word-wraps text when reading a book.

mods/default/craftitems.lua

index dd5ae51fdf72ac24e517f29338b6d43a73820668..facff57e7b749e2c1b506befdc1c2bdc1043cb51 100644 (file)
@@ -28,8 +28,9 @@ local function book_on_use(itemstack, user, pointed_thing)
                        "button_exit[2.5,7.5;3,1;save;Save]"
        else
                formspec = "size[8,8]"..default.gui_bg..
-                       "label[1,0.5;"..minetest.formspec_escape(title).."]"..
-                       "label[0.5,1.5;"..minetest.formspec_escape(text).."]"
+                       "label[0.5,0.5;by "..owner.."]"..
+                       "label[0.5,0;"..minetest.formspec_escape(title).."]"..
+                       "textarea[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text)..";]"
        end
        minetest.show_formspec(user:get_player_name(), "default:book", formspec)
 end