完善FILE.load的使用

重点修正几个string模式保存的文件的读取,以防刚好符合其他格式自动判断的条件
This commit is contained in:
MrZ626
2021-10-15 01:04:00 +08:00
parent 964537219a
commit dfa356e9d9
3 changed files with 5 additions and 5 deletions

View File

@@ -152,7 +152,7 @@ TABLE.cover (FILE.load('conf/key')or{},keyMap)
TABLE.cover (FILE.load('conf/virtualkey')or{},VK_org)
--Initialize fields, sequence, missions, gameEnv for cutsom game
local fieldData=FILE.load('conf/customBoards')
local fieldData=FILE.load('conf/customBoards','string')
if fieldData then
fieldData=STRING.split(fieldData,"!")
for i=1,#fieldData do
@@ -161,11 +161,11 @@ if fieldData then
else
FIELD[1]=DATA.newBoard()
end
local sequenceData=FILE.load('conf/customSequence')
local sequenceData=FILE.load('conf/customSequence','string')
if sequenceData then
DATA.pasteSequence(sequenceData)
end
local missionData=FILE.load('conf/customMissions')
local missionData=FILE.load('conf/customMissions','string')
if missionData then
DATA.pasteMission(missionData)
end

View File

@@ -85,7 +85,7 @@ local loadingThread=coroutine.wrap(function()
YIELD('loadMode')
for _,M in next,MODES do
M.records=FILE.load("record/"..M.name..".rec")or M.score and{}
M.records=FILE.load("record/"..M.name..".rec",'luaon')or M.score and{}
M.icon=M.icon and(modeIcons[M.icon]or gc.newImage("media/image/modeicon/"..M.icon..".png"))
end

View File

@@ -90,7 +90,7 @@ function scene.keyDown(key)
local rep=listBox:getSel()
if rep then
if rep.available and rep.fileName then
local repStr=FILE.load(rep.fileName)
local repStr=FILE.load(rep.fileName,'string')
if repStr then
love.system.setClipboardText(love.data.encode('string','base64',repStr))
MES.new('info',text.exportSuccess)