this.mode_admin.available_modes = ["admin_thing_protect", "control_pw_type",
"control_tile_type", "chat",
"study", "play", "edit"]
- this.mode_admin.available_actions = ["move"];
+ this.mode_admin.available_actions = ["move", "toggle_map_mode"];
this.mode_control_tile_draw.available_modes = ["admin_enter"]
this.mode_control_tile_draw.available_actions = ["toggle_tile_draw"];
this.mode_edit.available_modes = ["write", "annotate", "portal", "name_thing",
|| !game.player.carrying.commandable)) {
return fail('not carrying anything commandable');
} else if (mode_name == 'name_thing' && !game.player.carrying) {
- return fail('not carrying anything to re-name');
+ return fail('not carrying anything to re-name', 'edit');
} else if (mode_name == 'admin_thing_protect' && !game.player.carrying) {
return fail('not carrying anything to protect')
} else if (mode_name == 'take_thing' && game.player.carrying) {
this.switch_mode('play');
},
enter_ascii_art: function(command) {
- if (this.inputEl.value.length != 6) {
- this.log_msg('? wrong input length, must be 6; try again');
+ if (this.inputEl.value.length > 6) {
+ this.log_msg('? wrong input length, must be max 6; try again');
return;
+ } else if (this.inputEl.value.length < 6) {
+ while (this.inputEl.value.length < 6) {
+ this.inputEl.value += ' ';
+ }
}
this.log_msg(' ' + this.inputEl.value);
this.full_ascii_draw += this.inputEl.value;
} else if (tui.mode.name == 'admin') {
if (tui.mode.mode_switch_on_key(event)) {
null;
+ } else if (event.key == tui.keys.toggle_map_mode) {
+ tui.toggle_map_mode();
} else if (event.key in tui.movement_keys && tui.task_action_on('move')) {
server.send(['TASK:MOVE', tui.movement_keys[event.key]]);
};
}, 1000);
window.setInterval(function() {
if (document.activeElement.tagName.toLowerCase() != 'input') {
+ const scroll_x = window.scrollX;
+ const scroll_y = window.scrollY;
tui.inputEl.focus();
+ window.scrollTo(scroll_x, scroll_y);
};
}, 100);
document.getElementById("help").onclick = function() {