mirror of
https://github.com/Reuh/ubiquitousse.git
synced 2025-10-28 01:29:31 +00:00
Added scene path prefix
This commit is contained in:
parent
5268bd0c5b
commit
39198a3bd3
1 changed files with 6 additions and 2 deletions
|
|
@ -37,6 +37,10 @@ scene = {
|
||||||
-- @impl abstract
|
-- @impl abstract
|
||||||
stack = {},
|
stack = {},
|
||||||
|
|
||||||
|
--- A prefix for scene modules names
|
||||||
|
-- @impl abstract
|
||||||
|
prefix = "",
|
||||||
|
|
||||||
--- Creates and returns a new Scene object.
|
--- Creates and returns a new Scene object.
|
||||||
-- @impl abstract
|
-- @impl abstract
|
||||||
new = function()
|
new = function()
|
||||||
|
|
@ -60,7 +64,7 @@ scene = {
|
||||||
-- @impl abstract
|
-- @impl abstract
|
||||||
switch = function(scenePath)
|
switch = function(scenePath)
|
||||||
if scene.current then scene.current.exit() end
|
if scene.current then scene.current.exit() end
|
||||||
scene.current = dofile(getPath(scenePath))
|
scene.current = dofile(getPath(scene.prefix..scenePath))
|
||||||
local i = #scene.stack
|
local i = #scene.stack
|
||||||
scene.stack[math.max(i, 1)] = scene.current
|
scene.stack[math.max(i, 1)] = scene.current
|
||||||
end,
|
end,
|
||||||
|
|
@ -73,7 +77,7 @@ scene = {
|
||||||
-- @impl abstract
|
-- @impl abstract
|
||||||
push = function(scenePath)
|
push = function(scenePath)
|
||||||
if scene.current then scene.current.suspend() end
|
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)
|
table.insert(scene.stack, scene.current)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue