diff options
author | David Gay <david@davidgay.org> | 2021-06-03 22:03:16 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-06-03 22:03:16 -0400 |
commit | a02cf6d28a28d312b8a4a8e8feb40eb03289a090 (patch) | |
tree | d1ae91742d5df9b40810ff78981334ca68016b07 | |
parent | 25c9a1650e7dd9b302b1d47e4a33721d759c44b7 (diff) |
Timer: Improve accuracy/feel by starting to count down immediately (before this, there was an uncomfortable delay)
-rw-r--r-- | CHANGELOG.md | 8 | ||||
-rw-r--r-- | app/javascript/controllers/timer_controller.js | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d2fe44..7cf093a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,20 +10,22 @@ amenities, etc that are added unless they are special in some way. - Current activity, timer, results, and conditions (boons & banes) are now always visible. Most are located in a new box above the chat, while the results output is now in a new box below the main box. - When performing a beastslay activity, current and max wounds will be displayed as well. -- You can now see your resting status and toggle rest in the new timer box when you aren't performing an activity. - Spicework has been implemented. You can now craft food and drugs in your hearth, once you build a spicebench. A character can only have one food condition and one drink condition at a time. If a second food or drink condition is gained, the old one is lost. There is no limit to the number of drug conditions a character can have at once. - New hearth amenities: spicebench level 1, spicebench level 2 - New items: bluster powder, mudtub mash, midoras spice, midoras mudtub mash - New title: Aspirant, gained by reaching 100 total level +- You can now see your resting status and toggle rest in the new timer box when you aren't performing an activity. ### Changed +- Improved accuracy and feel of timer. It now starts counting down immediately, whereas before there was an + uncomfortable delay. +- Bazaar no longer displays your orders under "Buy Orders" or "Sell Orders". Now your own orders are only visible + in the "Your Orders" section. - Remaining duration of conditions and accumulated rested time are now expressed in "human" terms instead of seconds. - Blank line is now added to beginning of combat results instead of end, since it means more of the most-recent combat results can be visible when the box has a scroll bar. -- Bazaar no longer displays your orders under "Buy Orders" or "Sell Orders". Now your own orders are only visible - in the "Your Orders" section. - Character view: Reduced text size of headings. - Bazaar view: Reduced size (width) of number fields. diff --git a/app/javascript/controllers/timer_controller.js b/app/javascript/controllers/timer_controller.js index 5190a79..901ec0a 100644 --- a/app/javascript/controllers/timer_controller.js +++ b/app/javascript/controllers/timer_controller.js @@ -32,10 +32,11 @@ export default class extends Controller { return; } + if (controller.counter > 0) controller.counter--; + if (controller.counter > 0) { controller.timerTarget.textContent = controller.counter.toString(); - controller.counter--; - } else if (this.counter <= 0) { + } else { Rails.ajax({ type: "POST", url: controller.postUrlValue, |