Skip to content

Commit

Permalink
EventLoop: use non-deprecated OSD API
Browse files Browse the repository at this point in the history
  • Loading branch information
torque committed May 10, 2022
1 parent 7be2462 commit 04171b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/EventLoop.moon
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class EventLoop
@displayRequested = false
@needsRedraw = false

@canvas = mp.create_osd_overlay "ass-events"

@updateTimer = mp.add_periodic_timer settings['redraw-period'], @\redraw
@updateTimer\stop!

Expand Down Expand Up @@ -93,8 +95,11 @@ class EventLoop
uiElement\resize!

redraw: ( forceRedraw ) =>

clickPending = Mouse\update!
if Window\update!
@canvas.res_x = Window.w
@canvas.res_y = Window.h
@resize!

for index, zone in ipairs @activityZones
Expand All @@ -108,5 +113,6 @@ class EventLoop
@needsRedraw = true

if @needsRedraw
mp.set_osd_ass Window.w, Window.h, table.concat @script, '\n'
@canvas.data = table.concat @script, '\n'
@canvas\update!
@needsRedraw = false

0 comments on commit 04171b6

Please sign in to comment.