From 11bb084d7020aa8517111616df0d3ba64dd26a4c Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sat, 1 May 2021 20:46:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.lua | 6 +++--- parts/data.lua | 2 +- parts/net.lua | 16 ++++++++-------- parts/player/player.lua | 6 +++--- parts/scenes/app_console.lua | 2 +- parts/scenes/customGame.lua | 6 +++--- parts/scenes/lang.lua | 2 +- parts/scenes/load.lua | 2 +- parts/scenes/net_menu.lua | 2 +- parts/scenes/pause.lua | 2 +- parts/scenes/savedata.lua | 8 ++++---- parts/scenes/setting_game.lua | 2 +- parts/scenes/setting_key.lua | 2 +- parts/scenes/setting_sound.lua | 2 +- parts/scenes/setting_touch.lua | 2 +- parts/scenes/setting_video.lua | 2 +- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/main.lua b/main.lua index 0ba2a533..eca51bfb 100644 --- a/main.lua +++ b/main.lua @@ -319,9 +319,9 @@ do end if needSave then - FILE.save(SETTING,"conf/settings",'q') - FILE.save(RANKS,"conf/unlock",'q') - FILE.save(STAT,"conf/data",'q') + FILE.save(SETTING,'conf/settings','q') + FILE.save(RANKS,'conf/unlock','q') + FILE.save(STAT,'conf/data','q') end if autoRestart then love.event.quit('restart') diff --git a/parts/data.lua b/parts/data.lua index 51920733..9f58e82d 100644 --- a/parts/data.lua +++ b/parts/data.lua @@ -383,7 +383,7 @@ do--function DATA.saveRecording() love.filesystem.write(fileName,fileHead.."\n"..data.compress('string','zlib',fileBody)) ins(REPLAY,fileName) - FILE.save(REPLAY,"conf/replay") + FILE.save(REPLAY,'conf/replay') return true else LOG.print("Save failed: File already exists") diff --git a/parts/net.lua b/parts/net.lua index 58bfbce1..10e2a52d 100644 --- a/parts/net.lua +++ b/parts/net.lua @@ -300,7 +300,7 @@ function NET.updateWS_user() if res.uid then USER.uid=res.uid USER.authToken=res.authToken - FILE.save(USER,"conf/user",'q') + FILE.save(USER,'conf/user','q') if SCN.cur=='login'then SCN.back()end end LOG.print(text.loginSuccessed) @@ -350,7 +350,7 @@ function NET.updateWS_play() --? elseif res.action==2 then--Player join if res.type=='Self'then - --Create room + --Enter new room TABLE.cut(PLY_NET) if d.players then for _,p in next,d.players do @@ -373,7 +373,7 @@ function NET.updateWS_play() ready=d.ready, config=d.config, }) - if SCN.socketRead then SCN.socketRead("Join",d)end + if SCN.socketRead then SCN.socketRead('Join',d)end end elseif res.action==3 then--Player leave if not d.uid then @@ -399,10 +399,10 @@ function NET.updateWS_play() break end end - if SCN.socketRead then SCN.socketRead("Leave",d)end + if SCN.socketRead then SCN.socketRead('Leave',d)end end elseif res.action==4 then--Player talk - if SCN.socketRead then SCN.socketRead("Talk",d)end + if SCN.socketRead then SCN.socketRead('Talk',d)end elseif res.action==5 then--Player change settings if tostring(USER.uid)~=d.uid then for i=1,#PLY_NET do @@ -443,7 +443,7 @@ function NET.updateWS_play() elseif res.action==9 then--Game finished NET.allReady=false NET.wsclose_stream() - if SCN.socketRead then SCN.socketRead("Finish",d)end + if SCN.socketRead then SCN.socketRead('Finish',d)end end else WS.alert('play') @@ -472,7 +472,7 @@ function NET.updateWS_stream() if res.type=='Connect'then NET.unlock('wsc_stream') elseif res.action==0 then--Game start - SCN.socketRead("Go",d) + SCN.socketRead('Go',d) elseif res.action==1 then--Game finished --? elseif res.action==2 then--Player join @@ -487,7 +487,7 @@ function NET.updateWS_stream() end end elseif res.action==5 then--Receive stream - SCN.socketRead("Stream",d) + SCN.socketRead('Stream',d) end else WS.alert('stream') diff --git a/parts/player/player.lua b/parts/player/player.lua index 4c507af5..4780d958 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -1609,7 +1609,7 @@ end ---------------------------------------------------- local function gameOver()--Save record if GAME.replaying then return end - FILE.save(STAT,"conf/data") + FILE.save(STAT,'conf/data') local M=GAME.curMode local R=M.getRank if R then @@ -1639,7 +1639,7 @@ local function gameOver()--Save record end end if needSave then - FILE.save(RANKS,"conf/unlock",'q') + FILE.save(RANKS,'conf/unlock','q') end end local D=M.score(P) @@ -1658,7 +1658,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,"record/"..M.name..".rec",'lq') + FILE.save(L,('record/%s.rec'):format(M.name),'lq') end end end diff --git a/parts/scenes/app_console.lua b/parts/scenes/app_console.lua index 41d4abc7..8c1a7bc0 100644 --- a/parts/scenes/app_console.lua +++ b/parts/scenes/app_console.lua @@ -493,7 +493,7 @@ function commands.unlockall(bool) RANKS[name]=M.score and 0 or 6 end end - FILE.save(RANKS,"conf/unlock") + FILE.save(RANKS,'conf/unlock') log{C.lC,"\85\78\76\79\67\75\65\76\76"} SFX.play('clear_2') else diff --git a/parts/scenes/customGame.lua b/parts/scenes/customGame.lua index 1f0c4fb4..e5c0babf 100644 --- a/parts/scenes/customGame.lua +++ b/parts/scenes/customGame.lua @@ -50,11 +50,11 @@ function scene.keyDown(key) end if key=="return2"or kb.isDown("lalt","lctrl","lshift")then if initField then - FILE.save(CUSTOMENV,"conf/customEnv",'q') + FILE.save(CUSTOMENV,'conf/customEnv','q') loadGame('custom_puzzle',true) end else - FILE.save(CUSTOMENV,"conf/customEnv",'q') + FILE.save(CUSTOMENV,'conf/customEnv','q') loadGame('custom_clear',true) end elseif key=="f"then @@ -102,7 +102,7 @@ function scene.keyDown(key) do return end ::THROW_fail::LOG.print(text.dataCorrupted,COLOR.R) elseif key=="escape"then - FILE.save(CUSTOMENV,"conf/customEnv",'q') + FILE.save(CUSTOMENV,'conf/customEnv','q') SCN.back() else WIDGET.keyPressed(key) diff --git a/parts/scenes/lang.lua b/parts/scenes/lang.lua index 0360d077..576ad165 100644 --- a/parts/scenes/lang.lua +++ b/parts/scenes/lang.lua @@ -1,7 +1,7 @@ local scene={} function scene.sceneBack() - FILE.save(SETTING,"conf/settings") + FILE.save(SETTING,'conf/settings') end local function setLang(n)return function()SETTING.lang=n LANG.set(n)end end diff --git a/parts/scenes/load.lua b/parts/scenes/load.lua index dc926576..23975120 100644 --- a/parts/scenes/load.lua +++ b/parts/scenes/load.lua @@ -170,7 +170,7 @@ local loadingThread=coroutine.wrap(function() RANKS[name]=nil end end - FILE.save(RANKS,"conf/unlock",'q') + FILE.save(RANKS,'conf/unlock','q') end DAILYLAUNCH=freshDate'q' diff --git a/parts/scenes/net_menu.lua b/parts/scenes/net_menu.lua index c6aea1f1..923d9550 100644 --- a/parts/scenes/net_menu.lua +++ b/parts/scenes/net_menu.lua @@ -28,7 +28,7 @@ scene.widgetList={ USER.uid=false USER.username=false USER.authToken=false - FILE.save(USER,"conf/user",'q') + FILE.save(USER,'conf/user','q') SCN.back() end else diff --git a/parts/scenes/pause.lua b/parts/scenes/pause.lua index ac1620dd..9c256a67 100644 --- a/parts/scenes/pause.lua +++ b/parts/scenes/pause.lua @@ -122,7 +122,7 @@ function scene.sceneBack() STAT.todayTime=STAT.todayTime+PLAYERS[1].stat.time if not GAME.replaying and(PLAYERS[1].frameRun>400 or GAME.result)and not GAME.result then mergeStat(STAT,PLAYERS[1].stat) - FILE.save(STAT,"conf/data") + FILE.save(STAT,'conf/data') end end diff --git a/parts/scenes/savedata.lua b/parts/scenes/savedata.lua index 18c5d96e..4ba9bed8 100644 --- a/parts/scenes/savedata.lua +++ b/parts/scenes/savedata.lua @@ -39,7 +39,7 @@ scene.widgetList={ local D=parseCB() if D then TABLE.update(D,RANKS) - FILE.save(RANKS,"conf/unlock") + FILE.save(RANKS,'conf/unlock') LOG.print(text.importSuccess,'message') else LOG.print(text.dataCorrupted,'warn') @@ -50,7 +50,7 @@ scene.widgetList={ local D=parseCB() if D and D.version==STAT.version then TABLE.update(D,STAT) - FILE.save(STAT,"conf/data") + FILE.save(STAT,'conf/data') LOG.print(text.importSuccess,'message') else LOG.print(text.dataCorrupted,'warn') @@ -61,7 +61,7 @@ scene.widgetList={ local D=parseCB() if D then TABLE.update(D,SETTING) - FILE.save(SETTING,"conf/settings") + FILE.save(SETTING,'conf/settings') LOG.print(text.importSuccess,'message') else LOG.print(text.dataCorrupted,'warn') @@ -72,7 +72,7 @@ scene.widgetList={ local D=parseCB() if D then TABLE.update(D,VK_org) - FILE.save(VK_org,"conf/virtualkey") + FILE.save(VK_org,'conf/virtualkey') LOG.print(text.importSuccess,'message') else LOG.print(text.dataCorrupted,'warn') diff --git a/parts/scenes/setting_game.lua b/parts/scenes/setting_game.lua index f988d449..c73b1aeb 100644 --- a/parts/scenes/setting_game.lua +++ b/parts/scenes/setting_game.lua @@ -6,7 +6,7 @@ function scene.sceneInit() BG.set() end function scene.sceneBack() - FILE.save(SETTING,"conf/settings") + FILE.save(SETTING,'conf/settings') end function scene.draw() diff --git a/parts/scenes/setting_key.lua b/parts/scenes/setting_key.lua index f708a1ff..009e8168 100644 --- a/parts/scenes/setting_key.lua +++ b/parts/scenes/setting_key.lua @@ -23,7 +23,7 @@ function scene.sceneInit() BG.set('none') end function scene.sceneBack() - FILE.save(keyMap,"conf/key") + FILE.save(keyMap,'conf/key') end function scene.keyDown(key) diff --git a/parts/scenes/setting_sound.lua b/parts/scenes/setting_sound.lua index 1a55089d..68c772c4 100644 --- a/parts/scenes/setting_sound.lua +++ b/parts/scenes/setting_sound.lua @@ -15,7 +15,7 @@ function scene.sceneInit() BG.set() end function scene.sceneBack() - FILE.save(SETTING,"conf/settings") + FILE.save(SETTING,'conf/settings') end function scene.mouseDown(x,y) diff --git a/parts/scenes/setting_touch.lua b/parts/scenes/setting_touch.lua index fe000b03..5e22d57c 100644 --- a/parts/scenes/setting_touch.lua +++ b/parts/scenes/setting_touch.lua @@ -15,7 +15,7 @@ function scene.sceneInit() selected=false end function scene.sceneBack() - FILE.save(VK_org,"conf/virtualkey") + FILE.save(VK_org,'conf/virtualkey') end local function onVK_org(x,y) diff --git a/parts/scenes/setting_video.lua b/parts/scenes/setting_video.lua index 9e23abb4..f3fe8180 100644 --- a/parts/scenes/setting_video.lua +++ b/parts/scenes/setting_video.lua @@ -4,7 +4,7 @@ function scene.sceneInit() BG.set() end function scene.sceneBack() - FILE.save(SETTING,"conf/settings") + FILE.save(SETTING,'conf/settings') end scene.widgetList={