diff options
author | Fallstar <fallstar@live.fr> | 2014-05-25 00:05:22 +0000 |
---|---|---|
committer | Fallstar <fallstar@live.fr> | 2014-05-25 00:05:22 +0000 |
commit | 6ba298e0b0062665f4ca2295798d21eed678726a (patch) | |
tree | 2eae9dcd543f5dcb978af6b1b501244a837900da /Gamestates/Config.lua | |
parent | 9182ae1642a750fd5a8a574a6bbd1a36c105d9d9 (diff) | |
download | Mastermind-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/Config.lua')
-rw-r--r-- | Gamestates/Config.lua | 17 |
1 files changed, 12 insertions, 5 deletions
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 |