From 118932c0b5ae5eb90071e9cd8c186438b5980a40 Mon Sep 17 00:00:00 2001 From: hugeblank Date: Wed, 15 May 2019 11:31:33 -0700 Subject: [PATCH] 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. --- startup.lua | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/startup.lua b/startup.lua index 082bdc9..22c19ec 100644 --- a/startup.lua +++ b/startup.lua @@ -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