X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/balance2?a=blobdiff_plain;f=rogue_chat.html;h=0bb8c43413e495fbf3d9f01eac52121c934bc882;hb=a595b17ad67ad065a35e14f66773c2eaace0fa8c;hp=5a55f3bd1d01254e7531b03762d83508baea4739;hpb=01b6b1da2a94fe26d1ad44348afb133edcd2a273;p=plomrogue2 diff --git a/rogue_chat.html b/rogue_chat.html index 5a55f3b..0bb8c43 100644 --- a/rogue_chat.html +++ b/rogue_chat.html @@ -541,6 +541,7 @@ let server = { tui.log_msg('# ' + tokens[1], 1); } else if (tokens[0] === 'CHATFACE') { tui.draw_face = tokens[1]; + tui.full_refresh(); } else if (tokens[0] === 'REPLY') { tui.log_msg('#MUSICPLAYER: ' + tokens[1], 1); } else if (tokens[0] === 'PLAYER_ID') { @@ -771,12 +772,13 @@ let tui = { function fail(msg, return_mode) { tui.log_msg('? ' + msg); terminal.blink_screen(); - this.switch_mode(return_mode); + tui.switch_mode(return_mode); } if (this.mode && this.mode.name == 'control_tile_draw') { tui.log_msg('@ finished tile protection drawing.') } + this.draw_face = false; this.tile_draw = false; if (mode_name == 'command_thing' && (!game.player.carrying || !game.player.carrying.commandable)) { @@ -1132,24 +1134,29 @@ let tui = { }, draw_face_popup: function() { const t = game.things[this.draw_face]; - if (!t) { + if (!t || !t.face) { this.draw_face = false; return; } + const start_x = tui.window_width - 10; + let t_char = ' '; + if (t.thing_char) { + t_char = t.thing_char; + } function draw_body_part(body_part, end_y) { - const start_x = tui.window_width - 10; - terminal.write(end_y - 4, start_x, '+--------+'); + terminal.write(end_y - 4, start_x, ' _[ @' + t_char + ' ]_ '); terminal.write(end_y - 3, start_x, '| |'); terminal.write(end_y - 2, start_x, '| ' + body_part.slice(0, 6) + ' |'); terminal.write(end_y - 1, start_x, '| ' + body_part.slice(6, 12) + ' |'); terminal.write(end_y, start_x, '| ' + body_part.slice(12, 18) + ' |'); } if (t.face) { - draw_body_part(t.face, terminal.rows - 1); + draw_body_part(t.face, terminal.rows - 2); } if (t.hat) { - draw_body_part(t.hat, terminal.rows - 4); + draw_body_part(t.hat, terminal.rows - 5); } + terminal.write(terminal.rows - 1, start_x, '| |'); }, draw_mode_line: function() { let help = 'hit [' + this.keys.help + '] for help'; @@ -1502,7 +1509,6 @@ document.onclick = function() { }; tui.inputEl.addEventListener('keydown', (event) => { tui.show_help = false; - tui.draw_face = false; if (event.key == 'Enter') { event.preventDefault(); }