排行文件使用rec后缀
This commit is contained in:
2
main.lua
2
main.lua
@@ -267,7 +267,7 @@ if fs.getInfo("data.dat")then
|
|||||||
fs.createDirectory("record")
|
fs.createDirectory("record")
|
||||||
for _,name in next,fs.getDirectoryItems("")do
|
for _,name in next,fs.getDirectoryItems("")do
|
||||||
if name:sub(-4)==".dat"then
|
if name:sub(-4)==".dat"then
|
||||||
fs.write("record/"..name,fs.read(name))
|
fs.write("record/"..name:sub(1,-4).."rec",fs.read(name))
|
||||||
fs.remove(name)
|
fs.remove(name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1546,7 +1546,7 @@ local function gameOver()--Save record
|
|||||||
D.date=os.date("%Y/%m/%d %H:%M")
|
D.date=os.date("%Y/%m/%d %H:%M")
|
||||||
ins(L,p+1,D)
|
ins(L,p+1,D)
|
||||||
if L[11]then L[11]=nil end
|
if L[11]then L[11]=nil end
|
||||||
FILE.save(L,"record/"..M.name,"l")
|
FILE.save(L,"record/"..M.name..".rec","l")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ function scene.update()
|
|||||||
for k,v in next,m do
|
for k,v in next,m do
|
||||||
M[k]=v
|
M[k]=v
|
||||||
end
|
end
|
||||||
M.records=FILE.load(m.name..".dat")or M.score and{}
|
M.records=FILE.load("record/"..m.name..".rec")or M.score and{}
|
||||||
-- M.icon=gc.newImage("media/image/modeIcon/"..m.icon..".png")
|
-- M.icon=gc.newImage("media/image/modeIcon/"..m.icon..".png")
|
||||||
-- M.icon=gc.newImage("media/image/modeIcon/custom.png")
|
-- M.icon=gc.newImage("media/image/modeIcon/custom.png")
|
||||||
elseif phase==8 then
|
elseif phase==8 then
|
||||||
|
|||||||
Reference in New Issue
Block a user