node.lua: respect "use tracks" setting

This commit is contained in:
Franzi 2024-01-16 08:51:45 +01:00
parent 60cd315f0b
commit 99624b5d92

View file

@ -138,6 +138,7 @@ function node.render()
local track_x = 0
local track_y = NATIVE_HEIGHT - PADDING*0.3
local space_used_for_tracks = 0
if show_track then
for idx = 1, #tracks do
track = tracks[idx]
if track.color ~= json.null then
@ -175,6 +176,7 @@ function node.render()
track_x = track_x - track_width - PADDING
end
end
end
if #schedule == 0 then
font_text:write(col2, y, "Fetching talks...", TALK_FONT_SIZE, 1, 1, 1, 1)
@ -229,7 +231,7 @@ function node.render()
font_text:write(col2 - 15 - PADDING - time_width, y, talk_time, time_size, 1, 1, 1, 1)
-- track
if talk.track ~= json.null and talk.track.color ~= json.null then
if show_track and talk.track ~= json.null and talk.track.color ~= json.null then
local r,g,b = parse_rgb(talk.track.color)
resource.create_colored_texture(r,g,b,1):draw(col2 - 5 - PADDING, y, col2 - 10, y + #title_lines*TALK_FONT_SIZE + 3 + #info_lines*info_size)
end