},
log_msg: function(msg) {
this.log.push(msg);
- while (this.log.length > terminal.rows * 4) {
+ while (this.log.length > 100) {
this.log.shift();
};
this.full_refresh();
},
draw_input: function() {
if (this.mode.has_input_prompt) {
- for (let y = terminal.rows - this.height_input, i = 0; y < terminal.rows && i < this.input_lines.length; y++, i++) {
+ for (let y = terminal.rows - this.height_input, i = 0; i < this.input_lines.length; y++, i++) {
terminal.write(y, this.window_width, this.input_lines[i]);
}
}
},
get_info: function() {
let info = "";
+ let position_i = this.position[0] * game.map_size[1] + this.position[1];
+ info += "TERRAIN: " + game.map[position_i] + "\n";
for (let t_id in game.things) {
let t = game.things[t_id];
if (t.position[0] == this.position[0] && t.position[1] == this.position[1]) {
- info += "PLAYER";
+ info += "PLAYER @";
if (t.name_) {
- info += " " + t.name_;
+ info += ": " + t.name_;
}
info += "\n";
}
tui.inputEl.addEventListener('input', (event) => {
if (tui.mode.has_input_prompt) {
- let max_length = tui.window_width * terminal.rows - tui.input_prompt.length;
+ let max_length = tui.window_width * terminal.rows - tui.input_prompt.length;
if (tui.inputEl.value.length > max_length) {
tui.inputEl.value = tui.inputEl.value.slice(0, max_length);
};