From dc58cb606d9dfb492a759c626c05d40b607786ca Mon Sep 17 00:00:00 2001 From: DomtronVox Date: Mon, 4 May 2020 21:44:55 -0400 Subject: [PATCH] Fixed the quest info textarea element so it is readonly when displaying a quest's description. Also removed the word wrap function because it was not used that I could tell and minetest provides one in the API so it isn't needed. --- formspecs.lua | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/formspecs.lua b/formspecs.lua index c573008..7114455 100644 --- a/formspecs.lua +++ b/formspecs.lua @@ -111,34 +111,6 @@ function quests.create_config(playername, integrated) return formspec end -local function wordwrap(text, linelength) - local lines = text:split("\n") - local ret = "" - for i = 1,#lines do - local line = lines[i] - while (#line > linelength) do - local split = false - local j = linelength - while (not split) do - if (string.sub(line, j, j) == " ") then - split = true - ret = ret .. string.sub(line, 1, j) .. "\n" - line = string.sub(line, j + 1) - end - if (j <= 1) then - break - end - j = j - 1 - end - if (not split) then - ret = ret .. string.sub(line, 1, linelength) .. "\n" - line = string.sub(line, linelength); - end - end - ret = ret .. line .. "\n" - end - return ret -end -- construct the info formspec function quests.create_info(playername, questname, taskid, integrated) @@ -159,7 +131,7 @@ function quests.create_info(playername, questname, taskid, integrated) end if quest.simple then - formspec = formspec .. "textarea[.4,1;7.2,7;_;;" .. minetest.formspec_escape(quest.description) .. "]" + formspec = formspec .. "textarea[.4,1;7.2,7;;;" .. minetest.formspec_escape(quest.description) .. "]" else quests.formspec_lists[playername].taskid = nil local taskidlist = {}