From 39cd1c73d26da1886e03c1c1e7eb14a29f3aadd9 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Tue, 5 Nov 2024 21:21:18 -0700 Subject: [PATCH 1/9] Added pokertimer --- .gitmodules | 3 +++ apps/pokertimer | 1 + 2 files changed, 4 insertions(+) create mode 160000 apps/pokertimer diff --git a/.gitmodules b/.gitmodules index c2c1104c23..5002b324b2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "webtools"] path = webtools url = https://github.com/espruino/EspruinoWebTools.git +[submodule "apps/pokertimer"] + path = apps/pokertimer + url = https://gitea.gf4.pw/ki9/pokertimer.git diff --git a/apps/pokertimer b/apps/pokertimer new file mode 160000 index 0000000000..bdd82cc260 --- /dev/null +++ b/apps/pokertimer @@ -0,0 +1 @@ +Subproject commit bdd82cc2601f6904f1f45936e4830e38e53b1865 From ec34fcb2bfd7dcfffb4ae9e0678ed48fa4eef719 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Tue, 5 Nov 2024 21:44:03 -0700 Subject: [PATCH 2/9] Updated pokertimer documentation --- apps/pokertimer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/pokertimer b/apps/pokertimer index bdd82cc260..5fae11bd67 160000 --- a/apps/pokertimer +++ b/apps/pokertimer @@ -1 +1 @@ -Subproject commit bdd82cc2601f6904f1f45936e4830e38e53b1865 +Subproject commit 5fae11bd67a41c86f45168f71268cdeb8a194549 From 8e794e6c53cdcea011fbb0f5fd3517a318c44135 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Tue, 5 Nov 2024 21:45:49 -0700 Subject: [PATCH 3/9] Polished pokertimer comments --- apps/pokertimer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/pokertimer b/apps/pokertimer index 5fae11bd67..6dc2e3fb9a 160000 --- a/apps/pokertimer +++ b/apps/pokertimer @@ -1 +1 @@ -Subproject commit 5fae11bd67a41c86f45168f71268cdeb8a194549 +Subproject commit 6dc2e3fb9af28740b6cd9f8535dcab44d8125ac0 From 7f118fc5d178ccb4a53126a89a460b9b3cde2455 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Tue, 5 Nov 2024 21:49:56 -0700 Subject: [PATCH 4/9] Compliant changelog --- apps/pokertimer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/pokertimer b/apps/pokertimer index 6dc2e3fb9a..f78041a206 160000 --- a/apps/pokertimer +++ b/apps/pokertimer @@ -1 +1 @@ -Subproject commit 6dc2e3fb9af28740b6cd9f8535dcab44d8125ac0 +Subproject commit f78041a20643d801ce4ab027effef23205e0050a From 41d57e55558cefe8c733ab3fa30accec2dede7d2 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Tue, 5 Nov 2024 21:55:15 -0700 Subject: [PATCH 5/9] Reminder for screenshots --- apps/pokertimer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/pokertimer b/apps/pokertimer index f78041a206..bcfc295917 160000 --- a/apps/pokertimer +++ b/apps/pokertimer @@ -1 +1 @@ -Subproject commit f78041a20643d801ce4ab027effef23205e0050a +Subproject commit bcfc295917c6fc9faadf89e3bb718a0bf533905a From dac46fd46416eb9ce5af367b469348c125328b75 Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Wed, 6 Nov 2024 07:18:47 -0700 Subject: [PATCH 6/9] Revert "Added pokertimer" Apps can not be submodules, for good reasons. Reverting to re-add as a proper package. This reverts commit 39cd1c73d26da1886e03c1c1e7eb14a29f3aadd9. --- .gitmodules | 3 --- apps/pokertimer | 1 - 2 files changed, 4 deletions(-) delete mode 160000 apps/pokertimer diff --git a/.gitmodules b/.gitmodules index 5002b324b2..c2c1104c23 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "webtools"] path = webtools url = https://github.com/espruino/EspruinoWebTools.git -[submodule "apps/pokertimer"] - path = apps/pokertimer - url = https://gitea.gf4.pw/ki9/pokertimer.git diff --git a/apps/pokertimer b/apps/pokertimer deleted file mode 160000 index bcfc295917..0000000000 --- a/apps/pokertimer +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bcfc295917c6fc9faadf89e3bb718a0bf533905a From 30a349f3feb8bb757670b7d683f88e44b850b2bd Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Wed, 6 Nov 2024 07:25:14 -0700 Subject: [PATCH 7/9] Re-added pokertimer not as a submodule --- apps/pokertimer/ChangeLog | 1 + apps/pokertimer/LICENSE | 9 +++ apps/pokertimer/README.md | 32 +++++++++ apps/pokertimer/ROADMAP.md | 17 +++++ apps/pokertimer/app-icon.js | 1 + apps/pokertimer/app.img | Bin 0 -> 714 bytes apps/pokertimer/app.js | 124 ++++++++++++++++++++++++++++++++++ apps/pokertimer/app.png | Bin 0 -> 1132 bytes apps/pokertimer/metadata.json | 15 ++++ 9 files changed, 199 insertions(+) create mode 100644 apps/pokertimer/ChangeLog create mode 100644 apps/pokertimer/LICENSE create mode 100644 apps/pokertimer/README.md create mode 100644 apps/pokertimer/ROADMAP.md create mode 100644 apps/pokertimer/app-icon.js create mode 100644 apps/pokertimer/app.img create mode 100644 apps/pokertimer/app.js create mode 100644 apps/pokertimer/app.png create mode 100644 apps/pokertimer/metadata.json diff --git a/apps/pokertimer/ChangeLog b/apps/pokertimer/ChangeLog new file mode 100644 index 0000000000..642dbcc7ee --- /dev/null +++ b/apps/pokertimer/ChangeLog @@ -0,0 +1 @@ +0.0.1: Packaged app diff --git a/apps/pokertimer/LICENSE b/apps/pokertimer/LICENSE new file mode 100644 index 0000000000..a2bb2da017 --- /dev/null +++ b/apps/pokertimer/LICENSE @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright © 2024 Keith Irwin + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/apps/pokertimer/README.md b/apps/pokertimer/README.md new file mode 100644 index 0000000000..09aa2d6a14 --- /dev/null +++ b/apps/pokertimer/README.md @@ -0,0 +1,32 @@ +# Poker Timer + +A blinds timer for poker. Don't know what that means? See [Wikipedia: Blind (poker)](https://en.wikipedia.org/wiki/Blind_(poker)) and [Wikipedia: Texas hold 'em](https://en.wikipedia.org/wiki/Texas_hold_%27em). + +The blinds are hardcoded and go up every ten minutes: + +- 1, 2 +- 2, 4 +- 4, 8 +- 5, 10 +- 10, 20 +- 20, 40 +- 40, 80 + +... and so on, doubling each round. + +## Usage + +The timer will start as soon as you open the app. Time left in the round is on the top of the screen, currnt small and big blinds are shown below. After ten minutes, it will vibrate and flash and show the new blind. Then it starts over. + +## Controls + + - **Pause/Resume:** Press the button + - **Exit:** hold down the button. + +## Requests + +[Contact Keith Irwin](https://www.ki9.us/contact/) + +## Creator + +[Keith Irwin](https://www.ki9.us) diff --git a/apps/pokertimer/ROADMAP.md b/apps/pokertimer/ROADMAP.md new file mode 100644 index 0000000000..b182c5b386 --- /dev/null +++ b/apps/pokertimer/ROADMAP.md @@ -0,0 +1,17 @@ +# Roadmap + +## Bugs + +- Unlock before vibrate/flash + +## Improvements + +- Screenshots in README +- Start app paused +- Indicate when paused +- 20-second warning + +## Long-term projects + +- Set settings +- Better graphics diff --git a/apps/pokertimer/app-icon.js b/apps/pokertimer/app-icon.js new file mode 100644 index 0000000000..bf7227a801 --- /dev/null +++ b/apps/pokertimer/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("kso4cB7nW///7fWm2Vw8p7fOgH6lM6hEqgQCDkNCgmSpMkyUQqkEAQsJBYIOBkGohACD8dIiQaCpFBhUQAQVD+9qDQeQwWgkGCikg1lxknZBwUhgkooICCnMjpO1qIOBoUKwGCAQXt32TtMkwUkwkVgIdFg3SGQOBNYoCChuklfAgBQCPokqjdBluCNAJTBkN4UwVBm2C5ckxFBqEQq/+BYKMBtstz1JiBuC/+T2gjC7VYlmSkMFoFOQQON0mShO0iFNkhuC8iCBk4aBwdpFgNENwMOVgft1Ms9uiwNJLIM/VgWTxUFjdrtsUiUQ0NPXYe0qE27XRoLdC/wpCpxvBtuzpMiboX8DQXtQYPbtto0jdCm87zvOIwMh23YgDdBNwNBh/bYoL7BtuapDdE2VGWYMgw3brUpbocF/mcIYMIlu10WCpL4FihEB3PboBaBiFUGQOhAQcbqkgLQL1CdIYCBm2oIgNIru36VJkD+BboUgxMkyGcyOk1VIkGFboWhiRuBrHiqpBBIgUVboJEBoUf3dSK4IpBhUTtEiIgOEjlpGolBg3QoiuBJoZWCAQMN0kJFIIyCIIQCBkNb1JEBc4Ul2zKBAQW7qLzDBw7pBBYYCDwgpCoUEBYoCC0A7CBY4CCykooALIBwcRAoQ")) diff --git a/apps/pokertimer/app.img b/apps/pokertimer/app.img new file mode 100644 index 0000000000000000000000000000000000000000..e2e05ea17aef14d8efd6130ffe6d010ade2347b4 GIT binary patch literal 714 zcmb7?KTE?<6va;(trRIj1qG`RC4*9QYmwrRL7`C*ovo0;L7@TNT5xy;LEK7Eadhwl zbgBg%3WDI`Bt;2GR~`KV_1<^WKda&8a?kDWop+KnlX*76w{G`hK6|~C_dciF!MPo{ z|6B$1u4rRVA|+OlK2`|5Ib zY$f(P7@A_V9*EEOeN!QM<57#qa^*3)IT>r2U8A0Q33{Xdtb5 zH+I?)KB?H>uD%yV$6K0r5_h6akNsV1VpX(J*L=;~7EPak{RaU`nja3p{=7oJLF-HN ddcra+3onfJ?D5R-Alfb_bdWUtN`C;?`UC5bn?C>m literal 0 HcmV?d00001 diff --git a/apps/pokertimer/app.js b/apps/pokertimer/app.js new file mode 100644 index 0000000000..26b72c4811 --- /dev/null +++ b/apps/pokertimer/app.js @@ -0,0 +1,124 @@ +const BLIND_INTERVAL = 600; // 10 minutes +const BLINDSUP_ALERT_DURATION = 5000; // 30 seconds + +// Convert seconds to mm:ss +const secondsToMinutes = (s) => { + const mm = Math.floor(s/60); + const ss = s - mm * 60; + return `${mm}:${String(ss).padStart(2,'0')}`; +}; + +// Format screen +const fmtDark = () => { + g.clear(); + g.setFontAlign(0,0); + g.setBgColor(0,0.5,0); + g.setColor(1,1,1); +}; +const fmtLight = () => { + g.clear(); + g.setFontAlign(0,0); + g.setBgColor(0.5,1,0.5); + g.setColor(0,0,0); +}; + +// Start/stop/pause/resume timer +const startTimer = () => { + timer_running = true; tick(); + timer = setInterval(tick, 1000); +}; +const stopTimer = () => { + clearInterval(timer); + timer_running = false; +}; +const pauseResume = () => { + if (timer_running) stopTimer(); + else startTimer(); +}; + +// Calculate blinds for a round +const getBlinds = (i) => { + let small; + if (i===0) small = 1; + else if (i===1) small = 2; + else if (i===2) small = 4; + else small = 5*(Math.pow(2,(i-3))); + return [small, small*2]; +}; + +// Sound the alarm +const blindsUp = () => { + // Display message + const showMessage = () => { + g.clear(); + g.setFont('Vector',34); + g.drawString('Blinds Up!', + g.getWidth()/2, g.getHeight()/3); + g.setFont('Vector',40); + g.drawString(`${blinds[0]}/${blinds[1]}`, + g.getWidth()/2, g.getHeight()*2/3); + }; + stopTimer(); + // Increase blinds + b++; + // TODO: Kill program between round 25 and 26 + blinds = getBlinds(b); + console.log(`Blinds for round ${b} are ${blinds[0]} / ${blinds[1]}`); + // Buzz and light up every second + const buzzInterval = setInterval(() => { + Bangle.buzz(); + Bangle.setLCDPower(1); + }, 1000); + // Invert colors every second + fmtLight(); showMessage(); let dark = false; + const flashInterval = setInterval(() => { + if (dark) { + fmtLight(); + dark = false; + } else { + fmtDark(); + dark = true; + } showMessage(); + }, 500); + // Restart timer + setTimeout(() => { + fmtDark(); tick(); + clearInterval(buzzInterval); + clearInterval(flashInterval); + time_left = BLIND_INTERVAL + 1; + startTimer(); + }, BLINDSUP_ALERT_DURATION); +}; + +// Tick every second +const tick = () => { + if (!timer_running) return; + time_left--; + if (time_left<=0) blindsUp(); + else { + g.clear(); + g.setFont('Vector',40); + g.drawString( + secondsToMinutes(time_left), + g.getWidth()/2, g.getHeight()/3); + g.drawString( + `${blinds[0]}/${blinds[1]}`, + g.getWidth()/2, g.getHeight()*2/3); + } + return; +}; + +// button listener +Bangle.setUI({ + mode: 'custom', + btn: pauseResume, +}); + +// RUNTIME +fmtDark(); +let time_left = BLIND_INTERVAL + 1; +let b = 0; +let blinds = getBlinds(b); +let timer_running = true; +let timer = setInterval(tick, 1000); +tick(); diff --git a/apps/pokertimer/app.png b/apps/pokertimer/app.png new file mode 100644 index 0000000000000000000000000000000000000000..31a48dbb0a211500937af6a7bb7fc058d2f3164f GIT binary patch literal 1132 zcmV-y1e5!TP)Ic-y-^{?acbn_=_PT5Dl6#UTlbzX1p5M&P?Ch*0WtCM{afJvwjR*s~EMqz(*(p22 z>y|PF;9yG|JpAM`XlnIjCcyf4wm?q78Yr)PH}e1n10i_qnOrz;fyJpngX&Vy@}c>)0Uci-xLdILow z4_Xdz*yDp``Gq39?&Srm;mC2HX#nNNQ*gQZWf(tm8kna^fT-S|Mj%NPF1`BZ69uh@YwkT0Q4dN+-4a-eo=`jfP%GCPhO+7$0gzG>lT1A z&=dbY%ot7Y^+*EEeoK z#(2J^0LQ*R2@9WE5fhT{GNVh~{64p@D`|jVKYBeDfUvHV!Y2aY_H^}$my}g&)O(i%0$_B-ruPH@-%gnMon`>g+>J5q z0abm-c7V>l0a)~Ot^nX=r++XdfZsRf82>)wDThxMAgHL5`yk!LrRAdD48XO@JP3zJ z4HKB|upMBwK3BL1j?`|C+ZK*!jFx=w1D-uh-ky-g(v4>`6K}@A;0NLB3_a8J@5|R8_r8noIHZ8xdN9F#ATv z^fxnqDVflADV^j7m=_{iF5gv(qw*O5LRfo4N@s-#S-?MD$b@?NyKYSHWBTv#_|FeW ynWD3*dbf<#b%@X=nb1r8%gkJ7$|@@ Date: Wed, 6 Nov 2024 10:02:16 -0700 Subject: [PATCH 8/9] Bug fixes and upgrades to pokertimer --- apps/pokertimer/ChangeLog | 7 ++++- apps/pokertimer/README.md | 27 ++++++++++++++++-- apps/pokertimer/ROADMAP.md | 17 ----------- apps/pokertimer/app.img | Bin 714 -> 0 bytes apps/pokertimer/app.js | 26 ++++++++++++++--- apps/pokertimer/metadata.json | 6 ++-- .../screenshots/01_paused-start.png | Bin 0 -> 2820 bytes .../screenshots/02_counting-down.png | Bin 0 -> 3322 bytes apps/pokertimer/screenshots/03_blinds-up.png | Bin 0 -> 3551 bytes 9 files changed, 56 insertions(+), 27 deletions(-) delete mode 100644 apps/pokertimer/ROADMAP.md delete mode 100644 apps/pokertimer/app.img create mode 100644 apps/pokertimer/screenshots/01_paused-start.png create mode 100644 apps/pokertimer/screenshots/02_counting-down.png create mode 100644 apps/pokertimer/screenshots/03_blinds-up.png diff --git a/apps/pokertimer/ChangeLog b/apps/pokertimer/ChangeLog index 642dbcc7ee..ff87a17082 100644 --- a/apps/pokertimer/ChangeLog +++ b/apps/pokertimer/ChangeLog @@ -1 +1,6 @@ -0.0.1: Packaged app +0.06: Fix bug when play/pause during alert +0.05: Added screenshots +0.04: Added 20-second warning buzz +0.03: Start app with paused timer +0.02: Fix alert buzz time, Indicate when paused +0.01: Packaged app diff --git a/apps/pokertimer/README.md b/apps/pokertimer/README.md index 09aa2d6a14..ce8316def6 100644 --- a/apps/pokertimer/README.md +++ b/apps/pokertimer/README.md @@ -1,7 +1,12 @@ # Poker Timer +*v.0.06* A blinds timer for poker. Don't know what that means? See [Wikipedia: Blind (poker)](https://en.wikipedia.org/wiki/Blind_(poker)) and [Wikipedia: Texas hold 'em](https://en.wikipedia.org/wiki/Texas_hold_%27em). +![Screenshot showing countdown paused on start](screenshots/01_paused-start.png) +![Screenshot showing active countdown](screenshots/02_counting-down.png) +![Screenshot showing blinds up alert](screenshots/03_blinds-up.png) + The blinds are hardcoded and go up every ten minutes: - 1, 2 @@ -14,14 +19,32 @@ The blinds are hardcoded and go up every ten minutes: ... and so on, doubling each round. +## Features + +- Starts paused +- Button to pause/resume +- 20-second warning buzz +- Auto-exit after round 25 + ## Usage -The timer will start as soon as you open the app. Time left in the round is on the top of the screen, currnt small and big blinds are shown below. After ten minutes, it will vibrate and flash and show the new blind. Then it starts over. +The timer will start as soon as you open the app. Time left in the round is on the top of the screen, currnt small and big blinds are shown below. After ten minutes, it will vibrate and flash and show the new blind. Then it starts over. + +### Auto-exit + +The program will automatically exit after the 25 round. This is not a bug. If the blinds double again, it will perform some kind of overflow and convert the blind values to floats. + +The blinds in round 25 are `20971520 / 41943040`. You probably aren't still playing poker at that point and just forgot to exit the program. ## Controls - **Pause/Resume:** Press the button - - **Exit:** hold down the button. + - **Exit:** hold down the button + +## Roadmap + +- Set settings +- Better graphics ## Requests diff --git a/apps/pokertimer/ROADMAP.md b/apps/pokertimer/ROADMAP.md deleted file mode 100644 index b182c5b386..0000000000 --- a/apps/pokertimer/ROADMAP.md +++ /dev/null @@ -1,17 +0,0 @@ -# Roadmap - -## Bugs - -- Unlock before vibrate/flash - -## Improvements - -- Screenshots in README -- Start app paused -- Indicate when paused -- 20-second warning - -## Long-term projects - -- Set settings -- Better graphics diff --git a/apps/pokertimer/app.img b/apps/pokertimer/app.img deleted file mode 100644 index e2e05ea17aef14d8efd6130ffe6d010ade2347b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 714 zcmb7?KTE?<6va;(trRIj1qG`RC4*9QYmwrRL7`C*ovo0;L7@TNT5xy;LEK7Eadhwl zbgBg%3WDI`Bt;2GR~`KV_1<^WKda&8a?kDWop+KnlX*76w{G`hK6|~C_dciF!MPo{ z|6B$1u4rRVA|+OlK2`|5Ib zY$f(P7@A_V9*EEOeN!QM<57#qa^*3)IT>r2U8A0Q33{Xdtb5 zH+I?)KB?H>uD%yV$6K0r5_h6akNsV1VpX(J*L=;~7EPak{RaU`nja3p{=7oJLF-HN ddcra+3onfJ?D5R-Alfb_bdWUtN`C;?`UC5bn?C>m diff --git a/apps/pokertimer/app.js b/apps/pokertimer/app.js index 26b72c4811..9d584b3b2a 100644 --- a/apps/pokertimer/app.js +++ b/apps/pokertimer/app.js @@ -1,5 +1,5 @@ -const BLIND_INTERVAL = 600; // 10 minutes -const BLINDSUP_ALERT_DURATION = 5000; // 30 seconds +const BLIND_INTERVAL = 600; // 10 minutes in seconds +const BLINDSUP_ALERT_DURATION = 10000; // 10 seconds in ms // Convert seconds to mm:ss const secondsToMinutes = (s) => { @@ -32,7 +32,13 @@ const stopTimer = () => { timer_running = false; }; const pauseResume = () => { - if (timer_running) stopTimer(); + if (is_alerting) return; + if (timer_running) { + stopTimer(); + g.setFont('Vector',15); + g.drawString('(PAUSED)', + g.getWidth()/2, g.getHeight()*7/8); + } else startTimer(); }; @@ -48,6 +54,7 @@ const getBlinds = (i) => { // Sound the alarm const blindsUp = () => { + is_alerting = true; // Display message const showMessage = () => { g.clear(); @@ -66,7 +73,7 @@ const blindsUp = () => { console.log(`Blinds for round ${b} are ${blinds[0]} / ${blinds[1]}`); // Buzz and light up every second const buzzInterval = setInterval(() => { - Bangle.buzz(); + Bangle.buzz(500); Bangle.setLCDPower(1); }, 1000); // Invert colors every second @@ -82,6 +89,7 @@ const blindsUp = () => { }, 500); // Restart timer setTimeout(() => { + is_alerting = false; fmtDark(); tick(); clearInterval(buzzInterval); clearInterval(flashInterval); @@ -94,6 +102,13 @@ const blindsUp = () => { const tick = () => { if (!timer_running) return; time_left--; + // 20-second warning buzz + if (time_left==20) { + const buzzInterval = setInterval(Bangle.buzz, 500); + setTimeout(() => { + clearInterval(buzzInterval); + }, 5000); + } if (time_left<=0) blindsUp(); else { g.clear(); @@ -120,5 +135,8 @@ let time_left = BLIND_INTERVAL + 1; let b = 0; let blinds = getBlinds(b); let timer_running = true; +let is_alerting = false; let timer = setInterval(tick, 1000); tick(); +// Start paused +pauseResume(); diff --git a/apps/pokertimer/metadata.json b/apps/pokertimer/metadata.json index abdc6e81f2..a22229e4fb 100644 --- a/apps/pokertimer/metadata.json +++ b/apps/pokertimer/metadata.json @@ -4,12 +4,12 @@ "shortName":"Poker Timer", "readme":"README.md", "icon": "app.png", - "version":"0.0.1", + "version":"0.06", "description": "A blinds timer for use with Texas Hold 'Em", "tags": "poker", "supports": ["BANGLEJS2"], "storage": [ - {"name":"timer.app.js","url":"app.js"}, - {"name":"timer.img","url":"app-icon.js","evaluate":true} + {"name":"pokertimer.app.js","url":"app.js"}, + {"name":"pokertimer.img","url":"app-icon.js","evaluate":true} ] } diff --git a/apps/pokertimer/screenshots/01_paused-start.png b/apps/pokertimer/screenshots/01_paused-start.png new file mode 100644 index 0000000000000000000000000000000000000000..929bd473eb3314b795962c227087d047ca66b673 GIT binary patch literal 2820 zcmV+f3;XnmP)&smzif!h(Tb2cj(}Sz=M(p+xN9*gTN3N0^_0EFRBLz4$+d_jXeFnM6|z&)n3$KqW-5#P|_^Uw_hCJ2TO0TNe6Fa(Cctq5$t&vHi7V>zP<(GD%z{rEv(#5}Z^$wJ_%hn|rjFa(Cc zc*=PBQSa4$)bb!O1cty67y|bqGz5mgasmfDDV{6@SqQQay`~TD%ZGU&Fa(CckPs5~ zTF8ed@Yg4le*W|LKG8zH07;Pc^Yi2$kL3p)7I=4SuN8iwvk+&4xk~xrB(AIS_u=9l zELTBs7DT@S*Vyhz?e&5~NCM{u(<-W5`M;3w7&J%XNJM3wfg-inO5Ee`!x320*%ksz z%0CnE_Gi}M*^{S4ygz0K0g)rM*IT@y&PLM=rbR@W`_v|J3voq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6Sz8AI%!QK?zdjrW`NoOcJ(_jFB1I1e?8GZUhd#i^+5tizb5JX_dDB48l@=suEaQ zOs9Sf*9GZ{Rup&po*RMLyO_oezca2l0s?0UER+Ke-j{ke@VF{V~X_3gTQd2eY!B)NlCrL4+1YRk?AFt zkiP>0Bkh@a#GIeNqgH@GZkrXnRy%^gATS8bethUCmhB0Oe<}X9|3XAFi)g6-K;XW? zgKC12y`PIK^XI^=ITXG>Lma_ns3}2Ld0@X8`Fuowo!*TcHF38_kMQ3QSV8-vdGgsRMxzvo+|C^AL4?tMUHJOU3GhN3uoY&#}BTMh)ChrlCp%&|d5r=#rzMiCx4t0ZT& z9$`UX5O`*?w-eYpqHsSY(I?GeTm20JPe$P3%kZ)61p>Dc0N+=R81w{ Date: Wed, 6 Nov 2024 10:54:28 -0700 Subject: [PATCH 9/9] Fixed ChangeLog order --- apps/pokertimer/ChangeLog | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/pokertimer/ChangeLog b/apps/pokertimer/ChangeLog index ff87a17082..ceddbf5337 100644 --- a/apps/pokertimer/ChangeLog +++ b/apps/pokertimer/ChangeLog @@ -1,6 +1,6 @@ -0.06: Fix bug when play/pause during alert -0.05: Added screenshots -0.04: Added 20-second warning buzz -0.03: Start app with paused timer -0.02: Fix alert buzz time, Indicate when paused 0.01: Packaged app +0.02: Fix alert buzz time, Indicate when paused +0.03: Start app with paused timer +0.04: Added 20-second warning buzz +0.05: Added screenshots +0.06: Fix bug when play/pause during alert