文件模块重构

This commit is contained in:
MrZ626
2020-12-14 18:33:48 +08:00
parent b6b87f5480
commit 654a5b9dfe
17 changed files with 76 additions and 238 deletions

View File

@@ -82,7 +82,7 @@ function keyDown.calculator(k)
RANKS[name]=M.score and 0 or 6
end
end
FILE.saveUnlock()
FILE.save(RANKS,"unlock")
LOG.print("\68\69\86\58\85\78\76\79\67\75\65\76\76","message")
SFX.play("clear_2")
elseif v==1379e8+2626e4+1379 then

View File

@@ -1,5 +1,5 @@
function sceneBack.lang()
FILE.saveSetting()
FILE.save(SETTING,"settings")
end
local function setLang(n)return function()SETTING.lang=n LANG.set(n)end end

View File

@@ -70,7 +70,7 @@ function Tmr.load()
for k,v in next,m do
M[k]=v
end
M.records=FILE.loadRecord(m.name)or M.score and{}
M.records=FILE.load(m.name)or M.score and{}
if M.score then
if RANKS[M.name]==6 then
RANKS[M.name]=0

View File

@@ -117,7 +117,9 @@ function sceneBack.pause()
if not GAME.replaying then
mergeStat(STAT,PLAYERS[1].stat)
end
FILE.saveData()
if not GAME.result then
FILE.save(STAT,"data")
end
end
function keyDown.pause(key)

View File

@@ -7,7 +7,7 @@ function sceneInit.setting_game()
BG.set("space")
end
function sceneBack.setting_game()
FILE.saveSetting()
FILE.save(SETTING,"settings")
end
function Pnt.setting_game()

View File

@@ -13,7 +13,7 @@ function sceneInit.setting_key()
}
end
function sceneBack.setting_key()
FILE.saveKeyMap()
FILE.save(keyMap,"key")
end
function keyDown.setting_key(key)

View File

@@ -13,7 +13,7 @@ function sceneInit.setting_sound()
BG.set("space")
end
function sceneBack.setting_sound()
FILE.saveSetting()
FILE.save(SETTING,"settings")
end
function mouseDown.setting_sound(x,y)

View File

@@ -13,7 +13,7 @@ function sceneInit.setting_touch()
}
end
function sceneBack.setting_touch()
FILE.saveVK()
FILE.save(VK_org,"virtualkey")
end
local function onVK_org(x,y)

View File

@@ -2,7 +2,7 @@ function sceneInit.setting_video()
BG.set("space")
end
function sceneBack.setting_video()
FILE.saveSetting()
FILE.save(SETTING,"settings")
end
WIDGET.init("setting_video",{