X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/static/git-favicon.png?a=blobdiff_plain;f=new2%2Frogue_chat_nocanvas_monochrome.html;h=43c7ce85d5f87823976a5a2ecdbffbcbfa3a3d64;hb=c528fe926c6cbca9802e88d143e2d5a1a9f98822;hp=14668eaa6c015e1b3e5c483c16600f007d53c63d;hpb=8a8eb0967bcffcb934a37ecc5846f007268a0dc8;p=plomrogue2-experiments diff --git a/new2/rogue_chat_nocanvas_monochrome.html b/new2/rogue_chat_nocanvas_monochrome.html index 14668ea..43c7ce8 100644 --- a/new2/rogue_chat_nocanvas_monochrome.html +++ b/new2/rogue_chat_nocanvas_monochrome.html @@ -161,6 +161,7 @@ let tui = { explorer.position = game.things[game.player_id]; } this.mode = mode_name; + this.empty_input(); this.full_refresh(); }, draw_history: function() { @@ -168,7 +169,6 @@ let tui = { return; } terminal.drawBox(this.height_turn_line, this.window_width, terminal.rows - this.height_turn_line - this.height_input, this.window_width); - console.log(this.log); for (let y = terminal.rows - this.height_input - this.height_turn_line, i = this.log.length - 1; y >= this.height_turn_line && i >= 0; @@ -220,7 +220,11 @@ let tui = { }, empty_input: function(str) { this.input = ""; - this.recalc_input_lines(); + if (this.mode == 'annotate' || this.mode == 'chat') { + this.recalc_input_lines(); + } else { + this.height_input = 0; + } }, add_to_input: function(str) { if (this.input.length + str.length > this.window_width * terminal.rows) { @@ -234,10 +238,8 @@ let tui = { this.height_input = this.input_lines.length; }, shorten_input: function() { - if (this.input.length > 2) { - this.input = tui.input.slice(0, -1); - this.recalc_input_lines(); - } + this.input = tui.input.slice(0, -1); + this.recalc_input_lines(); }, draw_input: function() { terminal.drawBox(terminal.rows - this.height_input, this.window_width, this.height_input, this.window_width); @@ -264,7 +266,7 @@ let tui = { log_msg: function(msg) { let lines = this.msg_into_lines_of_width(msg, this.window_width); this.log = this.log.concat(lines); - while (this.log.length > terminal.rows - 2) { + while (this.log.length > terminal.rows) { this.log.shift(); }; this.draw_history(); @@ -531,7 +533,6 @@ document.addEventListener('keydown', (event) => { tui.full_refresh(); } else if (event.key == 'Enter') { explorer.annotate(tui.input); - tui.empty_input(); tui.switch_mode('study', true); } }