From 71f04b95da9a5dd2b7241b1cc920589b34d090ee Mon Sep 17 00:00:00 2001 From: MysticTempest Date: Mon, 31 Jan 2022 04:23:37 -0600 Subject: [PATCH] Fix mcl_signs automatic newline behavior once you have reached the 15char per line limit. --- mods/ITEMS/mcl_signs/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_signs/init.lua b/mods/ITEMS/mcl_signs/init.lua index e053c6e8..520490cd 100644 --- a/mods/ITEMS/mcl_signs/init.lua +++ b/mods/ITEMS/mcl_signs/init.lua @@ -65,6 +65,10 @@ local string_to_line_array = function(str) current = current + 1 tab[current] = "" linechar = 1 + elseif linechar == LINE_LENGTH + 1 then --proper newline long text + current = current + 1 + tab[current] = char + linechar = 1 else tab[current] = tab[current]..char linechar = linechar + 1 @@ -92,7 +96,7 @@ local generate_line = function(s, ypos) local width = 0 local chars = 0 local printed_char_width = CHAR_WIDTH + 1 - while chars < LINE_LENGTH and i <= #s do + while chars < LINE_LENGTH + 1 and i <= #s do local file = nil -- Get and render character if charmap[s:sub(i, i)] ~= nil then