mirror of https://github.com/espruino/BangleApps
BTN3 now won't restart when at the end of welcome screen
parent
9a76d6d800
commit
2775693936
|
@ -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,
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
0.01: New App!
|
||||
0.02: Animate balloon intro
|
||||
0.03: BTN3 now won't restart when at the end
|
||||
|
|
|
@ -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});
|
||||
|
|
Loading…
Reference in New Issue