LOG模块时间单位改为秒
This commit is contained in:
@@ -226,7 +226,7 @@ local function noDevkeyPressed(key)
|
|||||||
elseif key=="f7"and love._openConsole then
|
elseif key=="f7"and love._openConsole then
|
||||||
love._openConsole()
|
love._openConsole()
|
||||||
elseif key=="f8"then
|
elseif key=="f8"then
|
||||||
devMode=nil LOG.print("DEBUG OFF",10)
|
devMode=nil LOG.print("DEBUG OFF",.2)
|
||||||
elseif key=="f9"then
|
elseif key=="f9"then
|
||||||
devMode=1 LOG.print("DEBUG 1")
|
devMode=1 LOG.print("DEBUG 1")
|
||||||
elseif key=="f10"then
|
elseif key=="f10"then
|
||||||
@@ -263,7 +263,7 @@ function love.keypressed(key)
|
|||||||
return
|
return
|
||||||
elseif key=="f8"then
|
elseif key=="f8"then
|
||||||
devMode=1
|
devMode=1
|
||||||
LOG.print("DEBUG ON",10)
|
LOG.print("DEBUG ON",.2)
|
||||||
elseif key=="f11"then
|
elseif key=="f11"then
|
||||||
if kb.isDown("lctrl","rctrl")then
|
if kb.isDown("lctrl","rctrl")then
|
||||||
_G["\100\114\97\119\70\87\77"]=NULL
|
_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.update then SCN.update(dt)end
|
||||||
if SCN.swapping then SCN.swapUpdate()end
|
if SCN.swapping then SCN.swapUpdate()end
|
||||||
TEXT.update()
|
TEXT.update()
|
||||||
LOG.update()
|
LOG.update(dt)
|
||||||
|
|
||||||
--DRAW
|
--DRAW
|
||||||
if not MINI()then
|
if not MINI()then
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ local mesHistory={
|
|||||||
os.date("Launched at %Y/%m/%d %H:%M"),
|
os.date("Launched at %Y/%m/%d %H:%M"),
|
||||||
}
|
}
|
||||||
local LOG={}
|
local LOG={}
|
||||||
function LOG.update()
|
function LOG.update(dt)
|
||||||
if mesList[1]then
|
if mesList[1]then
|
||||||
for i=#mesList,1,-1 do
|
for i=#mesList,1,-1 do
|
||||||
local M=mesList[i]
|
local M=mesList[i]
|
||||||
if M.blink>0 then
|
if M.blink>0 then
|
||||||
M.blink=M.blink-1
|
M.blink=M.blink-1
|
||||||
else
|
else
|
||||||
M.time=M.time-1
|
M.time=M.time-dt
|
||||||
if M.time==0 then
|
if M.time<=0 then
|
||||||
rem(mesList,i)
|
rem(mesList,i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -31,9 +31,9 @@ function LOG.draw()
|
|||||||
setFont(20)
|
setFont(20)
|
||||||
for i=1,#mesList do
|
for i=1,#mesList do
|
||||||
local M=mesList[i]
|
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_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
|
end
|
||||||
end
|
end
|
||||||
@@ -42,20 +42,20 @@ function LOG.print(text,T)--text,type/time
|
|||||||
local his,time
|
local his,time
|
||||||
if T=='message'then
|
if T=='message'then
|
||||||
color=COLOR.N
|
color=COLOR.N
|
||||||
his,time=true,180
|
his,time=true,4
|
||||||
elseif T=='warn'then
|
elseif T=='warn'then
|
||||||
color=COLOR.Y
|
color=COLOR.Y
|
||||||
his,time=true,180
|
his,time=true,4
|
||||||
elseif T=='error'then
|
elseif T=='error'then
|
||||||
color=COLOR.R
|
color=COLOR.R
|
||||||
his,time=true,210
|
his,time=true,5
|
||||||
elseif type(T)=='number'then
|
elseif type(T)=='number'then
|
||||||
time=T
|
time=T
|
||||||
end
|
end
|
||||||
text=tostring(text)
|
text=tostring(text)
|
||||||
assert(utf8.len(text),"Error UTF-8 coding")
|
assert(utf8.len(text),"Error UTF-8 coding")
|
||||||
if his then ins(mesHistory,SCN.cur..": "..text)end
|
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
|
end
|
||||||
function LOG.copy()
|
function LOG.copy()
|
||||||
love.system.setClipboardText(table.concat(mesHistory,"\n"))
|
love.system.setClipboardText(table.concat(mesHistory,"\n"))
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function SFX.init(list)
|
|||||||
if love.filesystem.getInfo(N)then
|
if love.filesystem.getInfo(N)then
|
||||||
Sources[list[i]]={love.audio.newSource(N,'static')}
|
Sources[list[i]]={love.audio.newSource(N,'static')}
|
||||||
else
|
else
|
||||||
LOG.print("No SFX file: "..N,5)
|
LOG.print("No SFX file: "..N,.1)
|
||||||
end
|
end
|
||||||
if not skip and i~=count then
|
if not skip and i~=count then
|
||||||
coroutine.yield()
|
coroutine.yield()
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ function VOC.init(list)
|
|||||||
|
|
||||||
if n==1 then
|
if n==1 then
|
||||||
if not loadVoiceFile(list[i],list[i])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
|
||||||
end
|
end
|
||||||
if not Source[list[i]][1]then Source[list[i]]=nil end
|
if not Source[list[i]][1]then Source[list[i]]=nil end
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ local function pumpStream(d)
|
|||||||
if res then
|
if res then
|
||||||
DATA.pumpRecording(stream,P.stream)
|
DATA.pumpRecording(stream,P.stream)
|
||||||
else
|
else
|
||||||
LOG.print("Bad stream from "..P.username.."#"..P.uid,10)
|
LOG.print("Bad stream from "..P.username.."#"..P.uid,.2)
|
||||||
end
|
end
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@@ -295,7 +295,7 @@ function NET.loadSavedData(sections)
|
|||||||
FILE.save(NET.cloudData.vkSave1,'conf/vkSave1','q')
|
FILE.save(NET.cloudData.vkSave1,'conf/vkSave1','q')
|
||||||
FILE.save(NET.cloudData.vkSave2,'conf/vkSave2','q')
|
FILE.save(NET.cloudData.vkSave2,'conf/vkSave2','q')
|
||||||
else
|
else
|
||||||
LOG.print(text.versionNotMatch,60)
|
LOG.print(text.versionNotMatch,1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -414,22 +414,22 @@ function NET.updateWS_app()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if VERSION.code<res.newestCode then
|
if VERSION.code<res.newestCode then
|
||||||
LOG.print(text.oldVersion:gsub("$1",res.newestName),180)
|
LOG.print(text.oldVersion:gsub("$1",res.newestName),3)
|
||||||
end
|
end
|
||||||
LOG.print(res.notice,300)
|
LOG.print(res.notice,5)
|
||||||
NET.tryLogin(true)
|
NET.tryLogin(true)
|
||||||
elseif res.action==0 then--Broadcast
|
elseif res.action==0 then--Broadcast
|
||||||
LOG.print(res.data.message,300)
|
LOG.print(res.data.message,5)
|
||||||
elseif res.action==1 then--Get notice
|
elseif res.action==1 then--Get notice
|
||||||
--?
|
--?
|
||||||
elseif res.action==2 then--Register
|
elseif res.action==2 then--Register
|
||||||
if res.type=='Self'or res.type=='Server'then
|
if res.type=='Self'or res.type=='Server'then
|
||||||
LOG.print(res.data.message,300)
|
LOG.print(res.data.message,5)
|
||||||
if SCN.cur=='register'then
|
if SCN.cur=='register'then
|
||||||
SCN.back()
|
SCN.back()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
LOG.print(res.reason or"Registration failed",300)
|
LOG.print(res.reason or"Registration failed",5)
|
||||||
end
|
end
|
||||||
NET.unlock('register')
|
NET.unlock('register')
|
||||||
elseif res.action==3 then--Get player counts
|
elseif res.action==3 then--Get player counts
|
||||||
|
|||||||
Reference in New Issue
Block a user