Skip to content

Commit 04171b6

Browse files
committed
EventLoop: use non-deprecated OSD API
1 parent 7be2462 commit 04171b6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/EventLoop.moon

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ class EventLoop
77
@displayRequested = false
88
@needsRedraw = false
99

10+
@canvas = mp.create_osd_overlay "ass-events"
11+
1012
@updateTimer = mp.add_periodic_timer settings['redraw-period'], @\redraw
1113
@updateTimer\stop!
1214

@@ -93,8 +95,11 @@ class EventLoop
9395
uiElement\resize!
9496

9597
redraw: ( forceRedraw ) =>
98+
9699
clickPending = Mouse\update!
97100
if Window\update!
101+
@canvas.res_x = Window.w
102+
@canvas.res_y = Window.h
98103
@resize!
99104

100105
for index, zone in ipairs @activityZones
@@ -108,5 +113,6 @@ class EventLoop
108113
@needsRedraw = true
109114

110115
if @needsRedraw
111-
mp.set_osd_ass Window.w, Window.h, table.concat @script, '\n'
116+
@canvas.data = table.concat @script, '\n'
117+
@canvas\update!
112118
@needsRedraw = false

0 commit comments

Comments
 (0)