LOG.print新增"short"输出方式,仅显示一个时长很短的不重要提示信息

This commit is contained in:
MrZ626
2020-09-08 23:21:04 +08:00
parent 7ab34480cd
commit b673892b7d
2 changed files with 16 additions and 13 deletions

View File

@@ -55,7 +55,7 @@ function BGM.play(s)
elseif not s then elseif not s then
return return
elseif not BGM.list[s]then elseif not BGM.list[s]then
LOG.print("Cannot find BGM: "..s,color.red) LOG.print("Cannot find BGM: "..s,"short",color.red)
return return
end end
if BGM.nowPlay~=s then if BGM.nowPlay~=s then

View File

@@ -43,29 +43,32 @@ function LOG.draw()
end end
end end
end end
function LOG.print(text,type,clr) function LOG.print(text,T,C)--type/time,color
local time local time
local his local his
if _G.type(type)=="table"then if type(T)=="table"then
clr,type=type or color.white C,T=T or color.white
elseif type=="warn"then elseif T=="warn"then
clr=clr or color.yellow C=C or color.yellow
his=true his=true
time=180 time=180
elseif type=="error"then elseif T=="error"then
clr=clr or color.red C=C or color.red
his=true his=true
time=210 time=210
elseif type=="message"then elseif T=="message"then
clr=clr or color.green C=C or color.green
his=true his=true
elseif not clr then elseif T=="short"then
clr=color.white C=C or color.orange
time=30
elseif not C then
C=color.white
end end
if his then if his then
ins(debugMesHistory,SCN.cur..": "..tostring(text)) ins(debugMesHistory,SCN.cur..": "..tostring(text))
end end
ins(debugMesList,{text=text,r=clr[1],g=clr[2],b=clr[3],blink=30,time=time or 150}) ins(debugMesList,{text=text,r=C[1],g=C[2],b=C[3],blink=30,time=time or 150})
end end
function LOG.copy() function LOG.copy()
local str=table.concat(debugMesHistory,"\n") local str=table.concat(debugMesHistory,"\n")