aboutsummaryrefslogtreecommitdiffstats
path: root/Gamestates/Config.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Gamestates/Config.lua')
-rw-r--r--Gamestates/Config.lua17
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