tile.lua: talk.track.color might not exist

This commit is contained in:
Franzi 2023-12-18 08:11:39 +01:00
parent 3dff4cb230
commit ccfb13313b

View file

@ -315,13 +315,15 @@ local function view_all_talks(starts, ends, config, x1, y1, x2, y2)
local time_width = font_running:width(talk_time, time_size)
text(font_text, col2 - 35 - time_width, y, talk_time, time_size, rgba(default_color, 1))
if show_track and talk.track and talk.track.color then
local r,g,b = helper.parse_rgb(talk.track.color)
a.add(anims.moving_image_raw(
S, E, resource.create_colored_texture(r,g,b,1),
col2 - 25, y,
col2 - 10, y + #title_lines*title_size + 3 + #info_lines*info_size
))
if show_track and talk.track then
if talk.track.color then
local r,g,b = helper.parse_rgb(talk.track.color)
a.add(anims.moving_image_raw(
S, E, resource.create_colored_texture(r,g,b,1),
col2 - 25, y,
col2 - 10, y + #title_lines*title_size + 3 + #info_lines*info_size
))
end
end
-- title