From 9f8b8d259639d603feb8f954999f0cc3ff9bf6c5 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Wed, 24 Mar 2021 00:54:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=A5=E9=94=99=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E5=9C=BA=E6=99=AF=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/init.lua | 5 +++-- parts/scenes/error.lua | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Zframework/init.lua b/Zframework/init.lua index bc6726c2..317f1456 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -380,12 +380,13 @@ function love.errorhandler(msg) if LOADED and #ERRDATA<5 then BG.set("none") - ERRDATA[#ERRDATA+1]={mes=err} + local scn=SCN and SCN.cur or"NULL" + ERRDATA[#ERRDATA+1]={mes=err,scene=scn} --Write messages to log file love.filesystem.append("conf/error.log", os.date("%Y/%m/%d %A %H:%M:%S\n").. - #ERRDATA.." crash(es) "..SYSTEM.."-"..VERSION_NAME.." scene: "..(SCN and SCN.cur or"NULL").."\n".. + #ERRDATA.." crash(es) "..SYSTEM.."-"..VERSION_NAME.." scene: "..scn.."\n".. table.concat(err,"\n",1,c-2).."\n\n" ) diff --git a/parts/scenes/error.lua b/parts/scenes/error.lua index 864828c7..375937d6 100644 --- a/parts/scenes/error.lua +++ b/parts/scenes/error.lua @@ -9,7 +9,7 @@ local scene={} function scene.sceneInit() BGcolor=rnd()>.026 and{.3,.5,.9}or{.62,.3,.926} - stateInfo=SYSTEM.."-"..VERSION_NAME.." scene:"..SCN.cur + stateInfo=SYSTEM.."-"..VERSION_NAME.." scene:"..ERRDATA[#ERRDATA].scene errorText=LOADED and text.errorMsg or"An error has occurred during loading.\nError info has been created, and you can send it to the author." errorShot,errorInfo=ERRDATA[#ERRDATA].shot,ERRDATA[#ERRDATA].mes if SETTING then SFX.fplay("error",SETTING.voc*.8 or 0)end