mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
39 lines
995 B
Lua
39 lines
995 B
Lua
local bitser = require 'libs.bitser'
|
|
local fs = love.filesystem
|
|
|
|
local _settings = fs.read(CONFIG_FILE) ~= nil and bitser.loadLoveFile(CONFIG_FILE) or {}
|
|
local _defaultSettings = {
|
|
firstTime = true,
|
|
|
|
fullscreen = false,
|
|
music = true,
|
|
|
|
input = {
|
|
keys = {},
|
|
mobile = { -- Should not be changed for any reason, used for mobile only
|
|
enter = 'menu_decide',
|
|
f13 = 'up',
|
|
f14 = 'down',
|
|
f15 = 'left',
|
|
f16 = 'right',
|
|
f17 = 'rotate_left',
|
|
f18 = 'rotate_left2',
|
|
f19 = 'rotate_right',
|
|
f20 = 'rotate_right2',
|
|
}
|
|
}
|
|
}
|
|
|
|
SETTINGS = setmetatable(
|
|
{},
|
|
{
|
|
__index = function(_, k)
|
|
if _settings[k] == nil then _settings[k] = _defaultSettings[k] end
|
|
return _settings[k]
|
|
end,
|
|
__newindex = function(_, k, v)
|
|
_settings[k] = v
|
|
bitser.dumpLoveFile(CONFIG_FILE,_settings)
|
|
end
|
|
}
|
|
) |