Fix being unable to click the CC2 action buttons more than once

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-08 11:24:59 -07:00
parent 6d39fd3831
commit 9735ef93e9

View File

@ -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 => {