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>
- <td><button id="hex_move_upright">up-right</button></td>
+ <td style="text-align: right"><button id="hex_move_upleft"></button></td>
+ <td style="text-align: center"><button id="square_move_up"></button></td>
+ <td><button id="hex_move_upright"></button></td>
</tr>
<tr>
- <td style="text-align: right;"><button id="square_move_left">left</button><button id="hex_move_left">left</button></td>
+ <td style="text-align: right;"><button id="square_move_left"></button><button id="hex_move_left">left</button></td>
<td stlye="text-align: center;">move</td>
- <td><button id="square_move_right">right</button><button id="hex_move_right">right</button></td>
+ <td><button id="square_move_right"></button><button id="hex_move_right"></button></td>
</tr>
<tr>
- <td><button id="hex_move_downleft">down-left</button></td>
- <td style="text-align: center"><button id="square_move_down">down</button></td>
- <td><button id="hex_move_downright">down-right</button></td>
+ <td><button id="hex_move_downleft"></button></td>
+ <td style="text-align: center"><button id="square_move_down"></button></td>
+ <td><button id="hex_move_downright"></button></td>
</tr>
</table>
<table>
<tr>
- <td><button id="help">help</button></td>
+ <td><button id="help"></button></td>
</tr>
<tr>
- <td><button id="switch_to_chat">chat mode</button><br /></td>
+ <td><button id="switch_to_chat"></button><br /></td>
</tr>
<tr>
- <td><button id="switch_to_study">study mode</button></td>
- <td><button id="toggle_map_mode">toggle map view</button>
+ <td><button id="switch_to_study"></button></td>
+ <td><button id="toggle_map_mode"></button>
</tr>
<tr>
- <td><button id="switch_to_play">play mode</button></td>
+ <td><button id="switch_to_play"></button></td>
<td>
- <button id="take_thing">pick up thing</button>
- <button id="drop_thing">drop thing</button>
- <button id="teleport">teleport</button>
+ <button id="take_thing"></button>
+ <button id="drop_thing"></button>
+ <button id="teleport"></button>
</td>
</tr>
<tr>
- <td><button id="switch_to_edit">world edit mode</button></td>
+ <td><button id="switch_to_edit"></button></td>
<td>
- <button id="switch_to_write">change terrain</button>
- <button id="flatten">flatten surroundings</button>
- <button id="switch_to_annotate">annotate tile</button>
- <button id="switch_to_portal">edit portal</button>
- <button id="switch_to_name_thing">name thing</button>
- <button id="switch_to_password">enter world edit password</button>
+ <button id="switch_to_write"></button>
+ <button id="flatten"></button>
+ <button id="switch_to_annotate"></button>
+ <button id="switch_to_portal"></button>
+ <button id="switch_to_name_thing"></button>
+ <button id="switch_to_password"></button>
</td>
</tr>
<tr>
- <td><button id="switch_to_admin_enter">admin mode</button></td>
+ <td><button id="switch_to_admin_enter"></button></td>
<td>
- <button id="switch_to_control_pw_type">change protection character password</button>
- <button id="switch_to_control_tile_type">change protection areas</button>
- <button id="switch_to_admin_thing_protect">change thing protection</button>
- <button id="toggle_tile_draw">toggle protection character drawing</button>
+ <button id="switch_to_control_pw_type"></button>
+ <button id="switch_to_control_tile_type"></button>
+ <button id="switch_to_admin_thing_protect"></button>
+ <button id="toggle_tile_draw"></button>
</td>
<tr>
</tr>
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();
}
};
for (const move_button of document.querySelectorAll('[id*="_move_"]')) {
+ if (move_button.id.startsWith('key_')) {
+ continue;
+ }
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")) {