aboutsummaryrefslogtreecommitdiffstats
path: root/Gamestates
diff options
context:
space:
mode:
authorFallstar <fallstar@live.fr>2014-05-25 00:05:22 +0000
committerFallstar <fallstar@live.fr>2014-05-25 00:05:22 +0000
commit6ba298e0b0062665f4ca2295798d21eed678726a (patch)
tree2eae9dcd543f5dcb978af6b1b501244a837900da /Gamestates
parent9182ae1642a750fd5a8a574a6bbd1a36c105d9d9 (diff)
downloadMastermind-6ba298e0b0062665f4ca2295798d21eed678726a.tar.gz
Mastermind-6ba298e0b0062665f4ca2295798d21eed678726a.tar.bz2
Mastermind-6ba298e0b0062665f4ca2295798d21eed678726a.tar.xz
Mastermind-6ba298e0b0062665f4ca2295798d21eed678726a.zip
Mute is now Config.Mute and really dirty, but does the job. Updated TODO as well.
Diffstat (limited to 'Gamestates')
-rw-r--r--Gamestates/About.lua3
-rw-r--r--Gamestates/Config.lua17
-rw-r--r--Gamestates/Menu.lua2
-rw-r--r--Gamestates/Multiplayer/InGame.lua2
-rw-r--r--Gamestates/Solo.lua2
5 files changed, 18 insertions, 8 deletions
diff --git a/Gamestates/About.lua b/Gamestates/About.lua
index d65b245..3f267a7 100644
--- a/Gamestates/About.lua
+++ b/Gamestates/About.lua
@@ -26,5 +26,8 @@ function About:draw()
Gui.core.draw()
end
+function About:leave()
+ Menu.Music:stop()
+end
return About
diff --git a/Gamestates/Config.lua b/Gamestates/Config.lua
index a64650e..c8c8fbe 100644
--- a/Gamestates/Config.lua
+++ b/Gamestates/Config.lua
@@ -27,6 +27,9 @@ function Config:loadUserConfig() -- Load user config file
if not Config.player_name.text then
Config.player_name.text = "BlueMind" -- Set default player_name if nothing was found in the user config file
end
+ if not Config.Mute then
+ Config.Mute = false
+ end
end
function Config:enter()
@@ -42,12 +45,14 @@ function Config:update(dt)
if Gui.Button{text = "Save", size = {Utils.percentCoordinates(60, 10)}} then
love.filesystem.write( "userConfig", "PLAYERNAME: " .. Config.player_name.text) -- Write the new name to the config file
end
- if Gui.Button{text = "Mute", size = {Utils.percentCoordinates(40, 10)}} then
- if Mute == false then
- Mute = true
+ if Config.Mute == false then
+ if Gui.Button{text = "Mute", size = {Utils.percentCoordinates(40, 10)}} then
+ Config.Mute = true
Menu.Music:stop()
- else
- Mute = false
+ end
+ else
+ if Gui.Button{text = "Unmute", size = {Utils.percentCoordinates(40, 10)}} then
+ Config.Mute = false
Menu.Music:play()
end
end
@@ -56,6 +61,7 @@ end
+
-- Quickie's functions
function Config:draw()
Gui.core.draw()
@@ -72,6 +78,7 @@ end
function Config:leave()
love.keyboard.setTextInput(false)
+ Menu.Music:stop()
end
return Config
diff --git a/Gamestates/Menu.lua b/Gamestates/Menu.lua
index 7a7b32c..cf05d16 100644
--- a/Gamestates/Menu.lua
+++ b/Gamestates/Menu.lua
@@ -48,7 +48,7 @@ function Menu:enter()
-- End
Menu.Music = love.audio.newSource("Resources/BlueMind.ogg")
Menu.Music:setLooping(true)
- if Mute == false then
+ if Config.Mute == false then
Menu.Music:play()
end
end
diff --git a/Gamestates/Multiplayer/InGame.lua b/Gamestates/Multiplayer/InGame.lua
index 20bf6c4..ba47505 100644
--- a/Gamestates/Multiplayer/InGame.lua
+++ b/Gamestates/Multiplayer/InGame.lua
@@ -36,7 +36,7 @@ function InGame:enter(Local) -- Initialize or reset variables when entering game
InGame.Musiclowlife = love.audio.newSource("Resources/BlueMind midlife.ogg")
InGame.Music = Menu.Music
InGame.Music:setLooping(true)
- if Mute == false then
+ if Config.Mute == false then
InGame.Music:rewind()
end
end
diff --git a/Gamestates/Solo.lua b/Gamestates/Solo.lua
index 3e19152..2a73f1f 100644
--- a/Gamestates/Solo.lua
+++ b/Gamestates/Solo.lua
@@ -28,7 +28,7 @@ function Solo:enter() -- Initialize or reset variables when entering game
Solo.Music = Menu.Music
Solo.Music:setLooping(true)
- if Mute == false then
+ if Config.Mute == false then
Solo.Music:rewind()
end
end