UICurse.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:rogueinabox 作者: rogueinabox 项目源码 文件源码
def draw_log(self, string):
        """Draw some logs on the screen"""
        if self.logpad is not None and not self.rb.game_over():
            limit = curses.LINES - self.startlog - 3
            self.logpad.addstr(0, 0, "  LOGS")
            self.logpad.hline(1,0, "-", curses.COLS - 1)
            self.logpad.hline(limit + 1,0, "-", curses.COLS - 1)
            if self.loglines > limit:
                self.logpad.move(2, 0)
                self.logpad.deleteln()
                self.logpad.move(self.loglines - 1, 0)
                self.logpad.clrtoeol()
                self.logpad.addstr(self.loglines - 1, 0, string)
                self.logpad.hline(limit + 1,0, "-", curses.COLS - 1)
            else:
                self.logpad.addstr(self.loglines, 0, string)
            if self.loglines <= limit:
                self.loglines += 1
            self.logpad.refresh(0,0, self.startlog, 0, curses.LINES - 1, curses.COLS - 1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号