Fix book formspec to word-wrap lines
authortenplus1 <tenplus1@users.noreply.github.com>
Wed, 2 Mar 2016 21:26:16 +0000 (21:26 +0000)
committerparamat <mat.gregory@virginmedia.com>
Thu, 3 Mar 2016 00:37:07 +0000 (00:37 +0000)
Books still don't wrap long lines of text properly so until this has been sorted out I suggest reverting back to a previous working formspec which lets players read books properly until a fix is found (and maybe scrollbars added to texarea's).  Also adding a recipe to blank written books.

mods/default/craftitems.lua

index bb8c445cd77c29d9491a2fbb744f777b8f94cfba..c096f7fd483a1cf8a48d82798b508b0136740ecd 100644 (file)
@@ -32,8 +32,8 @@ local function book_on_use(itemstack, user, pointed_thing)
                        default.gui_bg_img..
                        "label[0.5,0.5;by "..owner.."]"..
                        "label[0.5,0;"..minetest.formspec_escape(title).."]"..
-                       "tableoptions[background=#00000000;highlight=#00000000;border=false]"..
-                       "table[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text):gsub("\n", ",")..";1]"
+                       "textarea[0.5,1.5;7.5,7;text;;"..
+                               minetest.formspec_escape(text).."]"
        end
        minetest.show_formspec(user:get_player_name(), "default:book", formspec)
 end