From a6c62fb6ed5e55d59ff03681d580833d34d739e0 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 10 Jun 2021 17:44:06 +0800 Subject: [PATCH] =?UTF-8?q?LOG=E6=A8=A1=E5=9D=97=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E6=94=B9=E4=B8=BA=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/init.lua | 6 +++--- Zframework/log.lua | 18 +++++++++--------- Zframework/sfx.lua | 2 +- Zframework/voice.lua | 2 +- parts/net.lua | 14 +++++++------- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Zframework/init.lua b/Zframework/init.lua index 52d770bf..1f3d67ed 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -226,7 +226,7 @@ local function noDevkeyPressed(key) elseif key=="f7"and love._openConsole then love._openConsole() elseif key=="f8"then - devMode=nil LOG.print("DEBUG OFF",10) + devMode=nil LOG.print("DEBUG OFF",.2) elseif key=="f9"then devMode=1 LOG.print("DEBUG 1") elseif key=="f10"then @@ -263,7 +263,7 @@ function love.keypressed(key) return elseif key=="f8"then devMode=1 - LOG.print("DEBUG ON",10) + LOG.print("DEBUG ON",.2) elseif key=="f11"then if kb.isDown("lctrl","rctrl")then _G["\100\114\97\119\70\87\77"]=NULL @@ -571,7 +571,7 @@ function love.run() if SCN.update then SCN.update(dt)end if SCN.swapping then SCN.swapUpdate()end TEXT.update() - LOG.update() + LOG.update(dt) --DRAW if not MINI()then diff --git a/Zframework/log.lua b/Zframework/log.lua index aa37a7e9..c60d1833 100644 --- a/Zframework/log.lua +++ b/Zframework/log.lua @@ -11,15 +11,15 @@ local mesHistory={ os.date("Launched at %Y/%m/%d %H:%M"), } local LOG={} -function LOG.update() +function LOG.update(dt) if mesList[1]then for i=#mesList,1,-1 do local M=mesList[i] if M.blink>0 then M.blink=M.blink-1 else - M.time=M.time-1 - if M.time==0 then + M.time=M.time-dt + if M.time<=0 then rem(mesList,i) end end @@ -31,9 +31,9 @@ function LOG.draw() setFont(20) for i=1,#mesList do local M=mesList[i] - M.rgba[4]=M.blink>0 and int(M.blink/3)%2 or min(M.time/26,1) + M.rgba[4]=M.blink>0 and int(M.blink/3)%2 or min(M.time*60/26,1) gc_setColor(M.rgba) - gc_print(M.text,10+(20-min(M.time,20))^1.5/4,25*i) + gc_print(M.text,10+(20-min(M.time*60,20))^1.5/4,25*i) end end end @@ -42,20 +42,20 @@ function LOG.print(text,T)--text,type/time local his,time if T=='message'then color=COLOR.N - his,time=true,180 + his,time=true,4 elseif T=='warn'then color=COLOR.Y - his,time=true,180 + his,time=true,4 elseif T=='error'then color=COLOR.R - his,time=true,210 + his,time=true,5 elseif type(T)=='number'then time=T end text=tostring(text) assert(utf8.len(text),"Error UTF-8 coding") if his then ins(mesHistory,SCN.cur..": "..text)end - ins(mesList,{text=text,rgba={color[1],color[2],color[3],nil},blink=30,time=time or 120}) + ins(mesList,{text=text,rgba={color[1],color[2],color[3],nil},blink=30,time=time or 3}) end function LOG.copy() love.system.setClipboardText(table.concat(mesHistory,"\n")) diff --git a/Zframework/sfx.lua b/Zframework/sfx.lua index 730487b3..20163104 100644 --- a/Zframework/sfx.lua +++ b/Zframework/sfx.lua @@ -17,7 +17,7 @@ function SFX.init(list) if love.filesystem.getInfo(N)then Sources[list[i]]={love.audio.newSource(N,'static')} else - LOG.print("No SFX file: "..N,5) + LOG.print("No SFX file: "..N,.1) end if not skip and i~=count then coroutine.yield() diff --git a/Zframework/voice.lua b/Zframework/voice.lua index ce1cae27..23cf24f1 100644 --- a/Zframework/voice.lua +++ b/Zframework/voice.lua @@ -45,7 +45,7 @@ function VOC.init(list) if n==1 then if not loadVoiceFile(list[i],list[i])then - LOG.print("No VOICE file: "..list[i],5) + LOG.print("No VOICE file: "..list[i],.1) end end if not Source[list[i]][1]then Source[list[i]]=nil end diff --git a/parts/net.lua b/parts/net.lua index c62c6387..241520b1 100644 --- a/parts/net.lua +++ b/parts/net.lua @@ -122,7 +122,7 @@ local function pumpStream(d) if res then DATA.pumpRecording(stream,P.stream) else - LOG.print("Bad stream from "..P.username.."#"..P.uid,10) + LOG.print("Bad stream from "..P.username.."#"..P.uid,.2) end break end @@ -295,7 +295,7 @@ function NET.loadSavedData(sections) FILE.save(NET.cloudData.vkSave1,'conf/vkSave1','q') FILE.save(NET.cloudData.vkSave2,'conf/vkSave2','q') else - LOG.print(text.versionNotMatch,60) + LOG.print(text.versionNotMatch,1) end end @@ -414,22 +414,22 @@ function NET.updateWS_app() end end if VERSION.code