更改profile开启方式,和计算器组合功能键不冲突了
This commit is contained in:
@@ -191,27 +191,16 @@ end
|
|||||||
function love.keypressed(i)
|
function love.keypressed(i)
|
||||||
mouseShow=false
|
mouseShow=false
|
||||||
if devMode then
|
if devMode then
|
||||||
if i=="1"then
|
if i=="f1"then
|
||||||
print("profile start!")
|
PROFILE.switch()
|
||||||
PROFILE.start()
|
|
||||||
elseif i=="2"then
|
|
||||||
print("profile stop!")
|
|
||||||
PROFILE.stop()
|
|
||||||
elseif i=="3"then
|
|
||||||
print("profile report copied!")
|
|
||||||
love.system.setClipboardText(PROFILE.report())
|
|
||||||
elseif i=="4"then
|
|
||||||
print("profile resetted!")
|
|
||||||
PROFILE.reset()
|
|
||||||
elseif i=="f1"then
|
|
||||||
local r=rnd()<.5
|
|
||||||
love._setGammaCorrect(r)
|
|
||||||
LOG.print("GammaCorrect: "..(r and"on"or"off"),"warn")
|
|
||||||
elseif i=="f2"then
|
elseif i=="f2"then
|
||||||
LOG.print("System:"..SYSTEM.."["..jit.arch.."]")
|
LOG.print("System:"..SYSTEM.."["..jit.arch.."]")
|
||||||
LOG.print("luaVer:".._VERSION)
|
LOG.print("luaVer:".._VERSION)
|
||||||
LOG.print("jitVer:"..jit.version)
|
LOG.print("jitVer:"..jit.version)
|
||||||
LOG.print("jitVerNum:"..jit.version_num)
|
LOG.print("jitVerNum:"..jit.version_num)
|
||||||
|
local r=rnd()<.5
|
||||||
|
love._setGammaCorrect(r)
|
||||||
|
LOG.print("GammaCorrect: "..(r and"on"or"off"),"warn")
|
||||||
elseif i=="f3"then
|
elseif i=="f3"then
|
||||||
for _=1,8 do
|
for _=1,8 do
|
||||||
local P=PLAYERS.alive[rnd(#PLAYERS.alive)]
|
local P=PLAYERS.alive[rnd(#PLAYERS.alive)]
|
||||||
@@ -220,7 +209,7 @@ function love.keypressed(i)
|
|||||||
P:lose()
|
P:lose()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif i=="f4"then LOG.copy()
|
elseif i=="f4"then if not kb.isDown("lalt","ralt")then LOG.copy()end
|
||||||
elseif i=="f5"then if love._openConsole then love._openConsole()end
|
elseif i=="f5"then if love._openConsole then love._openConsole()end
|
||||||
elseif i=="f6"then if WIDGET.sel then DBP(WIDGET.sel)end
|
elseif i=="f6"then if WIDGET.sel then DBP(WIDGET.sel)end
|
||||||
elseif i=="f7"then for k,v in next,_G do DBP(k,v)end
|
elseif i=="f7"then for k,v in next,_G do DBP(k,v)end
|
||||||
|
|||||||
@@ -166,6 +166,20 @@ function profile.report(n)
|
|||||||
return '\n'..sz..row
|
return '\n'..sz..row
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local switch=false
|
||||||
|
function profile.switch()
|
||||||
|
if switch then
|
||||||
|
profile.stop()
|
||||||
|
love.system.setClipboardText(PROFILE.report())
|
||||||
|
PROFILE.reset()
|
||||||
|
LOG.print("profile report copied!")
|
||||||
|
else
|
||||||
|
PROFILE.start()
|
||||||
|
LOG.print("profile start!")
|
||||||
|
end
|
||||||
|
switch=not switch
|
||||||
|
end
|
||||||
|
|
||||||
-- store all internal profiler functions
|
-- store all internal profiler functions
|
||||||
for _, v in next,profile do
|
for _, v in next,profile do
|
||||||
if type(v) == "function" then
|
if type(v) == "function" then
|
||||||
|
|||||||
Reference in New Issue
Block a user