X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/balance?a=blobdiff_plain;f=rogue_chat_nocanvas_monochrome.html;h=863495981002fd43669d341845b66111da9585de;hb=68ba631d7af62a416da8ff487534ec27b6a2d5c3;hp=60418718fb57b9fb8a2535b85f6a46ce70c1cf8b;hpb=72ed6e85260b57ab7ca7cd14363a9a9eb13e6461;p=plomrogue2 diff --git a/rogue_chat_nocanvas_monochrome.html b/rogue_chat_nocanvas_monochrome.html index 6041871..8634959 100644 --- a/rogue_chat_nocanvas_monochrome.html +++ b/rogue_chat_nocanvas_monochrome.html @@ -355,13 +355,8 @@ let tui = { } this.mode = mode; this.empty_input(); - if (mode == mode_annotate && explorer.position in explorer.info_db) { - let info = explorer.info_db[explorer.position]; - if (info != "(none)") { - this.inputEl.value = info; - this.recalc_input_lines(); - } - } else if (mode == mode_login) { + this.restore_input_values(); + if (mode == mode_login) { if (this.login_name) { server.send(['LOGIN', this.login_name]); } else { @@ -369,19 +364,28 @@ let tui = { } } else if (mode == mode_edit) { this.show_help = true; - } else if (mode == mode_portal && explorer.position in game.portals) { - let portal = game.portals[explorer.position] - this.inputEl.value = portal; - this.recalc_input_lines(); - } else if (mode == mode_password) { - this.inputEl.value = this.password; - this.recalc_input_lines(); } else if (mode == mode_teleport) { tui.log_msg("@ May teleport to: " + tui.teleport_target); tui.log_msg("@ Enter 'YES!' to entusiastically affirm."); } this.full_refresh(); }, + restore_input_values: function() { + if (this.mode == mode_annotate && explorer.position in explorer.info_db) { + let info = explorer.info_db[explorer.position]; + if (info != "(none)") { + this.inputEl.value = info; + this.recalc_input_lines(); + } + } else if (this.mode == mode_portal && explorer.position in game.portals) { + let portal = game.portals[explorer.position] + this.inputEl.value = portal; + this.recalc_input_lines(); + } else if (this.mode == mode_password) { + this.inputEl.value = this.password; + this.recalc_input_lines(); + } + }, empty_input: function(str) { this.inputEl.value = ""; if (this.mode.has_input_prompt) { @@ -743,6 +747,7 @@ tui.inputEl.addEventListener('keydown', (event) => { if (tui.mode.has_input_prompt && event.key == 'Enter' && tui.inputEl.value == '/help') { tui.show_help = true; tui.empty_input(); + tui.restore_input_values(); tui.full_refresh(); } else if (!tui.mode.has_input_prompt && event.key == tui.keys.help) { tui.show_help = true;