mirror of
				https://github.com/Reuh/ubiquitousse.git
				synced 2025-10-27 17:19: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 | ||||
| 	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, | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Reuh
						Reuh