diff --git a/client/src/components/game.jsx b/client/src/components/game.jsx index bc9f0ab1..a113c27c 100755 --- a/client/src/components/game.jsx +++ b/client/src/components/game.jsx @@ -1,6 +1,8 @@ const preact = require('preact'); const key = require('keymaster'); +const SKILL_HOT_KEYS = ['Q', 'W', 'E', 'R']; + function GamePanel(props) { const { game, @@ -36,8 +38,23 @@ function GamePanel(props) { }); function PlayerCrypCard(cryp) { - key.unbind('q'); - key('q', () => setActiveSkill(cryp.id, 'Attack')); + const skills = cryp.skills.map((skill, i) => { + const hotkey = SKILL_HOT_KEYS[i]; + key.unbind(hotkey); + key(hotkey, () => setActiveSkill(cryp.id, skill.skill)); + + return ( + + ); + }); + if (activeIncoming) console.log('should be a pointer'); return (