From 9735ef93e9ef5eed3f017617dbaff710e674d41d Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Tue, 8 Dec 2020 11:24:59 -0700 Subject: [PATCH] Fix being unable to click the CC2 action buttons more than once --- js/main.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/main.js b/js/main.js index 0333dfc..0253395 100644 --- a/js/main.js +++ b/js/main.js @@ -380,15 +380,20 @@ class Player extends PrimaryView { // TODO do these need buttons?? feel like they're not discoverable otherwise this.drop_button = this.root.querySelector('.actions .action-drop'); this.drop_button.addEventListener('click', ev => { - this.current_keys.add('q'); + // Use the set of "buttons pressed between tics" because it's cleared automatically; + // otherwise these will stick around forever + this.current_keys_new.add('q'); + ev.target.blur(); }); this.cycle_button = this.root.querySelector('.actions .action-cycle'); this.cycle_button.addEventListener('click', ev => { - this.current_keys.add('e'); + this.current_keys_new.add('e'); + ev.target.blur(); }); this.swap_button = this.root.querySelector('.actions .action-swap'); this.swap_button.addEventListener('click', ev => { - this.current_keys.add('c'); + this.current_keys_new.add('c'); + ev.target.blur(); }); // Demo playback this.root.querySelector('.demo-controls .demo-play').addEventListener('click', ev => {