From c8204f044f8b22567bc504229deaed12e248aa7f Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 2 Apr 2021 22:24:37 +0200 Subject: [PATCH] feat: add a callback to restored scenes --- sonic-radiance.love/core/modules/scenes.lua | 4 ++++ sonic-radiance.love/core/scenemanager.lua | 1 + 2 files changed, 5 insertions(+) diff --git a/sonic-radiance.love/core/modules/scenes.lua b/sonic-radiance.love/core/modules/scenes.lua index 7559768..83c9306 100644 --- a/sonic-radiance.love/core/modules/scenes.lua +++ b/sonic-radiance.love/core/modules/scenes.lua @@ -56,6 +56,10 @@ function Scene:clear() -- TODO: send automatic cleanups to the different elements of the scene end +function Scene:restored() + +end + -- UPDATE FUNCTIONS -- Handle stuff that happens every steps diff --git a/sonic-radiance.love/core/scenemanager.lua b/sonic-radiance.love/core/scenemanager.lua index a760f26..1038b64 100644 --- a/sonic-radiance.love/core/scenemanager.lua +++ b/sonic-radiance.love/core/scenemanager.lua @@ -54,6 +54,7 @@ function SceneManager:setStoredScene(name) if storedScene ~= nil then self.currentScene = storedScene self.storage[name] = nil + self.currentScene:restored() end end