Handle newline characters in UI messages

This commit is contained in:
David Vogel 2022-07-28 11:55:34 +02:00
parent 5d7f258973
commit 6a016ed0b9

View File

@ -89,7 +89,9 @@ function UI:_DrawMessages(messages)
GuiLayoutBeginVertical(gui, 0, 0, false, 0, 0)
if type(message.Lines) == "table" then
for _, line in ipairs(message.Lines) do
GuiText(gui, 0, 0, tostring(line)) posY = posY + 11
for splitLine in tostring(line):gmatch("[^\n]+") do
GuiText(gui, 0, 0, splitLine) posY = posY + 11
end
end
end
if type(message.Actions) == "table" then