el.disabled = true;
}
document.getElementById("help").disabled = false;
- if (this.mode.name == 'play' || this.mode.name == 'study' || this.mode.name == 'control_tile_draw' || this.mode.name == 'edit') {
+ if (this.mode.name == 'play' || this.mode.name == 'study' || this.mode.name == 'control_tile_draw' || this.mode.name == 'edit' || this.mode.name == 'admin') {
for (const move_key of document.querySelectorAll('[id^="move_"]')) {
move_key.disabled = false;
}
content += '/' + this.keys.switch_to_study + ' or /study – switch to study mode\n';
content += '/' + this.keys.switch_to_edit + ' or /edit – switch to map 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";
+ }
+ content += '\n';
}
content += this.mode.list_available_modes();
let start_x = 0;
} else if (tui.mode.name == 'admin') {
if (tui.mode.mode_switch_on_key(event)) {
null;
+ } else if (event.key in tui.movement_keys
+ && game.tasks.includes('MOVE')) {
+ server.send(['TASK:MOVE', tui.movement_keys[event.key]]);
};
} else if (tui.mode.name == 'edit') {
if (tui.mode.mode_switch_on_key(event)) {
content += '/%s or /study – switch to study mode\n' % self.keys['switch_to_study']
content += '/%s or /edit – switch to map edit mode\n' % self.keys['switch_to_edit']
content += '/%s or /admin – switch to admin mode\n' % self.keys['switch_to_admin_enter']
+ elif self.mode.name == 'admin':
+ content += "Available actions:\n"
+ if 'MOVE' in self.game.tasks:
+ content += "[%s] – move player\n" % ','.join(self.movement_keys)
+ content += '\n'
content += self.mode.list_available_modes(self)
for i in range(self.size.y):
safe_addstr(i,
elif self.mode.name == 'admin':
if self.mode.mode_switch_on_key(self, key):
continue
+ elif key in self.movement_keys and 'MOVE' in self.game.tasks:
+ self.send('TASK:MOVE ' + self.movement_keys[key])
elif self.mode.name == 'edit':
if self.mode.mode_switch_on_key(self, key):
continue