X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=rogue_chat_curses.py;h=6bd662be7c6873b20303fa7c3474d18d2efd9a06;hb=a595b17ad67ad065a35e14f66773c2eaace0fa8c;hp=7d2a3b163b0d3a05f4c0a24ffe1f2e3b2b67d95a;hpb=01b6b1da2a94fe26d1ad44348afb133edcd2a273;p=plomrogue2 diff --git a/rogue_chat_curses.py b/rogue_chat_curses.py index 7d2a3b1..6bd662b 100755 --- a/rogue_chat_curses.py +++ b/rogue_chat_curses.py @@ -202,6 +202,7 @@ cmd_CHAT.argtypes = 'string' def cmd_CHATFACE(game, thing_id): game.tui.draw_face = thing_id + game.tui.do_refresh = True cmd_CHATFACE.argtypes = 'int:pos' def cmd_PLAYER_ID(game, player_id): @@ -548,7 +549,6 @@ class TUI: self.fov = '' self.flash = False self.map_lines = [] - self.draw_face = False self.offset = YX(0,0) curses.wrapper(self.loop) @@ -643,6 +643,7 @@ class TUI: if self.mode and self.mode.name == 'control_tile_draw': self.log_msg('@ finished tile protection drawing.') + self.draw_face = False self.tile_draw = False if mode_name == 'command_thing' and\ (not self.game.player.carrying or @@ -965,22 +966,26 @@ class TUI: def draw_face_popup(): t = self.game.get_thing(self.draw_face) - if not t: + if not t or not hasattr(t, 'face'): self.draw_face = False return + start_x = self.window_width - 10 + t_char = ' ' + if hasattr(t, 'thing_char'): + t_char = t.thing_char def draw_body_part(body_part, end_y): - start_x = self.window_width - 10 - safe_addstr(end_y - 4, start_x, '+--------+') + safe_addstr(end_y - 4, start_x, ' _[ @' + t_char + ' ]_ ') safe_addstr(end_y - 3, start_x, '| |') safe_addstr(end_y - 2, start_x, '| ' + body_part[0:6] + ' |') safe_addstr(end_y - 1, start_x, '| ' + body_part[6:12] + ' |') safe_addstr(end_y, start_x, '| ' + body_part[12:18] + ' |') if hasattr(t, 'face'): - draw_body_part(t.face, self.size.y - 1) + draw_body_part(t.face, self.size.y - 2) if hasattr(t, 'hat'): - draw_body_part(t.hat, self.size.y - 4) + draw_body_part(t.hat, self.size.y - 5) + safe_addstr(self.size.y - 1, start_x, '| |') def draw_help(): content = "%s help\n\n%s\n\n" % (self.mode.short_desc,