From 1e23787b57534d523881d0f7959d71939b04c67f Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 19:17:21 -0500 Subject: [PATCH 01/89] Added app.js to this repository --- apps/multidice/app.js | 169 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 apps/multidice/app.js diff --git a/apps/multidice/app.js b/apps/multidice/app.js new file mode 100644 index 000000000..d0f62b8e9 --- /dev/null +++ b/apps/multidice/app.js @@ -0,0 +1,169 @@ +var menu = true; +var diceOpts = {amount: 2, selected: 5}; // TODO: grab values from settings +const DICE_ARRAY = [4, 6, 8, 10, 12, 20, 100]; // TODO: place in settings + +function drawMenu() { + + g.clear(); + g.setFont ("6x8", 2); + + g.drawString ("# of dice:", 5, 5); + g.drawString (diceOpts.amount, 137, 5); + + g.drawString ("dice:", 5, 32); + g.drawString (DICE_ARRAY [diceOpts.selected], 137, 32); +} + +function touchHandler (button, xy) { + + if (menu) { + + if (xy.y <= 26) { // selecting number of dice + + if (xy.x <= 87) { // left edge: decrease + + if (diceOpts.amount > 1) + diceOpts.amount--; + } else { // right edge: increase + + if (diceOpts.amount < 6) + diceOpts.amount++; + } + + drawMenu(); + } else if (xy.y <= 53) { // selecting dice type + + if (xy.x <= 87) { // left edge: decrease + + if (diceOpts.selected > 0) + diceOpts.selected--; + } else { // right edge: increase + + if (diceOpts.selected < DICE_ARRAY.length - 1) + diceOpts.selected++; + } + + drawMenu(); + } else { + + rollDice(); + } + } else { // return to menu screen + + menu = true; + drawMenu (); + } +} + +function rollDice() { + + menu = false; + if (diceOpts.amount == 1) { + + let output = random (DICE_ARRAY [diceOpts.selected]); + + g.clear(); + g.setFont ("Vector", 90); + + g.drawString ((" " + output).slice (-3), 10, 0); + } else { + + let output = new Int8Array ([-1, -1, -1, -1, -1, -1]); + for (let i = 0; i < diceOpts.amount; i++) { + + output [i] = random (DICE_ARRAY [diceOpts.selected]); + } + + g.clear(); + g.setFont ("Vector", 40); + + for (let i = 0; i < 3; i++) { // draws all the numbers in two rows + + if (output [i * 2 + 0] == -1) { + + break; + } else if (output [i * 2 + 1] == -1) { + + + g.drawString ((" " + output [i * 2]).slice (-3), 5, 5 + i * 40); + } else { + + g.drawString ((" " + output [i * 2]).slice (-3) + " " + (" " + output [i * 2 + 1]).slice (-3), 5, 5 + i * 40); + } + } + + g.setFont ("Vector", 20); + g.drawString ("H: " + (" " + max (output)).slice (-3), 5, 130); + g.drawString ("L: " + (" " + min (output)).slice (-3), 110, 130); + g.drawString ("T: " + (" " + total (output)).slice (-3), 5, 150); + g.drawString ("A: " + (" " + average (output)).slice (-3), 110, 150); + } +} + +function random (max) { // number is always between 1 and max + + return Math.round (Math.random() * (max - 1) + 1); +} + +function max (array) { + + let max = 0; + for (let i = 0; i < 6; i++) { + + if (array [i] == -1) + break; + + if (array [i] > max) + max = array [i]; + } + + return max; +} + +function min (array) { + + let min = array [0]; + for (let i = 1; i < 6; i++) { + + if (array [i] == -1) + break; + + if (array [i] < min) + min = array [i]; + } + + return min; +} + +function total (array) { + + let total = 0; + for (let i = 0; i < 6; i++) { + + if (array [i] == -1) + break; + + total += array [i]; + } + + return total; +} + +function average (array) { + + let average = 0; + let rounds = 0; + for (let i = 0; i < 6; i++) { + + if (array [i] == -1) + break; + + average += array [i]; + rounds++; + } + + return Math.round (average / rounds); +} + +drawMenu(); +Bangle.on ('touch', touchHandler); From 9dcf3e715e66230f21b1cf1e3dc59ab7da44ab7e Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 19:28:29 -0500 Subject: [PATCH 02/89] added a one-line changelog, and filled out the metadata.json file --- apps/multidice/ChangeLog | 1 + apps/multidice/metadata.json | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 apps/multidice/ChangeLog create mode 100644 apps/multidice/metadata.json diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog new file mode 100644 index 000000000..1c7728b3d --- /dev/null +++ b/apps/multidice/ChangeLog @@ -0,0 +1 @@ +0.90: got most of the features done, lacking some polish and real-hardware testing diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json new file mode 100644 index 000000000..b42c2ba16 --- /dev/null +++ b/apps/multidice/metadata.json @@ -0,0 +1,14 @@ +{ "id": "multidice", + "name": "multiple dice roller", + "shortName":"multidice", + "version":"0.90", + "description": "roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all dice", + "icon": "app.png", + "tags": "", + "supports" : ["BANGLEJS2"], + "readme": "README.md", + "storage": [ + {"name":"multidice.app.js","url":"app.js"}, + {"name":"multidice.img","url":"app-icon.js","evaluate":true} + ] +} From cd788fba56e409d7577381e6cd0a24aa648f4bed Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 19:31:32 -0500 Subject: [PATCH 03/89] left README.md incomplete so I can emulate + add screenshots --- apps/multidice/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 apps/multidice/README.md diff --git a/apps/multidice/README.md b/apps/multidice/README.md new file mode 100644 index 000000000..23a485d63 --- /dev/null +++ b/apps/multidice/README.md @@ -0,0 +1,25 @@ +# multiple dice roller + +roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all dice + +Add screen shots (if possible) to the app folder and link then into this file with ![](.png) + +## Usage + +Describe how to use it + +## Features + +Name the function + +## Controls + +Name the buttons and what they are used for + +## Requests + +Name who should be contacted for support/update requests + +## Creator + +Your name From c4bd98b35dd72a5133ff88ea1d1f20ee2646589d Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 19:57:31 -0500 Subject: [PATCH 04/89] toggled the enable emulation flag in metadata.json --- apps/multidice/metadata.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index b42c2ba16..1a41cf09f 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -7,6 +7,7 @@ "tags": "", "supports" : ["BANGLEJS2"], "readme": "README.md", + "allow_emulator": true, "storage": [ {"name":"multidice.app.js","url":"app.js"}, {"name":"multidice.img","url":"app-icon.js","evaluate":true} From 44dd494c5b4f50edfb30ccad70d675f553245ca5 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 20:10:09 -0500 Subject: [PATCH 05/89] forgot to switch from hard tabs to soft tabs --- apps/multidice/app.js | 278 +++++++++++++++++++++--------------------- 1 file changed, 139 insertions(+), 139 deletions(-) diff --git a/apps/multidice/app.js b/apps/multidice/app.js index d0f62b8e9..d11bc99d5 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -3,166 +3,166 @@ var diceOpts = {amount: 2, selected: 5}; // TODO: grab values from settings const DICE_ARRAY = [4, 6, 8, 10, 12, 20, 100]; // TODO: place in settings function drawMenu() { - - g.clear(); - g.setFont ("6x8", 2); - - g.drawString ("# of dice:", 5, 5); - g.drawString (diceOpts.amount, 137, 5); - - g.drawString ("dice:", 5, 32); - g.drawString (DICE_ARRAY [diceOpts.selected], 137, 32); + + g.clear(); + g.setFont ("6x8", 2); + + g.drawString ("# of dice:", 5, 5); + g.drawString (diceOpts.amount, 137, 5); + + g.drawString ("dice:", 5, 32); + g.drawString (DICE_ARRAY [diceOpts.selected], 137, 32); } function touchHandler (button, xy) { - - if (menu) { - - if (xy.y <= 26) { // selecting number of dice - - if (xy.x <= 87) { // left edge: decrease - - if (diceOpts.amount > 1) - diceOpts.amount--; - } else { // right edge: increase - - if (diceOpts.amount < 6) - diceOpts.amount++; - } - - drawMenu(); - } else if (xy.y <= 53) { // selecting dice type - - if (xy.x <= 87) { // left edge: decrease - - if (diceOpts.selected > 0) - diceOpts.selected--; - } else { // right edge: increase - - if (diceOpts.selected < DICE_ARRAY.length - 1) - diceOpts.selected++; - } - - drawMenu(); - } else { - - rollDice(); - } - } else { // return to menu screen - - menu = true; - drawMenu (); - } + + if (menu) { + + if (xy.y <= 26) { // selecting number of dice + + if (xy.x <= 87) { // left edge: decrease + + if (diceOpts.amount > 1) + diceOpts.amount--; + } else { // right edge: increase + + if (diceOpts.amount < 6) + diceOpts.amount++; + } + + drawMenu(); + } else if (xy.y <= 53) { // selecting dice type + + if (xy.x <= 87) { // left edge: decrease + + if (diceOpts.selected > 0) + diceOpts.selected--; + } else { // right edge: increase + + if (diceOpts.selected < DICE_ARRAY.length - 1) + diceOpts.selected++; + } + + drawMenu(); + } else { + + rollDice(); + } + } else { // return to menu screen + + menu = true; + drawMenu (); + } } function rollDice() { - - menu = false; - if (diceOpts.amount == 1) { - - let output = random (DICE_ARRAY [diceOpts.selected]); - - g.clear(); - g.setFont ("Vector", 90); - - g.drawString ((" " + output).slice (-3), 10, 0); - } else { - - let output = new Int8Array ([-1, -1, -1, -1, -1, -1]); - for (let i = 0; i < diceOpts.amount; i++) { - - output [i] = random (DICE_ARRAY [diceOpts.selected]); - } - - g.clear(); - g.setFont ("Vector", 40); - - for (let i = 0; i < 3; i++) { // draws all the numbers in two rows - - if (output [i * 2 + 0] == -1) { - - break; - } else if (output [i * 2 + 1] == -1) { - - - g.drawString ((" " + output [i * 2]).slice (-3), 5, 5 + i * 40); - } else { - - g.drawString ((" " + output [i * 2]).slice (-3) + " " + (" " + output [i * 2 + 1]).slice (-3), 5, 5 + i * 40); - } - } - - g.setFont ("Vector", 20); - g.drawString ("H: " + (" " + max (output)).slice (-3), 5, 130); - g.drawString ("L: " + (" " + min (output)).slice (-3), 110, 130); - g.drawString ("T: " + (" " + total (output)).slice (-3), 5, 150); - g.drawString ("A: " + (" " + average (output)).slice (-3), 110, 150); - } + + menu = false; + if (diceOpts.amount == 1) { + + let output = random (DICE_ARRAY [diceOpts.selected]); + + g.clear(); + g.setFont ("Vector", 90); + + g.drawString ((" " + output).slice (-3), 10, 0); + } else { + + let output = new Int8Array ([-1, -1, -1, -1, -1, -1]); + for (let i = 0; i < diceOpts.amount; i++) { + + output [i] = random (DICE_ARRAY [diceOpts.selected]); + } + + g.clear(); + g.setFont ("Vector", 40); + + for (let i = 0; i < 3; i++) { // draws all the numbers in two rows + + if (output [i * 2 + 0] == -1) { + + break; + } else if (output [i * 2 + 1] == -1) { + + + g.drawString ((" " + output [i * 2]).slice (-3), 5, 5 + i * 40); + } else { + + g.drawString ((" " + output [i * 2]).slice (-3) + " " + (" " + output [i * 2 + 1]).slice (-3), 5, 5 + i * 40); + } + } + + g.setFont ("Vector", 20); + g.drawString ("H: " + (" " + max (output)).slice (-3), 5, 130); + g.drawString ("L: " + (" " + min (output)).slice (-3), 110, 130); + g.drawString ("T: " + (" " + total (output)).slice (-3), 5, 150); + g.drawString ("A: " + (" " + average (output)).slice (-3), 110, 150); + } } function random (max) { // number is always between 1 and max - - return Math.round (Math.random() * (max - 1) + 1); + + return Math.round (Math.random() * (max - 1) + 1); } function max (array) { - - let max = 0; - for (let i = 0; i < 6; i++) { - - if (array [i] == -1) - break; - - if (array [i] > max) - max = array [i]; - } - - return max; + + let max = 0; + for (let i = 0; i < 6; i++) { + + if (array [i] == -1) + break; + + if (array [i] > max) + max = array [i]; + } + + return max; } function min (array) { - - let min = array [0]; - for (let i = 1; i < 6; i++) { - - if (array [i] == -1) - break; - - if (array [i] < min) - min = array [i]; - } - - return min; + + let min = array [0]; + for (let i = 1; i < 6; i++) { + + if (array [i] == -1) + break; + + if (array [i] < min) + min = array [i]; + } + + return min; } function total (array) { - - let total = 0; - for (let i = 0; i < 6; i++) { - - if (array [i] == -1) - break; - - total += array [i]; - } - - return total; + + let total = 0; + for (let i = 0; i < 6; i++) { + + if (array [i] == -1) + break; + + total += array [i]; + } + + return total; } function average (array) { - - let average = 0; - let rounds = 0; - for (let i = 0; i < 6; i++) { - - if (array [i] == -1) - break; - - average += array [i]; - rounds++; - } - - return Math.round (average / rounds); + + let average = 0; + let rounds = 0; + for (let i = 0; i < 6; i++) { + + if (array [i] == -1) + break; + + average += array [i]; + rounds++; + } + + return Math.round (average / rounds); } drawMenu(); From 0176522932179597fd018ce0550f75a9c5df43fe Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 20:26:04 -0500 Subject: [PATCH 06/89] filled out the README.md, and added screenshots of the app. --- apps/multidice/2d20.png | Bin 0 -> 2352 bytes apps/multidice/README.md | 19 ++++++++++++------- apps/multidice/d100.png | Bin 0 -> 1936 bytes apps/multidice/main.png | Bin 0 -> 1547 bytes apps/multidice/menuPercent.png | Bin 0 -> 1467 bytes 5 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 apps/multidice/2d20.png create mode 100644 apps/multidice/d100.png create mode 100644 apps/multidice/main.png create mode 100644 apps/multidice/menuPercent.png diff --git a/apps/multidice/2d20.png b/apps/multidice/2d20.png new file mode 100644 index 0000000000000000000000000000000000000000..e6c52b839b07e4237582668126be172707a6309c GIT binary patch literal 2352 zcmeH}`8V5%7Qo{xOkzd_#Vcy5B{VfUlxJGCHI){nQIbY%XADt0ovNMG(W1zs_H~NX zl0=AoZ8};@#8$B{jkR7ap|Mph&->+_^ZtkV;okepz2~0u`P?6F!hLI$sEDix2m}(n zdk1NIR;<5aF{-Z(MQ)fgt;Lk*0Pb&KvpjVbcabfd_e~L(NSUyd6!68YR;(HJj)$ z7_+h+NrGAG zTfsy{Qnz-@sQ(^@J@5Cf^&jlQeHx&swW(>A!6YpDyHj%eaNNm!y!Tr&GxcGK?d?TH z0mXt5G&jC;U5`Ft&}YMid|8E3lRl;S2A5NiSOd1BxAzGvGz&@vMaJD=FxiGr4HIoT>s zns-RsQQ<@q>dM+Q}P3S=$f0x=7nDJ1_IGr+JbGgBz;f zw5J`kXTl3RQO~j?eKYTINQZ|tVRJ72MRUiN1sOm3KraX}PUVTy?>RG^79XS2_Umo0 zn1r$bF?q02S!SxvgXvczGzDc?lX(kkJP)n`ma2MhNxE(?rmquX<=*aa0K=iM1QJyK8*A=VM?Qh$P_ zOUW}{SY(c*NrtFR3^!jk>wA9R-neBiQc>y(>_BN&dSV!cFr!H5+!$D$5;xc`)RP-% zFiNAsdpy~xQCO$x+D(kVl$8PT6@06~5n6Yt)c%<{Ut=w~t4IDk>tQ48Ax=XNwyIpc zWa((*<|rr-2Lcf3s1%7QZ?Vd6UN>1m}L!xT~T@_{N<`(C^D24>hE3?p%07T7RhuQq;sJ<{oM^Hp820crGFeLi+>rdd>pTFV-Y@RT1Oe0Lx7+`6+hq7r2akhE#^3dUYCa8_fuWzFLwYKqU^3#k(*?p#iTZv~^pOUFJ#sC^Z7Mxh>z zU&A+NPmXPgDmmvNlewPO;1gxpKvod;%jmCz)_%(`gZW@g?)q#XYr^6l7)qq8Z1s`Z z1>0`mIo`^8qm#QXjhdjpIhj?mn(5dqOzu{}eNqotUKp)m{A=^8x*4vK6@YQ#EasHE z0|@#X%;u`fka+319)TX>T=X{lA})dRgwRc+lERX7(2V98d^`*9=23t;SqVvc2UBgdo#hs z-c@@?-XCi2BRY3s6F(q99 zD`CRTsLP?`gMcg*cV-3{7NX|6av6U0h!mQRy}0b;FFX@1N1D6*`x;@-`DXCS@uS@t z+ID&e!{6SS?}Xucz6(#S-9-piyG5E@I1asFMN((h&Ty^ zI82fAid#jf3dk%&VjkW8B+7JBB!@O=u~T)Zu~hiLf6Rf=UcQ?p9TM$jJ{aqDOodUp zlg(1V^vyCoXU^J*Lw$#%>yrg^$S{pB8I>+ylcK-FM!nG}8gs*YES|wN{$%n`(vQ=k zfrkTEamFpZ9?taV5vrl8QMW%y0SGxO>89V%NdiQ#Gne<$w=>UNlACg5>E1>@ zbE)a4PEn6xjv_DkYYKp!6Z3j2p-KUI=q|hkh?uqD!T8_kfy|B(&Y>3Jee>)S0^PlB KjjS?refA&Y2tz>t literal 0 HcmV?d00001 diff --git a/apps/multidice/README.md b/apps/multidice/README.md index 23a485d63..b33365d49 100644 --- a/apps/multidice/README.md +++ b/apps/multidice/README.md @@ -1,25 +1,30 @@ # multiple dice roller -roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all dice +roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all the dice -Add screen shots (if possible) to the app folder and link then into this file with ![](.png) +![the start-up screen](main.png) +![two rolled dice](2d20.png) +![the startup screen](menuPercent.png) +![one large dice](d100.png) ## Usage -Describe how to use it +On the menu screen: tap to the right or left of the "# of dice" option to change how many dice to roll, & tap to the left or right of the "dice" option to select a different type (currently hard-coded to only allow DnD dice). To roll the dice, simply tap anywhere else on the screen. To go back to the dice selector. + +Once you're no longer on the menu screen, tap anywhere on the screen to return to the menu (W.I.P: shaking the watch to allow rolling dice again without having to go to the menu every time) ## Features -Name the function +roll anywhere from 1-6 dice (d4, d6, d8, d10, d12, d20, & d percentile). If only one dice is selected, it simply displays the output; if two or more dice are selected it also displays basic stats such as the highest & lowest roll, the total sum, and the average of all the dice. ## Controls -Name the buttons and what they are used for +No button is used in the app, it simply uses touch controls (W.I.P: accelerometor to roll the dice & compatability with the bangle.js 1). ## Requests -Name who should be contacted for support/update requests +Le3Kat@gmail.com ## Creator -Your name +Le~Kat diff --git a/apps/multidice/d100.png b/apps/multidice/d100.png new file mode 100644 index 0000000000000000000000000000000000000000..16350db1657632de685f8c0289d84112b8334f6d GIT binary patch literal 1936 zcmeHI`%{t$6vZ#UM6wA~EK76=-;AcEtENyPCak5DDLs6xWtv7>t*fSF>_BBDRGVp; zT4vHtDr{PsDB`2(HAbeE76Q7I_yWuaqN1z+!R|~y_QSnr=AOB8XU@5IZVn|la5Zc_ z3<80yCXSF4DEK#Ztl;*NdkQDcQ2zi;$00rM9Zm3?;c*IVIt53%B+ z>yx4mKY38ka<@IL(=KK&&V&FqzsO5PHn;E4vJsS+fSCjUHs3Mc+W?G+0?jCL4qN;c zIg_&@{|)$g+&FsFDh>|{J12``)VU$%x`YWQjm^l;m4%Mq_6+(qii(=;FJ{f?-p*dW za;v!tu2W9Xx8VAW8#ebGx+YM)2rN-AxKU!}BU|TKC{r#p>p`cx>@P4FR*R9}7i*O- zy}OO?SZES*IQZqVNm`j`sil`S=HZZ%D7tTppUvW06r2yjGp{zj#Md&ey%gIh`bTy1npI(Ue_NY$HD7A?jt@TNv0&uoIJW?il+--h?Q3jh6hIUUI3__z=!}) zojH-(_PgwMn7Nv~%PZB|DL7~-RI$vjNKau)+1Q{Djo}O;_=kIJ6OXOxm#iyiH{li{A#v{dIh5Baf zZ=ybZxEs58tV1egc$p4alwuUBVl7GHo)4(e*|p`N=c}&zW=b#flb+7$ag4Raq9Qc! zM%`&wP@2i~kTC@Q;qusbfss-t0=KP*o*dWblkcFhpsPgz1WvyAdXKNB#aEL$(y@c* zm!aOnE^bdoi+bO?v?;F&<|==(!W9BkrC0Vv0WEIdJMy=)Vz0!f@f{f~$lfMrv}rCh z96j!qA9aRG-%c8O^!jH6HNEUDk-_))UGiF5~lixc@d}K~dERs%v$M%G6>bf;SZ%;2@b26mqlGDN<@l| zIN0a<)ac{zjHxWxyxbdw{x%#F-56wb3=f{Y=3%_`fCS-i>QfeMmut<3HaJCI;CP$~ zr^FE2Z?6MjR%WbRH~`!A@PL{BcE;gSK7z2FVeFX{3w2D{W&Se(>gaaw=x!4Oke$=A z6KVk3cU9z|?~2^_^gx$@dE3+7(A?V|wgGKuUO=g~KYtE*LHrfNJO`L1{uuT{#_zTu a^F~jqKDvZ8uF)=iS_nBHm{>)K`Qu-37+f|0 literal 0 HcmV?d00001 diff --git a/apps/multidice/main.png b/apps/multidice/main.png new file mode 100644 index 0000000000000000000000000000000000000000..7ca8f963174c7da421bc8d8abfd3391a64f13492 GIT binary patch literal 1547 zcmeAS@N?(olHy`uVBq!ia0vp^8$g(Y4M?uv{v?ipf%TH7i(^Pd+}qg?%Vq@#u)Y3m zUvhi$5wnLK)#3p=?)&_2DoRgxSn~1P@Av!T{}nS$_Ir?aVDhZuoASa23C=UBnAmK# z+KJ~MFf;hdvW(|P*=}2zU#s`^-|OH0?cddJE4g?6c*I-b5Fnbdwf2F)yG?~m{>*V* zmeE%tkK4cAAw75Bo7DIJo=7tqK4{dG{P29jGR}(Jh2Gbz-&?w~2dzziZ}l$b?qi+r z>#rG}ie8)k#o}rm^YeH81?zvvK6og)L#UGdzV(8@g;%S-ty|2M)_c97K5l0JCxfb_ z+8QmJ-}85b-(?P$Kbd`d_4U#N``<_JeZP9U{`J4_9_P-z{ppDLgY}&fAD$;4S}T9^ zD(43C8}B&FzkIBVsoBHy|9{b^RSCNsL$~|5-#t`%SZeRn*Zbbj`@6UG$G5k)8s;xI z@jbA9A5%!UO1|Q}`%WR@YqIuTeZ9VWZ8tzQ?{ zh*ah7e>FLM=el?9uL9r4105#b@ovtl((uy(|h7TI^L(_^h@6Z4b`8E-gg6OeYGP`zo;b~*ju^t`%xe*F8rvdO8ACI z!Po14SHIm8x_g^*jsJm$waKqI_ozHrss89uxO%}A`493xKUXuG-FV39BVO<|c+x9z zma8+rt!u3Cx4ZM=uRoVqxYtO%$|8Gs*>-Ej66IQ)t+vEQ7cYHK!RPO!Fk5)3RbLii(d{v+0 zJ-c6XmvU{ZW~??VW>yownF5Te#?tc#-u=59Jz<&qop*PC>O05(-c)}?{aHx(gS7`@ z8Fx5wKX~`YkN?NH&EG8xzV3Oy;=8=r#N_oe3t7ANM`p4(G% z_u6u`YBrCGw_6y6pPaDx&SLgg_sE?S>+CX_*yf}NpGZ33@Y3_dD04I%hFl`3XK-^& Wv6(9Jbw99>XYh3Ob6Mw<&;$UNdjDDZGy0Y(FVSM=e(rLfL zi?^)XK5O|`tE+W;FI8W^UH#AYH}jtfQU`9gBr)jEXMETHBz$j4$n(hCakAT=3;y|g zea`>+S#SPMdHCYv>7D)a)?4i}U+!P6|Hb0J=Jx}k2N?eUo>6dxnd?FG{r`+R-Y>1n zeII`R@wP+jer4O9*Z%gI=g-0I0-*;P*4NBjUS(X&UzXo+Rr!YQk#D*#th-Nbx7v5h z?$@8IUr$#jG}OCAh?bR9zn{Hh)q|{guYP3xe(^c{x;|t7Kar%$e@_oo-{12^=g-Z3 zSDDK#udlYd9$W4DdT#pK?H6~-)VkUk-3Pjd!G8UkuZ%&Bm0yihzB;UWX34b0%Iwo= zo2!d*=BqO{Jb(FXk~Zs)Nn6it)}WNLBDP_5zIEvB=bhKR+|?OAyl9zQpTXqJz(4oK zNq_$ZUq!!##{ang>!s9z<;5qY71#>C`u=$(&T_Ti?*2!PzmG0TRmd&hH_r zvyX?{Kia$g)6K85>Vme22_JaRTJr5`5<~d;h{fCWyQ{u`J=gXr^LqTV`?uXoYulfW9ltxP#esqLrRM6#t6$Ua$1$#+SFq}F_4eaT>l8x2-?{p6+ji9eTg5L; zZ|=%J*f#IY)=3Npj@G9~?N#}DY8BIa+xu^RhgXK>f4erX@VZ^@ja~Ot-!*CnggyXj z{O_~i)aQ}|r_GbA?cJiQUH1O^v-Wyn|DN{?BmUYhsCpI?xAj-Sg3|x%|F+ff-Qjxu zf_ceTD+YhIiu*;fs*T@OH@x00@Lu}-RFw_Dq}}48&QMTN+r~bl@dXP*-@5Z37>tpV zJcGq9yTi<997>oN+^?rsG)Q*%F+6zji-+HU`64HSOzixJjA;s1j17xl8`~V<88r-4 hOpJyZdeZnKZ+?G`jqq~$%fLdJ!PC{xWt~$(696AnwY>lU literal 0 HcmV?d00001 From abc1951d485ae493778e16eb8984c3a7a595f741 Mon Sep 17 00:00:00 2001 From: Le-Kat <37410281+Le-Kat@users.noreply.github.com> Date: Fri, 10 Feb 2023 01:27:49 +0000 Subject: [PATCH 07/89] added spacing between two of the images --- apps/multidice/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/multidice/README.md b/apps/multidice/README.md index b33365d49..7e44600d6 100644 --- a/apps/multidice/README.md +++ b/apps/multidice/README.md @@ -4,6 +4,7 @@ roll anywhere from 1-6 dice at the same time, and display stats like the highest ![the start-up screen](main.png) ![two rolled dice](2d20.png) + ![the startup screen](menuPercent.png) ![one large dice](d100.png) From a2010999e4c7dfdf4a83ee48163c0ad70f9eb241 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 20:39:22 -0500 Subject: [PATCH 08/89] added app icon --- apps/multidice/app-icon.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 apps/multidice/app-icon.js diff --git a/apps/multidice/app-icon.js b/apps/multidice/app-icon.js new file mode 100644 index 000000000..d79fe5bd2 --- /dev/null +++ b/apps/multidice/app-icon.js @@ -0,0 +1 @@ +E.toArraybuffer(atob("MDCBAf////w///////gf/4AAAfPP/z///efn/z///M/z/z///J/5/z///z48/z///nwefz///PnfPz/D+fnfnz+B8/2fzz885/w/5z9+z///8z9+nw/4eT9+Pm/zfD88Puf3PD+Bvuf3PD/Dng/wfD//z5/8+T//5/5/8z//8/wf5z//+fnfzz///Pnfnz///H2fP4AAATw+R4AAAB/8wz///M/5+zD//OfyOyB//PPkGSZ//PnN2WZ//Nwd2eB//MP8GXD//OP+OX/D/P+P+f+B/P8H+X+Z/P93+T+Z/P93+T+B/P8H+T/D/P+P+T//DOP+OT/+BMH8GT/+ZN392T/+ZN392T/+BMH8GT//DOP+Oz///P//+4//8D//48AAAwAADw==")) From e3f3fe3ddddc041ed0fdd72f171d32eb9fa7cefb Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 21:36:51 -0500 Subject: [PATCH 09/89] removed email from README b/c I don't want it getting scraped --- apps/multidice/README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/apps/multidice/README.md b/apps/multidice/README.md index 7e44600d6..06ea82075 100644 --- a/apps/multidice/README.md +++ b/apps/multidice/README.md @@ -21,11 +21,3 @@ roll anywhere from 1-6 dice (d4, d6, d8, d10, d12, d20, & d percentile). If only ## Controls No button is used in the app, it simply uses touch controls (W.I.P: accelerometor to roll the dice & compatability with the bangle.js 1). - -## Requests - -Le3Kat@gmail.com - -## Creator - -Le~Kat From d236364b9ca21f592be45f64d2685ebd0a5f52c6 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 21:41:49 -0500 Subject: [PATCH 10/89] added app.png --- apps/multidice/app.png | Bin 0 -> 1330 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/multidice/app.png diff --git a/apps/multidice/app.png b/apps/multidice/app.png new file mode 100644 index 0000000000000000000000000000000000000000..75ee0514a953e29e618bf56a49e8526e8eac59f5 GIT binary patch literal 1330 zcmV-21iCYS(1OJaP25k$Q;U-Cc6Fq}DO z&f~^^GU+{YX6AhVneRCO{|_z%wga=k3E*Skx~hw=0yfvshP74*4PYP80`>qe0f&IU zfwg4>?*QHb=4)F)$4fq%-7cwW2lxIR!7w#Jawd^RBbJpr|vEJNZr zu$TJrE^sVT_(~*NI)%ECoNTP{E{TaEBurmNX%Di5Uk2;>QW1~>|Q zp_6*g8xu{U9R%{!X1DC4q2~>f$m3>z>*jeSp+ugy@h%ooqG4A zlCd=5?*@K#c6!`%mua{Y_}Q8BK5#(_2~*))>NtT{^!E|(eU}88QF1pdy?=@@8o*D$ z0U7p2;9uamlv6#Vjmsp^Ej{1w=(=wMqgulRcCk|Zw>f>&+Px4~XpR|ng3lEze7vad z=X#<06m%?SdQI)P`qnt7wA7n-rTT}Q&6rd44dF7)+2owaQ5n1s%iq3>Az-*3_)x{i z@4yF&riLEi5ACk$r;Bl^&6J84vy=XuZ|%{XX$8A8DKTe_#%zrxkcUBehDnda0_nU3 zuGfKO5o>iQPJ9Bq0bJ|7AJ9hZON_g&RAOy_Lrs$IA%cj(Q-5#BK@SrRPoB$R$OEM}|^&MV3cm!b|2>rMTQE;SDe76ozW5i7!!f zZb_+e#w8zuCNa;}9%g-4eBbsKIaz5><%D~+st>260#(qhHRt8iABgl$F={j97eA+T z&6fm`tx6Rva&A#y8En^wF4l7li2+CW)r!U^W$;Pl?{YTgoH#Hh=_bP{zDa7oziF4c}c>Zwgrb1(Ihyk;5!%cl<`h61e!VCCWN3H4Pmy;1p3-dpp18lA<&!SZE7P>#yb@; z;;DeQsf|Dx@8lCG>TUWn#@9w5%R9LQih7%#vbj)EWO*l-Kv8egERqXVAuwBzK&-cE z7RiOG5XkaQX}M6Wx9KgC3!Qcfnxe?^PDw%2DCuqb1LMyrXp)lB{TG<3u(ghOm%DXg zgVwz@=~$*>;)pE1>VNjwrnOG#wxgwDe5B&KBTi9o7h`APYTz?{wCZ(=tzq|_cB5=p oHg@l1bwC|gHFnkhjC-x}A5s&T=P#0nHvj+t07*qoM6N<$g6g++LI3~& literal 0 HcmV?d00001 From a8339c1718a5acaf0d38dce3f2d9821a59cd6096 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 22:31:50 -0500 Subject: [PATCH 11/89] added tags to metadata.json, trying to wrap my head around the sanitycheck --- apps/multidice/app-icon.js | 2 +- apps/multidice/metadata.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/multidice/app-icon.js b/apps/multidice/app-icon.js index d79fe5bd2..d6e931259 100644 --- a/apps/multidice/app-icon.js +++ b/apps/multidice/app-icon.js @@ -1 +1 @@ -E.toArraybuffer(atob("MDCBAf////w///////gf/4AAAfPP/z///efn/z///M/z/z///J/5/z///z48/z///nwefz///PnfPz/D+fnfnz+B8/2fzz885/w/5z9+z///8z9+nw/4eT9+Pm/zfD88Puf3PD+Bvuf3PD/Dng/wfD//z5/8+T//5/5/8z//8/wf5z//+fnfzz///Pnfnz///H2fP4AAATw+R4AAAB/8wz///M/5+zD//OfyOyB//PPkGSZ//PnN2WZ//Nwd2eB//MP8GXD//OP+OX/D/P+P+f+B/P8H+X+Z/P93+T+Z/P93+T+B/P8H+T/D/P+P+T//DOP+OT/+BMH8GT/+ZN392T/+ZN392T/+BMH8GT//DOP+Oz///P//+4//8D//48AAAwAADw==")) +atob("MDCEAREREREREREREREREREREQAAEREREREREREREREREREREREREREREAAAARERERERERAAAAAAAAAAAAAAARERABERABEREREREQARERERERERERERAREQAREREAEREREREQARERERERERERERABEAEREREQAREREREQARERERERERERERABABERERERABEREREQAREREREREREREREQARERAAEREAEREREQAREREREREREREREAEREQAAAREQAREREQARERERERERERERABEREAERARERABEREQARERERAAAREREQAREREAERAREREAEREQAREREQAAABEREAEREREQEQAREREQAREQAREREAEREAERABEREREQAAERERERABEQAREREBEREQEQAREREREREREREREREAEQAREREBEREQEAEREQAAERERERAAAREQAQAREREBEREQABEREAEQEREREQARARERAAAREREAEREAABEREBEQAREREQERABERAAAREREQAAABEBEREBEQAREREQERABERAAARERERAAAREAEREAAAEREREQAAARERAAAREREREREREQARERABEREREREAEREQAQARERERERERERABERERERABEREREREAEQAREREREREREREAEREREQAAARERERABEQAREREREREREREQAREREAERAREREQAREQARERERERERERERABEREAERAREREAEREQARERERERERERERAAEREQEQARERABERERAAAAAAAAAAAAAAAQAREQAAEREQAQABERAAAAAAAAAAAAAAAAABEREREREAEQAAEQARERERERERERERABEAERERERABEREQEQARAAARERERERERABEQAREREQAQABEQEQAQAAABERERERERABERABEREAEAAAEQAQAQARABERERERERABEREAERABEBEQEQAQEQARABERERERERABEBEQAAAREBEQEQAREQAAABERERERERABEAABEREREAAAEQAQERAAARERERERERABEQABEREREQABEQAQERERERAAARERERABEREREQABEREREQAREREREQAAABERERABEREREAAAEREREQAQEREREQARABERERABEREREBEQEREREQAQAREREQARABERERABEREREBEQEREREQAQAREREQAAABERERABEREREAAAEREREQAQARERERAAARERERABEREREQABEREREQAQARERERERERAAARABEQABEREREQABEQAQAREREREREQAAABABEAAAEREREAAAEQAQAREREREREQARABABEBEQEREREBEQEQAQAREREREREQARABABEBEQEREREBEQEQAQAREREREREQAAABABEAAAEREREAAAEQAQARERERERERAAARABEQABEREREQABEQEQARERERERERERERABEREREREREREREQERAAEREREREREREAAAARERERERERERAAEREAAAAAAAAAAAAAEQAAAAAAAAAAAAAREQ==") diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 1a41cf09f..b7537d0b3 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -4,7 +4,7 @@ "version":"0.90", "description": "roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all dice", "icon": "app.png", - "tags": "", + "tags": "tool,game", "supports" : ["BANGLEJS2"], "readme": "README.md", "allow_emulator": true, From b2c8f55261a2b84bc184e93f60e81cadec24da3e Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Fri, 24 Feb 2023 23:39:42 -0500 Subject: [PATCH 12/89] after a rigorous field study of size n = 1, I have determined this to be a better app after this change --- apps/multidice/app.js | 230 +++++++++++++++++------------------------- 1 file changed, 94 insertions(+), 136 deletions(-) diff --git a/apps/multidice/app.js b/apps/multidice/app.js index d11bc99d5..911177983 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -1,169 +1,127 @@ var menu = true; -var diceOpts = {amount: 2, selected: 5}; // TODO: grab values from settings -const DICE_ARRAY = [4, 6, 8, 10, 12, 20, 100]; // TODO: place in settings +const DICE_ARRAY = [0, 4, 6, 8, 10, 12, 20, 100]; +const SELECTION_ARRAY = [6, 0, 0, 0, 0, 0, 0, 0]; // default to selecting a single d20 function drawMenu() { + stringArr = new Array ("", "", "", "", "", "", "", ""); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; + } + } + g.clear(); - g.setFont ("6x8", 2); + g.setFont ("Vector", 40); - g.drawString ("# of dice:", 5, 5); - g.drawString (diceOpts.amount, 137, 5); - - g.drawString ("dice:", 5, 32); - g.drawString (DICE_ARRAY [diceOpts.selected], 137, 32); + g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); + g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); + g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); + g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); + g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); + g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); + g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); + g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); } function touchHandler (button, xy) { - if (menu) { - - if (xy.y <= 26) { // selecting number of dice - - if (xy.x <= 87) { // left edge: decrease - - if (diceOpts.amount > 1) - diceOpts.amount--; - } else { // right edge: increase - - if (diceOpts.amount < 6) - diceOpts.amount++; - } - - drawMenu(); - } else if (xy.y <= 53) { // selecting dice type - - if (xy.x <= 87) { // left edge: decrease - - if (diceOpts.selected > 0) - diceOpts.selected--; - } else { // right edge: increase - - if (diceOpts.selected < DICE_ARRAY.length - 1) - diceOpts.selected++; - } - - drawMenu(); - } else { - - rollDice(); - } - } else { // return to menu screen + if (! menu) { menu = true; - drawMenu (); + drawMenu(); + return; } + + if (xy.x <= 87) { // left + + if (xy.y <= 43) { + + selection = 0; + } else if (xy.y <= 87) { + + selection = 1; + } else if (xy.y <= 131) { + + selection = 2; + } else { + + selection = 3; + } + } else { // right + + if (xy.y <= 43) { + + selection = 4; + } else if (xy.y <= 87) { + + selection = 5; + } else if (xy.y <= 131) { + + selection = 6; + } else { + + selection = 7; + } + } + + // increment SELECTION_ARRAY [selection] + if (SELECTION_ARRAY [selection] == 7) { + + SELECTION_ARRAY [selection] = 0; + } else { + + SELECTION_ARRAY [selection] += 1; + } + + drawMenu(); } function rollDice() { - menu = false; - if (diceOpts.amount == 1) { + resultsArr = new Uint8Array (8); + for (i = 0; i < 8; i++) { - let output = random (DICE_ARRAY [diceOpts.selected]); - - g.clear(); - g.setFont ("Vector", 90); - - g.drawString ((" " + output).slice (-3), 10, 0); - } else { - - let output = new Int8Array ([-1, -1, -1, -1, -1, -1]); - for (let i = 0; i < diceOpts.amount; i++) { + if (SELECTION_ARRAY [i] != 0) { - output [i] = random (DICE_ARRAY [diceOpts.selected]); + resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); } + } + + g.clear(); + g.setFont ("Vector", 40); + + for (i = 0; i < 4; i++) { - g.clear(); - g.setFont ("Vector", 40); - - for (let i = 0; i < 3; i++) { // draws all the numbers in two rows + if (SELECTION_ARRAY [i] != 0) { - if (output [i * 2 + 0] == -1) { - - break; - } else if (output [i * 2 + 1] == -1) { - - - g.drawString ((" " + output [i * 2]).slice (-3), 5, 5 + i * 40); - } else { - - g.drawString ((" " + output [i * 2]).slice (-3) + " " + (" " + output [i * 2 + 1]).slice (-3), 5, 5 + i * 40); - } + g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); } + } + + for (i = 4; i < 8; i++) { - g.setFont ("Vector", 20); - g.drawString ("H: " + (" " + max (output)).slice (-3), 5, 130); - g.drawString ("L: " + (" " + min (output)).slice (-3), 110, 130); - g.drawString ("T: " + (" " + total (output)).slice (-3), 5, 150); - g.drawString ("A: " + (" " + average (output)).slice (-3), 110, 150); + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * i); + } } } -function random (max) { // number is always between 1 and max +function random (max) { return Math.round (Math.random() * (max - 1) + 1); } -function max (array) { - - let max = 0; - for (let i = 0; i < 6; i++) { - - if (array [i] == -1) - break; - - if (array [i] > max) - max = array [i]; - } - - return max; -} - -function min (array) { - - let min = array [0]; - for (let i = 1; i < 6; i++) { - - if (array [i] == -1) - break; - - if (array [i] < min) - min = array [i]; - } - - return min; -} - -function total (array) { - - let total = 0; - for (let i = 0; i < 6; i++) { - - if (array [i] == -1) - break; - - total += array [i]; - } - - return total; -} - -function average (array) { - - let average = 0; - let rounds = 0; - for (let i = 0; i < 6; i++) { - - if (array [i] == -1) - break; - - average += array [i]; - rounds++; - } - - return Math.round (average / rounds); -} - drawMenu(); Bangle.on ('touch', touchHandler); +Bangle.on ('accel', function (xyz) { + + if (xyz.diff >= 0.3) { + + menu = false; + rollDice(); + } +}); From d567a55f9ca34700fd8bc9200fec1c7750333ae2 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Fri, 24 Feb 2023 23:46:13 -0500 Subject: [PATCH 13/89] updated changelog, metadata, & readme. deleted outdated images --- apps/multidice/2d20.png | Bin 2352 -> 0 bytes apps/multidice/ChangeLog | 1 + apps/multidice/README.md | 16 +++++----------- apps/multidice/app.png | Bin 1330 -> 0 bytes apps/multidice/d100.png | Bin 1936 -> 0 bytes apps/multidice/main.png | Bin 1547 -> 0 bytes apps/multidice/menuPercent.png | Bin 1467 -> 0 bytes apps/multidice/metadata.json | 4 ++-- 8 files changed, 8 insertions(+), 13 deletions(-) delete mode 100644 apps/multidice/2d20.png delete mode 100644 apps/multidice/app.png delete mode 100644 apps/multidice/d100.png delete mode 100644 apps/multidice/main.png delete mode 100644 apps/multidice/menuPercent.png diff --git a/apps/multidice/2d20.png b/apps/multidice/2d20.png deleted file mode 100644 index e6c52b839b07e4237582668126be172707a6309c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2352 zcmeH}`8V5%7Qo{xOkzd_#Vcy5B{VfUlxJGCHI){nQIbY%XADt0ovNMG(W1zs_H~NX zl0=AoZ8};@#8$B{jkR7ap|Mph&->+_^ZtkV;okepz2~0u`P?6F!hLI$sEDix2m}(n zdk1NIR;<5aF{-Z(MQ)fgt;Lk*0Pb&KvpjVbcabfd_e~L(NSUyd6!68YR;(HJj)$ z7_+h+NrGAG zTfsy{Qnz-@sQ(^@J@5Cf^&jlQeHx&swW(>A!6YpDyHj%eaNNm!y!Tr&GxcGK?d?TH z0mXt5G&jC;U5`Ft&}YMid|8E3lRl;S2A5NiSOd1BxAzGvGz&@vMaJD=FxiGr4HIoT>s zns-RsQQ<@q>dM+Q}P3S=$f0x=7nDJ1_IGr+JbGgBz;f zw5J`kXTl3RQO~j?eKYTINQZ|tVRJ72MRUiN1sOm3KraX}PUVTy?>RG^79XS2_Umo0 zn1r$bF?q02S!SxvgXvczGzDc?lX(kkJP)n`ma2MhNxE(?rmquX<=*aa0K=iM1QJyK8*A=VM?Qh$P_ zOUW}{SY(c*NrtFR3^!jk>wA9R-neBiQc>y(>_BN&dSV!cFr!H5+!$D$5;xc`)RP-% zFiNAsdpy~xQCO$x+D(kVl$8PT6@06~5n6Yt)c%<{Ut=w~t4IDk>tQ48Ax=XNwyIpc zWa((*<|rr-2Lcf3s1%7QZ?Vd6UN>1m}L!xT~T@_{N<`(C^D24>hE3?p%07T7RhuQq;sJ<{oM^Hp820crGFeLi+>rdd>pTFV-Y@RT1Oe0Lx7+`6+hq7r2akhE#^3dUYCa8_fuWzFLwYKqU^3#k(*?p#iTZv~^pOUFJ#sC^Z7Mxh>z zU&A+NPmXPgDmmvNlewPO;1gxpKvod;%jmCz)_%(`gZW@g?)q#XYr^6l7)qq8Z1s`Z z1>0`mIo`^8qm#QXjhdjpIhj?mn(5dqOzu{}eNqotUKp)m{A=^8x*4vK6@YQ#EasHE z0|@#X%;u`fka+319)TX>T=X{lA})dRgwRc+lERX7(2V98d^`*9=23t;SqVvc2UBgdo#hs z-c@@?-XCi2BRY3s6F(q99 zD`CRTsLP?`gMcg*cV-3{7NX|6av6U0h!mQRy}0b;FFX@1N1D6*`x;@-`DXCS@uS@t z+ID&e!{6SS?}Xucz6(#S-9-piyG5E@I1asFMN((h&Ty^ zI82fAid#jf3dk%&VjkW8B+7JBB!@O=u~T)Zu~hiLf6Rf=UcQ?p9TM$jJ{aqDOodUp zlg(1V^vyCoXU^J*Lw$#%>yrg^$S{pB8I>+ylcK-FM!nG}8gs*YES|wN{$%n`(vQ=k zfrkTEamFpZ9?taV5vrl8QMW%y0SGxO>89V%NdiQ#Gne<$w=>UNlACg5>E1>@ zbE)a4PEn6xjv_DkYYKp!6Z3j2p-KUI=q|hkh?uqD!T8_kfy|B(&Y>3Jee>)S0^PlB KjjS?refA&Y2tz>t diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 1c7728b3d..a216ea61b 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -1 +1,2 @@ 0.90: got most of the features done, lacking some polish and real-hardware testing +1.00: overhauled the whole app, made some margins larger to be easier to tap on diff --git a/apps/multidice/README.md b/apps/multidice/README.md index 06ea82075..2d28ef33f 100644 --- a/apps/multidice/README.md +++ b/apps/multidice/README.md @@ -1,23 +1,17 @@ # multiple dice roller -roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all the dice +roll anywhere from 1-8 dice at the same time. -![the start-up screen](main.png) -![two rolled dice](2d20.png) - -![the startup screen](menuPercent.png) -![one large dice](d100.png) ## Usage -On the menu screen: tap to the right or left of the "# of dice" option to change how many dice to roll, & tap to the left or right of the "dice" option to select a different type (currently hard-coded to only allow DnD dice). To roll the dice, simply tap anywhere else on the screen. To go back to the dice selector. - -Once you're no longer on the menu screen, tap anywhere on the screen to return to the menu (W.I.P: shaking the watch to allow rolling dice again without having to go to the menu every time) +On the menu screen: tap on the dice to change what variant is selected, & shake the watch in order to roll those dice +On the dice screen: tap anywhere on the screen to go back to the menu, or shake to roll the dice again ## Features -roll anywhere from 1-6 dice (d4, d6, d8, d10, d12, d20, & d percentile). If only one dice is selected, it simply displays the output; if two or more dice are selected it also displays basic stats such as the highest & lowest roll, the total sum, and the average of all the dice. +roll anywhere from 1-8 dice (d4, d6, d8, d10, d12, d20, & d percentile). You can select multiple different dice at the same time ## Controls -No button is used in the app, it simply uses touch controls (W.I.P: accelerometor to roll the dice & compatability with the bangle.js 1). +No button is used in the app, it simply uses touch controls & the accelerometor diff --git a/apps/multidice/app.png b/apps/multidice/app.png deleted file mode 100644 index 75ee0514a953e29e618bf56a49e8526e8eac59f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1330 zcmV-21iCYS(1OJaP25k$Q;U-Cc6Fq}DO z&f~^^GU+{YX6AhVneRCO{|_z%wga=k3E*Skx~hw=0yfvshP74*4PYP80`>qe0f&IU zfwg4>?*QHb=4)F)$4fq%-7cwW2lxIR!7w#Jawd^RBbJpr|vEJNZr zu$TJrE^sVT_(~*NI)%ECoNTP{E{TaEBurmNX%Di5Uk2;>QW1~>|Q zp_6*g8xu{U9R%{!X1DC4q2~>f$m3>z>*jeSp+ugy@h%ooqG4A zlCd=5?*@K#c6!`%mua{Y_}Q8BK5#(_2~*))>NtT{^!E|(eU}88QF1pdy?=@@8o*D$ z0U7p2;9uamlv6#Vjmsp^Ej{1w=(=wMqgulRcCk|Zw>f>&+Px4~XpR|ng3lEze7vad z=X#<06m%?SdQI)P`qnt7wA7n-rTT}Q&6rd44dF7)+2owaQ5n1s%iq3>Az-*3_)x{i z@4yF&riLEi5ACk$r;Bl^&6J84vy=XuZ|%{XX$8A8DKTe_#%zrxkcUBehDnda0_nU3 zuGfKO5o>iQPJ9Bq0bJ|7AJ9hZON_g&RAOy_Lrs$IA%cj(Q-5#BK@SrRPoB$R$OEM}|^&MV3cm!b|2>rMTQE;SDe76ozW5i7!!f zZb_+e#w8zuCNa;}9%g-4eBbsKIaz5><%D~+st>260#(qhHRt8iABgl$F={j97eA+T z&6fm`tx6Rva&A#y8En^wF4l7li2+CW)r!U^W$;Pl?{YTgoH#Hh=_bP{zDa7oziF4c}c>Zwgrb1(Ihyk;5!%cl<`h61e!VCCWN3H4Pmy;1p3-dpp18lA<&!SZE7P>#yb@; z;;DeQsf|Dx@8lCG>TUWn#@9w5%R9LQih7%#vbj)EWO*l-Kv8egERqXVAuwBzK&-cE z7RiOG5XkaQX}M6Wx9KgC3!Qcfnxe?^PDw%2DCuqb1LMyrXp)lB{TG<3u(ghOm%DXg zgVwz@=~$*>;)pE1>VNjwrnOG#wxgwDe5B&KBTi9o7h`APYTz?{wCZ(=tzq|_cB5=p oHg@l1bwC|gHFnkhjC-x}A5s&T=P#0nHvj+t07*qoM6N<$g6g++LI3~& diff --git a/apps/multidice/d100.png b/apps/multidice/d100.png deleted file mode 100644 index 16350db1657632de685f8c0289d84112b8334f6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1936 zcmeHI`%{t$6vZ#UM6wA~EK76=-;AcEtENyPCak5DDLs6xWtv7>t*fSF>_BBDRGVp; zT4vHtDr{PsDB`2(HAbeE76Q7I_yWuaqN1z+!R|~y_QSnr=AOB8XU@5IZVn|la5Zc_ z3<80yCXSF4DEK#Ztl;*NdkQDcQ2zi;$00rM9Zm3?;c*IVIt53%B+ z>yx4mKY38ka<@IL(=KK&&V&FqzsO5PHn;E4vJsS+fSCjUHs3Mc+W?G+0?jCL4qN;c zIg_&@{|)$g+&FsFDh>|{J12``)VU$%x`YWQjm^l;m4%Mq_6+(qii(=;FJ{f?-p*dW za;v!tu2W9Xx8VAW8#ebGx+YM)2rN-AxKU!}BU|TKC{r#p>p`cx>@P4FR*R9}7i*O- zy}OO?SZES*IQZqVNm`j`sil`S=HZZ%D7tTppUvW06r2yjGp{zj#Md&ey%gIh`bTy1npI(Ue_NY$HD7A?jt@TNv0&uoIJW?il+--h?Q3jh6hIUUI3__z=!}) zojH-(_PgwMn7Nv~%PZB|DL7~-RI$vjNKau)+1Q{Djo}O;_=kIJ6OXOxm#iyiH{li{A#v{dIh5Baf zZ=ybZxEs58tV1egc$p4alwuUBVl7GHo)4(e*|p`N=c}&zW=b#flb+7$ag4Raq9Qc! zM%`&wP@2i~kTC@Q;qusbfss-t0=KP*o*dWblkcFhpsPgz1WvyAdXKNB#aEL$(y@c* zm!aOnE^bdoi+bO?v?;F&<|==(!W9BkrC0Vv0WEIdJMy=)Vz0!f@f{f~$lfMrv}rCh z96j!qA9aRG-%c8O^!jH6HNEUDk-_))UGiF5~lixc@d}K~dERs%v$M%G6>bf;SZ%;2@b26mqlGDN<@l| zIN0a<)ac{zjHxWxyxbdw{x%#F-56wb3=f{Y=3%_`fCS-i>QfeMmut<3HaJCI;CP$~ zr^FE2Z?6MjR%WbRH~`!A@PL{BcE;gSK7z2FVeFX{3w2D{W&Se(>gaaw=x!4Oke$=A z6KVk3cU9z|?~2^_^gx$@dE3+7(A?V|wgGKuUO=g~KYtE*LHrfNJO`L1{uuT{#_zTu a^F~jqKDvZ8uF)=iS_nBHm{>)K`Qu-37+f|0 diff --git a/apps/multidice/main.png b/apps/multidice/main.png deleted file mode 100644 index 7ca8f963174c7da421bc8d8abfd3391a64f13492..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1547 zcmeAS@N?(olHy`uVBq!ia0vp^8$g(Y4M?uv{v?ipf%TH7i(^Pd+}qg?%Vq@#u)Y3m zUvhi$5wnLK)#3p=?)&_2DoRgxSn~1P@Av!T{}nS$_Ir?aVDhZuoASa23C=UBnAmK# z+KJ~MFf;hdvW(|P*=}2zU#s`^-|OH0?cddJE4g?6c*I-b5Fnbdwf2F)yG?~m{>*V* zmeE%tkK4cAAw75Bo7DIJo=7tqK4{dG{P29jGR}(Jh2Gbz-&?w~2dzziZ}l$b?qi+r z>#rG}ie8)k#o}rm^YeH81?zvvK6og)L#UGdzV(8@g;%S-ty|2M)_c97K5l0JCxfb_ z+8QmJ-}85b-(?P$Kbd`d_4U#N``<_JeZP9U{`J4_9_P-z{ppDLgY}&fAD$;4S}T9^ zD(43C8}B&FzkIBVsoBHy|9{b^RSCNsL$~|5-#t`%SZeRn*Zbbj`@6UG$G5k)8s;xI z@jbA9A5%!UO1|Q}`%WR@YqIuTeZ9VWZ8tzQ?{ zh*ah7e>FLM=el?9uL9r4105#b@ovtl((uy(|h7TI^L(_^h@6Z4b`8E-gg6OeYGP`zo;b~*ju^t`%xe*F8rvdO8ACI z!Po14SHIm8x_g^*jsJm$waKqI_ozHrss89uxO%}A`493xKUXuG-FV39BVO<|c+x9z zma8+rt!u3Cx4ZM=uRoVqxYtO%$|8Gs*>-Ej66IQ)t+vEQ7cYHK!RPO!Fk5)3RbLii(d{v+0 zJ-c6XmvU{ZW~??VW>yownF5Te#?tc#-u=59Jz<&qop*PC>O05(-c)}?{aHx(gS7`@ z8Fx5wKX~`YkN?NH&EG8xzV3Oy;=8=r#N_oe3t7ANM`p4(G% z_u6u`YBrCGw_6y6pPaDx&SLgg_sE?S>+CX_*yf}NpGZ33@Y3_dD04I%hFl`3XK-^& Wv6(9Jbw99>XYh3Ob6Mw<&;$UNdjDDZGy0Y(FVSM=e(rLfL zi?^)XK5O|`tE+W;FI8W^UH#AYH}jtfQU`9gBr)jEXMETHBz$j4$n(hCakAT=3;y|g zea`>+S#SPMdHCYv>7D)a)?4i}U+!P6|Hb0J=Jx}k2N?eUo>6dxnd?FG{r`+R-Y>1n zeII`R@wP+jer4O9*Z%gI=g-0I0-*;P*4NBjUS(X&UzXo+Rr!YQk#D*#th-Nbx7v5h z?$@8IUr$#jG}OCAh?bR9zn{Hh)q|{guYP3xe(^c{x;|t7Kar%$e@_oo-{12^=g-Z3 zSDDK#udlYd9$W4DdT#pK?H6~-)VkUk-3Pjd!G8UkuZ%&Bm0yihzB;UWX34b0%Iwo= zo2!d*=BqO{Jb(FXk~Zs)Nn6it)}WNLBDP_5zIEvB=bhKR+|?OAyl9zQpTXqJz(4oK zNq_$ZUq!!##{ang>!s9z<;5qY71#>C`u=$(&T_Ti?*2!PzmG0TRmd&hH_r zvyX?{Kia$g)6K85>Vme22_JaRTJr5`5<~d;h{fCWyQ{u`J=gXr^LqTV`?uXoYulfW9ltxP#esqLrRM6#t6$Ua$1$#+SFq}F_4eaT>l8x2-?{p6+ji9eTg5L; zZ|=%J*f#IY)=3Npj@G9~?N#}DY8BIa+xu^RhgXK>f4erX@VZ^@ja~Ot-!*CnggyXj z{O_~i)aQ}|r_GbA?cJiQUH1O^v-Wyn|DN{?BmUYhsCpI?xAj-Sg3|x%|F+ff-Qjxu zf_ceTD+YhIiu*;fs*T@OH@x00@Lu}-RFw_Dq}}48&QMTN+r~bl@dXP*-@5Z37>tpV zJcGq9yTi<997>oN+^?rsG)Q*%F+6zji-+HU`64HSOzixJjA;s1j17xl8`~V<88r-4 hOpJyZdeZnKZ+?G`jqq~$%fLdJ!PC{xWt~$(696AnwY>lU diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index b7537d0b3..1b02945b6 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,8 +1,8 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"0.90", - "description": "roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all dice", + "version":"1.00", + "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", "supports" : ["BANGLEJS2"], From c6dbb65bd3a7f408f428357ed18e0752a135b8bc Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Fri, 24 Feb 2023 23:59:41 -0500 Subject: [PATCH 14/89] fixed bug that caused rolled dice on the right of screen to be writ off-screen --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index a216ea61b..c35862f7c 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -1,2 +1,3 @@ 0.90: got most of the features done, lacking some polish and real-hardware testing 1.00: overhauled the whole app, made some margins larger to be easier to tap on +1.01: fixed bug that caused rolled dice on the right of screen to be writ off-screen diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 911177983..58b72e9fc 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -105,7 +105,7 @@ function rollDice() { if (SELECTION_ARRAY [i] != 0) { - g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * i); + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); } } } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 1b02945b6..3e82d01be 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.00", + "version":"1.01", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 4d2763d1e013f38c65a2097b03433d6a57e7206a Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 00:09:16 -0500 Subject: [PATCH 15/89] added vibration when dice is rolled --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 ++ apps/multidice/metadata.json | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index c35862f7c..ee190c200 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -1,3 +1,4 @@ 0.90: got most of the features done, lacking some polish and real-hardware testing 1.00: overhauled the whole app, made some margins larger to be easier to tap on 1.01: fixed bug that caused rolled dice on the right of screen to be writ off-screen +1.02: added vibration when dice is rolled diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 58b72e9fc..0ab98f8d0 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -108,6 +108,8 @@ function rollDice() { g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); } } + + Bangle.buzz(); } function random (max) { diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 3e82d01be..ba0b5a57f 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.01", + "version":"1.02", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 4deee14663f2526bb1295db11273c36ecd180c03 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 00:18:26 -0500 Subject: [PATCH 16/89] vibration caused the accelerometer to never stop --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index ee190c200..6316210e5 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -2,3 +2,4 @@ 1.00: overhauled the whole app, made some margins larger to be easier to tap on 1.01: fixed bug that caused rolled dice on the right of screen to be writ off-screen 1.02: added vibration when dice is rolled +1.03: vibration caused the accelerometer to never stop diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 0ab98f8d0..8bf2ca662 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -121,7 +121,7 @@ drawMenu(); Bangle.on ('touch', touchHandler); Bangle.on ('accel', function (xyz) { - if (xyz.diff >= 0.3) { + if (xyz.diff >= 0.5) { menu = false; rollDice(); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index ba0b5a57f..6612cc999 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.02", + "version":"1.03", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From ae1bb8dab407fdcd9977b1bcd7eca48e1346198b Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 00:23:15 -0500 Subject: [PATCH 17/89] accidentally deleted app icon LMAO --- apps/multidice/app.png | Bin 0 -> 1330 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/multidice/app.png diff --git a/apps/multidice/app.png b/apps/multidice/app.png new file mode 100644 index 0000000000000000000000000000000000000000..75ee0514a953e29e618bf56a49e8526e8eac59f5 GIT binary patch literal 1330 zcmV-21iCYS(1OJaP25k$Q;U-Cc6Fq}DO z&f~^^GU+{YX6AhVneRCO{|_z%wga=k3E*Skx~hw=0yfvshP74*4PYP80`>qe0f&IU zfwg4>?*QHb=4)F)$4fq%-7cwW2lxIR!7w#Jawd^RBbJpr|vEJNZr zu$TJrE^sVT_(~*NI)%ECoNTP{E{TaEBurmNX%Di5Uk2;>QW1~>|Q zp_6*g8xu{U9R%{!X1DC4q2~>f$m3>z>*jeSp+ugy@h%ooqG4A zlCd=5?*@K#c6!`%mua{Y_}Q8BK5#(_2~*))>NtT{^!E|(eU}88QF1pdy?=@@8o*D$ z0U7p2;9uamlv6#Vjmsp^Ej{1w=(=wMqgulRcCk|Zw>f>&+Px4~XpR|ng3lEze7vad z=X#<06m%?SdQI)P`qnt7wA7n-rTT}Q&6rd44dF7)+2owaQ5n1s%iq3>Az-*3_)x{i z@4yF&riLEi5ACk$r;Bl^&6J84vy=XuZ|%{XX$8A8DKTe_#%zrxkcUBehDnda0_nU3 zuGfKO5o>iQPJ9Bq0bJ|7AJ9hZON_g&RAOy_Lrs$IA%cj(Q-5#BK@SrRPoB$R$OEM}|^&MV3cm!b|2>rMTQE;SDe76ozW5i7!!f zZb_+e#w8zuCNa;}9%g-4eBbsKIaz5><%D~+st>260#(qhHRt8iABgl$F={j97eA+T z&6fm`tx6Rva&A#y8En^wF4l7li2+CW)r!U^W$;Pl?{YTgoH#Hh=_bP{zDa7oziF4c}c>Zwgrb1(Ihyk;5!%cl<`h61e!VCCWN3H4Pmy;1p3-dpp18lA<&!SZE7P>#yb@; z;;DeQsf|Dx@8lCG>TUWn#@9w5%R9LQih7%#vbj)EWO*l-Kv8egERqXVAuwBzK&-cE z7RiOG5XkaQX}M6Wx9KgC3!Qcfnxe?^PDw%2DCuqb1LMyrXp)lB{TG<3u(ghOm%DXg zgVwz@=~$*>;)pE1>VNjwrnOG#wxgwDe5B&KBTi9o7h`APYTz?{wCZ(=tzq|_cB5=p oHg@l1bwC|gHFnkhjC-x}A5s&T=P#0nHvj+t07*qoM6N<$g6g++LI3~& literal 0 HcmV?d00001 From ec1c534b0d0b525879263d5fd3d4a8354cc9f7c7 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 00:25:33 -0500 Subject: [PATCH 18/89] decreased vibration strength --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 4 ++-- apps/multidice/metadata.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 6316210e5..9bc00d9be 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -3,3 +3,4 @@ 1.01: fixed bug that caused rolled dice on the right of screen to be writ off-screen 1.02: added vibration when dice is rolled 1.03: vibration caused the accelerometer to never stop +1.04: decreased vibration strength diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 8bf2ca662..ef16ca2de 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -109,7 +109,7 @@ function rollDice() { } } - Bangle.buzz(); + Bangle.buzz (200, 0.1); } function random (max) { @@ -121,7 +121,7 @@ drawMenu(); Bangle.on ('touch', touchHandler); Bangle.on ('accel', function (xyz) { - if (xyz.diff >= 0.5) { + if (xyz.diff >= 0.4) { menu = false; rollDice(); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 6612cc999..ef5841877 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.03", + "version":"1.04", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 379af915458eb6ee653d1c5a14dc3adcee04c651 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 07:52:26 -0500 Subject: [PATCH 19/89] toggled the acceleration handler to prevent infinite buzz loop --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 236 +++++++++++++++++++---------------- apps/multidice/metadata.json | 2 +- 3 files changed, 127 insertions(+), 112 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 9bc00d9be..fc6479e98 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -4,3 +4,4 @@ 1.02: added vibration when dice is rolled 1.03: vibration caused the accelerometer to never stop 1.04: decreased vibration strength +1.05: toggled the acceleration handler to prevent infinite buzz loop diff --git a/apps/multidice/app.js b/apps/multidice/app.js index ef16ca2de..15d9564bc 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -3,127 +3,141 @@ const DICE_ARRAY = [0, 4, 6, 8, 10, 12, 20, 100]; const SELECTION_ARRAY = [6, 0, 0, 0, 0, 0, 0, 0]; // default to selecting a single d20 function drawMenu() { - - stringArr = new Array ("", "", "", "", "", "", "", ""); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; - } - } - - g.clear(); - g.setFont ("Vector", 40); - - g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); - g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); - g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); - g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); - g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); - g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); - g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); - g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); + + stringArr = new Array ("", "", "", "", "", "", "", ""); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; + } + } + + g.clear(); + g.setFont ("Vector", 40); + + g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); + g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); + g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); + g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); + g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); + g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); + g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); + g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); } function touchHandler (button, xy) { - - if (! menu) { - - menu = true; - drawMenu(); - return; - } - - if (xy.x <= 87) { // left - - if (xy.y <= 43) { - - selection = 0; - } else if (xy.y <= 87) { - - selection = 1; - } else if (xy.y <= 131) { - - selection = 2; - } else { - - selection = 3; - } - } else { // right - - if (xy.y <= 43) { - - selection = 4; - } else if (xy.y <= 87) { - - selection = 5; - } else if (xy.y <= 131) { - - selection = 6; - } else { - - selection = 7; - } - } - - // increment SELECTION_ARRAY [selection] - if (SELECTION_ARRAY [selection] == 7) { - - SELECTION_ARRAY [selection] = 0; - } else { - - SELECTION_ARRAY [selection] += 1; - } - - drawMenu(); + + if (! menu) { + + menu = true; + drawMenu(); + return; + } + + if (xy.x <= 87) { // left + + if (xy.y <= 43) { + + selection = 0; + } else if (xy.y <= 87) { + + selection = 1; + } else if (xy.y <= 131) { + + selection = 2; + } else { + + selection = 3; + } + } else { // right + + if (xy.y <= 43) { + + selection = 4; + } else if (xy.y <= 87) { + + selection = 5; + } else if (xy.y <= 131) { + + selection = 6; + } else { + + selection = 7; + } + } + + // increment SELECTION_ARRAY [selection] + if (SELECTION_ARRAY [selection] == 7) { + + SELECTION_ARRAY [selection] = 0; + } else { + + SELECTION_ARRAY [selection] += 1; + } + + drawMenu(); +} + +function accelHandler (xyz) { + + if (xyz.diff >= 0.4) { + + menu = false; + rollDice(); + } +} + +function voidFn() { + + return; } function rollDice() { - - resultsArr = new Uint8Array (8); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); - } - } - - g.clear(); - g.setFont ("Vector", 40); - - for (i = 0; i < 4; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); - } - } - - for (i = 4; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); - } - } - - Bangle.buzz (200, 0.1); + + resultsArr = new Uint8Array (8); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); + } + } + + g.clear(); + g.setFont ("Vector", 40); + + for (i = 0; i < 4; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); + } + } + + for (i = 4; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); + } + } } function random (max) { - - return Math.round (Math.random() * (max - 1) + 1); + + return Math.round (Math.random() * (max - 1) + 1); +} + +function vibrate() { + + Bangle.on ('accel', voidFn); + Bangle.buzz (200, 0.1).then( + + Bangle.on ('accel', accelHandler) + ); } drawMenu(); Bangle.on ('touch', touchHandler); -Bangle.on ('accel', function (xyz) { - - if (xyz.diff >= 0.4) { - - menu = false; - rollDice(); - } -}); +Bangle.on ('accel', accelHandler); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index ef5841877..82af0ef8b 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.04", + "version":"1.05", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 79a64152cf4802af6f1dd2c8e0f89e34351509f3 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 07:55:52 -0500 Subject: [PATCH 20/89] increased vibration again --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index fc6479e98..b5de3ea67 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -5,3 +5,4 @@ 1.03: vibration caused the accelerometer to never stop 1.04: decreased vibration strength 1.05: toggled the acceleration handler to prevent infinite buzz loop +1.06: increased vibration again diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 15d9564bc..04e23e22a 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -132,7 +132,7 @@ function random (max) { function vibrate() { Bangle.on ('accel', voidFn); - Bangle.buzz (200, 0.1).then( + Bangle.buzz (200, 1).then( Bangle.on ('accel', accelHandler) ); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 82af0ef8b..36c0d9c1f 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.05", + "version":"1.06", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 54f61412a87a6fefd52b6ba4051ba7abc26d9f26 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 08:05:35 -0500 Subject: [PATCH 21/89] IDK how to use promises properly --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index b5de3ea67..445dd4d68 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -6,3 +6,4 @@ 1.04: decreased vibration strength 1.05: toggled the acceleration handler to prevent infinite buzz loop 1.06: increased vibration again +1.07: IDK how to use promises properly diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 04e23e22a..e99e785c3 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -132,7 +132,7 @@ function random (max) { function vibrate() { Bangle.on ('accel', voidFn); - Bangle.buzz (200, 1).then( + Bangle.buzz (200, 1).then ((value) => Bangle.on ('accel', accelHandler) ); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 36c0d9c1f..743cb79ae 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.06", + "version":"1.07", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From b688a4e90ad026a62ab34ca2142a778d9563697a Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 08:21:42 -0500 Subject: [PATCH 22/89] still trying to fix the lack of vibrations --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 445dd4d68..a9fc055c0 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -7,3 +7,4 @@ 1.05: toggled the acceleration handler to prevent infinite buzz loop 1.06: increased vibration again 1.07: IDK how to use promises properly +1.08: still trying to fix the lack of vibrations diff --git a/apps/multidice/app.js b/apps/multidice/app.js index e99e785c3..789cf26bd 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -132,7 +132,7 @@ function random (max) { function vibrate() { Bangle.on ('accel', voidFn); - Bangle.buzz (200, 1).then ((value) => + Bangle.buzz().then ((value) => Bangle.on ('accel', accelHandler) ); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 743cb79ae..effb1c57b 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.07", + "version":"1.08", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 53ba86b01a617576d4cb680b21ed13271779aa6e Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 08:35:18 -0500 Subject: [PATCH 23/89] hopefully now it's fixed? --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 4 ++-- apps/multidice/metadata.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index a9fc055c0..ce7632d7c 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -8,3 +8,4 @@ 1.06: increased vibration again 1.07: IDK how to use promises properly 1.08: still trying to fix the lack of vibrations +1.09: hopefully now it's fixed? diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 789cf26bd..8f027c47a 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -132,10 +132,10 @@ function random (max) { function vibrate() { Bangle.on ('accel', voidFn); - Bangle.buzz().then ((value) => + Bangle.buzz().then ((value) => { Bangle.on ('accel', accelHandler) - ); + }); } drawMenu(); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index effb1c57b..95071c67b 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.08", + "version":"1.09", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 79b733b963846f874c834ba1c52486c1569d3da5 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 10:06:52 -0500 Subject: [PATCH 24/89] not having web bluetooth to debug is a PAIN --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 13 ++++++++++++- apps/multidice/metadata.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index ce7632d7c..ca48267be 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -9,3 +9,4 @@ 1.07: IDK how to use promises properly 1.08: still trying to fix the lack of vibrations 1.09: hopefully now it's fixed? +1.10: not having web bluetooth to debug is a PAIN diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 8f027c47a..98a43eef8 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -35,6 +35,9 @@ function touchHandler (button, xy) { return; } + rollDice(); + return; + if (xy.x <= 87) { // left if (xy.y <= 43) { @@ -122,6 +125,13 @@ function rollDice() { g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); } } + + Bangle.on ('accel', voidFn); + console.log ("before"); + Bangle.buzz().then(()=>{ + Bangle.on ('accel', accelHandler); + }); + console.log ("after"); } function random (max) { @@ -134,7 +144,8 @@ function vibrate() { Bangle.on ('accel', voidFn); Bangle.buzz().then ((value) => { - Bangle.on ('accel', accelHandler) + console.log ("I ran."); + Bangle.on ('accel', accelHandler); }); } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 95071c67b..37adcac91 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.09", + "version":"1.10", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From bd9ac4fc33856abc1c18a5683ea5e4ee3e779feb Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 10:20:26 -0500 Subject: [PATCH 25/89] decreased vibration time, decreased accel requirement --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 12 +++--------- apps/multidice/metadata.json | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index ca48267be..68ada4870 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -10,3 +10,4 @@ 1.08: still trying to fix the lack of vibrations 1.09: hopefully now it's fixed? 1.10: not having web bluetooth to debug is a PAIN +1.11: decreased vibration time, decreased accel requirement diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 98a43eef8..5469b495b 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -84,7 +84,7 @@ function touchHandler (button, xy) { function accelHandler (xyz) { - if (xyz.diff >= 0.4) { + if (xyz.diff >= 0.3) { menu = false; rollDice(); @@ -126,12 +126,7 @@ function rollDice() { } } - Bangle.on ('accel', voidFn); - console.log ("before"); - Bangle.buzz().then(()=>{ - Bangle.on ('accel', accelHandler); - }); - console.log ("after"); + vibrate(); } function random (max) { @@ -142,9 +137,8 @@ function random (max) { function vibrate() { Bangle.on ('accel', voidFn); - Bangle.buzz().then ((value) => { + Bangle.buzz(50, 1).then ((value) => { - console.log ("I ran."); Bangle.on ('accel', accelHandler); }); } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 37adcac91..ca5ec991f 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.10", + "version":"1.11", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From b9559280f973a430c1b2b088f7559ae9bafd099b Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 12:17:09 -0500 Subject: [PATCH 26/89] issue with app calling roll function too many times at startup --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 68ada4870..29da3bf24 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -11,3 +11,4 @@ 1.09: hopefully now it's fixed? 1.10: not having web bluetooth to debug is a PAIN 1.11: decreased vibration time, decreased accel requirement +1.12: issue with app calling roll function too many times at startup diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 5469b495b..6295c7a9b 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -137,7 +137,7 @@ function random (max) { function vibrate() { Bangle.on ('accel', voidFn); - Bangle.buzz(50, 1).then ((value) => { + Bangle.buzz(50, 0.5).then ((value) => { Bangle.on ('accel', accelHandler); }); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index ca5ec991f..177b8a32a 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.11", + "version":"1.12", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 5d399688910171e05d351b7f3afb9f56c0102a76 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 12:27:24 -0500 Subject: [PATCH 27/89] added a delay after the buzzer stops to prevent multi-rolling --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 18 ++++++++---------- apps/multidice/metadata.json | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 29da3bf24..7eb5f605c 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -12,3 +12,4 @@ 1.10: not having web bluetooth to debug is a PAIN 1.11: decreased vibration time, decreased accel requirement 1.12: issue with app calling roll function too many times at startup +1.13: added a delay after the buzzer stops to prevent multi-rolling diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 6295c7a9b..0d4b57a6c 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -126,7 +126,14 @@ function rollDice() { } } - vibrate(); + Bangle.on ('accel', voidFn); + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (function() { // wait 50ms *after* the buzzing has stopped + + Bangle.on ('accel', accelHandler); + }, 50); + }); } function random (max) { @@ -134,15 +141,6 @@ function random (max) { return Math.round (Math.random() * (max - 1) + 1); } -function vibrate() { - - Bangle.on ('accel', voidFn); - Bangle.buzz(50, 0.5).then ((value) => { - - Bangle.on ('accel', accelHandler); - }); -} - drawMenu(); Bangle.on ('touch', touchHandler); Bangle.on ('accel', accelHandler); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 177b8a32a..a6cbf46b9 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.12", + "version":"1.13", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From f85c17814cbe1cf2bb748615975c4925d8b60dec Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 12:35:36 -0500 Subject: [PATCH 28/89] made the delay needlessly long to see if it even does anything --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 7eb5f605c..d8a684575 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -13,3 +13,4 @@ 1.11: decreased vibration time, decreased accel requirement 1.12: issue with app calling roll function too many times at startup 1.13: added a delay after the buzzer stops to prevent multi-rolling +1.14: made the delay needlessly long to see if it even does anything diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 0d4b57a6c..271b7bad3 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -132,7 +132,7 @@ function rollDice() { setTimeout (function() { // wait 50ms *after* the buzzing has stopped Bangle.on ('accel', accelHandler); - }, 50); + }, 1000); }); } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index a6cbf46b9..2bcf4d2eb 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.13", + "version":"1.14", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From e6e2d622fbe3e0208a2fcc174160828a4c491c47 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 12:48:47 -0500 Subject: [PATCH 29/89] moved accel & vibration commands to the accelHandler function --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 23 +++++++++++------------ apps/multidice/metadata.json | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index d8a684575..2e6b8c622 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -14,3 +14,4 @@ 1.12: issue with app calling roll function too many times at startup 1.13: added a delay after the buzzer stops to prevent multi-rolling 1.14: made the delay needlessly long to see if it even does anything +1.15: moved accel & vibration commands to the accelHandler function diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 271b7bad3..6dddf1e19 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -35,9 +35,6 @@ function touchHandler (button, xy) { return; } - rollDice(); - return; - if (xy.x <= 87) { // left if (xy.y <= 43) { @@ -84,11 +81,22 @@ function touchHandler (button, xy) { function accelHandler (xyz) { + Bangle.on ('accel', voidFn); // temporarily disable more acceleration events if (xyz.diff >= 0.3) { menu = false; rollDice(); + + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (function() { // wait 50ms *after* the buzzing has stopped + + Bangle.on ('accel', accelHandler); + }, 50); + }); } + + Bangle.on ('accel', accelHandler); // re-enable acceleration events } function voidFn() { @@ -125,15 +133,6 @@ function rollDice() { g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); } } - - Bangle.on ('accel', voidFn); - Bangle.buzz(50, 0.5).then (() => { - - setTimeout (function() { // wait 50ms *after* the buzzing has stopped - - Bangle.on ('accel', accelHandler); - }, 1000); - }); } function random (max) { diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 2bcf4d2eb..7eb1c1607 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.14", + "version":"1.15", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 8efd551ba493d47569b324525ca4c9dccf3d6bae Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 13:00:36 -0500 Subject: [PATCH 30/89] enabled button usage & temporarily disabled acceleration --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 15 ++++++++++++++- apps/multidice/metadata.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 2e6b8c622..ff191cf13 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -15,3 +15,4 @@ 1.13: added a delay after the buzzer stops to prevent multi-rolling 1.14: made the delay needlessly long to see if it even does anything 1.15: moved accel & vibration commands to the accelHandler function +1.16: enabled button usage & temporarily disabled acceleration diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 6dddf1e19..0893fe470 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -142,4 +142,17 @@ function random (max) { drawMenu(); Bangle.on ('touch', touchHandler); -Bangle.on ('accel', accelHandler); +//Bangle.on ('accel', accelHandler); +setWatch (function() { + + menu = false; + rollDice(); + + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (function() { // wait 50ms *after* the buzzing has stopped + + //Bangle.on ('accel', accelHandler); + }, 50); + }); +}, BTN, {repeat: true, edge: "falling", debounce: 10}); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 7eb1c1607..9b2148682 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.15", + "version":"1.16", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 18d1425ad725d26334fb954b15b2e56da7234cd5 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 13:16:33 -0500 Subject: [PATCH 31/89] made changes to when accelHandler gets overwritten, temporarily disabled button usage --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 39 +++++++++++++++++------------------- apps/multidice/metadata.json | 2 +- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index ff191cf13..651233c63 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -16,3 +16,4 @@ 1.14: made the delay needlessly long to see if it even does anything 1.15: moved accel & vibration commands to the accelHandler function 1.16: enabled button usage & temporarily disabled acceleration +1.17: made changes to when accelHandler gets overwritten, temporarily disabled button usage diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 0893fe470..3789dc04b 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -81,22 +81,16 @@ function touchHandler (button, xy) { function accelHandler (xyz) { - Bangle.on ('accel', voidFn); // temporarily disable more acceleration events if (xyz.diff >= 0.3) { - menu = false; - rollDice(); + Bangle.on ('accel', voidFn); // temporarily disable more acceleration events - Bangle.buzz(50, 0.5).then (() => { + menu = false; + rollDice (function() { - setTimeout (function() { // wait 50ms *after* the buzzing has stopped - - Bangle.on ('accel', accelHandler); - }, 50); + Bangle.on ('accel', accelHandler); // re-enable acceleration events }); } - - Bangle.on ('accel', accelHandler); // re-enable acceleration events } function voidFn() { @@ -104,7 +98,7 @@ function voidFn() { return; } -function rollDice() { +function rollDice (timeoutFunctionRef) { resultsArr = new Uint8Array (8); for (i = 0; i < 8; i++) { @@ -133,6 +127,16 @@ function rollDice() { g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); } } + + vibrate (timeoutFunctionRef); +} + +function vibrate (timeoutFunctionRef) { + + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (timeoutFunctionRef, 50); + }); } function random (max) { @@ -142,17 +146,10 @@ function random (max) { drawMenu(); Bangle.on ('touch', touchHandler); -//Bangle.on ('accel', accelHandler); -setWatch (function() { +Bangle.on ('accel', accelHandler); +/*setWatch (function() { menu = false; rollDice(); - Bangle.buzz(50, 0.5).then (() => { - - setTimeout (function() { // wait 50ms *after* the buzzing has stopped - - //Bangle.on ('accel', accelHandler); - }, 50); - }); -}, BTN, {repeat: true, edge: "falling", debounce: 10}); +}, BTN, {repeat: true, edge: "falling", debounce: 10});*/ diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 9b2148682..8a78fe22a 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.16", + "version":"1.17", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 3a5a6f47a58322bfe8b7da6b20187db43e4d9a8b Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 13:27:12 -0500 Subject: [PATCH 32/89] decided to keep around the button even while testing, disabled all safety round the accelHandler self-triggering --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 10 +++++----- apps/multidice/metadata.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 651233c63..ec0d407b8 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -17,3 +17,4 @@ 1.15: moved accel & vibration commands to the accelHandler function 1.16: enabled button usage & temporarily disabled acceleration 1.17: made changes to when accelHandler gets overwritten, temporarily disabled button usage +1.18: decided to keep around the button even while testing, disabled all safety round the accelHandler self-triggering diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 3789dc04b..940de3eb3 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -83,12 +83,12 @@ function accelHandler (xyz) { if (xyz.diff >= 0.3) { - Bangle.on ('accel', voidFn); // temporarily disable more acceleration events + //Bangle.on ('accel', voidFn); // temporarily disable more acceleration events menu = false; rollDice (function() { - Bangle.on ('accel', accelHandler); // re-enable acceleration events + //Bangle.on ('accel', accelHandler); // re-enable acceleration events }); } } @@ -147,9 +147,9 @@ function random (max) { drawMenu(); Bangle.on ('touch', touchHandler); Bangle.on ('accel', accelHandler); -/*setWatch (function() { +setWatch (function() { menu = false; - rollDice(); + rollDice (voidFn); -}, BTN, {repeat: true, edge: "falling", debounce: 10});*/ +}, BTN, {repeat: true, edge: "falling", debounce: 10}); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 8a78fe22a..7b45f11eb 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.17", + "version":"1.18", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From c2d694cabc8a7fed4c78cfefa9f3e1a983a353fd Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 13:36:24 -0500 Subject: [PATCH 33/89] added longer delay before resetting accelHandler --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 6 +++--- apps/multidice/metadata.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index ec0d407b8..c47d4c8ff 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -18,3 +18,4 @@ 1.16: enabled button usage & temporarily disabled acceleration 1.17: made changes to when accelHandler gets overwritten, temporarily disabled button usage 1.18: decided to keep around the button even while testing, disabled all safety round the accelHandler self-triggering +1.19: added longer delay before resetting accelHandler diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 940de3eb3..82561853e 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -83,12 +83,12 @@ function accelHandler (xyz) { if (xyz.diff >= 0.3) { - //Bangle.on ('accel', voidFn); // temporarily disable more acceleration events + Bangle.on ('accel', voidFn); // temporarily disable more acceleration events menu = false; rollDice (function() { - //Bangle.on ('accel', accelHandler); // re-enable acceleration events + Bangle.on ('accel', accelHandler); // re-enable acceleration events }); } } @@ -135,7 +135,7 @@ function vibrate (timeoutFunctionRef) { Bangle.buzz(50, 0.5).then (() => { - setTimeout (timeoutFunctionRef, 50); + setTimeout (timeoutFunctionRef, 150); }); } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 7b45f11eb..aec4455f4 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.18", + "version":"1.19", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 32865ce94bdcf99b180c7bd35a7663b521086b6e Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 19:17:21 -0500 Subject: [PATCH 34/89] Added app.js to this repository --- apps/multidice/app.js | 169 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 apps/multidice/app.js diff --git a/apps/multidice/app.js b/apps/multidice/app.js new file mode 100644 index 000000000..d0f62b8e9 --- /dev/null +++ b/apps/multidice/app.js @@ -0,0 +1,169 @@ +var menu = true; +var diceOpts = {amount: 2, selected: 5}; // TODO: grab values from settings +const DICE_ARRAY = [4, 6, 8, 10, 12, 20, 100]; // TODO: place in settings + +function drawMenu() { + + g.clear(); + g.setFont ("6x8", 2); + + g.drawString ("# of dice:", 5, 5); + g.drawString (diceOpts.amount, 137, 5); + + g.drawString ("dice:", 5, 32); + g.drawString (DICE_ARRAY [diceOpts.selected], 137, 32); +} + +function touchHandler (button, xy) { + + if (menu) { + + if (xy.y <= 26) { // selecting number of dice + + if (xy.x <= 87) { // left edge: decrease + + if (diceOpts.amount > 1) + diceOpts.amount--; + } else { // right edge: increase + + if (diceOpts.amount < 6) + diceOpts.amount++; + } + + drawMenu(); + } else if (xy.y <= 53) { // selecting dice type + + if (xy.x <= 87) { // left edge: decrease + + if (diceOpts.selected > 0) + diceOpts.selected--; + } else { // right edge: increase + + if (diceOpts.selected < DICE_ARRAY.length - 1) + diceOpts.selected++; + } + + drawMenu(); + } else { + + rollDice(); + } + } else { // return to menu screen + + menu = true; + drawMenu (); + } +} + +function rollDice() { + + menu = false; + if (diceOpts.amount == 1) { + + let output = random (DICE_ARRAY [diceOpts.selected]); + + g.clear(); + g.setFont ("Vector", 90); + + g.drawString ((" " + output).slice (-3), 10, 0); + } else { + + let output = new Int8Array ([-1, -1, -1, -1, -1, -1]); + for (let i = 0; i < diceOpts.amount; i++) { + + output [i] = random (DICE_ARRAY [diceOpts.selected]); + } + + g.clear(); + g.setFont ("Vector", 40); + + for (let i = 0; i < 3; i++) { // draws all the numbers in two rows + + if (output [i * 2 + 0] == -1) { + + break; + } else if (output [i * 2 + 1] == -1) { + + + g.drawString ((" " + output [i * 2]).slice (-3), 5, 5 + i * 40); + } else { + + g.drawString ((" " + output [i * 2]).slice (-3) + " " + (" " + output [i * 2 + 1]).slice (-3), 5, 5 + i * 40); + } + } + + g.setFont ("Vector", 20); + g.drawString ("H: " + (" " + max (output)).slice (-3), 5, 130); + g.drawString ("L: " + (" " + min (output)).slice (-3), 110, 130); + g.drawString ("T: " + (" " + total (output)).slice (-3), 5, 150); + g.drawString ("A: " + (" " + average (output)).slice (-3), 110, 150); + } +} + +function random (max) { // number is always between 1 and max + + return Math.round (Math.random() * (max - 1) + 1); +} + +function max (array) { + + let max = 0; + for (let i = 0; i < 6; i++) { + + if (array [i] == -1) + break; + + if (array [i] > max) + max = array [i]; + } + + return max; +} + +function min (array) { + + let min = array [0]; + for (let i = 1; i < 6; i++) { + + if (array [i] == -1) + break; + + if (array [i] < min) + min = array [i]; + } + + return min; +} + +function total (array) { + + let total = 0; + for (let i = 0; i < 6; i++) { + + if (array [i] == -1) + break; + + total += array [i]; + } + + return total; +} + +function average (array) { + + let average = 0; + let rounds = 0; + for (let i = 0; i < 6; i++) { + + if (array [i] == -1) + break; + + average += array [i]; + rounds++; + } + + return Math.round (average / rounds); +} + +drawMenu(); +Bangle.on ('touch', touchHandler); From 457a395617c08c6a04a5b1eb60a8d0fc36ff1f85 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 19:28:29 -0500 Subject: [PATCH 35/89] added a one-line changelog, and filled out the metadata.json file --- apps/multidice/ChangeLog | 1 + apps/multidice/metadata.json | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 apps/multidice/ChangeLog create mode 100644 apps/multidice/metadata.json diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog new file mode 100644 index 000000000..1c7728b3d --- /dev/null +++ b/apps/multidice/ChangeLog @@ -0,0 +1 @@ +0.90: got most of the features done, lacking some polish and real-hardware testing diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json new file mode 100644 index 000000000..b42c2ba16 --- /dev/null +++ b/apps/multidice/metadata.json @@ -0,0 +1,14 @@ +{ "id": "multidice", + "name": "multiple dice roller", + "shortName":"multidice", + "version":"0.90", + "description": "roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all dice", + "icon": "app.png", + "tags": "", + "supports" : ["BANGLEJS2"], + "readme": "README.md", + "storage": [ + {"name":"multidice.app.js","url":"app.js"}, + {"name":"multidice.img","url":"app-icon.js","evaluate":true} + ] +} From a8ba6e678b6446a2d296b7a885ca59f3fe546ad5 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 19:31:32 -0500 Subject: [PATCH 36/89] left README.md incomplete so I can emulate + add screenshots --- apps/multidice/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 apps/multidice/README.md diff --git a/apps/multidice/README.md b/apps/multidice/README.md new file mode 100644 index 000000000..23a485d63 --- /dev/null +++ b/apps/multidice/README.md @@ -0,0 +1,25 @@ +# multiple dice roller + +roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all dice + +Add screen shots (if possible) to the app folder and link then into this file with ![](.png) + +## Usage + +Describe how to use it + +## Features + +Name the function + +## Controls + +Name the buttons and what they are used for + +## Requests + +Name who should be contacted for support/update requests + +## Creator + +Your name From 76f3fe6c0c4e00d23b6e5178cdcc8b3f96401029 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 19:57:31 -0500 Subject: [PATCH 37/89] toggled the enable emulation flag in metadata.json --- apps/multidice/metadata.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index b42c2ba16..1a41cf09f 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -7,6 +7,7 @@ "tags": "", "supports" : ["BANGLEJS2"], "readme": "README.md", + "allow_emulator": true, "storage": [ {"name":"multidice.app.js","url":"app.js"}, {"name":"multidice.img","url":"app-icon.js","evaluate":true} From 0c3aad9b10739e98d1120cd4e9a91496ffd5ae04 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 20:10:09 -0500 Subject: [PATCH 38/89] forgot to switch from hard tabs to soft tabs --- apps/multidice/app.js | 278 +++++++++++++++++++++--------------------- 1 file changed, 139 insertions(+), 139 deletions(-) diff --git a/apps/multidice/app.js b/apps/multidice/app.js index d0f62b8e9..d11bc99d5 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -3,166 +3,166 @@ var diceOpts = {amount: 2, selected: 5}; // TODO: grab values from settings const DICE_ARRAY = [4, 6, 8, 10, 12, 20, 100]; // TODO: place in settings function drawMenu() { - - g.clear(); - g.setFont ("6x8", 2); - - g.drawString ("# of dice:", 5, 5); - g.drawString (diceOpts.amount, 137, 5); - - g.drawString ("dice:", 5, 32); - g.drawString (DICE_ARRAY [diceOpts.selected], 137, 32); + + g.clear(); + g.setFont ("6x8", 2); + + g.drawString ("# of dice:", 5, 5); + g.drawString (diceOpts.amount, 137, 5); + + g.drawString ("dice:", 5, 32); + g.drawString (DICE_ARRAY [diceOpts.selected], 137, 32); } function touchHandler (button, xy) { - - if (menu) { - - if (xy.y <= 26) { // selecting number of dice - - if (xy.x <= 87) { // left edge: decrease - - if (diceOpts.amount > 1) - diceOpts.amount--; - } else { // right edge: increase - - if (diceOpts.amount < 6) - diceOpts.amount++; - } - - drawMenu(); - } else if (xy.y <= 53) { // selecting dice type - - if (xy.x <= 87) { // left edge: decrease - - if (diceOpts.selected > 0) - diceOpts.selected--; - } else { // right edge: increase - - if (diceOpts.selected < DICE_ARRAY.length - 1) - diceOpts.selected++; - } - - drawMenu(); - } else { - - rollDice(); - } - } else { // return to menu screen - - menu = true; - drawMenu (); - } + + if (menu) { + + if (xy.y <= 26) { // selecting number of dice + + if (xy.x <= 87) { // left edge: decrease + + if (diceOpts.amount > 1) + diceOpts.amount--; + } else { // right edge: increase + + if (diceOpts.amount < 6) + diceOpts.amount++; + } + + drawMenu(); + } else if (xy.y <= 53) { // selecting dice type + + if (xy.x <= 87) { // left edge: decrease + + if (diceOpts.selected > 0) + diceOpts.selected--; + } else { // right edge: increase + + if (diceOpts.selected < DICE_ARRAY.length - 1) + diceOpts.selected++; + } + + drawMenu(); + } else { + + rollDice(); + } + } else { // return to menu screen + + menu = true; + drawMenu (); + } } function rollDice() { - - menu = false; - if (diceOpts.amount == 1) { - - let output = random (DICE_ARRAY [diceOpts.selected]); - - g.clear(); - g.setFont ("Vector", 90); - - g.drawString ((" " + output).slice (-3), 10, 0); - } else { - - let output = new Int8Array ([-1, -1, -1, -1, -1, -1]); - for (let i = 0; i < diceOpts.amount; i++) { - - output [i] = random (DICE_ARRAY [diceOpts.selected]); - } - - g.clear(); - g.setFont ("Vector", 40); - - for (let i = 0; i < 3; i++) { // draws all the numbers in two rows - - if (output [i * 2 + 0] == -1) { - - break; - } else if (output [i * 2 + 1] == -1) { - - - g.drawString ((" " + output [i * 2]).slice (-3), 5, 5 + i * 40); - } else { - - g.drawString ((" " + output [i * 2]).slice (-3) + " " + (" " + output [i * 2 + 1]).slice (-3), 5, 5 + i * 40); - } - } - - g.setFont ("Vector", 20); - g.drawString ("H: " + (" " + max (output)).slice (-3), 5, 130); - g.drawString ("L: " + (" " + min (output)).slice (-3), 110, 130); - g.drawString ("T: " + (" " + total (output)).slice (-3), 5, 150); - g.drawString ("A: " + (" " + average (output)).slice (-3), 110, 150); - } + + menu = false; + if (diceOpts.amount == 1) { + + let output = random (DICE_ARRAY [diceOpts.selected]); + + g.clear(); + g.setFont ("Vector", 90); + + g.drawString ((" " + output).slice (-3), 10, 0); + } else { + + let output = new Int8Array ([-1, -1, -1, -1, -1, -1]); + for (let i = 0; i < diceOpts.amount; i++) { + + output [i] = random (DICE_ARRAY [diceOpts.selected]); + } + + g.clear(); + g.setFont ("Vector", 40); + + for (let i = 0; i < 3; i++) { // draws all the numbers in two rows + + if (output [i * 2 + 0] == -1) { + + break; + } else if (output [i * 2 + 1] == -1) { + + + g.drawString ((" " + output [i * 2]).slice (-3), 5, 5 + i * 40); + } else { + + g.drawString ((" " + output [i * 2]).slice (-3) + " " + (" " + output [i * 2 + 1]).slice (-3), 5, 5 + i * 40); + } + } + + g.setFont ("Vector", 20); + g.drawString ("H: " + (" " + max (output)).slice (-3), 5, 130); + g.drawString ("L: " + (" " + min (output)).slice (-3), 110, 130); + g.drawString ("T: " + (" " + total (output)).slice (-3), 5, 150); + g.drawString ("A: " + (" " + average (output)).slice (-3), 110, 150); + } } function random (max) { // number is always between 1 and max - - return Math.round (Math.random() * (max - 1) + 1); + + return Math.round (Math.random() * (max - 1) + 1); } function max (array) { - - let max = 0; - for (let i = 0; i < 6; i++) { - - if (array [i] == -1) - break; - - if (array [i] > max) - max = array [i]; - } - - return max; + + let max = 0; + for (let i = 0; i < 6; i++) { + + if (array [i] == -1) + break; + + if (array [i] > max) + max = array [i]; + } + + return max; } function min (array) { - - let min = array [0]; - for (let i = 1; i < 6; i++) { - - if (array [i] == -1) - break; - - if (array [i] < min) - min = array [i]; - } - - return min; + + let min = array [0]; + for (let i = 1; i < 6; i++) { + + if (array [i] == -1) + break; + + if (array [i] < min) + min = array [i]; + } + + return min; } function total (array) { - - let total = 0; - for (let i = 0; i < 6; i++) { - - if (array [i] == -1) - break; - - total += array [i]; - } - - return total; + + let total = 0; + for (let i = 0; i < 6; i++) { + + if (array [i] == -1) + break; + + total += array [i]; + } + + return total; } function average (array) { - - let average = 0; - let rounds = 0; - for (let i = 0; i < 6; i++) { - - if (array [i] == -1) - break; - - average += array [i]; - rounds++; - } - - return Math.round (average / rounds); + + let average = 0; + let rounds = 0; + for (let i = 0; i < 6; i++) { + + if (array [i] == -1) + break; + + average += array [i]; + rounds++; + } + + return Math.round (average / rounds); } drawMenu(); From 2657090d4ebef0540fa495a653dc6a617d8094ca Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 20:26:04 -0500 Subject: [PATCH 39/89] filled out the README.md, and added screenshots of the app. --- apps/multidice/2d20.png | Bin 0 -> 2352 bytes apps/multidice/README.md | 19 ++++++++++++------- apps/multidice/d100.png | Bin 0 -> 1936 bytes apps/multidice/main.png | Bin 0 -> 1547 bytes apps/multidice/menuPercent.png | Bin 0 -> 1467 bytes 5 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 apps/multidice/2d20.png create mode 100644 apps/multidice/d100.png create mode 100644 apps/multidice/main.png create mode 100644 apps/multidice/menuPercent.png diff --git a/apps/multidice/2d20.png b/apps/multidice/2d20.png new file mode 100644 index 0000000000000000000000000000000000000000..e6c52b839b07e4237582668126be172707a6309c GIT binary patch literal 2352 zcmeH}`8V5%7Qo{xOkzd_#Vcy5B{VfUlxJGCHI){nQIbY%XADt0ovNMG(W1zs_H~NX zl0=AoZ8};@#8$B{jkR7ap|Mph&->+_^ZtkV;okepz2~0u`P?6F!hLI$sEDix2m}(n zdk1NIR;<5aF{-Z(MQ)fgt;Lk*0Pb&KvpjVbcabfd_e~L(NSUyd6!68YR;(HJj)$ z7_+h+NrGAG zTfsy{Qnz-@sQ(^@J@5Cf^&jlQeHx&swW(>A!6YpDyHj%eaNNm!y!Tr&GxcGK?d?TH z0mXt5G&jC;U5`Ft&}YMid|8E3lRl;S2A5NiSOd1BxAzGvGz&@vMaJD=FxiGr4HIoT>s zns-RsQQ<@q>dM+Q}P3S=$f0x=7nDJ1_IGr+JbGgBz;f zw5J`kXTl3RQO~j?eKYTINQZ|tVRJ72MRUiN1sOm3KraX}PUVTy?>RG^79XS2_Umo0 zn1r$bF?q02S!SxvgXvczGzDc?lX(kkJP)n`ma2MhNxE(?rmquX<=*aa0K=iM1QJyK8*A=VM?Qh$P_ zOUW}{SY(c*NrtFR3^!jk>wA9R-neBiQc>y(>_BN&dSV!cFr!H5+!$D$5;xc`)RP-% zFiNAsdpy~xQCO$x+D(kVl$8PT6@06~5n6Yt)c%<{Ut=w~t4IDk>tQ48Ax=XNwyIpc zWa((*<|rr-2Lcf3s1%7QZ?Vd6UN>1m}L!xT~T@_{N<`(C^D24>hE3?p%07T7RhuQq;sJ<{oM^Hp820crGFeLi+>rdd>pTFV-Y@RT1Oe0Lx7+`6+hq7r2akhE#^3dUYCa8_fuWzFLwYKqU^3#k(*?p#iTZv~^pOUFJ#sC^Z7Mxh>z zU&A+NPmXPgDmmvNlewPO;1gxpKvod;%jmCz)_%(`gZW@g?)q#XYr^6l7)qq8Z1s`Z z1>0`mIo`^8qm#QXjhdjpIhj?mn(5dqOzu{}eNqotUKp)m{A=^8x*4vK6@YQ#EasHE z0|@#X%;u`fka+319)TX>T=X{lA})dRgwRc+lERX7(2V98d^`*9=23t;SqVvc2UBgdo#hs z-c@@?-XCi2BRY3s6F(q99 zD`CRTsLP?`gMcg*cV-3{7NX|6av6U0h!mQRy}0b;FFX@1N1D6*`x;@-`DXCS@uS@t z+ID&e!{6SS?}Xucz6(#S-9-piyG5E@I1asFMN((h&Ty^ zI82fAid#jf3dk%&VjkW8B+7JBB!@O=u~T)Zu~hiLf6Rf=UcQ?p9TM$jJ{aqDOodUp zlg(1V^vyCoXU^J*Lw$#%>yrg^$S{pB8I>+ylcK-FM!nG}8gs*YES|wN{$%n`(vQ=k zfrkTEamFpZ9?taV5vrl8QMW%y0SGxO>89V%NdiQ#Gne<$w=>UNlACg5>E1>@ zbE)a4PEn6xjv_DkYYKp!6Z3j2p-KUI=q|hkh?uqD!T8_kfy|B(&Y>3Jee>)S0^PlB KjjS?refA&Y2tz>t literal 0 HcmV?d00001 diff --git a/apps/multidice/README.md b/apps/multidice/README.md index 23a485d63..b33365d49 100644 --- a/apps/multidice/README.md +++ b/apps/multidice/README.md @@ -1,25 +1,30 @@ # multiple dice roller -roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all dice +roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all the dice -Add screen shots (if possible) to the app folder and link then into this file with ![](.png) +![the start-up screen](main.png) +![two rolled dice](2d20.png) +![the startup screen](menuPercent.png) +![one large dice](d100.png) ## Usage -Describe how to use it +On the menu screen: tap to the right or left of the "# of dice" option to change how many dice to roll, & tap to the left or right of the "dice" option to select a different type (currently hard-coded to only allow DnD dice). To roll the dice, simply tap anywhere else on the screen. To go back to the dice selector. + +Once you're no longer on the menu screen, tap anywhere on the screen to return to the menu (W.I.P: shaking the watch to allow rolling dice again without having to go to the menu every time) ## Features -Name the function +roll anywhere from 1-6 dice (d4, d6, d8, d10, d12, d20, & d percentile). If only one dice is selected, it simply displays the output; if two or more dice are selected it also displays basic stats such as the highest & lowest roll, the total sum, and the average of all the dice. ## Controls -Name the buttons and what they are used for +No button is used in the app, it simply uses touch controls (W.I.P: accelerometor to roll the dice & compatability with the bangle.js 1). ## Requests -Name who should be contacted for support/update requests +Le3Kat@gmail.com ## Creator -Your name +Le~Kat diff --git a/apps/multidice/d100.png b/apps/multidice/d100.png new file mode 100644 index 0000000000000000000000000000000000000000..16350db1657632de685f8c0289d84112b8334f6d GIT binary patch literal 1936 zcmeHI`%{t$6vZ#UM6wA~EK76=-;AcEtENyPCak5DDLs6xWtv7>t*fSF>_BBDRGVp; zT4vHtDr{PsDB`2(HAbeE76Q7I_yWuaqN1z+!R|~y_QSnr=AOB8XU@5IZVn|la5Zc_ z3<80yCXSF4DEK#Ztl;*NdkQDcQ2zi;$00rM9Zm3?;c*IVIt53%B+ z>yx4mKY38ka<@IL(=KK&&V&FqzsO5PHn;E4vJsS+fSCjUHs3Mc+W?G+0?jCL4qN;c zIg_&@{|)$g+&FsFDh>|{J12``)VU$%x`YWQjm^l;m4%Mq_6+(qii(=;FJ{f?-p*dW za;v!tu2W9Xx8VAW8#ebGx+YM)2rN-AxKU!}BU|TKC{r#p>p`cx>@P4FR*R9}7i*O- zy}OO?SZES*IQZqVNm`j`sil`S=HZZ%D7tTppUvW06r2yjGp{zj#Md&ey%gIh`bTy1npI(Ue_NY$HD7A?jt@TNv0&uoIJW?il+--h?Q3jh6hIUUI3__z=!}) zojH-(_PgwMn7Nv~%PZB|DL7~-RI$vjNKau)+1Q{Djo}O;_=kIJ6OXOxm#iyiH{li{A#v{dIh5Baf zZ=ybZxEs58tV1egc$p4alwuUBVl7GHo)4(e*|p`N=c}&zW=b#flb+7$ag4Raq9Qc! zM%`&wP@2i~kTC@Q;qusbfss-t0=KP*o*dWblkcFhpsPgz1WvyAdXKNB#aEL$(y@c* zm!aOnE^bdoi+bO?v?;F&<|==(!W9BkrC0Vv0WEIdJMy=)Vz0!f@f{f~$lfMrv}rCh z96j!qA9aRG-%c8O^!jH6HNEUDk-_))UGiF5~lixc@d}K~dERs%v$M%G6>bf;SZ%;2@b26mqlGDN<@l| zIN0a<)ac{zjHxWxyxbdw{x%#F-56wb3=f{Y=3%_`fCS-i>QfeMmut<3HaJCI;CP$~ zr^FE2Z?6MjR%WbRH~`!A@PL{BcE;gSK7z2FVeFX{3w2D{W&Se(>gaaw=x!4Oke$=A z6KVk3cU9z|?~2^_^gx$@dE3+7(A?V|wgGKuUO=g~KYtE*LHrfNJO`L1{uuT{#_zTu a^F~jqKDvZ8uF)=iS_nBHm{>)K`Qu-37+f|0 literal 0 HcmV?d00001 diff --git a/apps/multidice/main.png b/apps/multidice/main.png new file mode 100644 index 0000000000000000000000000000000000000000..7ca8f963174c7da421bc8d8abfd3391a64f13492 GIT binary patch literal 1547 zcmeAS@N?(olHy`uVBq!ia0vp^8$g(Y4M?uv{v?ipf%TH7i(^Pd+}qg?%Vq@#u)Y3m zUvhi$5wnLK)#3p=?)&_2DoRgxSn~1P@Av!T{}nS$_Ir?aVDhZuoASa23C=UBnAmK# z+KJ~MFf;hdvW(|P*=}2zU#s`^-|OH0?cddJE4g?6c*I-b5Fnbdwf2F)yG?~m{>*V* zmeE%tkK4cAAw75Bo7DIJo=7tqK4{dG{P29jGR}(Jh2Gbz-&?w~2dzziZ}l$b?qi+r z>#rG}ie8)k#o}rm^YeH81?zvvK6og)L#UGdzV(8@g;%S-ty|2M)_c97K5l0JCxfb_ z+8QmJ-}85b-(?P$Kbd`d_4U#N``<_JeZP9U{`J4_9_P-z{ppDLgY}&fAD$;4S}T9^ zD(43C8}B&FzkIBVsoBHy|9{b^RSCNsL$~|5-#t`%SZeRn*Zbbj`@6UG$G5k)8s;xI z@jbA9A5%!UO1|Q}`%WR@YqIuTeZ9VWZ8tzQ?{ zh*ah7e>FLM=el?9uL9r4105#b@ovtl((uy(|h7TI^L(_^h@6Z4b`8E-gg6OeYGP`zo;b~*ju^t`%xe*F8rvdO8ACI z!Po14SHIm8x_g^*jsJm$waKqI_ozHrss89uxO%}A`493xKUXuG-FV39BVO<|c+x9z zma8+rt!u3Cx4ZM=uRoVqxYtO%$|8Gs*>-Ej66IQ)t+vEQ7cYHK!RPO!Fk5)3RbLii(d{v+0 zJ-c6XmvU{ZW~??VW>yownF5Te#?tc#-u=59Jz<&qop*PC>O05(-c)}?{aHx(gS7`@ z8Fx5wKX~`YkN?NH&EG8xzV3Oy;=8=r#N_oe3t7ANM`p4(G% z_u6u`YBrCGw_6y6pPaDx&SLgg_sE?S>+CX_*yf}NpGZ33@Y3_dD04I%hFl`3XK-^& Wv6(9Jbw99>XYh3Ob6Mw<&;$UNdjDDZGy0Y(FVSM=e(rLfL zi?^)XK5O|`tE+W;FI8W^UH#AYH}jtfQU`9gBr)jEXMETHBz$j4$n(hCakAT=3;y|g zea`>+S#SPMdHCYv>7D)a)?4i}U+!P6|Hb0J=Jx}k2N?eUo>6dxnd?FG{r`+R-Y>1n zeII`R@wP+jer4O9*Z%gI=g-0I0-*;P*4NBjUS(X&UzXo+Rr!YQk#D*#th-Nbx7v5h z?$@8IUr$#jG}OCAh?bR9zn{Hh)q|{guYP3xe(^c{x;|t7Kar%$e@_oo-{12^=g-Z3 zSDDK#udlYd9$W4DdT#pK?H6~-)VkUk-3Pjd!G8UkuZ%&Bm0yihzB;UWX34b0%Iwo= zo2!d*=BqO{Jb(FXk~Zs)Nn6it)}WNLBDP_5zIEvB=bhKR+|?OAyl9zQpTXqJz(4oK zNq_$ZUq!!##{ang>!s9z<;5qY71#>C`u=$(&T_Ti?*2!PzmG0TRmd&hH_r zvyX?{Kia$g)6K85>Vme22_JaRTJr5`5<~d;h{fCWyQ{u`J=gXr^LqTV`?uXoYulfW9ltxP#esqLrRM6#t6$Ua$1$#+SFq}F_4eaT>l8x2-?{p6+ji9eTg5L; zZ|=%J*f#IY)=3Npj@G9~?N#}DY8BIa+xu^RhgXK>f4erX@VZ^@ja~Ot-!*CnggyXj z{O_~i)aQ}|r_GbA?cJiQUH1O^v-Wyn|DN{?BmUYhsCpI?xAj-Sg3|x%|F+ff-Qjxu zf_ceTD+YhIiu*;fs*T@OH@x00@Lu}-RFw_Dq}}48&QMTN+r~bl@dXP*-@5Z37>tpV zJcGq9yTi<997>oN+^?rsG)Q*%F+6zji-+HU`64HSOzixJjA;s1j17xl8`~V<88r-4 hOpJyZdeZnKZ+?G`jqq~$%fLdJ!PC{xWt~$(696AnwY>lU literal 0 HcmV?d00001 From 71c69d9668c4f936345ad8f93918610051044dae Mon Sep 17 00:00:00 2001 From: Le-Kat <37410281+Le-Kat@users.noreply.github.com> Date: Fri, 10 Feb 2023 01:27:49 +0000 Subject: [PATCH 40/89] added spacing between two of the images --- apps/multidice/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/multidice/README.md b/apps/multidice/README.md index b33365d49..7e44600d6 100644 --- a/apps/multidice/README.md +++ b/apps/multidice/README.md @@ -4,6 +4,7 @@ roll anywhere from 1-6 dice at the same time, and display stats like the highest ![the start-up screen](main.png) ![two rolled dice](2d20.png) + ![the startup screen](menuPercent.png) ![one large dice](d100.png) From a82a50ff5a8194310a38ca8dec6adafcbdee1f2b Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 20:39:22 -0500 Subject: [PATCH 41/89] added app icon --- apps/multidice/app-icon.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 apps/multidice/app-icon.js diff --git a/apps/multidice/app-icon.js b/apps/multidice/app-icon.js new file mode 100644 index 000000000..d79fe5bd2 --- /dev/null +++ b/apps/multidice/app-icon.js @@ -0,0 +1 @@ +E.toArraybuffer(atob("MDCBAf////w///////gf/4AAAfPP/z///efn/z///M/z/z///J/5/z///z48/z///nwefz///PnfPz/D+fnfnz+B8/2fzz885/w/5z9+z///8z9+nw/4eT9+Pm/zfD88Puf3PD+Bvuf3PD/Dng/wfD//z5/8+T//5/5/8z//8/wf5z//+fnfzz///Pnfnz///H2fP4AAATw+R4AAAB/8wz///M/5+zD//OfyOyB//PPkGSZ//PnN2WZ//Nwd2eB//MP8GXD//OP+OX/D/P+P+f+B/P8H+X+Z/P93+T+Z/P93+T+B/P8H+T/D/P+P+T//DOP+OT/+BMH8GT/+ZN392T/+ZN392T/+BMH8GT//DOP+Oz///P//+4//8D//48AAAwAADw==")) From 168d318fa9ae996bb83d88e5b675ee0e14f4f7a6 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 21:36:51 -0500 Subject: [PATCH 42/89] removed email from README b/c I don't want it getting scraped --- apps/multidice/README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/apps/multidice/README.md b/apps/multidice/README.md index 7e44600d6..06ea82075 100644 --- a/apps/multidice/README.md +++ b/apps/multidice/README.md @@ -21,11 +21,3 @@ roll anywhere from 1-6 dice (d4, d6, d8, d10, d12, d20, & d percentile). If only ## Controls No button is used in the app, it simply uses touch controls (W.I.P: accelerometor to roll the dice & compatability with the bangle.js 1). - -## Requests - -Le3Kat@gmail.com - -## Creator - -Le~Kat From ad28b9b387b36461a73abe2bba37084b6d8182b7 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 21:41:49 -0500 Subject: [PATCH 43/89] added app.png --- apps/multidice/app.png | Bin 0 -> 1330 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/multidice/app.png diff --git a/apps/multidice/app.png b/apps/multidice/app.png new file mode 100644 index 0000000000000000000000000000000000000000..75ee0514a953e29e618bf56a49e8526e8eac59f5 GIT binary patch literal 1330 zcmV-21iCYS(1OJaP25k$Q;U-Cc6Fq}DO z&f~^^GU+{YX6AhVneRCO{|_z%wga=k3E*Skx~hw=0yfvshP74*4PYP80`>qe0f&IU zfwg4>?*QHb=4)F)$4fq%-7cwW2lxIR!7w#Jawd^RBbJpr|vEJNZr zu$TJrE^sVT_(~*NI)%ECoNTP{E{TaEBurmNX%Di5Uk2;>QW1~>|Q zp_6*g8xu{U9R%{!X1DC4q2~>f$m3>z>*jeSp+ugy@h%ooqG4A zlCd=5?*@K#c6!`%mua{Y_}Q8BK5#(_2~*))>NtT{^!E|(eU}88QF1pdy?=@@8o*D$ z0U7p2;9uamlv6#Vjmsp^Ej{1w=(=wMqgulRcCk|Zw>f>&+Px4~XpR|ng3lEze7vad z=X#<06m%?SdQI)P`qnt7wA7n-rTT}Q&6rd44dF7)+2owaQ5n1s%iq3>Az-*3_)x{i z@4yF&riLEi5ACk$r;Bl^&6J84vy=XuZ|%{XX$8A8DKTe_#%zrxkcUBehDnda0_nU3 zuGfKO5o>iQPJ9Bq0bJ|7AJ9hZON_g&RAOy_Lrs$IA%cj(Q-5#BK@SrRPoB$R$OEM}|^&MV3cm!b|2>rMTQE;SDe76ozW5i7!!f zZb_+e#w8zuCNa;}9%g-4eBbsKIaz5><%D~+st>260#(qhHRt8iABgl$F={j97eA+T z&6fm`tx6Rva&A#y8En^wF4l7li2+CW)r!U^W$;Pl?{YTgoH#Hh=_bP{zDa7oziF4c}c>Zwgrb1(Ihyk;5!%cl<`h61e!VCCWN3H4Pmy;1p3-dpp18lA<&!SZE7P>#yb@; z;;DeQsf|Dx@8lCG>TUWn#@9w5%R9LQih7%#vbj)EWO*l-Kv8egERqXVAuwBzK&-cE z7RiOG5XkaQX}M6Wx9KgC3!Qcfnxe?^PDw%2DCuqb1LMyrXp)lB{TG<3u(ghOm%DXg zgVwz@=~$*>;)pE1>VNjwrnOG#wxgwDe5B&KBTi9o7h`APYTz?{wCZ(=tzq|_cB5=p oHg@l1bwC|gHFnkhjC-x}A5s&T=P#0nHvj+t07*qoM6N<$g6g++LI3~& literal 0 HcmV?d00001 From 91eb88ef849ddf3ebed88fd3bea0dc61b571dc7e Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Thu, 9 Feb 2023 22:31:50 -0500 Subject: [PATCH 44/89] added tags to metadata.json, trying to wrap my head around the sanitycheck --- apps/multidice/app-icon.js | 2 +- apps/multidice/metadata.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/multidice/app-icon.js b/apps/multidice/app-icon.js index d79fe5bd2..d6e931259 100644 --- a/apps/multidice/app-icon.js +++ b/apps/multidice/app-icon.js @@ -1 +1 @@ -E.toArraybuffer(atob("MDCBAf////w///////gf/4AAAfPP/z///efn/z///M/z/z///J/5/z///z48/z///nwefz///PnfPz/D+fnfnz+B8/2fzz885/w/5z9+z///8z9+nw/4eT9+Pm/zfD88Puf3PD+Bvuf3PD/Dng/wfD//z5/8+T//5/5/8z//8/wf5z//+fnfzz///Pnfnz///H2fP4AAATw+R4AAAB/8wz///M/5+zD//OfyOyB//PPkGSZ//PnN2WZ//Nwd2eB//MP8GXD//OP+OX/D/P+P+f+B/P8H+X+Z/P93+T+Z/P93+T+B/P8H+T/D/P+P+T//DOP+OT/+BMH8GT/+ZN392T/+ZN392T/+BMH8GT//DOP+Oz///P//+4//8D//48AAAwAADw==")) +atob("MDCEAREREREREREREREREREREQAAEREREREREREREREREREREREREREREAAAARERERERERAAAAAAAAAAAAAAARERABERABEREREREQARERERERERERERAREQAREREAEREREREQARERERERERERERABEAEREREQAREREREQARERERERERERERABABERERERABEREREQAREREREREREREREQARERAAEREAEREREQAREREREREREREREAEREQAAAREQAREREQARERERERERERERABEREAERARERABEREQARERERAAAREREQAREREAERAREREAEREQAREREQAAABEREAEREREQEQAREREQAREQAREREAEREAERABEREREQAAERERERABEQAREREBEREQEQAREREREREREREREREAEQAREREBEREQEAEREQAAERERERAAAREQAQAREREBEREQABEREAEQEREREQARARERAAAREREAEREAABEREBEQAREREQERABERAAAREREQAAABEBEREBEQAREREQERABERAAARERERAAAREAEREAAAEREREQAAARERAAAREREREREREQARERABEREREREAEREQAQARERERERERERABERERERABEREREREAEQAREREREREREREAEREREQAAARERERABEQAREREREREREREQAREREAERAREREQAREQARERERERERERERABEREAERAREREAEREQARERERERERERERAAEREQEQARERABERERAAAAAAAAAAAAAAAQAREQAAEREQAQABERAAAAAAAAAAAAAAAAABEREREREAEQAAEQARERERERERERERABEAERERERABEREQEQARAAARERERERERABEQAREREQAQABEQEQAQAAABERERERERABERABEREAEAAAEQAQAQARABERERERERABEREAERABEBEQEQAQEQARABERERERERABEBEQAAAREBEQEQAREQAAABERERERERABEAABEREREAAAEQAQERAAARERERERERABEQABEREREQABEQAQERERERAAARERERABEREREQABEREREQAREREREQAAABERERABEREREAAAEREREQAQEREREQARABERERABEREREBEQEREREQAQAREREQARABERERABEREREBEQEREREQAQAREREQAAABERERABEREREAAAEREREQAQARERERAAARERERABEREREQABEREREQAQARERERERERAAARABEQABEREREQABEQAQAREREREREQAAABABEAAAEREREAAAEQAQAREREREREQARABABEBEQEREREBEQEQAQAREREREREQARABABEBEQEREREBEQEQAQAREREREREQAAABABEAAAEREREAAAEQAQARERERERERAAARABEQABEREREQABEQEQARERERERERERERABEREREREREREREQERAAEREREREREREAAAARERERERERERAAEREAAAAAAAAAAAAAEQAAAAAAAAAAAAAREQ==") diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 1a41cf09f..b7537d0b3 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -4,7 +4,7 @@ "version":"0.90", "description": "roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all dice", "icon": "app.png", - "tags": "", + "tags": "tool,game", "supports" : ["BANGLEJS2"], "readme": "README.md", "allow_emulator": true, From 6a39a53c740ac2cc3568c885e5dd512b3dd278fd Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Fri, 24 Feb 2023 23:39:42 -0500 Subject: [PATCH 45/89] after a rigorous field study of size n = 1, I have determined this to be a better app after this change --- apps/multidice/app.js | 230 +++++++++++++++++------------------------- 1 file changed, 94 insertions(+), 136 deletions(-) diff --git a/apps/multidice/app.js b/apps/multidice/app.js index d11bc99d5..911177983 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -1,169 +1,127 @@ var menu = true; -var diceOpts = {amount: 2, selected: 5}; // TODO: grab values from settings -const DICE_ARRAY = [4, 6, 8, 10, 12, 20, 100]; // TODO: place in settings +const DICE_ARRAY = [0, 4, 6, 8, 10, 12, 20, 100]; +const SELECTION_ARRAY = [6, 0, 0, 0, 0, 0, 0, 0]; // default to selecting a single d20 function drawMenu() { + stringArr = new Array ("", "", "", "", "", "", "", ""); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; + } + } + g.clear(); - g.setFont ("6x8", 2); + g.setFont ("Vector", 40); - g.drawString ("# of dice:", 5, 5); - g.drawString (diceOpts.amount, 137, 5); - - g.drawString ("dice:", 5, 32); - g.drawString (DICE_ARRAY [diceOpts.selected], 137, 32); + g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); + g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); + g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); + g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); + g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); + g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); + g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); + g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); } function touchHandler (button, xy) { - if (menu) { - - if (xy.y <= 26) { // selecting number of dice - - if (xy.x <= 87) { // left edge: decrease - - if (diceOpts.amount > 1) - diceOpts.amount--; - } else { // right edge: increase - - if (diceOpts.amount < 6) - diceOpts.amount++; - } - - drawMenu(); - } else if (xy.y <= 53) { // selecting dice type - - if (xy.x <= 87) { // left edge: decrease - - if (diceOpts.selected > 0) - diceOpts.selected--; - } else { // right edge: increase - - if (diceOpts.selected < DICE_ARRAY.length - 1) - diceOpts.selected++; - } - - drawMenu(); - } else { - - rollDice(); - } - } else { // return to menu screen + if (! menu) { menu = true; - drawMenu (); + drawMenu(); + return; } + + if (xy.x <= 87) { // left + + if (xy.y <= 43) { + + selection = 0; + } else if (xy.y <= 87) { + + selection = 1; + } else if (xy.y <= 131) { + + selection = 2; + } else { + + selection = 3; + } + } else { // right + + if (xy.y <= 43) { + + selection = 4; + } else if (xy.y <= 87) { + + selection = 5; + } else if (xy.y <= 131) { + + selection = 6; + } else { + + selection = 7; + } + } + + // increment SELECTION_ARRAY [selection] + if (SELECTION_ARRAY [selection] == 7) { + + SELECTION_ARRAY [selection] = 0; + } else { + + SELECTION_ARRAY [selection] += 1; + } + + drawMenu(); } function rollDice() { - menu = false; - if (diceOpts.amount == 1) { + resultsArr = new Uint8Array (8); + for (i = 0; i < 8; i++) { - let output = random (DICE_ARRAY [diceOpts.selected]); - - g.clear(); - g.setFont ("Vector", 90); - - g.drawString ((" " + output).slice (-3), 10, 0); - } else { - - let output = new Int8Array ([-1, -1, -1, -1, -1, -1]); - for (let i = 0; i < diceOpts.amount; i++) { + if (SELECTION_ARRAY [i] != 0) { - output [i] = random (DICE_ARRAY [diceOpts.selected]); + resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); } + } + + g.clear(); + g.setFont ("Vector", 40); + + for (i = 0; i < 4; i++) { - g.clear(); - g.setFont ("Vector", 40); - - for (let i = 0; i < 3; i++) { // draws all the numbers in two rows + if (SELECTION_ARRAY [i] != 0) { - if (output [i * 2 + 0] == -1) { - - break; - } else if (output [i * 2 + 1] == -1) { - - - g.drawString ((" " + output [i * 2]).slice (-3), 5, 5 + i * 40); - } else { - - g.drawString ((" " + output [i * 2]).slice (-3) + " " + (" " + output [i * 2 + 1]).slice (-3), 5, 5 + i * 40); - } + g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); } + } + + for (i = 4; i < 8; i++) { - g.setFont ("Vector", 20); - g.drawString ("H: " + (" " + max (output)).slice (-3), 5, 130); - g.drawString ("L: " + (" " + min (output)).slice (-3), 110, 130); - g.drawString ("T: " + (" " + total (output)).slice (-3), 5, 150); - g.drawString ("A: " + (" " + average (output)).slice (-3), 110, 150); + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * i); + } } } -function random (max) { // number is always between 1 and max +function random (max) { return Math.round (Math.random() * (max - 1) + 1); } -function max (array) { - - let max = 0; - for (let i = 0; i < 6; i++) { - - if (array [i] == -1) - break; - - if (array [i] > max) - max = array [i]; - } - - return max; -} - -function min (array) { - - let min = array [0]; - for (let i = 1; i < 6; i++) { - - if (array [i] == -1) - break; - - if (array [i] < min) - min = array [i]; - } - - return min; -} - -function total (array) { - - let total = 0; - for (let i = 0; i < 6; i++) { - - if (array [i] == -1) - break; - - total += array [i]; - } - - return total; -} - -function average (array) { - - let average = 0; - let rounds = 0; - for (let i = 0; i < 6; i++) { - - if (array [i] == -1) - break; - - average += array [i]; - rounds++; - } - - return Math.round (average / rounds); -} - drawMenu(); Bangle.on ('touch', touchHandler); +Bangle.on ('accel', function (xyz) { + + if (xyz.diff >= 0.3) { + + menu = false; + rollDice(); + } +}); From f2c900f8e13ad8f36167e82c21ea63daa1642760 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Fri, 24 Feb 2023 23:46:13 -0500 Subject: [PATCH 46/89] updated changelog, metadata, & readme. deleted outdated images --- apps/multidice/2d20.png | Bin 2352 -> 0 bytes apps/multidice/ChangeLog | 1 + apps/multidice/README.md | 16 +++++----------- apps/multidice/app.png | Bin 1330 -> 0 bytes apps/multidice/d100.png | Bin 1936 -> 0 bytes apps/multidice/main.png | Bin 1547 -> 0 bytes apps/multidice/menuPercent.png | Bin 1467 -> 0 bytes apps/multidice/metadata.json | 4 ++-- 8 files changed, 8 insertions(+), 13 deletions(-) delete mode 100644 apps/multidice/2d20.png delete mode 100644 apps/multidice/app.png delete mode 100644 apps/multidice/d100.png delete mode 100644 apps/multidice/main.png delete mode 100644 apps/multidice/menuPercent.png diff --git a/apps/multidice/2d20.png b/apps/multidice/2d20.png deleted file mode 100644 index e6c52b839b07e4237582668126be172707a6309c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2352 zcmeH}`8V5%7Qo{xOkzd_#Vcy5B{VfUlxJGCHI){nQIbY%XADt0ovNMG(W1zs_H~NX zl0=AoZ8};@#8$B{jkR7ap|Mph&->+_^ZtkV;okepz2~0u`P?6F!hLI$sEDix2m}(n zdk1NIR;<5aF{-Z(MQ)fgt;Lk*0Pb&KvpjVbcabfd_e~L(NSUyd6!68YR;(HJj)$ z7_+h+NrGAG zTfsy{Qnz-@sQ(^@J@5Cf^&jlQeHx&swW(>A!6YpDyHj%eaNNm!y!Tr&GxcGK?d?TH z0mXt5G&jC;U5`Ft&}YMid|8E3lRl;S2A5NiSOd1BxAzGvGz&@vMaJD=FxiGr4HIoT>s zns-RsQQ<@q>dM+Q}P3S=$f0x=7nDJ1_IGr+JbGgBz;f zw5J`kXTl3RQO~j?eKYTINQZ|tVRJ72MRUiN1sOm3KraX}PUVTy?>RG^79XS2_Umo0 zn1r$bF?q02S!SxvgXvczGzDc?lX(kkJP)n`ma2MhNxE(?rmquX<=*aa0K=iM1QJyK8*A=VM?Qh$P_ zOUW}{SY(c*NrtFR3^!jk>wA9R-neBiQc>y(>_BN&dSV!cFr!H5+!$D$5;xc`)RP-% zFiNAsdpy~xQCO$x+D(kVl$8PT6@06~5n6Yt)c%<{Ut=w~t4IDk>tQ48Ax=XNwyIpc zWa((*<|rr-2Lcf3s1%7QZ?Vd6UN>1m}L!xT~T@_{N<`(C^D24>hE3?p%07T7RhuQq;sJ<{oM^Hp820crGFeLi+>rdd>pTFV-Y@RT1Oe0Lx7+`6+hq7r2akhE#^3dUYCa8_fuWzFLwYKqU^3#k(*?p#iTZv~^pOUFJ#sC^Z7Mxh>z zU&A+NPmXPgDmmvNlewPO;1gxpKvod;%jmCz)_%(`gZW@g?)q#XYr^6l7)qq8Z1s`Z z1>0`mIo`^8qm#QXjhdjpIhj?mn(5dqOzu{}eNqotUKp)m{A=^8x*4vK6@YQ#EasHE z0|@#X%;u`fka+319)TX>T=X{lA})dRgwRc+lERX7(2V98d^`*9=23t;SqVvc2UBgdo#hs z-c@@?-XCi2BRY3s6F(q99 zD`CRTsLP?`gMcg*cV-3{7NX|6av6U0h!mQRy}0b;FFX@1N1D6*`x;@-`DXCS@uS@t z+ID&e!{6SS?}Xucz6(#S-9-piyG5E@I1asFMN((h&Ty^ zI82fAid#jf3dk%&VjkW8B+7JBB!@O=u~T)Zu~hiLf6Rf=UcQ?p9TM$jJ{aqDOodUp zlg(1V^vyCoXU^J*Lw$#%>yrg^$S{pB8I>+ylcK-FM!nG}8gs*YES|wN{$%n`(vQ=k zfrkTEamFpZ9?taV5vrl8QMW%y0SGxO>89V%NdiQ#Gne<$w=>UNlACg5>E1>@ zbE)a4PEn6xjv_DkYYKp!6Z3j2p-KUI=q|hkh?uqD!T8_kfy|B(&Y>3Jee>)S0^PlB KjjS?refA&Y2tz>t diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 1c7728b3d..a216ea61b 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -1 +1,2 @@ 0.90: got most of the features done, lacking some polish and real-hardware testing +1.00: overhauled the whole app, made some margins larger to be easier to tap on diff --git a/apps/multidice/README.md b/apps/multidice/README.md index 06ea82075..2d28ef33f 100644 --- a/apps/multidice/README.md +++ b/apps/multidice/README.md @@ -1,23 +1,17 @@ # multiple dice roller -roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all the dice +roll anywhere from 1-8 dice at the same time. -![the start-up screen](main.png) -![two rolled dice](2d20.png) - -![the startup screen](menuPercent.png) -![one large dice](d100.png) ## Usage -On the menu screen: tap to the right or left of the "# of dice" option to change how many dice to roll, & tap to the left or right of the "dice" option to select a different type (currently hard-coded to only allow DnD dice). To roll the dice, simply tap anywhere else on the screen. To go back to the dice selector. - -Once you're no longer on the menu screen, tap anywhere on the screen to return to the menu (W.I.P: shaking the watch to allow rolling dice again without having to go to the menu every time) +On the menu screen: tap on the dice to change what variant is selected, & shake the watch in order to roll those dice +On the dice screen: tap anywhere on the screen to go back to the menu, or shake to roll the dice again ## Features -roll anywhere from 1-6 dice (d4, d6, d8, d10, d12, d20, & d percentile). If only one dice is selected, it simply displays the output; if two or more dice are selected it also displays basic stats such as the highest & lowest roll, the total sum, and the average of all the dice. +roll anywhere from 1-8 dice (d4, d6, d8, d10, d12, d20, & d percentile). You can select multiple different dice at the same time ## Controls -No button is used in the app, it simply uses touch controls (W.I.P: accelerometor to roll the dice & compatability with the bangle.js 1). +No button is used in the app, it simply uses touch controls & the accelerometor diff --git a/apps/multidice/app.png b/apps/multidice/app.png deleted file mode 100644 index 75ee0514a953e29e618bf56a49e8526e8eac59f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1330 zcmV-21iCYS(1OJaP25k$Q;U-Cc6Fq}DO z&f~^^GU+{YX6AhVneRCO{|_z%wga=k3E*Skx~hw=0yfvshP74*4PYP80`>qe0f&IU zfwg4>?*QHb=4)F)$4fq%-7cwW2lxIR!7w#Jawd^RBbJpr|vEJNZr zu$TJrE^sVT_(~*NI)%ECoNTP{E{TaEBurmNX%Di5Uk2;>QW1~>|Q zp_6*g8xu{U9R%{!X1DC4q2~>f$m3>z>*jeSp+ugy@h%ooqG4A zlCd=5?*@K#c6!`%mua{Y_}Q8BK5#(_2~*))>NtT{^!E|(eU}88QF1pdy?=@@8o*D$ z0U7p2;9uamlv6#Vjmsp^Ej{1w=(=wMqgulRcCk|Zw>f>&+Px4~XpR|ng3lEze7vad z=X#<06m%?SdQI)P`qnt7wA7n-rTT}Q&6rd44dF7)+2owaQ5n1s%iq3>Az-*3_)x{i z@4yF&riLEi5ACk$r;Bl^&6J84vy=XuZ|%{XX$8A8DKTe_#%zrxkcUBehDnda0_nU3 zuGfKO5o>iQPJ9Bq0bJ|7AJ9hZON_g&RAOy_Lrs$IA%cj(Q-5#BK@SrRPoB$R$OEM}|^&MV3cm!b|2>rMTQE;SDe76ozW5i7!!f zZb_+e#w8zuCNa;}9%g-4eBbsKIaz5><%D~+st>260#(qhHRt8iABgl$F={j97eA+T z&6fm`tx6Rva&A#y8En^wF4l7li2+CW)r!U^W$;Pl?{YTgoH#Hh=_bP{zDa7oziF4c}c>Zwgrb1(Ihyk;5!%cl<`h61e!VCCWN3H4Pmy;1p3-dpp18lA<&!SZE7P>#yb@; z;;DeQsf|Dx@8lCG>TUWn#@9w5%R9LQih7%#vbj)EWO*l-Kv8egERqXVAuwBzK&-cE z7RiOG5XkaQX}M6Wx9KgC3!Qcfnxe?^PDw%2DCuqb1LMyrXp)lB{TG<3u(ghOm%DXg zgVwz@=~$*>;)pE1>VNjwrnOG#wxgwDe5B&KBTi9o7h`APYTz?{wCZ(=tzq|_cB5=p oHg@l1bwC|gHFnkhjC-x}A5s&T=P#0nHvj+t07*qoM6N<$g6g++LI3~& diff --git a/apps/multidice/d100.png b/apps/multidice/d100.png deleted file mode 100644 index 16350db1657632de685f8c0289d84112b8334f6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1936 zcmeHI`%{t$6vZ#UM6wA~EK76=-;AcEtENyPCak5DDLs6xWtv7>t*fSF>_BBDRGVp; zT4vHtDr{PsDB`2(HAbeE76Q7I_yWuaqN1z+!R|~y_QSnr=AOB8XU@5IZVn|la5Zc_ z3<80yCXSF4DEK#Ztl;*NdkQDcQ2zi;$00rM9Zm3?;c*IVIt53%B+ z>yx4mKY38ka<@IL(=KK&&V&FqzsO5PHn;E4vJsS+fSCjUHs3Mc+W?G+0?jCL4qN;c zIg_&@{|)$g+&FsFDh>|{J12``)VU$%x`YWQjm^l;m4%Mq_6+(qii(=;FJ{f?-p*dW za;v!tu2W9Xx8VAW8#ebGx+YM)2rN-AxKU!}BU|TKC{r#p>p`cx>@P4FR*R9}7i*O- zy}OO?SZES*IQZqVNm`j`sil`S=HZZ%D7tTppUvW06r2yjGp{zj#Md&ey%gIh`bTy1npI(Ue_NY$HD7A?jt@TNv0&uoIJW?il+--h?Q3jh6hIUUI3__z=!}) zojH-(_PgwMn7Nv~%PZB|DL7~-RI$vjNKau)+1Q{Djo}O;_=kIJ6OXOxm#iyiH{li{A#v{dIh5Baf zZ=ybZxEs58tV1egc$p4alwuUBVl7GHo)4(e*|p`N=c}&zW=b#flb+7$ag4Raq9Qc! zM%`&wP@2i~kTC@Q;qusbfss-t0=KP*o*dWblkcFhpsPgz1WvyAdXKNB#aEL$(y@c* zm!aOnE^bdoi+bO?v?;F&<|==(!W9BkrC0Vv0WEIdJMy=)Vz0!f@f{f~$lfMrv}rCh z96j!qA9aRG-%c8O^!jH6HNEUDk-_))UGiF5~lixc@d}K~dERs%v$M%G6>bf;SZ%;2@b26mqlGDN<@l| zIN0a<)ac{zjHxWxyxbdw{x%#F-56wb3=f{Y=3%_`fCS-i>QfeMmut<3HaJCI;CP$~ zr^FE2Z?6MjR%WbRH~`!A@PL{BcE;gSK7z2FVeFX{3w2D{W&Se(>gaaw=x!4Oke$=A z6KVk3cU9z|?~2^_^gx$@dE3+7(A?V|wgGKuUO=g~KYtE*LHrfNJO`L1{uuT{#_zTu a^F~jqKDvZ8uF)=iS_nBHm{>)K`Qu-37+f|0 diff --git a/apps/multidice/main.png b/apps/multidice/main.png deleted file mode 100644 index 7ca8f963174c7da421bc8d8abfd3391a64f13492..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1547 zcmeAS@N?(olHy`uVBq!ia0vp^8$g(Y4M?uv{v?ipf%TH7i(^Pd+}qg?%Vq@#u)Y3m zUvhi$5wnLK)#3p=?)&_2DoRgxSn~1P@Av!T{}nS$_Ir?aVDhZuoASa23C=UBnAmK# z+KJ~MFf;hdvW(|P*=}2zU#s`^-|OH0?cddJE4g?6c*I-b5Fnbdwf2F)yG?~m{>*V* zmeE%tkK4cAAw75Bo7DIJo=7tqK4{dG{P29jGR}(Jh2Gbz-&?w~2dzziZ}l$b?qi+r z>#rG}ie8)k#o}rm^YeH81?zvvK6og)L#UGdzV(8@g;%S-ty|2M)_c97K5l0JCxfb_ z+8QmJ-}85b-(?P$Kbd`d_4U#N``<_JeZP9U{`J4_9_P-z{ppDLgY}&fAD$;4S}T9^ zD(43C8}B&FzkIBVsoBHy|9{b^RSCNsL$~|5-#t`%SZeRn*Zbbj`@6UG$G5k)8s;xI z@jbA9A5%!UO1|Q}`%WR@YqIuTeZ9VWZ8tzQ?{ zh*ah7e>FLM=el?9uL9r4105#b@ovtl((uy(|h7TI^L(_^h@6Z4b`8E-gg6OeYGP`zo;b~*ju^t`%xe*F8rvdO8ACI z!Po14SHIm8x_g^*jsJm$waKqI_ozHrss89uxO%}A`493xKUXuG-FV39BVO<|c+x9z zma8+rt!u3Cx4ZM=uRoVqxYtO%$|8Gs*>-Ej66IQ)t+vEQ7cYHK!RPO!Fk5)3RbLii(d{v+0 zJ-c6XmvU{ZW~??VW>yownF5Te#?tc#-u=59Jz<&qop*PC>O05(-c)}?{aHx(gS7`@ z8Fx5wKX~`YkN?NH&EG8xzV3Oy;=8=r#N_oe3t7ANM`p4(G% z_u6u`YBrCGw_6y6pPaDx&SLgg_sE?S>+CX_*yf}NpGZ33@Y3_dD04I%hFl`3XK-^& Wv6(9Jbw99>XYh3Ob6Mw<&;$UNdjDDZGy0Y(FVSM=e(rLfL zi?^)XK5O|`tE+W;FI8W^UH#AYH}jtfQU`9gBr)jEXMETHBz$j4$n(hCakAT=3;y|g zea`>+S#SPMdHCYv>7D)a)?4i}U+!P6|Hb0J=Jx}k2N?eUo>6dxnd?FG{r`+R-Y>1n zeII`R@wP+jer4O9*Z%gI=g-0I0-*;P*4NBjUS(X&UzXo+Rr!YQk#D*#th-Nbx7v5h z?$@8IUr$#jG}OCAh?bR9zn{Hh)q|{guYP3xe(^c{x;|t7Kar%$e@_oo-{12^=g-Z3 zSDDK#udlYd9$W4DdT#pK?H6~-)VkUk-3Pjd!G8UkuZ%&Bm0yihzB;UWX34b0%Iwo= zo2!d*=BqO{Jb(FXk~Zs)Nn6it)}WNLBDP_5zIEvB=bhKR+|?OAyl9zQpTXqJz(4oK zNq_$ZUq!!##{ang>!s9z<;5qY71#>C`u=$(&T_Ti?*2!PzmG0TRmd&hH_r zvyX?{Kia$g)6K85>Vme22_JaRTJr5`5<~d;h{fCWyQ{u`J=gXr^LqTV`?uXoYulfW9ltxP#esqLrRM6#t6$Ua$1$#+SFq}F_4eaT>l8x2-?{p6+ji9eTg5L; zZ|=%J*f#IY)=3Npj@G9~?N#}DY8BIa+xu^RhgXK>f4erX@VZ^@ja~Ot-!*CnggyXj z{O_~i)aQ}|r_GbA?cJiQUH1O^v-Wyn|DN{?BmUYhsCpI?xAj-Sg3|x%|F+ff-Qjxu zf_ceTD+YhIiu*;fs*T@OH@x00@Lu}-RFw_Dq}}48&QMTN+r~bl@dXP*-@5Z37>tpV zJcGq9yTi<997>oN+^?rsG)Q*%F+6zji-+HU`64HSOzixJjA;s1j17xl8`~V<88r-4 hOpJyZdeZnKZ+?G`jqq~$%fLdJ!PC{xWt~$(696AnwY>lU diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index b7537d0b3..1b02945b6 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,8 +1,8 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"0.90", - "description": "roll anywhere from 1-6 dice at the same time, and display stats like the highest & lowest roll, the total sum of the dice, and the average of all dice", + "version":"1.00", + "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", "supports" : ["BANGLEJS2"], From fe010d949cdd37da4f47f2296b501e27607a0660 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Fri, 24 Feb 2023 23:59:41 -0500 Subject: [PATCH 47/89] fixed bug that caused rolled dice on the right of screen to be writ off-screen --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index a216ea61b..c35862f7c 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -1,2 +1,3 @@ 0.90: got most of the features done, lacking some polish and real-hardware testing 1.00: overhauled the whole app, made some margins larger to be easier to tap on +1.01: fixed bug that caused rolled dice on the right of screen to be writ off-screen diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 911177983..58b72e9fc 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -105,7 +105,7 @@ function rollDice() { if (SELECTION_ARRAY [i] != 0) { - g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * i); + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); } } } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 1b02945b6..3e82d01be 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.00", + "version":"1.01", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 678f7137224901d7253eb82b31c266ed9098f0bb Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 00:09:16 -0500 Subject: [PATCH 48/89] added vibration when dice is rolled --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 ++ apps/multidice/metadata.json | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index c35862f7c..ee190c200 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -1,3 +1,4 @@ 0.90: got most of the features done, lacking some polish and real-hardware testing 1.00: overhauled the whole app, made some margins larger to be easier to tap on 1.01: fixed bug that caused rolled dice on the right of screen to be writ off-screen +1.02: added vibration when dice is rolled diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 58b72e9fc..0ab98f8d0 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -108,6 +108,8 @@ function rollDice() { g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); } } + + Bangle.buzz(); } function random (max) { diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 3e82d01be..ba0b5a57f 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.01", + "version":"1.02", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From d82594480f36abf66c127451a87cf84c04686e72 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 00:18:26 -0500 Subject: [PATCH 49/89] vibration caused the accelerometer to never stop --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index ee190c200..6316210e5 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -2,3 +2,4 @@ 1.00: overhauled the whole app, made some margins larger to be easier to tap on 1.01: fixed bug that caused rolled dice on the right of screen to be writ off-screen 1.02: added vibration when dice is rolled +1.03: vibration caused the accelerometer to never stop diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 0ab98f8d0..8bf2ca662 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -121,7 +121,7 @@ drawMenu(); Bangle.on ('touch', touchHandler); Bangle.on ('accel', function (xyz) { - if (xyz.diff >= 0.3) { + if (xyz.diff >= 0.5) { menu = false; rollDice(); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index ba0b5a57f..6612cc999 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.02", + "version":"1.03", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 7af12fd68e25647ed7b048dcb3a2cedf1ccafc73 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 00:23:15 -0500 Subject: [PATCH 50/89] accidentally deleted app icon LMAO --- apps/multidice/app.png | Bin 0 -> 1330 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/multidice/app.png diff --git a/apps/multidice/app.png b/apps/multidice/app.png new file mode 100644 index 0000000000000000000000000000000000000000..75ee0514a953e29e618bf56a49e8526e8eac59f5 GIT binary patch literal 1330 zcmV-21iCYS(1OJaP25k$Q;U-Cc6Fq}DO z&f~^^GU+{YX6AhVneRCO{|_z%wga=k3E*Skx~hw=0yfvshP74*4PYP80`>qe0f&IU zfwg4>?*QHb=4)F)$4fq%-7cwW2lxIR!7w#Jawd^RBbJpr|vEJNZr zu$TJrE^sVT_(~*NI)%ECoNTP{E{TaEBurmNX%Di5Uk2;>QW1~>|Q zp_6*g8xu{U9R%{!X1DC4q2~>f$m3>z>*jeSp+ugy@h%ooqG4A zlCd=5?*@K#c6!`%mua{Y_}Q8BK5#(_2~*))>NtT{^!E|(eU}88QF1pdy?=@@8o*D$ z0U7p2;9uamlv6#Vjmsp^Ej{1w=(=wMqgulRcCk|Zw>f>&+Px4~XpR|ng3lEze7vad z=X#<06m%?SdQI)P`qnt7wA7n-rTT}Q&6rd44dF7)+2owaQ5n1s%iq3>Az-*3_)x{i z@4yF&riLEi5ACk$r;Bl^&6J84vy=XuZ|%{XX$8A8DKTe_#%zrxkcUBehDnda0_nU3 zuGfKO5o>iQPJ9Bq0bJ|7AJ9hZON_g&RAOy_Lrs$IA%cj(Q-5#BK@SrRPoB$R$OEM}|^&MV3cm!b|2>rMTQE;SDe76ozW5i7!!f zZb_+e#w8zuCNa;}9%g-4eBbsKIaz5><%D~+st>260#(qhHRt8iABgl$F={j97eA+T z&6fm`tx6Rva&A#y8En^wF4l7li2+CW)r!U^W$;Pl?{YTgoH#Hh=_bP{zDa7oziF4c}c>Zwgrb1(Ihyk;5!%cl<`h61e!VCCWN3H4Pmy;1p3-dpp18lA<&!SZE7P>#yb@; z;;DeQsf|Dx@8lCG>TUWn#@9w5%R9LQih7%#vbj)EWO*l-Kv8egERqXVAuwBzK&-cE z7RiOG5XkaQX}M6Wx9KgC3!Qcfnxe?^PDw%2DCuqb1LMyrXp)lB{TG<3u(ghOm%DXg zgVwz@=~$*>;)pE1>VNjwrnOG#wxgwDe5B&KBTi9o7h`APYTz?{wCZ(=tzq|_cB5=p oHg@l1bwC|gHFnkhjC-x}A5s&T=P#0nHvj+t07*qoM6N<$g6g++LI3~& literal 0 HcmV?d00001 From d64609aa92785c826970e966d3a1c4f0817de5a5 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 00:25:33 -0500 Subject: [PATCH 51/89] decreased vibration strength --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 4 ++-- apps/multidice/metadata.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 6316210e5..9bc00d9be 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -3,3 +3,4 @@ 1.01: fixed bug that caused rolled dice on the right of screen to be writ off-screen 1.02: added vibration when dice is rolled 1.03: vibration caused the accelerometer to never stop +1.04: decreased vibration strength diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 8bf2ca662..ef16ca2de 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -109,7 +109,7 @@ function rollDice() { } } - Bangle.buzz(); + Bangle.buzz (200, 0.1); } function random (max) { @@ -121,7 +121,7 @@ drawMenu(); Bangle.on ('touch', touchHandler); Bangle.on ('accel', function (xyz) { - if (xyz.diff >= 0.5) { + if (xyz.diff >= 0.4) { menu = false; rollDice(); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 6612cc999..ef5841877 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.03", + "version":"1.04", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 1e46b479e25260cbc73ccda2fc412d60da3585cf Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 07:52:26 -0500 Subject: [PATCH 52/89] toggled the acceleration handler to prevent infinite buzz loop --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 236 +++++++++++++++++++---------------- apps/multidice/metadata.json | 2 +- 3 files changed, 127 insertions(+), 112 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 9bc00d9be..fc6479e98 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -4,3 +4,4 @@ 1.02: added vibration when dice is rolled 1.03: vibration caused the accelerometer to never stop 1.04: decreased vibration strength +1.05: toggled the acceleration handler to prevent infinite buzz loop diff --git a/apps/multidice/app.js b/apps/multidice/app.js index ef16ca2de..15d9564bc 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -3,127 +3,141 @@ const DICE_ARRAY = [0, 4, 6, 8, 10, 12, 20, 100]; const SELECTION_ARRAY = [6, 0, 0, 0, 0, 0, 0, 0]; // default to selecting a single d20 function drawMenu() { - - stringArr = new Array ("", "", "", "", "", "", "", ""); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; - } - } - - g.clear(); - g.setFont ("Vector", 40); - - g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); - g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); - g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); - g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); - g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); - g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); - g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); - g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); + + stringArr = new Array ("", "", "", "", "", "", "", ""); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; + } + } + + g.clear(); + g.setFont ("Vector", 40); + + g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); + g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); + g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); + g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); + g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); + g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); + g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); + g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); } function touchHandler (button, xy) { - - if (! menu) { - - menu = true; - drawMenu(); - return; - } - - if (xy.x <= 87) { // left - - if (xy.y <= 43) { - - selection = 0; - } else if (xy.y <= 87) { - - selection = 1; - } else if (xy.y <= 131) { - - selection = 2; - } else { - - selection = 3; - } - } else { // right - - if (xy.y <= 43) { - - selection = 4; - } else if (xy.y <= 87) { - - selection = 5; - } else if (xy.y <= 131) { - - selection = 6; - } else { - - selection = 7; - } - } - - // increment SELECTION_ARRAY [selection] - if (SELECTION_ARRAY [selection] == 7) { - - SELECTION_ARRAY [selection] = 0; - } else { - - SELECTION_ARRAY [selection] += 1; - } - - drawMenu(); + + if (! menu) { + + menu = true; + drawMenu(); + return; + } + + if (xy.x <= 87) { // left + + if (xy.y <= 43) { + + selection = 0; + } else if (xy.y <= 87) { + + selection = 1; + } else if (xy.y <= 131) { + + selection = 2; + } else { + + selection = 3; + } + } else { // right + + if (xy.y <= 43) { + + selection = 4; + } else if (xy.y <= 87) { + + selection = 5; + } else if (xy.y <= 131) { + + selection = 6; + } else { + + selection = 7; + } + } + + // increment SELECTION_ARRAY [selection] + if (SELECTION_ARRAY [selection] == 7) { + + SELECTION_ARRAY [selection] = 0; + } else { + + SELECTION_ARRAY [selection] += 1; + } + + drawMenu(); +} + +function accelHandler (xyz) { + + if (xyz.diff >= 0.4) { + + menu = false; + rollDice(); + } +} + +function voidFn() { + + return; } function rollDice() { - - resultsArr = new Uint8Array (8); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); - } - } - - g.clear(); - g.setFont ("Vector", 40); - - for (i = 0; i < 4; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); - } - } - - for (i = 4; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); - } - } - - Bangle.buzz (200, 0.1); + + resultsArr = new Uint8Array (8); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); + } + } + + g.clear(); + g.setFont ("Vector", 40); + + for (i = 0; i < 4; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); + } + } + + for (i = 4; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); + } + } } function random (max) { - - return Math.round (Math.random() * (max - 1) + 1); + + return Math.round (Math.random() * (max - 1) + 1); +} + +function vibrate() { + + Bangle.on ('accel', voidFn); + Bangle.buzz (200, 0.1).then( + + Bangle.on ('accel', accelHandler) + ); } drawMenu(); Bangle.on ('touch', touchHandler); -Bangle.on ('accel', function (xyz) { - - if (xyz.diff >= 0.4) { - - menu = false; - rollDice(); - } -}); +Bangle.on ('accel', accelHandler); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index ef5841877..82af0ef8b 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.04", + "version":"1.05", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 959fa4183cca78cdbb9c7855a827d80f41a65f49 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 07:55:52 -0500 Subject: [PATCH 53/89] increased vibration again --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index fc6479e98..b5de3ea67 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -5,3 +5,4 @@ 1.03: vibration caused the accelerometer to never stop 1.04: decreased vibration strength 1.05: toggled the acceleration handler to prevent infinite buzz loop +1.06: increased vibration again diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 15d9564bc..04e23e22a 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -132,7 +132,7 @@ function random (max) { function vibrate() { Bangle.on ('accel', voidFn); - Bangle.buzz (200, 0.1).then( + Bangle.buzz (200, 1).then( Bangle.on ('accel', accelHandler) ); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 82af0ef8b..36c0d9c1f 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.05", + "version":"1.06", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 463c3fec238f531ac19accad0766f0264ee40332 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 08:05:35 -0500 Subject: [PATCH 54/89] IDK how to use promises properly --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index b5de3ea67..445dd4d68 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -6,3 +6,4 @@ 1.04: decreased vibration strength 1.05: toggled the acceleration handler to prevent infinite buzz loop 1.06: increased vibration again +1.07: IDK how to use promises properly diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 04e23e22a..e99e785c3 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -132,7 +132,7 @@ function random (max) { function vibrate() { Bangle.on ('accel', voidFn); - Bangle.buzz (200, 1).then( + Bangle.buzz (200, 1).then ((value) => Bangle.on ('accel', accelHandler) ); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 36c0d9c1f..743cb79ae 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.06", + "version":"1.07", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 1872f264d1cdd939ba08191ce60bdfa828110a5d Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 08:21:42 -0500 Subject: [PATCH 55/89] still trying to fix the lack of vibrations --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 445dd4d68..a9fc055c0 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -7,3 +7,4 @@ 1.05: toggled the acceleration handler to prevent infinite buzz loop 1.06: increased vibration again 1.07: IDK how to use promises properly +1.08: still trying to fix the lack of vibrations diff --git a/apps/multidice/app.js b/apps/multidice/app.js index e99e785c3..789cf26bd 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -132,7 +132,7 @@ function random (max) { function vibrate() { Bangle.on ('accel', voidFn); - Bangle.buzz (200, 1).then ((value) => + Bangle.buzz().then ((value) => Bangle.on ('accel', accelHandler) ); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 743cb79ae..effb1c57b 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.07", + "version":"1.08", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 13c5b41aef1ed3743243d743bcec72485e6b545c Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 08:35:18 -0500 Subject: [PATCH 56/89] hopefully now it's fixed? --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 4 ++-- apps/multidice/metadata.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index a9fc055c0..ce7632d7c 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -8,3 +8,4 @@ 1.06: increased vibration again 1.07: IDK how to use promises properly 1.08: still trying to fix the lack of vibrations +1.09: hopefully now it's fixed? diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 789cf26bd..8f027c47a 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -132,10 +132,10 @@ function random (max) { function vibrate() { Bangle.on ('accel', voidFn); - Bangle.buzz().then ((value) => + Bangle.buzz().then ((value) => { Bangle.on ('accel', accelHandler) - ); + }); } drawMenu(); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index effb1c57b..95071c67b 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.08", + "version":"1.09", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 1499a524d950b523befbba2be24156852d1c686e Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 10:06:52 -0500 Subject: [PATCH 57/89] not having web bluetooth to debug is a PAIN --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 13 ++++++++++++- apps/multidice/metadata.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index ce7632d7c..ca48267be 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -9,3 +9,4 @@ 1.07: IDK how to use promises properly 1.08: still trying to fix the lack of vibrations 1.09: hopefully now it's fixed? +1.10: not having web bluetooth to debug is a PAIN diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 8f027c47a..98a43eef8 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -35,6 +35,9 @@ function touchHandler (button, xy) { return; } + rollDice(); + return; + if (xy.x <= 87) { // left if (xy.y <= 43) { @@ -122,6 +125,13 @@ function rollDice() { g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); } } + + Bangle.on ('accel', voidFn); + console.log ("before"); + Bangle.buzz().then(()=>{ + Bangle.on ('accel', accelHandler); + }); + console.log ("after"); } function random (max) { @@ -134,7 +144,8 @@ function vibrate() { Bangle.on ('accel', voidFn); Bangle.buzz().then ((value) => { - Bangle.on ('accel', accelHandler) + console.log ("I ran."); + Bangle.on ('accel', accelHandler); }); } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 95071c67b..37adcac91 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.09", + "version":"1.10", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 3001618e0f0b00b77e3588de746f62550c83dec6 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 10:20:26 -0500 Subject: [PATCH 58/89] decreased vibration time, decreased accel requirement --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 12 +++--------- apps/multidice/metadata.json | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index ca48267be..68ada4870 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -10,3 +10,4 @@ 1.08: still trying to fix the lack of vibrations 1.09: hopefully now it's fixed? 1.10: not having web bluetooth to debug is a PAIN +1.11: decreased vibration time, decreased accel requirement diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 98a43eef8..5469b495b 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -84,7 +84,7 @@ function touchHandler (button, xy) { function accelHandler (xyz) { - if (xyz.diff >= 0.4) { + if (xyz.diff >= 0.3) { menu = false; rollDice(); @@ -126,12 +126,7 @@ function rollDice() { } } - Bangle.on ('accel', voidFn); - console.log ("before"); - Bangle.buzz().then(()=>{ - Bangle.on ('accel', accelHandler); - }); - console.log ("after"); + vibrate(); } function random (max) { @@ -142,9 +137,8 @@ function random (max) { function vibrate() { Bangle.on ('accel', voidFn); - Bangle.buzz().then ((value) => { + Bangle.buzz(50, 1).then ((value) => { - console.log ("I ran."); Bangle.on ('accel', accelHandler); }); } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 37adcac91..ca5ec991f 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.10", + "version":"1.11", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From f9c338d90db08c85f676bc2ceb81db9584b66c3a Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 12:17:09 -0500 Subject: [PATCH 59/89] issue with app calling roll function too many times at startup --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 68ada4870..29da3bf24 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -11,3 +11,4 @@ 1.09: hopefully now it's fixed? 1.10: not having web bluetooth to debug is a PAIN 1.11: decreased vibration time, decreased accel requirement +1.12: issue with app calling roll function too many times at startup diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 5469b495b..6295c7a9b 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -137,7 +137,7 @@ function random (max) { function vibrate() { Bangle.on ('accel', voidFn); - Bangle.buzz(50, 1).then ((value) => { + Bangle.buzz(50, 0.5).then ((value) => { Bangle.on ('accel', accelHandler); }); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index ca5ec991f..177b8a32a 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.11", + "version":"1.12", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From a89f6cb4df1e74aa77fcc454ea69b923d6941c70 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 12:27:24 -0500 Subject: [PATCH 60/89] added a delay after the buzzer stops to prevent multi-rolling --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 18 ++++++++---------- apps/multidice/metadata.json | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 29da3bf24..7eb5f605c 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -12,3 +12,4 @@ 1.10: not having web bluetooth to debug is a PAIN 1.11: decreased vibration time, decreased accel requirement 1.12: issue with app calling roll function too many times at startup +1.13: added a delay after the buzzer stops to prevent multi-rolling diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 6295c7a9b..0d4b57a6c 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -126,7 +126,14 @@ function rollDice() { } } - vibrate(); + Bangle.on ('accel', voidFn); + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (function() { // wait 50ms *after* the buzzing has stopped + + Bangle.on ('accel', accelHandler); + }, 50); + }); } function random (max) { @@ -134,15 +141,6 @@ function random (max) { return Math.round (Math.random() * (max - 1) + 1); } -function vibrate() { - - Bangle.on ('accel', voidFn); - Bangle.buzz(50, 0.5).then ((value) => { - - Bangle.on ('accel', accelHandler); - }); -} - drawMenu(); Bangle.on ('touch', touchHandler); Bangle.on ('accel', accelHandler); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 177b8a32a..a6cbf46b9 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.12", + "version":"1.13", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 47caa9cd79716c4957cf7034981395de696298ee Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 12:35:36 -0500 Subject: [PATCH 61/89] made the delay needlessly long to see if it even does anything --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 7eb5f605c..d8a684575 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -13,3 +13,4 @@ 1.11: decreased vibration time, decreased accel requirement 1.12: issue with app calling roll function too many times at startup 1.13: added a delay after the buzzer stops to prevent multi-rolling +1.14: made the delay needlessly long to see if it even does anything diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 0d4b57a6c..271b7bad3 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -132,7 +132,7 @@ function rollDice() { setTimeout (function() { // wait 50ms *after* the buzzing has stopped Bangle.on ('accel', accelHandler); - }, 50); + }, 1000); }); } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index a6cbf46b9..2bcf4d2eb 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.13", + "version":"1.14", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From b3cc27a391e82afe582d49f776fcd3ea688ac6c3 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 12:48:47 -0500 Subject: [PATCH 62/89] moved accel & vibration commands to the accelHandler function --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 23 +++++++++++------------ apps/multidice/metadata.json | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index d8a684575..2e6b8c622 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -14,3 +14,4 @@ 1.12: issue with app calling roll function too many times at startup 1.13: added a delay after the buzzer stops to prevent multi-rolling 1.14: made the delay needlessly long to see if it even does anything +1.15: moved accel & vibration commands to the accelHandler function diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 271b7bad3..6dddf1e19 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -35,9 +35,6 @@ function touchHandler (button, xy) { return; } - rollDice(); - return; - if (xy.x <= 87) { // left if (xy.y <= 43) { @@ -84,11 +81,22 @@ function touchHandler (button, xy) { function accelHandler (xyz) { + Bangle.on ('accel', voidFn); // temporarily disable more acceleration events if (xyz.diff >= 0.3) { menu = false; rollDice(); + + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (function() { // wait 50ms *after* the buzzing has stopped + + Bangle.on ('accel', accelHandler); + }, 50); + }); } + + Bangle.on ('accel', accelHandler); // re-enable acceleration events } function voidFn() { @@ -125,15 +133,6 @@ function rollDice() { g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); } } - - Bangle.on ('accel', voidFn); - Bangle.buzz(50, 0.5).then (() => { - - setTimeout (function() { // wait 50ms *after* the buzzing has stopped - - Bangle.on ('accel', accelHandler); - }, 1000); - }); } function random (max) { diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 2bcf4d2eb..7eb1c1607 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.14", + "version":"1.15", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From ef8b26c4901c320f805de926dd976eb22a6b3a2e Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 13:00:36 -0500 Subject: [PATCH 63/89] enabled button usage & temporarily disabled acceleration --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 15 ++++++++++++++- apps/multidice/metadata.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 2e6b8c622..ff191cf13 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -15,3 +15,4 @@ 1.13: added a delay after the buzzer stops to prevent multi-rolling 1.14: made the delay needlessly long to see if it even does anything 1.15: moved accel & vibration commands to the accelHandler function +1.16: enabled button usage & temporarily disabled acceleration diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 6dddf1e19..0893fe470 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -142,4 +142,17 @@ function random (max) { drawMenu(); Bangle.on ('touch', touchHandler); -Bangle.on ('accel', accelHandler); +//Bangle.on ('accel', accelHandler); +setWatch (function() { + + menu = false; + rollDice(); + + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (function() { // wait 50ms *after* the buzzing has stopped + + //Bangle.on ('accel', accelHandler); + }, 50); + }); +}, BTN, {repeat: true, edge: "falling", debounce: 10}); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 7eb1c1607..9b2148682 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.15", + "version":"1.16", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 64bff4303f508954f42b33530c9bdfaf336fe321 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 13:16:33 -0500 Subject: [PATCH 64/89] made changes to when accelHandler gets overwritten, temporarily disabled button usage --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 39 +++++++++++++++++------------------- apps/multidice/metadata.json | 2 +- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index ff191cf13..651233c63 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -16,3 +16,4 @@ 1.14: made the delay needlessly long to see if it even does anything 1.15: moved accel & vibration commands to the accelHandler function 1.16: enabled button usage & temporarily disabled acceleration +1.17: made changes to when accelHandler gets overwritten, temporarily disabled button usage diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 0893fe470..3789dc04b 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -81,22 +81,16 @@ function touchHandler (button, xy) { function accelHandler (xyz) { - Bangle.on ('accel', voidFn); // temporarily disable more acceleration events if (xyz.diff >= 0.3) { - menu = false; - rollDice(); + Bangle.on ('accel', voidFn); // temporarily disable more acceleration events - Bangle.buzz(50, 0.5).then (() => { + menu = false; + rollDice (function() { - setTimeout (function() { // wait 50ms *after* the buzzing has stopped - - Bangle.on ('accel', accelHandler); - }, 50); + Bangle.on ('accel', accelHandler); // re-enable acceleration events }); } - - Bangle.on ('accel', accelHandler); // re-enable acceleration events } function voidFn() { @@ -104,7 +98,7 @@ function voidFn() { return; } -function rollDice() { +function rollDice (timeoutFunctionRef) { resultsArr = new Uint8Array (8); for (i = 0; i < 8; i++) { @@ -133,6 +127,16 @@ function rollDice() { g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); } } + + vibrate (timeoutFunctionRef); +} + +function vibrate (timeoutFunctionRef) { + + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (timeoutFunctionRef, 50); + }); } function random (max) { @@ -142,17 +146,10 @@ function random (max) { drawMenu(); Bangle.on ('touch', touchHandler); -//Bangle.on ('accel', accelHandler); -setWatch (function() { +Bangle.on ('accel', accelHandler); +/*setWatch (function() { menu = false; rollDice(); - Bangle.buzz(50, 0.5).then (() => { - - setTimeout (function() { // wait 50ms *after* the buzzing has stopped - - //Bangle.on ('accel', accelHandler); - }, 50); - }); -}, BTN, {repeat: true, edge: "falling", debounce: 10}); +}, BTN, {repeat: true, edge: "falling", debounce: 10});*/ diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 9b2148682..8a78fe22a 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.16", + "version":"1.17", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 4d379345562cc70111421dd8b559bca586143237 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 13:27:12 -0500 Subject: [PATCH 65/89] decided to keep around the button even while testing, disabled all safety round the accelHandler self-triggering --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 10 +++++----- apps/multidice/metadata.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 651233c63..ec0d407b8 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -17,3 +17,4 @@ 1.15: moved accel & vibration commands to the accelHandler function 1.16: enabled button usage & temporarily disabled acceleration 1.17: made changes to when accelHandler gets overwritten, temporarily disabled button usage +1.18: decided to keep around the button even while testing, disabled all safety round the accelHandler self-triggering diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 3789dc04b..940de3eb3 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -83,12 +83,12 @@ function accelHandler (xyz) { if (xyz.diff >= 0.3) { - Bangle.on ('accel', voidFn); // temporarily disable more acceleration events + //Bangle.on ('accel', voidFn); // temporarily disable more acceleration events menu = false; rollDice (function() { - Bangle.on ('accel', accelHandler); // re-enable acceleration events + //Bangle.on ('accel', accelHandler); // re-enable acceleration events }); } } @@ -147,9 +147,9 @@ function random (max) { drawMenu(); Bangle.on ('touch', touchHandler); Bangle.on ('accel', accelHandler); -/*setWatch (function() { +setWatch (function() { menu = false; - rollDice(); + rollDice (voidFn); -}, BTN, {repeat: true, edge: "falling", debounce: 10});*/ +}, BTN, {repeat: true, edge: "falling", debounce: 10}); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 8a78fe22a..7b45f11eb 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.17", + "version":"1.18", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 479a2da3ab390c27891fd0024258e47d0740dc71 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 13:36:24 -0500 Subject: [PATCH 66/89] added longer delay before resetting accelHandler --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 6 +++--- apps/multidice/metadata.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index ec0d407b8..c47d4c8ff 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -18,3 +18,4 @@ 1.16: enabled button usage & temporarily disabled acceleration 1.17: made changes to when accelHandler gets overwritten, temporarily disabled button usage 1.18: decided to keep around the button even while testing, disabled all safety round the accelHandler self-triggering +1.19: added longer delay before resetting accelHandler diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 940de3eb3..82561853e 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -83,12 +83,12 @@ function accelHandler (xyz) { if (xyz.diff >= 0.3) { - //Bangle.on ('accel', voidFn); // temporarily disable more acceleration events + Bangle.on ('accel', voidFn); // temporarily disable more acceleration events menu = false; rollDice (function() { - //Bangle.on ('accel', accelHandler); // re-enable acceleration events + Bangle.on ('accel', accelHandler); // re-enable acceleration events }); } } @@ -135,7 +135,7 @@ function vibrate (timeoutFunctionRef) { Bangle.buzz(50, 0.5).then (() => { - setTimeout (timeoutFunctionRef, 50); + setTimeout (timeoutFunctionRef, 150); }); } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 7b45f11eb..aec4455f4 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.18", + "version":"1.19", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 79fbaf52a304528fe003aab9210f7271991abb26 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 13:49:04 -0500 Subject: [PATCH 67/89] merged from upstream --- core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core b/core index 0d02ff376..893c2dbbe 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 0d02ff3763783d166ff84906af038420736aabfc +Subproject commit 893c2dbbe5a93fbb80d035a695663b4f4cca8875 From 69140a58d51d146658ae2a178f7044ea38359726 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 14:03:32 -0500 Subject: [PATCH 68/89] gave up on acceleration, changed from hard tabs to double spaced, updated README.md --- apps/multidice/ChangeLog | 1 + apps/multidice/README.md | 7 +- apps/multidice/app.js | 243 ++++++++++++++++++--------------------- 3 files changed, 119 insertions(+), 132 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index c47d4c8ff..ba0f62269 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -19,3 +19,4 @@ 1.17: made changes to when accelHandler gets overwritten, temporarily disabled button usage 1.18: decided to keep around the button even while testing, disabled all safety round the accelHandler self-triggering 1.19: added longer delay before resetting accelHandler +1.20: removed all traces of accel b/c I've given up diff --git a/apps/multidice/README.md b/apps/multidice/README.md index 2d28ef33f..d80ed7ef1 100644 --- a/apps/multidice/README.md +++ b/apps/multidice/README.md @@ -5,8 +5,8 @@ roll anywhere from 1-8 dice at the same time. ## Usage -On the menu screen: tap on the dice to change what variant is selected, & shake the watch in order to roll those dice -On the dice screen: tap anywhere on the screen to go back to the menu, or shake to roll the dice again +On the menu screen: tap on the dice to change what variant is selected, & press the button to roll the dice +On the dice screen: tap anywhere on the screen to go back to the menu, or press the button to roll the dice ## Features @@ -14,4 +14,5 @@ roll anywhere from 1-8 dice (d4, d6, d8, d10, d12, d20, & d percentile). You can ## Controls -No button is used in the app, it simply uses touch controls & the accelerometor +App uses touchscreen to cycle through different dice, and BTN to roll them +(W.I.P. using acceleration to roll dice) diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 82561853e..01f39751d 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -3,153 +3,138 @@ const DICE_ARRAY = [0, 4, 6, 8, 10, 12, 20, 100]; const SELECTION_ARRAY = [6, 0, 0, 0, 0, 0, 0, 0]; // default to selecting a single d20 function drawMenu() { - - stringArr = new Array ("", "", "", "", "", "", "", ""); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; - } - } - - g.clear(); - g.setFont ("Vector", 40); - - g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); - g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); - g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); - g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); - g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); - g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); - g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); - g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); + + stringArr = new Array ("", "", "", "", "", "", "", ""); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; + } + } + + g.clear(); + g.setFont ("Vector", 40); + + g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); + g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); + g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); + g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); + g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); + g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); + g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); + g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); } function touchHandler (button, xy) { - - if (! menu) { - - menu = true; - drawMenu(); - return; - } - - if (xy.x <= 87) { // left - - if (xy.y <= 43) { - - selection = 0; - } else if (xy.y <= 87) { - - selection = 1; - } else if (xy.y <= 131) { - - selection = 2; - } else { - - selection = 3; - } - } else { // right - - if (xy.y <= 43) { - - selection = 4; - } else if (xy.y <= 87) { - - selection = 5; - } else if (xy.y <= 131) { - - selection = 6; - } else { - - selection = 7; - } - } - - // increment SELECTION_ARRAY [selection] - if (SELECTION_ARRAY [selection] == 7) { - - SELECTION_ARRAY [selection] = 0; - } else { - - SELECTION_ARRAY [selection] += 1; - } - - drawMenu(); -} - -function accelHandler (xyz) { - - if (xyz.diff >= 0.3) { - - Bangle.on ('accel', voidFn); // temporarily disable more acceleration events - - menu = false; - rollDice (function() { - - Bangle.on ('accel', accelHandler); // re-enable acceleration events - }); - } + + if (! menu) { + + menu = true; + drawMenu(); + return; + } + + if (xy.x <= 87) { // left + + if (xy.y <= 43) { + + selection = 0; + } else if (xy.y <= 87) { + + selection = 1; + } else if (xy.y <= 131) { + + selection = 2; + } else { + + selection = 3; + } + } else { // right + + if (xy.y <= 43) { + + selection = 4; + } else if (xy.y <= 87) { + + selection = 5; + } else if (xy.y <= 131) { + + selection = 6; + } else { + + selection = 7; + } + } + + // increment SELECTION_ARRAY [selection] + if (SELECTION_ARRAY [selection] == 7) { + + SELECTION_ARRAY [selection] = 0; + } else { + + SELECTION_ARRAY [selection] += 1; + } + + drawMenu(); } function voidFn() { - - return; + + return; } function rollDice (timeoutFunctionRef) { - - resultsArr = new Uint8Array (8); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); - } - } - - g.clear(); - g.setFont ("Vector", 40); - - for (i = 0; i < 4; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); - } - } - - for (i = 4; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); - } - } - - vibrate (timeoutFunctionRef); + + resultsArr = new Uint8Array (8); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); + } + } + + g.clear(); + g.setFont ("Vector", 40); + + for (i = 0; i < 4; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); + } + } + + for (i = 4; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); + } + } + + vibrate (timeoutFunctionRef); } function vibrate (timeoutFunctionRef) { - - Bangle.buzz(50, 0.5).then (() => { - - setTimeout (timeoutFunctionRef, 150); - }); + + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (timeoutFunctionRef, 150); + }); } function random (max) { - - return Math.round (Math.random() * (max - 1) + 1); + + return Math.round (Math.random() * (max - 1) + 1); } drawMenu(); Bangle.on ('touch', touchHandler); -Bangle.on ('accel', accelHandler); setWatch (function() { - - menu = false; - rollDice (voidFn); - + + menu = false; + rollDice (voidFn); + }, BTN, {repeat: true, edge: "falling", debounce: 10}); From 6e7910254121abe98eaeb8d0c35dbf1aef4bd6ac Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 14:10:57 -0500 Subject: [PATCH 69/89] dumb theory ab the automated testing --- apps/multidice/app.js | 228 +++++++++++++++++++++--------------------- 1 file changed, 114 insertions(+), 114 deletions(-) diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 01f39751d..f93250c7b 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -3,138 +3,138 @@ const DICE_ARRAY = [0, 4, 6, 8, 10, 12, 20, 100]; const SELECTION_ARRAY = [6, 0, 0, 0, 0, 0, 0, 0]; // default to selecting a single d20 function drawMenu() { - - stringArr = new Array ("", "", "", "", "", "", "", ""); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; - } - } - - g.clear(); - g.setFont ("Vector", 40); - - g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); - g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); - g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); - g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); - g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); - g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); - g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); - g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); + + stringArr = new Array ("", "", "", "", "", "", "", ""); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; + } + } + + g.clear(); + g.setFont ("Vector", 40); + + g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); + g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); + g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); + g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); + g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); + g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); + g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); + g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); } function touchHandler (button, xy) { - - if (! menu) { - - menu = true; - drawMenu(); - return; - } - - if (xy.x <= 87) { // left - - if (xy.y <= 43) { - - selection = 0; - } else if (xy.y <= 87) { - - selection = 1; - } else if (xy.y <= 131) { - - selection = 2; - } else { - - selection = 3; - } - } else { // right - - if (xy.y <= 43) { - - selection = 4; - } else if (xy.y <= 87) { - - selection = 5; - } else if (xy.y <= 131) { - - selection = 6; - } else { - - selection = 7; - } - } - - // increment SELECTION_ARRAY [selection] - if (SELECTION_ARRAY [selection] == 7) { - - SELECTION_ARRAY [selection] = 0; - } else { - - SELECTION_ARRAY [selection] += 1; - } - - drawMenu(); + + if (! menu) { + + menu = true; + drawMenu(); + return; + } + + if (xy.x <= 87) { // left + + if (xy.y <= 43) { + + selection = 0; + } else if (xy.y <= 87) { + + selection = 1; + } else if (xy.y <= 131) { + + selection = 2; + } else { + + selection = 3; + } + } else { // right + + if (xy.y <= 43) { + + selection = 4; + } else if (xy.y <= 87) { + + selection = 5; + } else if (xy.y <= 131) { + + selection = 6; + } else { + + selection = 7; + } + } + + // increment SELECTION_ARRAY [selection] + if (SELECTION_ARRAY [selection] == 7) { + + SELECTION_ARRAY [selection] = 0; + } else { + + SELECTION_ARRAY [selection] += 1; + } + + drawMenu(); } function voidFn() { - - return; + + return; } function rollDice (timeoutFunctionRef) { - - resultsArr = new Uint8Array (8); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); - } - } - - g.clear(); - g.setFont ("Vector", 40); - - for (i = 0; i < 4; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); - } - } - - for (i = 4; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); - } - } - - vibrate (timeoutFunctionRef); + + resultsArr = new Uint8Array (8); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); + } + } + + g.clear(); + g.setFont ("Vector", 40); + + for (i = 0; i < 4; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); + } + } + + for (i = 4; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); + } + } + + vibrate (timeoutFunctionRef); } function vibrate (timeoutFunctionRef) { - - Bangle.buzz(50, 0.5).then (() => { - - setTimeout (timeoutFunctionRef, 150); - }); + + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (timeoutFunctionRef, 150); + }); } function random (max) { - - return Math.round (Math.random() * (max - 1) + 1); + + return Math.round (Math.random() * (max - 1) + 1); } drawMenu(); Bangle.on ('touch', touchHandler); setWatch (function() { - - menu = false; - rollDice (voidFn); - + + menu = false; + rollDice (voidFn); + }, BTN, {repeat: true, edge: "falling", debounce: 10}); From f17c270353c698dacdbcd675b974e23969b717d1 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 14:17:09 -0500 Subject: [PATCH 70/89] maby I should read the logs instead of guessing why it failed --- apps/multidice/app.js | 228 +++++++++++++++++------------------ apps/multidice/metadata.json | 2 +- 2 files changed, 115 insertions(+), 115 deletions(-) diff --git a/apps/multidice/app.js b/apps/multidice/app.js index f93250c7b..01f39751d 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -3,138 +3,138 @@ const DICE_ARRAY = [0, 4, 6, 8, 10, 12, 20, 100]; const SELECTION_ARRAY = [6, 0, 0, 0, 0, 0, 0, 0]; // default to selecting a single d20 function drawMenu() { - - stringArr = new Array ("", "", "", "", "", "", "", ""); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; - } - } - - g.clear(); - g.setFont ("Vector", 40); - - g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); - g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); - g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); - g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); - g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); - g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); - g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); - g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); + + stringArr = new Array ("", "", "", "", "", "", "", ""); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; + } + } + + g.clear(); + g.setFont ("Vector", 40); + + g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); + g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); + g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); + g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); + g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); + g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); + g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); + g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); } function touchHandler (button, xy) { - - if (! menu) { - - menu = true; - drawMenu(); - return; - } - - if (xy.x <= 87) { // left - - if (xy.y <= 43) { - - selection = 0; - } else if (xy.y <= 87) { - - selection = 1; - } else if (xy.y <= 131) { - - selection = 2; - } else { - - selection = 3; - } - } else { // right - - if (xy.y <= 43) { - - selection = 4; - } else if (xy.y <= 87) { - - selection = 5; - } else if (xy.y <= 131) { - - selection = 6; - } else { - - selection = 7; - } - } - - // increment SELECTION_ARRAY [selection] - if (SELECTION_ARRAY [selection] == 7) { - - SELECTION_ARRAY [selection] = 0; - } else { - - SELECTION_ARRAY [selection] += 1; - } - - drawMenu(); + + if (! menu) { + + menu = true; + drawMenu(); + return; + } + + if (xy.x <= 87) { // left + + if (xy.y <= 43) { + + selection = 0; + } else if (xy.y <= 87) { + + selection = 1; + } else if (xy.y <= 131) { + + selection = 2; + } else { + + selection = 3; + } + } else { // right + + if (xy.y <= 43) { + + selection = 4; + } else if (xy.y <= 87) { + + selection = 5; + } else if (xy.y <= 131) { + + selection = 6; + } else { + + selection = 7; + } + } + + // increment SELECTION_ARRAY [selection] + if (SELECTION_ARRAY [selection] == 7) { + + SELECTION_ARRAY [selection] = 0; + } else { + + SELECTION_ARRAY [selection] += 1; + } + + drawMenu(); } function voidFn() { - - return; + + return; } function rollDice (timeoutFunctionRef) { - - resultsArr = new Uint8Array (8); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); - } - } - - g.clear(); - g.setFont ("Vector", 40); - - for (i = 0; i < 4; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); - } - } - - for (i = 4; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); - } - } - - vibrate (timeoutFunctionRef); + + resultsArr = new Uint8Array (8); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); + } + } + + g.clear(); + g.setFont ("Vector", 40); + + for (i = 0; i < 4; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); + } + } + + for (i = 4; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); + } + } + + vibrate (timeoutFunctionRef); } function vibrate (timeoutFunctionRef) { - - Bangle.buzz(50, 0.5).then (() => { - - setTimeout (timeoutFunctionRef, 150); - }); + + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (timeoutFunctionRef, 150); + }); } function random (max) { - - return Math.round (Math.random() * (max - 1) + 1); + + return Math.round (Math.random() * (max - 1) + 1); } drawMenu(); Bangle.on ('touch', touchHandler); setWatch (function() { - - menu = false; - rollDice (voidFn); - + + menu = false; + rollDice (voidFn); + }, BTN, {repeat: true, edge: "falling", debounce: 10}); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index aec4455f4..ce84df4b2 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.19", + "version":"1.20", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From ac22a2a2cf95b103c894b5f56e44949eeb3a69ea Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 20:50:45 -0500 Subject: [PATCH 71/89] added a drawWidgets command to see if I have the padding right --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 229 ++++++++++++++++++----------------- apps/multidice/metadata.json | 2 +- 3 files changed, 117 insertions(+), 115 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index ba0f62269..9fd5f3935 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -20,3 +20,4 @@ 1.18: decided to keep around the button even while testing, disabled all safety round the accelHandler self-triggering 1.19: added longer delay before resetting accelHandler 1.20: removed all traces of accel b/c I've given up +1.21: added a drawWidgets command to see if I have the padding right diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 01f39751d..2c2c36c58 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -3,138 +3,139 @@ const DICE_ARRAY = [0, 4, 6, 8, 10, 12, 20, 100]; const SELECTION_ARRAY = [6, 0, 0, 0, 0, 0, 0, 0]; // default to selecting a single d20 function drawMenu() { - - stringArr = new Array ("", "", "", "", "", "", "", ""); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; - } - } - - g.clear(); - g.setFont ("Vector", 40); - - g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); - g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); - g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); - g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); - g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); - g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); - g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); - g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); + + stringArr = new Array ("", "", "", "", "", "", "", ""); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; + } + } + + g.clear(); + g.setFont ("Vector", 40); + Bangle.drawWidgets(); + + g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); + g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); + g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); + g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); + g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); + g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); + g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); + g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); } function touchHandler (button, xy) { - - if (! menu) { - - menu = true; - drawMenu(); - return; - } - - if (xy.x <= 87) { // left - - if (xy.y <= 43) { - - selection = 0; - } else if (xy.y <= 87) { - - selection = 1; - } else if (xy.y <= 131) { - - selection = 2; - } else { - - selection = 3; - } - } else { // right - - if (xy.y <= 43) { - - selection = 4; - } else if (xy.y <= 87) { - - selection = 5; - } else if (xy.y <= 131) { - - selection = 6; - } else { - - selection = 7; - } - } - - // increment SELECTION_ARRAY [selection] - if (SELECTION_ARRAY [selection] == 7) { - - SELECTION_ARRAY [selection] = 0; - } else { - - SELECTION_ARRAY [selection] += 1; - } - - drawMenu(); + + if (! menu) { + + menu = true; + drawMenu(); + return; + } + + if (xy.x <= 87) { // left + + if (xy.y <= 43) { + + selection = 0; + } else if (xy.y <= 87) { + + selection = 1; + } else if (xy.y <= 131) { + + selection = 2; + } else { + + selection = 3; + } + } else { // right + + if (xy.y <= 43) { + + selection = 4; + } else if (xy.y <= 87) { + + selection = 5; + } else if (xy.y <= 131) { + + selection = 6; + } else { + + selection = 7; + } + } + + // increment SELECTION_ARRAY [selection] + if (SELECTION_ARRAY [selection] == 7) { + + SELECTION_ARRAY [selection] = 0; + } else { + + SELECTION_ARRAY [selection] += 1; + } + + drawMenu(); } function voidFn() { - - return; + + return; } function rollDice (timeoutFunctionRef) { - - resultsArr = new Uint8Array (8); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); - } - } - - g.clear(); - g.setFont ("Vector", 40); - - for (i = 0; i < 4; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); - } - } - - for (i = 4; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); - } - } - - vibrate (timeoutFunctionRef); + + resultsArr = new Uint8Array (8); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); + } + } + + g.clear(); + g.setFont ("Vector", 40); + + for (i = 0; i < 4; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); + } + } + + for (i = 4; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); + } + } + + vibrate (timeoutFunctionRef); } function vibrate (timeoutFunctionRef) { - - Bangle.buzz(50, 0.5).then (() => { - - setTimeout (timeoutFunctionRef, 150); - }); + + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (timeoutFunctionRef, 150); + }); } function random (max) { - - return Math.round (Math.random() * (max - 1) + 1); + + return Math.round (Math.random() * (max - 1) + 1); } drawMenu(); Bangle.on ('touch', touchHandler); setWatch (function() { - - menu = false; - rollDice (voidFn); - + + menu = false; + rollDice (voidFn); + }, BTN, {repeat: true, edge: "falling", debounce: 10}); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index ce84df4b2..e8b2c4393 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.20", + "version":"1.21", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 560a784be83f1e9b03af12c83d450fcf3580de76 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 20:51:07 -0500 Subject: [PATCH 72/89] tabs, again --- apps/multidice/app.js | 230 +++++++++++++++++++++--------------------- 1 file changed, 115 insertions(+), 115 deletions(-) diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 2c2c36c58..95732f16f 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -3,139 +3,139 @@ const DICE_ARRAY = [0, 4, 6, 8, 10, 12, 20, 100]; const SELECTION_ARRAY = [6, 0, 0, 0, 0, 0, 0, 0]; // default to selecting a single d20 function drawMenu() { - - stringArr = new Array ("", "", "", "", "", "", "", ""); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; - } - } - - g.clear(); - g.setFont ("Vector", 40); - Bangle.drawWidgets(); - - g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); - g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); - g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); - g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); - g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); - g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); - g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); - g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); + + stringArr = new Array ("", "", "", "", "", "", "", ""); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; + } + } + + g.clear(); + g.setFont ("Vector", 40); + Bangle.drawWidgets(); + + g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); + g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); + g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); + g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); + g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); + g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); + g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); + g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); } function touchHandler (button, xy) { - - if (! menu) { - - menu = true; - drawMenu(); - return; - } - - if (xy.x <= 87) { // left - - if (xy.y <= 43) { - - selection = 0; - } else if (xy.y <= 87) { - - selection = 1; - } else if (xy.y <= 131) { - - selection = 2; - } else { - - selection = 3; - } - } else { // right - - if (xy.y <= 43) { - - selection = 4; - } else if (xy.y <= 87) { - - selection = 5; - } else if (xy.y <= 131) { - - selection = 6; - } else { - - selection = 7; - } - } - - // increment SELECTION_ARRAY [selection] - if (SELECTION_ARRAY [selection] == 7) { - - SELECTION_ARRAY [selection] = 0; - } else { - - SELECTION_ARRAY [selection] += 1; - } - - drawMenu(); + + if (! menu) { + + menu = true; + drawMenu(); + return; + } + + if (xy.x <= 87) { // left + + if (xy.y <= 43) { + + selection = 0; + } else if (xy.y <= 87) { + + selection = 1; + } else if (xy.y <= 131) { + + selection = 2; + } else { + + selection = 3; + } + } else { // right + + if (xy.y <= 43) { + + selection = 4; + } else if (xy.y <= 87) { + + selection = 5; + } else if (xy.y <= 131) { + + selection = 6; + } else { + + selection = 7; + } + } + + // increment SELECTION_ARRAY [selection] + if (SELECTION_ARRAY [selection] == 7) { + + SELECTION_ARRAY [selection] = 0; + } else { + + SELECTION_ARRAY [selection] += 1; + } + + drawMenu(); } function voidFn() { - - return; + + return; } function rollDice (timeoutFunctionRef) { - - resultsArr = new Uint8Array (8); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); - } - } - - g.clear(); - g.setFont ("Vector", 40); - - for (i = 0; i < 4; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); - } - } - - for (i = 4; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); - } - } - - vibrate (timeoutFunctionRef); + + resultsArr = new Uint8Array (8); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); + } + } + + g.clear(); + g.setFont ("Vector", 40); + + for (i = 0; i < 4; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); + } + } + + for (i = 4; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); + } + } + + vibrate (timeoutFunctionRef); } function vibrate (timeoutFunctionRef) { - - Bangle.buzz(50, 0.5).then (() => { - - setTimeout (timeoutFunctionRef, 150); - }); + + Bangle.buzz(50, 0.5).then (() => { + + setTimeout (timeoutFunctionRef, 150); + }); } function random (max) { - - return Math.round (Math.random() * (max - 1) + 1); + + return Math.round (Math.random() * (max - 1) + 1); } drawMenu(); Bangle.on ('touch', touchHandler); setWatch (function() { - - menu = false; - rollDice (voidFn); - + + menu = false; + rollDice (voidFn); + }, BTN, {repeat: true, edge: "falling", debounce: 10}); From 9d42114acb0eda95d6abb14fd0cee6180e6122a3 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 22:44:11 -0500 Subject: [PATCH 73/89] ok the buzzing *might* work now --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 259 +++++++++++++++++++---------------- apps/multidice/metadata.json | 2 +- 3 files changed, 144 insertions(+), 118 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 9fd5f3935..72ff0367f 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -21,3 +21,4 @@ 1.19: added longer delay before resetting accelHandler 1.20: removed all traces of accel b/c I've given up 1.21: added a drawWidgets command to see if I have the padding right +1.22: ok the buzzing *might* work now diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 95732f16f..5f8e8712d 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -3,139 +3,164 @@ const DICE_ARRAY = [0, 4, 6, 8, 10, 12, 20, 100]; const SELECTION_ARRAY = [6, 0, 0, 0, 0, 0, 0, 0]; // default to selecting a single d20 function drawMenu() { - - stringArr = new Array ("", "", "", "", "", "", "", ""); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; - } - } - - g.clear(); - g.setFont ("Vector", 40); - Bangle.drawWidgets(); - - g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); - g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); - g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); - g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); - g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); - g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); - g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); - g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); + + stringArr = new Array ("", "", "", "", "", "", "", ""); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; + } + } + + g.clear(); + g.setFont ("Vector", 40); + + g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); + g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); + g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); + g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); + g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); + g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); + g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); + g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); } function touchHandler (button, xy) { - - if (! menu) { - - menu = true; - drawMenu(); - return; - } - - if (xy.x <= 87) { // left - - if (xy.y <= 43) { - - selection = 0; - } else if (xy.y <= 87) { - - selection = 1; - } else if (xy.y <= 131) { - - selection = 2; - } else { - - selection = 3; - } - } else { // right - - if (xy.y <= 43) { - - selection = 4; - } else if (xy.y <= 87) { - - selection = 5; - } else if (xy.y <= 131) { - - selection = 6; - } else { - - selection = 7; - } - } - - // increment SELECTION_ARRAY [selection] - if (SELECTION_ARRAY [selection] == 7) { - - SELECTION_ARRAY [selection] = 0; - } else { - - SELECTION_ARRAY [selection] += 1; - } - - drawMenu(); + + if (! menu) { + + menu = true; + drawMenu(); + return; + } + + if (xy.x <= 87) { // left + + if (xy.y <= 43) { + + selection = 0; + } else if (xy.y <= 87) { + + selection = 1; + } else if (xy.y <= 131) { + + selection = 2; + } else { + + selection = 3; + } + } else { // right + + if (xy.y <= 43) { + + selection = 4; + } else if (xy.y <= 87) { + + selection = 5; + } else if (xy.y <= 131) { + + selection = 6; + } else { + + selection = 7; + } + } + + // increment SELECTION_ARRAY [selection] + if (SELECTION_ARRAY [selection] == 7) { + + SELECTION_ARRAY [selection] = 0; + } else { + + SELECTION_ARRAY [selection] += 1; + } + + drawMenu(); +} + +function accelHandler (xyz) { + + if (xyz.diff >= 0.3) { + + menu = false; + //rollDice(); + //mutex (rollDice); + } +} + +let lock = false; +function mutex (functionRef) { + + if (lock) { + + return Promise.reject (new Error ("mutex is busy")); + } + + lock = true; + return new Promise (() => { + + functionRef.then (() => { + + lock = false; + }); + }); } function voidFn() { - - return; + + return; } -function rollDice (timeoutFunctionRef) { - - resultsArr = new Uint8Array (8); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); - } - } - - g.clear(); - g.setFont ("Vector", 40); - - for (i = 0; i < 4; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); - } - } - - for (i = 4; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); - } - } - - vibrate (timeoutFunctionRef); +function rollDice() { + + resultsArr = new Uint8Array (8); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); + } + } + + g.clear(); + g.setFont ("Vector", 40); + + for (i = 0; i < 4; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); + } + } + + for (i = 4; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); + } + } + + return vibrate(); } -function vibrate (timeoutFunctionRef) { - - Bangle.buzz(50, 0.5).then (() => { - - setTimeout (timeoutFunctionRef, 150); - }); +function vibrate() { + + return Bangle.buzz(50, 0.5); } function random (max) { - - return Math.round (Math.random() * (max - 1) + 1); + + return Math.round (Math.random() * (max - 1) + 1); } drawMenu(); Bangle.on ('touch', touchHandler); +Bangle.on ('accel', accelHandler); setWatch (function() { - - menu = false; - rollDice (voidFn); - + + menu = false; + //rollDice(); + mutex (rollDice); }, BTN, {repeat: true, edge: "falling", debounce: 10}); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index e8b2c4393..acbca320b 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.21", + "version":"1.22", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 4ffaf9bb3237db00e982269b2a26e51a072a4398 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 22:50:34 -0500 Subject: [PATCH 74/89] forgot to resolve the promise --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 3 ++- apps/multidice/metadata.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 72ff0367f..9f1d05d5e 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -22,3 +22,4 @@ 1.20: removed all traces of accel b/c I've given up 1.21: added a drawWidgets command to see if I have the padding right 1.22: ok the buzzing *might* work now +1.23: forgot to resolve the promise diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 5f8e8712d..892e88d41 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -100,9 +100,10 @@ function mutex (functionRef) { lock = true; return new Promise (() => { - functionRef.then (() => { + functionRef.then ((result) => { lock = false; + resolve (result); }); }); } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index acbca320b..5ca785724 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.22", + "version":"1.23", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 635d8be5078b41c00d6d38fa5686a11f65a346dd Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 22:58:41 -0500 Subject: [PATCH 75/89] fixed dumb errors --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 8 ++++++-- apps/multidice/metadata.json | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 9f1d05d5e..08981ebfc 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -23,3 +23,4 @@ 1.21: added a drawWidgets command to see if I have the padding right 1.22: ok the buzzing *might* work now 1.23: forgot to resolve the promise +1.24: fixed dumb errors diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 892e88d41..03380ee39 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -98,12 +98,16 @@ function mutex (functionRef) { } lock = true; - return new Promise (() => { + return new Promise ((resolve, reject) => { - functionRef.then ((result) => { + functionRef().then ((result) => { lock = false; resolve (result); + }).catch ((error) => { + + lock = false; + reject (error); }); }); } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 5ca785724..999446eac 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.23", + "version":"1.24", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 09b2d9259fd907b1f5e4c7e97e48c400af0205d2 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 23:02:33 -0500 Subject: [PATCH 76/89] god I hope this works --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 4 +--- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 08981ebfc..84b20801f 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -24,3 +24,4 @@ 1.22: ok the buzzing *might* work now 1.23: forgot to resolve the promise 1.24: fixed dumb errors +1.25: god I hope this works diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 03380ee39..9f74b1a09 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -84,8 +84,7 @@ function accelHandler (xyz) { if (xyz.diff >= 0.3) { menu = false; - //rollDice(); - //mutex (rollDice); + mutex (rollDice); } } @@ -166,6 +165,5 @@ Bangle.on ('accel', accelHandler); setWatch (function() { menu = false; - //rollDice(); mutex (rollDice); }, BTN, {repeat: true, edge: "falling", debounce: 10}); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index 999446eac..a6de27ac1 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.24", + "version":"1.25", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 2e92b04af553ca952c2ac14502241aa122b843fb Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 23:21:47 -0500 Subject: [PATCH 77/89] trying to add timeout after it's done buzzing... again --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 18 +++++++++++------- apps/multidice/metadata.json | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 84b20801f..d139f16c5 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -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 diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 9f74b1a09..c4597cdaf 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -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) { diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index a6de27ac1..e5d555fa8 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -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", From 16bcc2ca6cad44e8f7a3f9008a7abdc065b339c8 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sat, 25 Feb 2023 23:28:28 -0500 Subject: [PATCH 78/89] OH GOD IT FINALLY F*CKING WORKS --- apps/multidice/ChangeLog | 1 + apps/multidice/README.md | 7 +++---- apps/multidice/app.js | 3 ++- apps/multidice/metadata.json | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index d139f16c5..55ed99b4f 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -26,3 +26,4 @@ 1.24: fixed dumb errors 1.25: god I hope this works 1.26: trying to add timeout after it's done buzzing... again +1.27: OH GOD IT FINALLY WORKS diff --git a/apps/multidice/README.md b/apps/multidice/README.md index d80ed7ef1..43c3fb0b3 100644 --- a/apps/multidice/README.md +++ b/apps/multidice/README.md @@ -5,8 +5,8 @@ roll anywhere from 1-8 dice at the same time. ## Usage -On the menu screen: tap on the dice to change what variant is selected, & press the button to roll the dice -On the dice screen: tap anywhere on the screen to go back to the menu, or press the button to roll the dice +On the menu screen: tap on the dice to change what variant is selected, & shake/or press BTN to roll the dice +On the dice screen: tap anywhere on the screen to go back to the menu, or shake/or press BTN to roll the dice ## Features @@ -14,5 +14,4 @@ roll anywhere from 1-8 dice (d4, d6, d8, d10, d12, d20, & d percentile). You can ## Controls -App uses touchscreen to cycle through different dice, and BTN to roll them -(W.I.P. using acceleration to roll dice) +App uses touchscreen to cycle through different dice, and accelerometer/BTN to roll them diff --git a/apps/multidice/app.js b/apps/multidice/app.js index c4597cdaf..474d8fb7c 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -81,7 +81,7 @@ function touchHandler (button, xy) { function accelHandler (xyz) { - if (xyz.diff >= 0.4) { + if (xyz.diff >= 0.3) { menu = false; mutex (rollDice); @@ -158,6 +158,7 @@ function vibrate() { }); } +// returns a integer [1, max] function random (max) { return Math.round (Math.random() * (max - 1) + 1); diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index e5d555fa8..f77e5fab8 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.26", + "version":"1.27", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From c3f5fbbd28ddc54c2842ae73bc990aadbf7cede5 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Sun, 26 Feb 2023 15:51:03 -0500 Subject: [PATCH 79/89] increased vibration strength, added some comments, & some QOL --- apps/multidice/ChangeLog | 1 + apps/multidice/app.js | 43 ++++++++++++++++++++++-------------- apps/multidice/metadata.json | 2 +- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 55ed99b4f..6b773d96b 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -27,3 +27,4 @@ 1.25: god I hope this works 1.26: trying to add timeout after it's done buzzing... again 1.27: OH GOD IT FINALLY WORKS +1.28: increased vibration strength, added some comments, & some QOL diff --git a/apps/multidice/app.js b/apps/multidice/app.js index 474d8fb7c..d0f13ae7c 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -1,7 +1,8 @@ -var menu = true; -const DICE_ARRAY = [0, 4, 6, 8, 10, 12, 20, 100]; +var menu = true; // default to have the selection menu open +const DICE_ARRAY = [0, 4, 6, 8, 10, 12, 20, 100]; // 0 means nothing selected const SELECTION_ARRAY = [6, 0, 0, 0, 0, 0, 0, 0]; // default to selecting a single d20 +// function to draw the selection menu function drawMenu() { stringArr = new Array ("", "", "", "", "", "", "", ""); @@ -10,12 +11,16 @@ function drawMenu() { if (SELECTION_ARRAY [i] != 0) { stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; + } else { + + stringArr [i] = " . "; // more clearly defines where the user can tap } } g.clear(); g.setFont ("Vector", 40); + // " ".slice(-3) left-pads all numbers with spaces g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); @@ -26,9 +31,10 @@ function drawMenu() { g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); } +// function to change what dice is selected in the menu function touchHandler (button, xy) { - if (! menu) { + if (! menu) { // if menu isn't open, open it & return menu = true; drawMenu(); @@ -37,38 +43,37 @@ function touchHandler (button, xy) { if (xy.x <= 87) { // left - if (xy.y <= 43) { + if (xy.y <= 43) { // first selection = 0; - } else if (xy.y <= 87) { + } else if (xy.y <= 87) { // second selection = 1; - } else if (xy.y <= 131) { + } else if (xy.y <= 131) { // third selection = 2; - } else { + } else { // fourth selection = 3; } } else { // right - if (xy.y <= 43) { + if (xy.y <= 43) { // first selection = 4; - } else if (xy.y <= 87) { + } else if (xy.y <= 87) { // second selection = 5; - } else if (xy.y <= 131) { + } else if (xy.y <= 131) { // third selection = 6; - } else { + } else { // fourth selection = 7; } } - // increment SELECTION_ARRAY [selection] - if (SELECTION_ARRAY [selection] == 7) { + if (SELECTION_ARRAY [selection] == SELECTION_ARRAY.length - 1) { // if last dice is selected, go back to first SELECTION_ARRAY [selection] = 0; } else { @@ -84,10 +89,14 @@ function accelHandler (xyz) { if (xyz.diff >= 0.3) { menu = false; - mutex (rollDice); + mutex (rollDice).catch (() => { + + return; // not necessary, but prevents spamming the logs + }); } } +// returns a resolved promise if no other mutex call is active, all further ones return a rejected one let lock = false; function mutex (functionRef) { @@ -111,6 +120,7 @@ function mutex (functionRef) { }); } +// function to roll all selected dice, and display them function rollDice() { resultsArr = new Uint8Array (8); @@ -144,16 +154,17 @@ function rollDice() { return vibrate(); } +// triggers the vibration, then pauses before returning function vibrate() { return new Promise ((resolve, reject) => { - return Bangle.buzz (50, 0.5).then ((value) => { + return Bangle.buzz (50, 1).then ((value) => { setTimeout (() => { resolve (value); - }, 150); + }, 200); }); }); } diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index f77e5fab8..c3c144890 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.27", + "version":"1.28", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From b2679d7b9b3620351abf57b68ddbc8f9bac104bd Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Mon, 27 Feb 2023 18:40:15 -0500 Subject: [PATCH 80/89] removed an extra newline --- apps/multidice/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/multidice/README.md b/apps/multidice/README.md index 43c3fb0b3..056e5a7eb 100644 --- a/apps/multidice/README.md +++ b/apps/multidice/README.md @@ -2,7 +2,6 @@ roll anywhere from 1-8 dice at the same time. - ## Usage On the menu screen: tap on the dice to change what variant is selected, & shake/or press BTN to roll the dice From a40d7cee5c7f23dc5292e5f59b6cbd4aa98ae94d Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Mon, 27 Feb 2023 18:41:10 -0500 Subject: [PATCH 81/89] tabs, since app is p. much finalized --- apps/multidice/app.js | 296 +++++++++++++++++++++--------------------- 1 file changed, 148 insertions(+), 148 deletions(-) diff --git a/apps/multidice/app.js b/apps/multidice/app.js index d0f13ae7c..53f67e21e 100644 --- a/apps/multidice/app.js +++ b/apps/multidice/app.js @@ -4,182 +4,182 @@ const SELECTION_ARRAY = [6, 0, 0, 0, 0, 0, 0, 0]; // default to selecting a sing // function to draw the selection menu function drawMenu() { - - stringArr = new Array ("", "", "", "", "", "", "", ""); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; - } else { - - stringArr [i] = " . "; // more clearly defines where the user can tap - } - } - - g.clear(); - g.setFont ("Vector", 40); - - // " ".slice(-3) left-pads all numbers with spaces - g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); - g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); - g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); - g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); - g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); - g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); - g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); - g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); + + stringArr = new Array ("", "", "", "", "", "", "", ""); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + stringArr [i] = "" + DICE_ARRAY [SELECTION_ARRAY [i]]; + } else { + + stringArr [i] = " . "; // more clearly defines where the user can tap + } + } + + g.clear(); + g.setFont ("Vector", 40); + + // " ".slice(-3) left-pads all numbers with spaces + g.drawString ((" " + stringArr [0]).slice (-3), 5, 10); + g.drawString ((" " + stringArr [1]).slice (-3), 5, 50); + g.drawString ((" " + stringArr [2]).slice (-3), 5, 90); + g.drawString ((" " + stringArr [3]).slice (-3), 5, 130); + g.drawString ((" " + stringArr [4]).slice (-3), 96, 10); + g.drawString ((" " + stringArr [5]).slice (-3), 96, 50); + g.drawString ((" " + stringArr [6]).slice (-3), 96, 90); + g.drawString ((" " + stringArr [7]).slice (-3), 96, 130); } // function to change what dice is selected in the menu function touchHandler (button, xy) { - - if (! menu) { // if menu isn't open, open it & return - - menu = true; - drawMenu(); - return; - } - - if (xy.x <= 87) { // left - - if (xy.y <= 43) { // first - - selection = 0; - } else if (xy.y <= 87) { // second - - selection = 1; - } else if (xy.y <= 131) { // third - - selection = 2; - } else { // fourth - - selection = 3; - } - } else { // right - - if (xy.y <= 43) { // first - - selection = 4; - } else if (xy.y <= 87) { // second - - selection = 5; - } else if (xy.y <= 131) { // third - - selection = 6; - } else { // fourth - - selection = 7; - } - } - - if (SELECTION_ARRAY [selection] == SELECTION_ARRAY.length - 1) { // if last dice is selected, go back to first - - SELECTION_ARRAY [selection] = 0; - } else { - - SELECTION_ARRAY [selection] += 1; - } - - drawMenu(); + + if (! menu) { // if menu isn't open, open it & return + + menu = true; + drawMenu(); + return; + } + + if (xy.x <= 87) { // left + + if (xy.y <= 43) { // first + + selection = 0; + } else if (xy.y <= 87) { // second + + selection = 1; + } else if (xy.y <= 131) { // third + + selection = 2; + } else { // fourth + + selection = 3; + } + } else { // right + + if (xy.y <= 43) { // first + + selection = 4; + } else if (xy.y <= 87) { // second + + selection = 5; + } else if (xy.y <= 131) { // third + + selection = 6; + } else { // fourth + + selection = 7; + } + } + + if (SELECTION_ARRAY [selection] == SELECTION_ARRAY.length - 1) { // if last dice is selected, go back to first + + SELECTION_ARRAY [selection] = 0; + } else { + + SELECTION_ARRAY [selection] += 1; + } + + drawMenu(); } function accelHandler (xyz) { - - if (xyz.diff >= 0.3) { - - menu = false; - mutex (rollDice).catch (() => { - - return; // not necessary, but prevents spamming the logs - }); - } + + if (xyz.diff >= 0.3) { + + menu = false; + mutex (rollDice).catch (() => { + + return; // not necessary, but prevents spamming the logs + }); + } } // returns a resolved promise if no other mutex call is active, all further ones return a rejected one let lock = false; function mutex (functionRef) { - - if (lock) { - - return Promise.reject (new Error ("mutex is busy")); - } - - lock = true; - return new Promise ((resolve, reject) => { - - functionRef().then ((result) => { - - lock = false; - resolve (result); - }).catch ((error) => { - - lock = false; - reject (error); - }); - }); + + if (lock) { + + return Promise.reject (new Error ("mutex is busy")); + } + + lock = true; + return new Promise ((resolve, reject) => { + + functionRef().then ((result) => { + + lock = false; + resolve (result); + }).catch ((error) => { + + lock = false; + reject (error); + }); + }); } // function to roll all selected dice, and display them function rollDice() { - - resultsArr = new Uint8Array (8); - for (i = 0; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); - } - } - - g.clear(); - g.setFont ("Vector", 40); - - for (i = 0; i < 4; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); - } - } - - for (i = 4; i < 8; i++) { - - if (SELECTION_ARRAY [i] != 0) { - - g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); - } - } - - return vibrate(); + + resultsArr = new Uint8Array (8); + for (i = 0; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + resultsArr [i] = random (DICE_ARRAY [SELECTION_ARRAY [i]]); + } + } + + g.clear(); + g.setFont ("Vector", 40); + + for (i = 0; i < 4; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 5, 10 + 40 * i); + } + } + + for (i = 4; i < 8; i++) { + + if (SELECTION_ARRAY [i] != 0) { + + g.drawString ((" " + resultsArr [i]).slice (-3), 96, 10 + 40 * (i - 4)); + } + } + + return vibrate(); } // triggers the vibration, then pauses before returning function vibrate() { - - return new Promise ((resolve, reject) => { - - return Bangle.buzz (50, 1).then ((value) => { - - setTimeout (() => { - - resolve (value); - }, 200); - }); - }); + + return new Promise ((resolve, reject) => { + + return Bangle.buzz (50, 1).then ((value) => { + + setTimeout (() => { + + resolve (value); + }, 200); + }); + }); } // returns a integer [1, max] function random (max) { - - return Math.round (Math.random() * (max - 1) + 1); + + return Math.round (Math.random() * (max - 1) + 1); } drawMenu(); Bangle.on ('touch', touchHandler); Bangle.on ('accel', accelHandler); setWatch (function() { - - menu = false; - mutex (rollDice); + + menu = false; + mutex (rollDice); }, BTN, {repeat: true, edge: "falling", debounce: 10}); From 50d43e917615a95ffbba6948f332bc126dcc8437 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Tue, 28 Feb 2023 19:00:25 -0500 Subject: [PATCH 82/89] reverted to before image manipulation --- apps/multidice/app-icon.js | 2 +- apps/multidice/app.png | Bin 1330 -> 0 bytes 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 apps/multidice/app.png diff --git a/apps/multidice/app-icon.js b/apps/multidice/app-icon.js index d6e931259..88feb83cd 100644 --- a/apps/multidice/app-icon.js +++ b/apps/multidice/app-icon.js @@ -1 +1 @@ -atob("MDCEAREREREREREREREREREREQAAEREREREREREREREREREREREREREREAAAARERERERERAAAAAAAAAAAAAAARERABERABEREREREQARERERERERERERAREQAREREAEREREREQARERERERERERERABEAEREREQAREREREQARERERERERERERABABERERERABEREREQAREREREREREREREQARERAAEREAEREREQAREREREREREREREAEREQAAAREQAREREQARERERERERERERABEREAERARERABEREQARERERAAAREREQAREREAERAREREAEREQAREREQAAABEREAEREREQEQAREREQAREQAREREAEREAERABEREREQAAERERERABEQAREREBEREQEQAREREREREREREREREAEQAREREBEREQEAEREQAAERERERAAAREQAQAREREBEREQABEREAEQEREREQARARERAAAREREAEREAABEREBEQAREREQERABERAAAREREQAAABEBEREBEQAREREQERABERAAARERERAAAREAEREAAAEREREQAAARERAAAREREREREREQARERABEREREREAEREQAQARERERERERERABERERERABEREREREAEQAREREREREREREAEREREQAAARERERABEQAREREREREREREQAREREAERAREREQAREQARERERERERERERABEREAERAREREAEREQARERERERERERERAAEREQEQARERABERERAAAAAAAAAAAAAAAQAREQAAEREQAQABERAAAAAAAAAAAAAAAAABEREREREAEQAAEQARERERERERERERABEAERERERABEREQEQARAAARERERERERABEQAREREQAQABEQEQAQAAABERERERERABERABEREAEAAAEQAQAQARABERERERERABEREAERABEBEQEQAQEQARABERERERERABEBEQAAAREBEQEQAREQAAABERERERERABEAABEREREAAAEQAQERAAARERERERERABEQABEREREQABEQAQERERERAAARERERABEREREQABEREREQAREREREQAAABERERABEREREAAAEREREQAQEREREQARABERERABEREREBEQEREREQAQAREREQARABERERABEREREBEQEREREQAQAREREQAAABERERABEREREAAAEREREQAQARERERAAARERERABEREREQABEREREQAQARERERERERAAARABEQABEREREQABEQAQAREREREREQAAABABEAAAEREREAAAEQAQAREREREREQARABABEBEQEREREBEQEQAQAREREREREQARABABEBEQEREREBEQEQAQAREREREREQAAABABEAAAEREREAAAEQAQARERERERERAAARABEQABEREREQABEQEQARERERERERERERABEREREREREREREQERAAEREREREREREAAAARERERERERERAAEREAAAAAAAAAAAAAEQAAAAAAAAAAAAAREQ==") +atob("MDABAAAAA8AAAAAAB+AAf//+DDAAwAACGBgAwAADMAwAwAADYAYAgAAAwYMAgAABg+GAgAADBiDAgDwGBiBggH4MAmAwgMMYA8AYgIEwAAAMgIFg8AeGgIHBkAyDgMNBGAjDgH5BGAjDgDxh8A+DgAAwYAMGgAAYAYAMgAAMA+AYwAAGBiAwwAADBiBgwAADgmDAf//+w8Gwf///4AM8wAADMAYEzwADGA3En4ABDBvkmYABBjIkmYABI+IkH4ABPAPkjwABHAHEgDwBAHAEAH4BAPgEgGYBAIgEgGYBAIgEgH4BAPgEgDwBAHAEgADxHAHEgAH5PgPkgAGZIgIkgAGZIgIkgAH5PgPkwADzHAHEwAADAAAEcAAPwAAcP//8///w") diff --git a/apps/multidice/app.png b/apps/multidice/app.png deleted file mode 100644 index 75ee0514a953e29e618bf56a49e8526e8eac59f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1330 zcmV-21iCYS(1OJaP25k$Q;U-Cc6Fq}DO z&f~^^GU+{YX6AhVneRCO{|_z%wga=k3E*Skx~hw=0yfvshP74*4PYP80`>qe0f&IU zfwg4>?*QHb=4)F)$4fq%-7cwW2lxIR!7w#Jawd^RBbJpr|vEJNZr zu$TJrE^sVT_(~*NI)%ECoNTP{E{TaEBurmNX%Di5Uk2;>QW1~>|Q zp_6*g8xu{U9R%{!X1DC4q2~>f$m3>z>*jeSp+ugy@h%ooqG4A zlCd=5?*@K#c6!`%mua{Y_}Q8BK5#(_2~*))>NtT{^!E|(eU}88QF1pdy?=@@8o*D$ z0U7p2;9uamlv6#Vjmsp^Ej{1w=(=wMqgulRcCk|Zw>f>&+Px4~XpR|ng3lEze7vad z=X#<06m%?SdQI)P`qnt7wA7n-rTT}Q&6rd44dF7)+2owaQ5n1s%iq3>Az-*3_)x{i z@4yF&riLEi5ACk$r;Bl^&6J84vy=XuZ|%{XX$8A8DKTe_#%zrxkcUBehDnda0_nU3 zuGfKO5o>iQPJ9Bq0bJ|7AJ9hZON_g&RAOy_Lrs$IA%cj(Q-5#BK@SrRPoB$R$OEM}|^&MV3cm!b|2>rMTQE;SDe76ozW5i7!!f zZb_+e#w8zuCNa;}9%g-4eBbsKIaz5><%D~+st>260#(qhHRt8iABgl$F={j97eA+T z&6fm`tx6Rva&A#y8En^wF4l7li2+CW)r!U^W$;Pl?{YTgoH#Hh=_bP{zDa7oziF4c}c>Zwgrb1(Ihyk;5!%cl<`h61e!VCCWN3H4Pmy;1p3-dpp18lA<&!SZE7P>#yb@; z;;DeQsf|Dx@8lCG>TUWn#@9w5%R9LQih7%#vbj)EWO*l-Kv8egERqXVAuwBzK&-cE z7RiOG5XkaQX}M6Wx9KgC3!Qcfnxe?^PDw%2DCuqb1LMyrXp)lB{TG<3u(ghOm%DXg zgVwz@=~$*>;)pE1>VNjwrnOG#wxgwDe5B&KBTi9o7h`APYTz?{wCZ(=tzq|_cB5=p oHg@l1bwC|gHFnkhjC-x}A5s&T=P#0nHvj+t07*qoM6N<$g6g++LI3~& From b0f729eb1e918964787d623d05f0589a007292b3 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Tue, 28 Feb 2023 19:02:49 -0500 Subject: [PATCH 83/89] 4th try --- apps/multidice/app-icon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/multidice/app-icon.js b/apps/multidice/app-icon.js index 88feb83cd..62233cfee 100644 --- a/apps/multidice/app-icon.js +++ b/apps/multidice/app-icon.js @@ -1 +1 @@ -atob("MDABAAAAA8AAAAAAB+AAf//+DDAAwAACGBgAwAADMAwAwAADYAYAgAAAwYMAgAABg+GAgAADBiDAgDwGBiBggH4MAmAwgMMYA8AYgIEwAAAMgIFg8AeGgIHBkAyDgMNBGAjDgH5BGAjDgDxh8A+DgAAwYAMGgAAYAYAMgAAMA+AYwAAGBiAwwAADBiBgwAADgmDAf//+w8Gwf///4AM8wAADMAYEzwADGA3En4ABDBvkmYABBjIkmYABI+IkH4ABPAPkjwABHAHEgDwBAHAEAH4BAPgEgGYBAIgEgGYBAIgEgH4BAPgEgDwBAHAEgADxHAHEgAH5PgPkgAGZIgIkgAGZIgIkgAH5PgPkwADzHAHEwAADAAAEcAAPwAAcP//8///w") +atob("MDAB/////D//////+B//gAAB88//P//95+f/P//8z/P/P//8n/n/P///Pjz/P//+fB5/P//8+d8/P8P5+d+fP4Hz/Z/PPzzn/D/nP37P///zP36fD/h5P34+b/M8Pzw+5/c8P4G+5/c8P8OeD/B8P//Pn/z5P//n/n/zP//z/B/nP//5+d/PP//8+d+fP//8fZ8/gAABPD5HgAAAH/zDP//8z/n7MP/85/I7IH/88+QZJn/8+c3ZZn/83B3Z4H/8w/wZcP/84/45f8P8/4/5/4H8/wf5f5n8/3f5P5n8/3f5P4H8/wf5P8P8/4/5P/8M4/45P/4EwfwZP/5k3f3ZP/5k3f3ZP/4EwfwZP/8M4/47P//8///7j//wP//jwAADAAAP") From 3bbcb6522eed8af1e4b2783af649a59f2f001d17 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Tue, 28 Feb 2023 19:05:37 -0500 Subject: [PATCH 84/89] didn't add the file I meant to --- apps/multidice/app.png | Bin 0 -> 1330 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/multidice/app.png diff --git a/apps/multidice/app.png b/apps/multidice/app.png new file mode 100644 index 0000000000000000000000000000000000000000..75ee0514a953e29e618bf56a49e8526e8eac59f5 GIT binary patch literal 1330 zcmV-21iCYS(1OJaP25k$Q;U-Cc6Fq}DO z&f~^^GU+{YX6AhVneRCO{|_z%wga=k3E*Skx~hw=0yfvshP74*4PYP80`>qe0f&IU zfwg4>?*QHb=4)F)$4fq%-7cwW2lxIR!7w#Jawd^RBbJpr|vEJNZr zu$TJrE^sVT_(~*NI)%ECoNTP{E{TaEBurmNX%Di5Uk2;>QW1~>|Q zp_6*g8xu{U9R%{!X1DC4q2~>f$m3>z>*jeSp+ugy@h%ooqG4A zlCd=5?*@K#c6!`%mua{Y_}Q8BK5#(_2~*))>NtT{^!E|(eU}88QF1pdy?=@@8o*D$ z0U7p2;9uamlv6#Vjmsp^Ej{1w=(=wMqgulRcCk|Zw>f>&+Px4~XpR|ng3lEze7vad z=X#<06m%?SdQI)P`qnt7wA7n-rTT}Q&6rd44dF7)+2owaQ5n1s%iq3>Az-*3_)x{i z@4yF&riLEi5ACk$r;Bl^&6J84vy=XuZ|%{XX$8A8DKTe_#%zrxkcUBehDnda0_nU3 zuGfKO5o>iQPJ9Bq0bJ|7AJ9hZON_g&RAOy_Lrs$IA%cj(Q-5#BK@SrRPoB$R$OEM}|^&MV3cm!b|2>rMTQE;SDe76ozW5i7!!f zZb_+e#w8zuCNa;}9%g-4eBbsKIaz5><%D~+st>260#(qhHRt8iABgl$F={j97eA+T z&6fm`tx6Rva&A#y8En^wF4l7li2+CW)r!U^W$;Pl?{YTgoH#Hh=_bP{zDa7oziF4c}c>Zwgrb1(Ihyk;5!%cl<`h61e!VCCWN3H4Pmy;1p3-dpp18lA<&!SZE7P>#yb@; z;;DeQsf|Dx@8lCG>TUWn#@9w5%R9LQih7%#vbj)EWO*l-Kv8egERqXVAuwBzK&-cE z7RiOG5XkaQX}M6Wx9KgC3!Qcfnxe?^PDw%2DCuqb1LMyrXp)lB{TG<3u(ghOm%DXg zgVwz@=~$*>;)pE1>VNjwrnOG#wxgwDe5B&KBTi9o7h`APYTz?{wCZ(=tzq|_cB5=p oHg@l1bwC|gHFnkhjC-x}A5s&T=P#0nHvj+t07*qoM6N<$g6g++LI3~& literal 0 HcmV?d00001 From 07952c23b5516421030426efe12a4f3a5b1dd0fb Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Tue, 28 Feb 2023 22:07:17 -0500 Subject: [PATCH 85/89] 5th try --- apps/multidice/app-icon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/multidice/app-icon.js b/apps/multidice/app-icon.js index 62233cfee..524f27d52 100644 --- a/apps/multidice/app-icon.js +++ b/apps/multidice/app-icon.js @@ -1 +1 @@ -atob("MDAB/////D//////+B//gAAB88//P//95+f/P//8z/P/P//8n/n/P///Pjz/P//+fB5/P//8+d8/P8P5+d+fP4Hz/Z/PPzzn/D/nP37P///zP36fD/h5P34+b/M8Pzw+5/c8P4G+5/c8P8OeD/B8P//Pn/z5P//n/n/zP//z/B/nP//5+d/PP//8+d+fP//8fZ8/gAABPD5HgAAAH/zDP//8z/n7MP/85/I7IH/88+QZJn/8+c3ZZn/83B3Z4H/8w/wZcP/84/45f8P8/4/5/4H8/wf5f5n8/3f5P5n8/3f5P4H8/wf5P8P8/4/5P/8M4/45P/4EwfwZP/5k3f3ZP/5k3f3ZP/4EwfwZP/8M4/47P//8///7j//wP//jwAADAAAP") +atob("MDCBAf////w///////gf/4AAAfPP/z///efn/z///M/z/z///J/5/z///z48/z///nwefz///PnfPz/D+fnfnz+B8/2fzz885/w/5z9+z///8z9+nw/4eT9+Pm/zfD88Puf3PD+Bvuf3PD/Dng/wfD//z5/8+T//5/5/8z//8/wf5z//+fnfzz///Pnfnz///H2fP4AAATw+R4AAAB/8wz///M/5+zD//OfyOyB//PPkGSZ//PnN2WZ//Nwd2eB//MP8GXD//OP+OX/D/P+P+f+B/P8H+X+Z/P93+T+Z/P93+T+B/P8H+T/D/P+P+T//DOP+OT/+BMH8GT/+ZN392T/+ZN392T/+BMH8GT//DOP+Oz///P//+4//8D//48AAAwAADw==") From 1f64a1736b5ff0847e5677908266fb8653973ea8 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Tue, 28 Feb 2023 22:10:48 -0500 Subject: [PATCH 86/89] I think that fixed the icon --- apps/multidice/app-icon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/multidice/app-icon.js b/apps/multidice/app-icon.js index 524f27d52..88feb83cd 100644 --- a/apps/multidice/app-icon.js +++ b/apps/multidice/app-icon.js @@ -1 +1 @@ -atob("MDCBAf////w///////gf/4AAAfPP/z///efn/z///M/z/z///J/5/z///z48/z///nwefz///PnfPz/D+fnfnz+B8/2fzz885/w/5z9+z///8z9+nw/4eT9+Pm/zfD88Puf3PD+Bvuf3PD/Dng/wfD//z5/8+T//5/5/8z//8/wf5z//+fnfzz///Pnfnz///H2fP4AAATw+R4AAAB/8wz///M/5+zD//OfyOyB//PPkGSZ//PnN2WZ//Nwd2eB//MP8GXD//OP+OX/D/P+P+f+B/P8H+X+Z/P93+T+Z/P93+T+B/P8H+T/D/P+P+T//DOP+OT/+BMH8GT/+ZN392T/+ZN392T/+BMH8GT//DOP+Oz///P//+4//8D//48AAAwAADw==") +atob("MDABAAAAA8AAAAAAB+AAf//+DDAAwAACGBgAwAADMAwAwAADYAYAgAAAwYMAgAABg+GAgAADBiDAgDwGBiBggH4MAmAwgMMYA8AYgIEwAAAMgIFg8AeGgIHBkAyDgMNBGAjDgH5BGAjDgDxh8A+DgAAwYAMGgAAYAYAMgAAMA+AYwAAGBiAwwAADBiBgwAADgmDAf//+w8Gwf///4AM8wAADMAYEzwADGA3En4ABDBvkmYABBjIkmYABI+IkH4ABPAPkjwABHAHEgDwBAHAEAH4BAPgEgGYBAIgEgGYBAIgEgH4BAPgEgDwBAHAEgADxHAHEgAH5PgPkgAGZIgIkgAGZIgIkgAH5PgPkwADzHAHEwAADAAAEcAAPwAAcP//8///w") From 52bb9f1ca88a0e01182f31f429cbb3a054921cfa Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Tue, 28 Feb 2023 22:17:17 -0500 Subject: [PATCH 87/89] checking if I need to increase version for image to change --- apps/multidice/ChangeLog | 1 + apps/multidice/app-icon.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 6b773d96b..6c9836e94 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -28,3 +28,4 @@ 1.26: trying to add timeout after it's done buzzing... again 1.27: OH GOD IT FINALLY WORKS 1.28: increased vibration strength, added some comments, & some QOL +1.29: changed image diff --git a/apps/multidice/app-icon.js b/apps/multidice/app-icon.js index 88feb83cd..524f27d52 100644 --- a/apps/multidice/app-icon.js +++ b/apps/multidice/app-icon.js @@ -1 +1 @@ -atob("MDABAAAAA8AAAAAAB+AAf//+DDAAwAACGBgAwAADMAwAwAADYAYAgAAAwYMAgAABg+GAgAADBiDAgDwGBiBggH4MAmAwgMMYA8AYgIEwAAAMgIFg8AeGgIHBkAyDgMNBGAjDgH5BGAjDgDxh8A+DgAAwYAMGgAAYAYAMgAAMA+AYwAAGBiAwwAADBiBgwAADgmDAf//+w8Gwf///4AM8wAADMAYEzwADGA3En4ABDBvkmYABBjIkmYABI+IkH4ABPAPkjwABHAHEgDwBAHAEAH4BAPgEgGYBAIgEgGYBAIgEgH4BAPgEgDwBAHAEgADxHAHEgAH5PgPkgAGZIgIkgAGZIgIkgAH5PgPkwADzHAHEwAADAAAEcAAPwAAcP//8///w") +atob("MDCBAf////w///////gf/4AAAfPP/z///efn/z///M/z/z///J/5/z///z48/z///nwefz///PnfPz/D+fnfnz+B8/2fzz885/w/5z9+z///8z9+nw/4eT9+Pm/zfD88Puf3PD+Bvuf3PD/Dng/wfD//z5/8+T//5/5/8z//8/wf5z//+fnfzz///Pnfnz///H2fP4AAATw+R4AAAB/8wz///M/5+zD//OfyOyB//PPkGSZ//PnN2WZ//Nwd2eB//MP8GXD//OP+OX/D/P+P+f+B/P8H+X+Z/P93+T+Z/P93+T+B/P8H+T/D/P+P+T//DOP+OT/+BMH8GT/+ZN392T/+ZN392T/+BMH8GT//DOP+Oz///P//+4//8D//48AAAwAADw==") diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index c3c144890..a754ef8b2 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.28", + "version":"1.29", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From 8e609ff281fa1e935cdd0ac60c983d09c7f25d2b Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Tue, 28 Feb 2023 22:20:53 -0500 Subject: [PATCH 88/89] if this doesn't work I'm reverting & giving up --- apps/multidice/ChangeLog | 1 + apps/multidice/app-icon.js | 2 +- apps/multidice/metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/multidice/ChangeLog b/apps/multidice/ChangeLog index 6c9836e94..cb0cce2aa 100644 --- a/apps/multidice/ChangeLog +++ b/apps/multidice/ChangeLog @@ -29,3 +29,4 @@ 1.27: OH GOD IT FINALLY WORKS 1.28: increased vibration strength, added some comments, & some QOL 1.29: changed image +1.30: changed image, again diff --git a/apps/multidice/app-icon.js b/apps/multidice/app-icon.js index 524f27d52..88feb83cd 100644 --- a/apps/multidice/app-icon.js +++ b/apps/multidice/app-icon.js @@ -1 +1 @@ -atob("MDCBAf////w///////gf/4AAAfPP/z///efn/z///M/z/z///J/5/z///z48/z///nwefz///PnfPz/D+fnfnz+B8/2fzz885/w/5z9+z///8z9+nw/4eT9+Pm/zfD88Puf3PD+Bvuf3PD/Dng/wfD//z5/8+T//5/5/8z//8/wf5z//+fnfzz///Pnfnz///H2fP4AAATw+R4AAAB/8wz///M/5+zD//OfyOyB//PPkGSZ//PnN2WZ//Nwd2eB//MP8GXD//OP+OX/D/P+P+f+B/P8H+X+Z/P93+T+Z/P93+T+B/P8H+T/D/P+P+T//DOP+OT/+BMH8GT/+ZN392T/+ZN392T/+BMH8GT//DOP+Oz///P//+4//8D//48AAAwAADw==") +atob("MDABAAAAA8AAAAAAB+AAf//+DDAAwAACGBgAwAADMAwAwAADYAYAgAAAwYMAgAABg+GAgAADBiDAgDwGBiBggH4MAmAwgMMYA8AYgIEwAAAMgIFg8AeGgIHBkAyDgMNBGAjDgH5BGAjDgDxh8A+DgAAwYAMGgAAYAYAMgAAMA+AYwAAGBiAwwAADBiBgwAADgmDAf//+w8Gwf///4AM8wAADMAYEzwADGA3En4ABDBvkmYABBjIkmYABI+IkH4ABPAPkjwABHAHEgDwBAHAEAH4BAPgEgGYBAIgEgGYBAIgEgH4BAPgEgDwBAHAEgADxHAHEgAH5PgPkgAGZIgIkgAGZIgIkgAH5PgPkwADzHAHEwAADAAAEcAAPwAAcP//8///w") diff --git a/apps/multidice/metadata.json b/apps/multidice/metadata.json index a754ef8b2..304c789e4 100644 --- a/apps/multidice/metadata.json +++ b/apps/multidice/metadata.json @@ -1,7 +1,7 @@ { "id": "multidice", "name": "multiple dice roller", "shortName":"multidice", - "version":"1.29", + "version":"1.30", "description": "roll anywhere from 1-8 dice at the same time", "icon": "app.png", "tags": "tool,game", From f9e3463964af3cdb3404148666a6b358211f5f80 Mon Sep 17 00:00:00 2001 From: Le~Kat Date: Tue, 28 Feb 2023 22:44:27 -0500 Subject: [PATCH 89/89] added images to README.md --- apps/multidice/README.md | 4 ++++ apps/multidice/many_rolled.png | Bin 0 -> 2192 bytes apps/multidice/many_selected.png | Bin 0 -> 2520 bytes apps/multidice/single_rolled.png | Bin 0 -> 1283 bytes apps/multidice/startup.png | Bin 0 -> 1565 bytes 5 files changed, 4 insertions(+) create mode 100644 apps/multidice/many_rolled.png create mode 100644 apps/multidice/many_selected.png create mode 100644 apps/multidice/single_rolled.png create mode 100644 apps/multidice/startup.png diff --git a/apps/multidice/README.md b/apps/multidice/README.md index 056e5a7eb..72a2d8af5 100644 --- a/apps/multidice/README.md +++ b/apps/multidice/README.md @@ -4,12 +4,16 @@ roll anywhere from 1-8 dice at the same time. ## Usage +![startup.png](startup.png) On the menu screen: tap on the dice to change what variant is selected, & shake/or press BTN to roll the dice +![single_rolled.png](single_rolled.png) On the dice screen: tap anywhere on the screen to go back to the menu, or shake/or press BTN to roll the dice ## Features roll anywhere from 1-8 dice (d4, d6, d8, d10, d12, d20, & d percentile). You can select multiple different dice at the same time +![many_selected.png](many_selected.png) +![many_rolled.png](many_rolled.png) ## Controls diff --git a/apps/multidice/many_rolled.png b/apps/multidice/many_rolled.png new file mode 100644 index 0000000000000000000000000000000000000000..4cf34e9c7da3eefbe05ecd61c6e3d3aee8d7f444 GIT binary patch literal 2192 zcma);dpy&N8^^a9mP^?xM93)F-0wvf+9s)Va@&R($^9pC+g!?o+#+g=P@P;lvDjQf zOy5o#T^ha>#CJevnLtq;=|lu8|a>N!G}qAJwW4R%fNzl!*ukJUOr6ISreL{S`~(j(fp!ENoh5Q+?wqAEvj1c-LEM$JoESS7^=3b zWtz`8zNu!|oWELWzbh`Pa54uEn!O0#>VUaV|7>Q)iy>^uT9}N6MMsgis+P|c%A~&GBW=5Ap(@og zh}MoXmh~c>QjT>Hr^&ukFS!7s4Q1ZIQchMbB+fQ#4lePu#yTC25AIx+4khV<>2yk~ zn@Ck#eaX$MS+o@|++OmG>XL}NEYMe>h>X9auaV}pYSNlk+R-KECsFKLp!k)6%7%M!PIh1$s+iCr{R49i91nCX z$o1|HU#CdBI%L7-eqB|Ur^SQd{I;MN6Ud)(8m#Pr6@TcOI*zQS?-)^)#CuC|L_p&; zKe`o=3abk&^pB3uJGYv5yD5y$ZR7M0hwjPjZTkA?po`KiAS)2}xaaNwct|lFz+JLc zgjkXfCnH&VBeGi~NLoI&7CV5GLd4*PFE(U(!R8XMN1;9r>PJ|MLH)M?d+|q z&k~=E4WMrFwPLZnKFB&KURMPn{k)iCA(fePyx zY(95k|1bG?G(!^mC!&2P?r96GQiGDO-ualO&=aA!|gW(ElISojKZ58UPa?#?aa zK=ygbmz3YrZYB5S<;hU9&(|Y12uc`Ljp;$1{DKKxaoo5eB$gD?8K?xaDr2~HCjv!R z*INkRxzS~HBL)>f&8x-hJ%H;IqsJXlhJ&c3H&+;~9ac7Ykoq#;O`2v&#bx;;uULK> z3Bmgo^UK9RFU?4{=P-}a;m5;45t z$Y6;e=vH;czlF!@6(J77hu}z?FS(AsEJ3-LABb-9FPlCBvmTx&I}EjVDC_j$Bm?=U zzneU7ylggGDjvc);r-og;YdTqYBgk3JfaYB+<4@Dj2&$eT3$SocYe{Ab05&nvwcqq zZiky^tQtY;$FakPUsY?Iyg5k#Jt6B;$>jNdyuI{rV*aY3i(?&|;Cz+C1gwn4cg1N1 z5onvaf8edFd@DL*j?ot9B&g>mD)0Y{>I#p{g}5%jR5zs9{RDlj(CmE?^WlMvu7cZ} z{ybP`#~u4^IevJo(v^xcrlb@MK9UzfK5n35(L{Gzlp3`1t#mD_^O1Z+Fqq^a69D2W oa>yJ4%S8O$RsU$Ue}vm&BC9@okiRE-=hFb$VJ~7TZODm#0Z2~n+a literal 0 HcmV?d00001 diff --git a/apps/multidice/many_selected.png b/apps/multidice/many_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..137e2c3639764bd81c59f572bf4ead346241371b GIT binary patch literal 2520 zcmbW3XH=8v5`aS>l&C1&Pz98dl@h5d(g_&&L{uP@1VoG=QUU~|3j!Z3dnE=~N&-eY zNYPLumoA@PKq69Np)3Mfng}dy6-8Lsc+TE``|JLA+r00bnRDiucP7p8GH?VbkA%Ts zN9@ky@cgym`w$i8&-E?yUND$gu^rCJCC2Ob!pYp9cPLZKf6Idz>G zK?8tDbLq#yvHJCc{nZ0U(;AENPBbaR(;R2BWgz(0*KB5q}fbAw^{7yOB8ezn!jX`OKGC z{e6XPO%t-fZFc6+htS~mM0}sT=+divnz*wZ!RPe3c?F@_7R7 zOcukOFl!P|TbwY~2n|km(&HKp*d%9{K}RbvHrBrps5z?y$>Z-}2k$HF6Wu6wMT)K2 zO_puvDITZAiG9;i5y*HQ`q?Gs^7PEH6KxlYYvX2;$~$9z8vi7^`8LwhNPUAR*%V>) z-C7tMjLM}M-RlGr=&enHlu@vD3(reT<+M@_M*ElYmB_Rn#lko?1>%~s1t}vSuvK=J zl&Ex7E`jb7pc#+UYwg%x*7yI?fAA$voDl`qMnwAy|aL%JQxV&05;i3M<@3S%;&^NY&I@_j5}G|Co91 zvs*dGdn3PEcZdXYI(nI(E3U=et}nf>6ZmSWCM9C(e)G9og_;}AGPaTjJtzH4$WB>j z)Qo{Xk1v|B`0G~(QnV1lL0hmRm^n#rIu$;XdtEI__?!O_SzeCZD(hc>V-L5Wfr2wD z>5I81^QS@JtZ;TlQjmhcnwTtyV<0?He8W5!(WGsXr)Ih7EXtXup+SE*%804^;V2pl zp4+^&_5U4puaZ9Qw#)O~@ZWl=l=Dp4C*7c>1`c%1?@jPn>mS&?xX~;0&nOV^cE9#b zb}*3;y28ARGw`;>uy&OOPYjw|CEfV1banq8Ma6xzNO@_JDSBuiA#11Hy-Ex-5foj` zwwX?gq(YJQkdRWTTnGG@=x$2 z2TMB(S)BSE;c7Y@D0%G*+hipItS1z>nN=Jw)swn~4Oi?f{36-=>+=Eq?U3~Vxc&Ye zft438tNX{gNw$TYGBrgJ_9~;Y(to- zTo!etzRP2=k@gUhfj^#t(tEbEU+8E0Vh|P***4Y#MC4(!r7={*+nq;y zQ}#*&W{k$kLwkINNp6fhMWgEUm}^-M0c+Yih!D+<^Y4AGJdXBSf04?l^pWeBlJHhr z*Pg}mO4e3(8hV)o+(U}DuE&f!~ zHQ)G(uign!rlO-`V}BA|mMJ34XUx>uy`1g!Fm=G)!FyH3r?67Ng7v7KWH^2NUUTIG zpnumib3JqPnmR04;g%2j{;u`{jSu4xb#Ru~oZ)JT+#@liR+r(Hk=Hp-&1IcQ$i3x) z#eXxadr)6-FIQA+ciW5~q}((=8fF>kEpk)DEt>ZS7I(uT%o$;8iI)Z7c({flk%^kK zgYnUG!qc?ulHhrmLpj!Bj-*`F+y%)J2tDw;!V!*=MfbL53#o^4nshaCVF+70y*f1k zq-PW6A`;zD02QrwmK}>ue+=E01O4vEbeDJ1i7hg+U@RRo`!HJ(SJ&U(49S=HanNn<1vpG!;#bM@<@ zL%_}xL{?rxy2QI!Cmv<^>yNWL-sO-$dO!S~z9C6#p(=jP74#htXPF~iU|!SX_Q}7# z@N+K?v=@tS$lIg1&CGVBNz?1ycn%g^l@_V5HHYkxaz_Z+_V0*~A-+Uq;#a&K}L;xaSLD(P0`|iSxR|xr;@j3pRgo>#!4vWNJ~ZqWVJAsl)fx%bp>M( zY%^MGy3y7o>PcM*Kkee(MT0CJ{)U+nb>xLe`8+*P#)2BSf2f-OTw=RZq1RvBYf_7_ zhGZnGUJ95#Rss!q+}JmPj6X-c8622xim!7WfI;S?KWKgK_1i6yKT%$PKgI6PNBr$b6mdrSPF>52I=eBO3 zMguDQ$7#V;&G7RRc5}4_42f}g^16-Ln{(a4=XT=QmC($5S7}-A>M;NmeB`1S2r;TI zxfh->)ivE%>9qm{Zv&Cl0#}L*eIvhz?g?`uy6^R#8+G{RC6Lfm1$n85VkMeNg@Z~5 zb0=66;AAyd)d{KKSQW(A@;C4`BuDWK13#V5g^Rq^I35T||9bKM;O%?j?<>Dubh(%W zzn2w;Me`dR{F(fF`7ngE>Ri$VetJF()RoZ_Kw@nB1nB&*UU)~+_J*T~G@78ML`}d^?Ehe?rB&ne z?%!7$?3*RO<{b#yd@{e2eJnx#D7&o}W_ zXkJ+Q{(XFAdEXrdqX(vi>vpCs>6o`QpLs{a^}2Hl8@{s^Z{01z`2P!^2V=bM(b~@o znC=NZotFK5?Y7-+ISj%dt|@Gfvv+bke`6nG$${I~Kfdp?yYczdw_|ss5Ac`89(b%& z^VE|y=D_+d#lQ9f>E-S}PBFmvGa9z%Z7NsXmiK1Xb@2~#r~i9ccGhFQuc^v|t^bvi z-u}8L7^VK;){Wn{6?gt_W2xc1 z)aH=4pkZQ^Z2;?=!d?~Kge778A&k{A%AVX3E3Yz#9+124af!(->#Kw4hU2D_wu~wr g4S_)%0$!&;r+qox)yUES1(?y?*Qas_xyZ9*LZ|z5oB;U&r;CW^?V~thhY6_@+D)lh~na zOicHF{fODqV7g&zL&J7EJ8}I4-W*+p2W$J!ALWiTEeBh$45P^EvKGVb5I z_wRd=d4KO4OIa@|={=CjSTA}tz3JuzY3p^CX3_QBSD58Gv&^0xuVNP;UD!B9{9`l{862F&WdSkgZy2|{anv>?|xC*RnNDr!kGpbzy?k%|m(uvy z(`TyF|K;4X)>nA&eSHeQUDcV*vp?uCGIIZj)QvStf7#G~N3ws2N`3kl_!8_dLB!m*3wk z*!|tdD0}boPYve_Y<6Y$*G#n7^gi;xR?nNNZ`tp@S$qj%wEt!C)Eqzu;NZ*q_D@(^)${1Tp;w}Ze5=9(FVdQ&MBb@0O0GRkpKVy literal 0 HcmV?d00001