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

@ -85,11 +85,13 @@ function UI:_DrawMessages(messages)
else
GuiImage(gui, self:_GenID(), 0, 0, "mods/noita-mapcap/files/ui-gfx/hint-16x16.png", 1, 1, 0, 0, 0, "")
end
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