Skip to content

Commit 95ab754

Browse files
committed
命令行启动小程序时会跳过几乎所有加载流程
1 parent 4b64f1a commit 95ab754

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

main.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,9 @@ if PROGRESS.get('main')>=3 and ShellOption.launchApplet then
508508
if appletSceneSet[ShellOption.launchApplet] then
509509
ZENITHA.setFirstScene(ShellOption.launchApplet)
510510
else
511-
MSG('error',"Applet scene '"..ShellOption.launchApplet.."' doesn't exist")
511+
ZENITHA.setFirstScene('_quit')
512+
LOG('error',"Applet scene '"..ShellOption.launchApplet.."' doesn't exist")
513+
return
512514
end
513515
end
514516

shell.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ function write(text)
1616
stdout:flush()
1717
end
1818
local function sleep(time)
19+
if time<=0 then return end
1920
if love._os=='Linux' then
2021
os.execute('sleep '..time)
2122
else
@@ -112,8 +113,11 @@ function commands.shell(startArg)
112113
)
113114
elseif args[1]=='start' then
114115
local t1,t2,t3=.03,.06,.12
116+
if TABLE.find(args,"app") then
117+
option.launchApplet=args[TABLE.find(args,"app")+1]
118+
break
119+
end
115120
if TABLE.find(args,"overclock") then t1,t2,t3=.01,.03,.05 end
116-
if TABLE.find(args,"app") then option.launchApplet=args[TABLE.find(args,"app")+1] end
117121
math.randomseed(os.time())
118122
local function OK(n) return AE.U[n].."\r[ "..AE._G"OK"..AE.NL[n] end
119123

0 commit comments

Comments
 (0)