summaryrefslogtreecommitdiffhomepage
path: root/settings.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-01-14 23:03:35 +0100
committerAki <nthirtyone@gmail.com>2017-01-14 23:03:35 +0100
commitb80ba2f5a7bf7acbbbf14c1325fca8df3c39cac4 (patch)
treedbe0a5fc49691b2c40196a79a2be149cd6b1e410 /settings.lua
parentc0d3e5782bb5010730f22819c6e4a6ade9e64834 (diff)
downloadroflnauts-b80ba2f5a7bf7acbbbf14c1325fca8df3c39cac4.zip
roflnauts-b80ba2f5a7bf7acbbbf14c1325fca8df3c39cac4.tar.gz
roflnauts-b80ba2f5a7bf7acbbbf14c1325fca8df3c39cac4.tar.bz2
Fixed gamepad bug and overwrite bug
Diffstat (limited to 'settings.lua')
-rw-r--r--settings.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/settings.lua b/settings.lua
index ad8b8e5..e73b997 100644
--- a/settings.lua
+++ b/settings.lua
@@ -11,6 +11,7 @@ function Settings.load()
end
local getSettings = love.filesystem.load("settings")
Settings.current = getSettings()
+ Controller.reset()
local joysticksList = love.joystick.getJoysticks() -- local list for editing
for _,set in pairs(Settings.current) do
local isJoystick = set[7]
@@ -57,7 +58,9 @@ function Settings.change(n, left, right, up, down, attack, jump, joystick)
else
bool = false
end
+ -- Save current settings
Settings.current[n] = {left, right, up, down, attack, jump, bool}
- table.remove(Controller.sets, n)
- Controller.registerSet(left, right, up, down, attack, jump, joystick)
+ Settings.save()
+ -- Load settings
+ Settings.load()
end \ No newline at end of file