warn with osd_message

This commit is contained in:
Ren Tatsumoto 2020-09-06 19:01:32 +03:00
parent 7c4e61a8ba
commit 9863bc6b8e

View file

@ -235,7 +235,7 @@ menu.set_time_sub = function(property)
local time_pos = mp.get_property_number(string.format("sub-%s", property)) local time_pos = mp.get_property_number(string.format("sub-%s", property))
if time_pos == nil then if time_pos == nil then
menu.update("Warning: No subtitles visible.") mp.osd_message("Warning: No subtitles visible.", 2)
return return
end end
@ -243,7 +243,7 @@ menu.set_time_sub = function(property)
menu.update() menu.update()
end end
menu.update = function(message) menu.update = function()
local osd = OSD:new():size(config.font_size):align(4) local osd = OSD:new():size(config.font_size):align(4)
osd:bold('Clip creator'):newline():newline() osd:bold('Clip creator'):newline():newline()
@ -262,10 +262,6 @@ menu.update = function(message)
osd:tab():bold('o: '):append('Open `streamable.com`'):newline() osd:tab():bold('o: '):append('Open `streamable.com`'):newline()
osd:tab():bold('ESC: '):append('Close'):newline() osd:tab():bold('ESC: '):append('Close'):newline()
if message ~= nil then
osd:newline():append(message):newline()
end
osd:draw() osd:draw()
end end