Add option to remove splash on startup

Adds the setting option 'opus.show_splash'. By default it is set to true. When set to false opus will immediately boot without showing the splash screen. Fairly straightforward.
This commit is contained in:
hugeblank 2019-05-15 11:31:33 -07:00
parent 43163053a5
commit 118932c0b5
1 changed files with 25 additions and 14 deletions

View File

@ -117,22 +117,33 @@ local function splash()
term.write(str)
end
term.clear()
splash()
local timerId = os.startTimer(1.5)
while true do
local e, id = os.pullEvent()
if e == 'timer' and id == timerId then
break
local doSplash = true
if settings then
doSplash = settings.get('opus.show_splash')
if doSplash == nil then
doSplash = true
settings.set('opus.show_splash', true)
settings.save('.settings')
end
if e == 'char' then
bootOption = startupMenu()
if settings then
settings.set('opus.boot_option', bootOption)
settings.save('.settings')
end
if doSplash then
term.clear()
splash()
local timerId = os.startTimer(1.5)
while true do
local e, id = os.pullEvent()
if e == 'timer' and id == timerId then
break
end
if e == 'char' then
bootOption = startupMenu()
if settings then
settings.set('opus.boot_option', bootOption)
settings.save('.settings')
end
break
end
break
end
end