From 39198a3bd322bce5f9186dbfe6b6a36b28ce39e9 Mon Sep 17 00:00:00 2001 From: Reuh Date: Tue, 26 Apr 2016 17:34:41 +0200 Subject: [PATCH] Added scene path prefix --- scene.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scene.lua b/scene.lua index 1e9c39e..89b5aef 100644 --- a/scene.lua +++ b/scene.lua @@ -37,6 +37,10 @@ scene = { -- @impl abstract stack = {}, + --- A prefix for scene modules names + -- @impl abstract + prefix = "", + --- Creates and returns a new Scene object. -- @impl abstract new = function() @@ -60,7 +64,7 @@ scene = { -- @impl abstract switch = function(scenePath) if scene.current then scene.current.exit() end - scene.current = dofile(getPath(scenePath)) + scene.current = dofile(getPath(scene.prefix..scenePath)) local i = #scene.stack scene.stack[math.max(i, 1)] = scene.current end, @@ -73,7 +77,7 @@ scene = { -- @impl abstract push = function(scenePath) if scene.current then scene.current.suspend() end - scene.current = dofile(getPath(scenePath)) + scene.current = dofile(getPath(scene.prefix..scenePath)) table.insert(scene.stack, scene.current) end,