部分弹出消息改用LOG.print输出到屏幕左上角

This commit is contained in:
MrZ626
2020-09-03 16:00:28 +08:00
parent b873aa09d6
commit 4da23852a7
3 changed files with 25 additions and 25 deletions

View File

@@ -99,7 +99,7 @@ function FILE.saveRecord(N,L)
local _,mes=F:write(dumpTable(L))
F:flush()F:close()
if not _ then
TEXT.show(text.recSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
LOG.print(text.recSavingError..(mes or"unknown error"),color.red)
end
end
function FILE.delRecord(N)
@@ -125,7 +125,7 @@ function FILE.saveUnlock()
local _,mes=F:write(dumpTable(modeRanks))
F:flush()F:close()
if not _ then
TEXT.show(text.unlockSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
LOG.print(text.unlockSavingError..(mes or"unknown error"),color.red)
end
end
@@ -151,7 +151,7 @@ function FILE.saveData()
local _,mes=F:write(dumpTable(stat))
F:flush()F:close()
if not _ then
TEXT.show(text.statSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
LOG.print(text.statSavingError..(mes or"unknown error"),color.red)
end
end
@@ -175,8 +175,8 @@ function FILE.saveSetting()
F:open("w")
local _,mes=F:write(dumpTable(setting))
F:flush()F:close()
if _ then TEXT.show(text.settingSaved,1140,650,40,"sudden",.5)
else TEXT.show(text.settingSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
if _ then LOG.print(text.settingSaved,color.green)
else LOG.print(text.settingSavingError..(mes or"unknown error"),color.red)
end
end
@@ -196,8 +196,8 @@ function FILE.saveKeyMap()
F:open("w")
local _,mes=F:write(dumpTable(keyMap))
F:flush()F:close()
if _ then TEXT.show(text.keyMapSaved,1140,650,26,"sudden",.5)
else TEXT.show(text.keyMapSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
if _ then LOG.print(text.keyMapSaved,color.green)
else LOG.print(text.keyMapSavingError..(mes or"unknown error"),color.red)
end
end
@@ -217,8 +217,8 @@ function FILE.saveVK()
F:open("w")
local _,mes=F:write(dumpTable(VK_org))
F:flush()F:close()
if _ then TEXT.show(text.VKSaved,1140,650,26,"sudden",.5)
else TEXT.show(text.VKSavingError..(mes or"unknown error"),1140,650,20,"sudden",.5)
if _ then LOG.print(text.VKSaved,color.green)
else LOG.print(text.VKSavingError..(mes or"unknown error"),color.red)
end
end
return FILE

View File

@@ -193,11 +193,11 @@ function love.keypressed(i)
DBP("DEBUG:")
elseif i=="f3"then
LOG.print("挂了.gif")
elseif i=="f8"then devMode=nil TEXT.show("DEBUG OFF",640,360,80,"fly",.8)
elseif i=="f9"then devMode=1 TEXT.show("DEBUG 1",640,360,80,"fly",.8)
elseif i=="f10"then devMode=2 TEXT.show("DEBUG 2",640,360,80,"fly",.8)
elseif i=="f11"then devMode=3 TEXT.show("DEBUG 3",640,360,80,"fly",8)
elseif i=="f12"then devMode=4 TEXT.show("DEBUG 4",640,360,80,"fly",12)
elseif i=="f8"then devMode=nil LOG.print("DEBUG OFF",color.yellow)
elseif i=="f9"then devMode=1 LOG.print("DEBUG 1",color.yellow)
elseif i=="f10"then devMode=2 LOG.print("DEBUG 2",color.yellow)
elseif i=="f11"then devMode=3 LOG.print("DEBUG 3",color.yellow)
elseif i=="f12"then devMode=4 LOG.print("DEBUG 4",color.yellow)
elseif devMode==2 then
if i=="k"then
for i=1,8 do
@@ -245,7 +245,7 @@ function love.keypressed(i)
end
else
devMode=1
TEXT.show("DEBUG ON",640,360,80,"fly",.8)
LOG.print("DEBUG ON",color.yellow)
end
end
function love.keyreleased(i)
@@ -537,7 +537,7 @@ function love.run()
lastFreshPow=Timer()
if gc.getWidth()~=scr.w then
love.resize(gc.getWidth(),gc.getHeight())
TEXT.show("resized",200,100,30,"stretch")
LOG.print("Resized",color.yellow)
end
end