mirror of
https://github.com/Kunsi/scheduled-plugin-pretalx-broadcast-tools.git
synced 2024-11-22 01:51:03 +00:00
info: respect newlines
This commit is contained in:
parent
d17d8f1f23
commit
13b156b6fc
1 changed files with 34 additions and 25 deletions
13
tile.lua
13
tile.lua
|
@ -476,12 +476,13 @@ local function view_info(starts, ends, config, x1, y1, x2, y2)
|
|||
info_text = text_b
|
||||
end
|
||||
|
||||
local y = 0
|
||||
for line in string.gmatch(info_text.."\n", "([^\n]*)\n") do
|
||||
local lines = wrap(
|
||||
info_text,
|
||||
line,
|
||||
font_text, font_size, a.width
|
||||
)
|
||||
|
||||
local y = 0
|
||||
for idx = 1, #lines do
|
||||
local x = 0
|
||||
local w = font_text:width(lines[idx], font_size)
|
||||
|
@ -495,12 +496,19 @@ local function view_info(starts, ends, config, x1, y1, x2, y2)
|
|||
text(font_text, x, y, lines[idx], font_size, rgba(default_color,.8))
|
||||
y = y + font_size
|
||||
end
|
||||
end
|
||||
|
||||
for now in api.frame_between(starts, ends) do
|
||||
if animate then
|
||||
a.draw(now, x1, y1, x2, y2)
|
||||
else
|
||||
local y = 0
|
||||
for line in string.gmatch(info_text.."\n", "([^\n]*)\n") do
|
||||
local lines = wrap(
|
||||
line,
|
||||
font_text, font_size, a.width
|
||||
)
|
||||
|
||||
for idx = 1, #lines do
|
||||
local x = 0
|
||||
local w = font_text:width(lines[idx], font_size)
|
||||
|
@ -517,6 +525,7 @@ local function view_info(starts, ends, config, x1, y1, x2, y2)
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function M.task(starts, ends, config, x1, y1, x2, y2)
|
||||
check_next_talks()
|
||||
|
|
Loading…
Reference in a new issue