From 71a84b1d6f710fe422f7f046ecc4d45bcebf6828 Mon Sep 17 00:00:00 2001 From: Blue Fox Date: Mon, 18 Jul 2022 21:03:46 +0200 Subject: [PATCH] Added fundamental structure for modules --- memorytrainer.app.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/memorytrainer.app.js b/memorytrainer.app.js index b78333d..be6eebb 100644 --- a/memorytrainer.app.js +++ b/memorytrainer.app.js @@ -4,7 +4,8 @@ g.clear(); // constants const settingsfile = "memorytrainer.settings.json"; - +const moduleList = []; +storage.list(/\.memorytrainer\.js$/).forEach(module => moduleList.push(eval(storage.read(module)))); // utilities function wait(s) { @@ -36,6 +37,12 @@ function animate100x100img_big2small(img, minscale, maxscale) { function homescreen() { g.clear(); + if(moduleList.length == 0) { + E.showMessage("No module to load.\nExiting...", {"title": "ERROR", "img": atob("FBQBAfgAf+Af/4P//D+fx/n+f5/v+f//n//5//+f//n////3//5/n+P//D//wf/4B/4AH4A=")}); + wait(5); + Bangle.showLauncher(); + } + E.showMessage(":/\nModules aren't implemented yet.\nSee you soon!", "COMING SOON"); } function setupWizard() {