mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Temproraily allowing save
This commit is contained in:
26
main.lua
26
main.lua
@@ -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});
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user