keyboard input/control: <span id="keyboard_control"></span>
</div>
<h3>button controls for mouse players</h3>
-<table style="float: left">
+<table id="move_table" style="float: left">
<tr>
<td style="text-align: right"><button id="hex_move_upleft">up-left</button></td>
<td style="text-align: center"><button id="square_move_up">up</button></td>
this.init_keys();
},
init_keys: function() {
+ document.getElementById("move_table").hidden = true;
this.keys = {};
for (let key_selector of key_selectors) {
this.keys[key_selector.id.slice(4)] = key_selector.value;
}
this.movement_keys = {};
- if (!game.map_geometry) {
- return;
+ let geometry_prefix = 'undefinedMapGeometry_';
+ if (game.map_geometry) {
+ geometry_prefix = game.map_geometry.toLowerCase() + '_';
}
- let geometry_prefix = game.map_geometry.toLowerCase() + '_';
for (const key_name of Object.keys(key_descriptions)) {
if (key_name.startsWith(geometry_prefix)) {
let direction = key_name.split('_')[2].toUpperCase();
move_button.hidden = true;
};
for (const move_button of document.querySelectorAll('[id^="' + geometry_prefix + 'move_"]')) {
+ document.getElementById("move_table").hidden = false;
move_button.hidden = false;
};
for (let el of document.getElementsByTagName("button")) {