- chunk += msg[i];
- }
- lines.unshift(chunk);
- return lines;
- },
- log_msg: function(msg) {
- let line_length = (terminal.cols / 2);
- let chunk = "";
- this.log = this.msg_into_lines_of_width(msg, terminal.cols / 2).concat(this.log);
- while (this.log.length > terminal.rows - 2) {
- this.log.pop();
- };
- this.draw_history();
- },
- refresh: function() {
- terminal.refresh();
- },
- log_help: function() {
- tui.log_msg("");
- tui.log_msg("HELP");
- tui.log_msg("");
- tui.log_msg("chat mode commands:");
- tui.log_msg("/login USER - register as USER");
- tui.log_msg("/msg USER TEXT - send TEXT to USER");
- tui.log_msg("/help - show this help");
- tui.log_msg("/play or /p - switch to play mode");
- tui.log_msg("/study or /s - switch to study mode");
- tui.log_msg("");
- tui.log_msg("play mode commands:");
- tui.log_msg("w, a, s, d - move avatar");
- tui.log_msg("f - flatten surroundings");
- tui.log_msg("e - write following ASCII character");
- tui.log_msg("c - switch to chat mode");
- tui.log_msg("? - switch to study mode");
- tui.log_msg("");
- tui.log_msg("study mode commands:");
- tui.log_msg("w, a, s, d - move question mark");
- tui.log_msg("A - annotate terrain");
- tui.log_msg("c - switch to chat mode");
- tui.log_msg("p - switch to play mode");
- tui.log_msg("");
+ for (let y = terminal.rows - 1 - this.height_input,
+ i = log_display_lines.length - 1;
+ y >= this.height_header && i >= 0;
+ y--, i--) {
+ terminal.write(y, this.window_width, log_display_lines[i]);
+ }