trying to add timeout after it's done buzzing... again

master
Le~Kat 2023-02-25 23:21:47 -05:00
parent 09b2d9259f
commit 2e92b04af5
3 changed files with 13 additions and 8 deletions

View File

@ -25,3 +25,4 @@
1.23: forgot to resolve the promise
1.24: fixed dumb errors
1.25: god I hope this works
1.26: trying to add timeout after it's done buzzing... again

View File

@ -81,7 +81,7 @@ function touchHandler (button, xy) {
function accelHandler (xyz) {
if (xyz.diff >= 0.3) {
if (xyz.diff >= 0.4) {
menu = false;
mutex (rollDice);
@ -111,11 +111,6 @@ function mutex (functionRef) {
});
}
function voidFn() {
return;
}
function rollDice() {
resultsArr = new Uint8Array (8);
@ -151,7 +146,16 @@ function rollDice() {
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) {

View File

@ -1,7 +1,7 @@
{ "id": "multidice",
"name": "multiple dice roller",
"shortName":"multidice",
"version":"1.25",
"version":"1.26",
"description": "roll anywhere from 1-8 dice at the same time",
"icon": "app.png",
"tags": "tool,game",