mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 17:29:03 -06:00
BGM focus fix
This commit is contained in:
parent
042dbd220b
commit
f14ab2a328
2
main.lua
2
main.lua
@ -251,7 +251,7 @@ function love.joystickhat(joystick, hat, direction)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function love.focus(f)
|
function love.focus(f)
|
||||||
if f then
|
if f and (scene.title ~= "Game" or not scene.paused) then
|
||||||
resumeBGM()
|
resumeBGM()
|
||||||
else
|
else
|
||||||
pauseBGM()
|
pauseBGM()
|
||||||
|
@ -87,9 +87,9 @@ function GameScene:onInputPress(e)
|
|||||||
elseif e.input == "retry" then
|
elseif e.input == "retry" then
|
||||||
scene = GameScene(self.retry_mode, self.retry_ruleset)
|
scene = GameScene(self.retry_mode, self.retry_ruleset)
|
||||||
elseif e.input == "pause" and not (self.game.game_over or self.game.completed) then
|
elseif e.input == "pause" and not (self.game.game_over or self.game.completed) then
|
||||||
if not self.paused then pauseBGM()
|
|
||||||
else resumeBGM() end
|
|
||||||
self.paused = not self.paused
|
self.paused = not self.paused
|
||||||
|
if self.paused then pauseBGM()
|
||||||
|
else resumeBGM() end
|
||||||
elseif e.input == "menu_back" then
|
elseif e.input == "menu_back" then
|
||||||
scene = ModeSelectScene()
|
scene = ModeSelectScene()
|
||||||
elseif e.input and string.sub(e.input, 1, 5) ~= "menu_" then
|
elseif e.input and string.sub(e.input, 1, 5) ~= "menu_" then
|
||||||
|
Loading…
Reference in New Issue
Block a user