trying to add timeout after it's done buzzing... again
parent
09b2d9259f
commit
2e92b04af5
|
|
@ -25,3 +25,4 @@
|
||||||
1.23: forgot to resolve the promise
|
1.23: forgot to resolve the promise
|
||||||
1.24: fixed dumb errors
|
1.24: fixed dumb errors
|
||||||
1.25: god I hope this works
|
1.25: god I hope this works
|
||||||
|
1.26: trying to add timeout after it's done buzzing... again
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ function touchHandler (button, xy) {
|
||||||
|
|
||||||
function accelHandler (xyz) {
|
function accelHandler (xyz) {
|
||||||
|
|
||||||
if (xyz.diff >= 0.3) {
|
if (xyz.diff >= 0.4) {
|
||||||
|
|
||||||
menu = false;
|
menu = false;
|
||||||
mutex (rollDice);
|
mutex (rollDice);
|
||||||
|
|
@ -111,11 +111,6 @@ function mutex (functionRef) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function voidFn() {
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function rollDice() {
|
function rollDice() {
|
||||||
|
|
||||||
resultsArr = new Uint8Array (8);
|
resultsArr = new Uint8Array (8);
|
||||||
|
|
@ -151,7 +146,16 @@ function rollDice() {
|
||||||
|
|
||||||
function vibrate() {
|
function vibrate() {
|
||||||
|
|
||||||
return Bangle.buzz(50, 0.5);
|
return new Promise ((resolve, reject) => {
|
||||||
|
|
||||||
|
return Bangle.buzz (50, 0.5).then ((value) => {
|
||||||
|
|
||||||
|
setTimeout (() => {
|
||||||
|
|
||||||
|
resolve (value);
|
||||||
|
}, 150);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function random (max) {
|
function random (max) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{ "id": "multidice",
|
{ "id": "multidice",
|
||||||
"name": "multiple dice roller",
|
"name": "multiple dice roller",
|
||||||
"shortName":"multidice",
|
"shortName":"multidice",
|
||||||
"version":"1.25",
|
"version":"1.26",
|
||||||
"description": "roll anywhere from 1-8 dice at the same time",
|
"description": "roll anywhere from 1-8 dice at the same time",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "tool,game",
|
"tags": "tool,game",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue