Temproraily allowing save

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-05-25 00:39:11 +07:00
parent 1b5c736c95
commit cf1063c83b
3 changed files with 15 additions and 16 deletions

View File

@@ -38,20 +38,18 @@ function love.load()
math.randomseed(os.time())
require "settings"
if SETTINGS.input.virtual == nil then
SETTINGS.input.virtual = {
{type='button',x= 70,y=280,key= 'up',r=45,iconSize=60,alpha=0.4},
{type='button',x= 70,y=430,key= 'down',r=45,iconSize=60,alpha=0.4},
{type='button',x= -5,y=355,key= 'left',r=45,iconSize=60,alpha=0.4},
{type='button',x= 145,y=355,key= 'right',r=45,iconSize=60,alpha=0.4},
{type='button',x=640- -5,y=355,key= 'rotate_left',r=45,iconSize=60,alpha=0.4},
{type='button',x=640-145,y=355,key= 'rotate_left2',r=45,iconSize=60,alpha=0.4},
{type='button',x=640- 70,y=430,key= 'rotate_right',r=45,iconSize=60,alpha=0.4},
{type='button',x=640- 70,y=280,key='rotate_right2',r=45,iconSize=60,alpha=0.4},
{type='button',x=320- 40,y=420,key= 'menu_decide',r=35,iconSize=60,alpha=0.4},
{type='button',x=320+ 40,y=420,key= 'menu_back',r=35,iconSize=60,alpha=0.4},
}
end
-- SETTINGS.input.virtual = {
-- {type='button',x= 70,y=280,key= 'up',r=45,iconSize=60,alpha=0.4},
-- {type='button',x= 70,y=430,key= 'down',r=45,iconSize=60,alpha=0.4},
-- {type='button',x= -5,y=355,key= 'left',r=45,iconSize=60,alpha=0.4},
-- {type='button',x= 145,y=355,key= 'right',r=45,iconSize=60,alpha=0.4},
-- {type='button',x=640- -5,y=355,key= 'rotate_left',r=45,iconSize=60,alpha=0.4},
-- {type='button',x=640-145,y=355,key= 'rotate_left2',r=45,iconSize=60,alpha=0.4},
-- {type='button',x=640- 70,y=430,key= 'rotate_right',r=45,iconSize=60,alpha=0.4},
-- {type='button',x=640- 70,y=280,key='rotate_right2',r=45,iconSize=60,alpha=0.4},
-- {type='button',x=320- 40,y=420,key= 'menu_decide',r=35,iconSize=60,alpha=0.4},
-- {type='button',x=320+ 40,y=420,key= 'menu_back',r=35,iconSize=60,alpha=0.4},
-- }
-- Window stuffs
love.window.setMode(love.graphics.getWidth(), love.graphics.getHeight(), {resizable = true});

View File

@@ -59,8 +59,9 @@ buttonList = {
)
if selection == 1 then
SETTINGS.input.virtual = VCTRL.exportAll()
SETTINGS.__force_saving__()
-- love.window.showMessageBox("Saved!", "Your changes was saved!")
exitSceneFunc()
elseif selection == 2 then
VCTRL.clearAll()

View File

@@ -32,7 +32,7 @@ local _defaultSettings = {
}
SETTINGS = setmetatable(
{},
{__force_saving__ = function() bitser.dumpLoveFile(CONFIG_FILE,_settings) end},
{
__index = function(_, k)
return _settings[k] == nil and _defaultSettings[k] or _settings[k]