diff options
-rw-r--r-- | main.lua | 2 | ||||
-rw-r--r-- | not/Settings.lua (renamed from settings.lua) | 12 |
2 files changed, 10 insertions, 4 deletions
@@ -28,7 +28,7 @@ require "not.World" require "camera" require "not.Menu" require "controller" -require "settings" +require "not.Settings" -- Temporary debug debug = false diff --git a/settings.lua b/not/Settings.lua index e73b997..e3316f9 100644 --- a/settings.lua +++ b/not/Settings.lua @@ -1,5 +1,9 @@ -Settings = {} -Settings.current = {} +--- `Settings` +-- Stores, loads, saves and changes game settings including Controller sets. +Settings = { + current = {} +} + function Settings.load() if Controller then if not love.filesystem.exists("settings") then @@ -27,6 +31,7 @@ function Settings.load() end end end + function Settings.save() local new = love.filesystem.newFile("settings") local sets = Settings.current @@ -51,6 +56,7 @@ function Settings.save() new:write(string) new:close() end + function Settings.change(n, left, right, up, down, attack, jump, joystick) local bool if joystick then @@ -63,4 +69,4 @@ function Settings.change(n, left, right, up, down, attack, jump, joystick) Settings.save() -- Load settings Settings.load() -end
\ No newline at end of file +end |