简单封装保存统计、进度、设置的三个函数方便阅读代码

f11开关全屏时会自动保存设置
close #230
This commit is contained in:
MrZ626
2021-08-24 18:29:45 +08:00
parent aab45b1b14
commit 754545cc40
11 changed files with 36 additions and 35 deletions

View File

@@ -37,9 +37,8 @@ scene.widgetList={
RANKS[k]=nil
end
end
if FILE.save(RANKS,'conf/unlock')then
MES.new('check',text.importSuccess)
end
saveProgress()
MES.new('check',text.importSuccess)
else
MES.new('error',text.dataCorrupted)
end
@@ -49,9 +48,8 @@ scene.widgetList={
local D=parseCB()
if D and D.version==STAT.version then
TABLE.update(D,STAT)
if FILE.save(STAT,'conf/data')then
MES.new('check',text.importSuccess)
end
saveStats()
MES.new('check',text.importSuccess)
else
MES.new('error',text.dataCorrupted)
end
@@ -62,9 +60,8 @@ scene.widgetList={
if D then
TABLE.update(D,SETTING)
applySettings()
if FILE.save(SETTING,'conf/settings')then
MES.new('check',text.importSuccess)
end
saveSettings()
MES.new('check',text.importSuccess)
else
MES.new('error',text.dataCorrupted)
end
@@ -74,9 +71,8 @@ scene.widgetList={
local D=parseCB()
if D then
TABLE.update(D,VK_org)
if FILE.save(VK_org,'conf/virtualkey')then
MES.new('check',text.importSuccess)
end
FILE.save(VK_org,'conf/virtualkey')
MES.new('check',text.importSuccess)
else
MES.new('error',text.dataCorrupted)
end