- if (game.tasks.includes('MOVE')) {
- content += "[" + movement_keys_desc + "] – move player\n";
- }
- if (game.tasks.includes('PICK_UP')) {
- content += "[" + this.keys.take_thing + "] – pick up thing\n";
- }
- if (game.tasks.includes('DROP')) {
- content += "[" + this.keys.drop_thing + "] – drop thing\n";
- }
- content += "[" + tui.keys.teleport + "] – teleport\n";
- content += '\n';
- } else if (this.mode.name == 'study') {
- content += "Available actions:\n";
- content += '[' + movement_keys_desc + '] – move question mark\n';
- content += '[' + this.keys.toggle_map_mode + '] – toggle map view\n';
- content += '\n';
- } else if (this.mode.name == 'edit') {
- content += "Available actions:\n";
- if (game.tasks.includes('MOVE')) {
- content += "[" + movement_keys_desc + "] – move player\n";
- }
- if (game.tasks.includes('FLATTEN_SURROUNDINGS')) {
- content += "[" + tui.keys.flatten + "] – flatten surroundings\n";
- }
- content += '[' + this.keys.toggle_map_mode + '] – toggle map view\n';
- content += '\n';
- } else if (this.mode.name == 'control_tile_draw') {
- content += "Available actions:\n";
- content += "[" + tui.keys.toggle_tile_draw + "] – toggle protection character drawing\n";
- content += '\n';
- } else if (this.mode.name == 'chat') {
- content += '/nick NAME – re-name yourself to NAME\n';
- content += '/' + this.keys.switch_to_play + ' or /play – switch to play mode\n';
- content += '/' + this.keys.switch_to_study + ' or /study – switch to study mode\n';
- content += '/' + this.keys.switch_to_edit + ' or /edit – switch to world edit mode\n';
- content += '/' + this.keys.switch_to_admin_enter + ' or /admin – switch to admin mode\n';
- } else if (this.mode.name == 'admin') {
- content += "Available actions:\n";
- if (game.tasks.includes('MOVE')) {
- content += "[" + movement_keys_desc + "] – move player\n";
+ for (let action of this.mode.available_actions) {
+ if (Object.keys(this.action_tasks).includes(action)) {
+ if (!this.task_action_on(action)) {
+ continue;
+ }
+ }
+ if (action == 'move_explorer') {
+ action = 'move';
+ }
+ if (action == 'move') {
+ content += "[" + movement_keys_desc + "] – move\n"
+ } else {
+ content += "[" + this.keys[action] + "] – " + key_descriptions[action] + "\n";
+ }