FILE模块修改,并将所有文件分类整理方便未来调整

This commit is contained in:
MrZ626
2020-12-13 23:38:06 +08:00
parent fdbbdfea05
commit d5dcc78acd
15 changed files with 52 additions and 29 deletions

View File

@@ -1498,7 +1498,7 @@ end
--------------------------<Events>--------------------------
local function gameOver()--Save record
if GAME.replaying then return end
FILE.save(STAT,"data")
FILE.save(STAT,"conf/data")
local M=GAME.curMode
local R=M.getRank
if R then
@@ -1528,7 +1528,7 @@ local function gameOver()--Save record
end
end
if needSave then
FILE.save(RANKS,"unlock","q")
FILE.save(RANKS,"conf/unlock","q")
end
local D=M.score(P)
local L=M.records
@@ -1546,7 +1546,7 @@ local function gameOver()--Save record
D.date=os.date("%Y/%m/%d %H:%M")
ins(L,p+1,D)
if L[11]then L[11]=nil end
FILE.save(L,M.name,"l")
FILE.save(L,"record/"..M.name,"l")
end
end
end

View File

@@ -86,7 +86,7 @@ function scene.keyDown(k)
RANKS[name]=M.score and 0 or 6
end
end
FILE.save(RANKS,"unlock")
FILE.save(RANKS,"conf/unlock")
LOG.print("\68\69\86\58\85\78\76\79\67\75\65\76\76","message")
SFX.play("clear_2")
elseif v%1==0 and v>=8001 and v<=8012 then

View File

@@ -1,7 +1,7 @@
local scene={}
function scene.sceneBack()
FILE.save(SETTING,"settings")
FILE.save(SETTING,"conf/settings")
end
local function setLang(n)return function()SETTING.lang=n LANG.set(n)end end

View File

@@ -140,7 +140,7 @@ function scene.update()
for k,v in next,m do
M[k]=v
end
M.records=FILE.load(m.name)or M.score and{}
M.records=FILE.load(m.name..".dat")or M.score and{}
-- M.icon=gc.newImage("media/image/modeIcon/"..m.icon..".png")
-- M.icon=gc.newImage("media/image/modeIcon/custom.png")
elseif phase==8 then

View File

@@ -11,7 +11,7 @@ local function tick_httpREQ_newLogin(task)
LOG.print(text.loginSuccessed)
ACCOUNT.email=res.email
ACCOUNT.auth_token=res.auth_token
FILE.save(ACCOUNT,"account","q")
FILE.save(ACCOUNT,"conf/account","q")
httpRequest(
TICK.httpREQ_getAccessToken,

View File

@@ -127,7 +127,7 @@ function scene.sceneBack()
STAT.todayTime=STAT.todayTime+PLAYERS[1].stat.time
end
if not GAME.result then
FILE.save(STAT,"data")
FILE.save(STAT,"conf/data")
end
end

View File

@@ -48,7 +48,7 @@ scene.widgetList={
local D=parseCB()
if D then
addToTable(D,RANKS)
FILE.save(RANKS,"unlock")
FILE.save(RANKS,"conf/unlock")
else
LOG.print(text.importSuccess,COLOR.green)
end
@@ -57,7 +57,7 @@ scene.widgetList={
local D=parseCB()
if D then
addToTable(D,STAT)
FILE.save(STAT,"data")
FILE.save(STAT,"conf/data")
else
LOG.print(text.importSuccess,COLOR.green)
end
@@ -66,7 +66,7 @@ scene.widgetList={
local D=parseCB()
if D then
addToTable(D,SETTING)
FILE.save(SETTING,"settings")
FILE.save(SETTING,"conf/settings")
else
LOG.print(text.importSuccess,COLOR.green)
end
@@ -75,7 +75,7 @@ scene.widgetList={
local D=parseCB()
if D then
addToTable(D,VK_org)
FILE.save(VK_org,"virtualkey")
FILE.save(VK_org,"conf/virtualkey")
else
LOG.print(text.importSuccess,COLOR.green)
end

View File

@@ -9,7 +9,7 @@ function scene.sceneInit()
BG.set("space")
end
function scene.sceneBack()
FILE.save(SETTING,"settings")
FILE.save(SETTING,"conf/settings")
end
function scene.draw()

View File

@@ -17,7 +17,7 @@ function scene.sceneInit()
kS,jS=false,false
end
function scene.sceneBack()
FILE.save(keyMap,"key")
FILE.save(keyMap,"conf/key")
end
function scene.keyDown(key)

View File

@@ -17,7 +17,7 @@ function scene.sceneInit()
BG.set("space")
end
function scene.sceneBack()
FILE.save(SETTING,"settings")
FILE.save(SETTING,"conf/settings")
end
function scene.mouseDown(x,y)

View File

@@ -17,7 +17,7 @@ function scene.sceneInit()
select=nil
end
function scene.sceneBack()
FILE.save(VK_org,"virtualkey")
FILE.save(VK_org,"conf/virtualkey")
end
local function onVK_org(x,y)

View File

@@ -4,7 +4,7 @@ function scene.sceneInit()
BG.set("space")
end
function scene.sceneBack()
FILE.save(SETTING,"settings")
FILE.save(SETTING,"conf/settings")
end
scene.widgetList={

View File

@@ -10,7 +10,7 @@ function Tick.httpREQ_getAccessToken(task)
if res then
LOG.print(text.accessSuccessed)
ACCOUNT.access_token=res.access_token
FILE.save(ACCOUNT,"account")
FILE.save(ACCOUNT,"conf/account")
SCN.swapTo("netgame")
else
LOG.print(text.netErrorCode..response.code..": "..res.message,"warn")