From 6a5eca342c3bd324da8e4fb216ce1017c3d2ac14 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 16 Dec 2022 19:35:29 -0800 Subject: [PATCH] a new event: receiving code changes from the driver --- 0001-on | 1 + live.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/0001-on b/0001-on index 596678c..cb092dc 100644 --- a/0001-on +++ b/0001-on @@ -4,6 +4,7 @@ on = { -- supported handlers: -- on.initialize (see love.load) -- on.quit + -- on.code_changed (runs after every time the driver sends a new definition) -- on.draw -- on.update -- on.resize diff --git a/live.lua b/live.lua index 28a9c3e..159a1b9 100644 --- a/live.lua +++ b/live.lua @@ -148,6 +148,7 @@ function live.update(dt) local buf = live.receive() if buf then live.run(buf) + if on.code_changed then on.code_changed() end end Live.Previous_read = Current_time end