summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-07-12 11:09:05 +0200
committerAki <nthirtyone@gmail.com>2017-07-12 11:09:05 +0200
commit6c6e2fe6ec84ec57f6336fa9d6e4136c0e1c9513 (patch)
treea93776e6f624773cbf11aeb53ed4c4ef05500d4f
parentea694c3659c801effaaf3361d3713f20517de3f5 (diff)
downloadroflnauts-6c6e2fe6ec84ec57f6336fa9d6e4136c0e1c9513.zip
roflnauts-6c6e2fe6ec84ec57f6336fa9d6e4136c0e1c9513.tar.gz
roflnauts-6c6e2fe6ec84ec57f6336fa9d6e4136c0e1c9513.tar.bz2
All changeScene calls replaced with proper SceneManager calls
-rw-r--r--config/menus/select.lua4
-rw-r--r--main.lua5
-rw-r--r--not/World.lua4
3 files changed, 4 insertions, 9 deletions
diff --git a/config/menus/select.lua b/config/menus/select.lua
index 431e620..037b798 100644
--- a/config/menus/select.lua
+++ b/config/menus/select.lua
@@ -36,7 +36,7 @@ return {
:set("active", function (self)
local nauts = naut_Selector:getFullSelection(false)
if #nauts > 1 then
- changeScene(World(MAP, nauts))
+ sceneManager:changeScene(World(MAP, nauts))
end
end)
,
@@ -73,4 +73,4 @@ return {
end
end)
,
-} \ No newline at end of file
+}
diff --git a/main.lua b/main.lua
index 869cac8..ac04383 100644
--- a/main.lua
+++ b/main.lua
@@ -15,11 +15,6 @@ end
musicPlayer = require "not.MusicPlayer"()
sceneManager = require "not.SceneManager"()
--- TODO: This is a temporary wrapper! Remove all use cases of `changeScene()`.
-function changeScene (scene)
- sceneManager:changeScene(scene)
-end
-
-- Require
require "iconsList"
require "not.World"
diff --git a/not/World.lua b/not/World.lua
index be29557..8108a8a 100644
--- a/not/World.lua
+++ b/not/World.lua
@@ -195,7 +195,7 @@ function World:onNautKilled (naut)
self:createRay(naut)
local nauts = self:getNautsPlayable()
if self.lastNaut then
- changeScene(Menu())
+ sceneManager:changeScene(Menu())
elseif #nauts < 2 then
self.lastNaut = true
naut:playSound(5, true)
@@ -391,7 +391,7 @@ function World:controlpressed (set, action, key)
table.insert(nauts, {naut.name, naut:getControllerSet()})
end
local new = World(map, nauts)
- changeScene(new)
+ sceneManager:changeScene(new)
end
for k,naut in pairs(self:getNautsAll()) do
naut:controlpressed(set, action, key)