BTN3 now won't restart when at the end of welcome screen

pull/191/head
Gordon Williams 2020-02-25 13:35:10 +00:00
parent 9a76d6d800
commit 2775693936
3 changed files with 7 additions and 5 deletions

View File

@ -40,7 +40,7 @@
{ "id": "welcome",
"name": "Welcome",
"icon": "app.png",
"version":"0.02",
"version":"0.03",
"description": "Appears at first boot and explains how to use Bangle.js",
"tags": "welcome",
"allow_emulator":true,

View File

@ -1,2 +1,3 @@
0.01: New App!
0.02: Animate balloon intro
0.03: BTN3 now won't restart when at the end

View File

@ -250,6 +250,7 @@ var scenes = [
var sceneNumber = 0;
function move(dir) {
if (dir>0 && sceneNumber+1 == scenes.length) return; // at the end
sceneNumber = (sceneNumber+dir)%scenes.length;
if (sceneNumber<0) sceneNumber=0;
clearInterval();
@ -270,12 +271,12 @@ function move(dir) {
}
}
if (sceneNumber < scenes.length-1)
setTimeout(next, 5000);
setTimeout(function() {
move(1);
}, 5000);
}
function next() {
move(1);
}
Bangle.on('swipe',move);
setWatch(()=>move(1), BTN3, {repeat:true});