Fixed text wrapping

master
E. Almqvist 5 years ago
parent d3770ef811
commit 5b8fdf5fc3
  1. 10
      gamemode/engine/derma/lib/cl_menu_dialogueBox.lua

@ -12,11 +12,12 @@ local padding_s = 4 * scale
local theme = Quantum.Client.Menu.GetAPI( "theme" )
function log.appendLinesToStr(tbl)
function log.appendLinesToStr(tbl, sep)
sep = sep || ""
local out = ""
for _, l in SortedPairs(tbl) do
if(l != nil) then
out = out .. l
out = out .. l .. sep
end
end
return out
@ -43,11 +44,10 @@ function log.genTextLinebreak( txt, font, maxW )
for _, wordI in pairs(wordsUsed) do
wordlist[wordI] = nil
end
else
-- append the last sentence
table.insert(lines, log.appendLinesToStr(wordlist))
end
end
-- append the last sentence
table.insert(lines, log.appendLinesToStr(wordlist, " "))
return lines
end

Loading…
Cancel
Save