let chunk = "";
for (let i = 0, x = 0; i < msg.length; i++, x++) {
if (x >= line_length) {
- chat.history.unshift(' '.repeat(indent) + chunk);
- chunk = "";
+ chat.history.unshift(' '.repeat(indent) + chunk);
+ chunk = "";
x = 0;
};
chunk += msg[i];
tui.log_msg("/login USER - register as USER", 3);
tui.log_msg("/msg USER TEXT - send TEXT to USER", 3);
tui.log_msg("/help - show this help", 3);
- tui.log_msg("/play - switch to game mode", 3);
+ tui.log_msg("/play - switch to play mode", 3);
tui.log_msg("");
- tui.log_msg("map mode commands:", 1);
+ tui.log_msg("play mode commands:", 1);
tui.log_msg("w, a, s, d - move avatar", 3);
tui.log_msg("f - flatten surroundings", 3);
tui.log_msg("e - write following ASCII character", 3);
tui.log_msg("c - switch to chat mode", 3);
+ tui.log_msg("? - switch to explore mode", 3);
tui.log_msg("");
+ tui.log_msg("explore mode commands:", 1);
+ tui.log_msg("w, a, s, d - move question mark", 3);
+ tui.log_msg("c - switch to chat mode", 3);
+ tui.log_msg("p - switch to play mode", 3);
+ tui.log_msg("");
+ },
+ draw_info: function() {
+ terminal.drawBox(0, terminal.cols / 2, terminal.rows, terminal.cols / 2);
+ let lines = ['unfinished info screen'];
+ for (let y = 0, i = 0; y < terminal.rows && i < lines.length; y++, i++) {
+ terminal.write(y, terminal.cols / 2, lines[i]);
+ }
},
full_refresh: function() {
this.draw_map();
&& !(try_pos[1] >= game.map_size[1])) {
this.position = try_pos;
tui.draw_map();
+ tui.draw_info();
tui.refresh();
}
}