- init_wasd: function() {
- if (wasd_selector.value == 'w, a, s, d') {
- tui.key_up = 'w';
- tui.key_down = 's';
- tui.key_left = 'a';
- tui.key_right = 'd';
- } else if (wasd_selector.value == 'arrow keys') {
- tui.key_up = 'ArrowUp';
- tui.key_down = 'ArrowDown';
- tui.key_left = 'ArrowLeft';
- tui.key_right = 'ArrowRight';
+ init_keys: function() {
+ this.keys = {
+ switch_to_chat: key_switch_to_chat_selector.value,
+ switch_to_play: key_switch_to_play_selector.value,
+ switch_to_annotate: key_switch_to_annotate_selector.value,
+ switch_to_portal: key_switch_to_portal_selector.value,
+ switch_to_study: key_switch_to_study_selector.value,
+ switch_to_edit: key_switch_to_edit_selector.value,
+ flatten: key_flatten_selector.value,
+ hex_move_upleft: key_hex_move_upleft_selector.value,
+ hex_move_upright: key_hex_move_upright_selector.value,
+ hex_move_right: key_hex_move_right_selector.value,
+ hex_move_downright: key_hex_move_downright_selector.value,
+ hex_move_downleft: key_hex_move_downleft_selector.value,
+ hex_move_left: key_hex_move_left_selector.value,
+ square_move_up: key_square_move_up_selector.value,
+ square_move_left: key_square_move_left_selector.value,
+ square_move_down: key_square_move_down_selector.value,
+ square_move_right: key_square_move_right_selector.value,
+ }
+ if (game.map_geometry == 'Square') {
+ this.movement_keys = {
+ [this.keys.square_move_up]: 'UP',
+ [this.keys.square_move_left]: 'LEFT',
+ [this.keys.square_move_down]: 'DOWN',
+ [this.keys.square_move_right]: 'RIGHT'
+ };
+ } else if (game.map_geometry == 'Hex') {
+ this.movement_keys = {
+ [this.keys.hex_move_upleft]: 'UPLEFT',
+ [this.keys.hex_move_upright]: 'UPRIGHT',
+ [this.keys.hex_move_right]: 'RIGHT',
+ [this.keys.hex_move_downright]: 'DOWNRIGHT',
+ [this.keys.hex_move_downleft]: 'DOWNLEFT',
+ [this.keys.hex_move_left]: 'LEFT'
+ };