1
0
Fork 0
mirror of https://github.com/Reuh/ubiquitousse.git synced 2025-10-27 09:09:30 +00:00

Added scene path prefix

This commit is contained in:
Reuh 2016-04-26 17:34:41 +02:00
parent 5268bd0c5b
commit 39198a3bd3

View file

@ -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,