def print_char(self, char, color_code, row=None, col=None):
"""
Print one char to the screen with coloration.
In compat_debug this will just append the char to stdout. This checks for silent mode
:param char: The character to print
:param color_code: The colorcode 1234 = RGYB
:param row: The y pos used with curses
:param col: The x pos used with curses
"""
if self.silent:
return 42
if self.compat_debug:
if not color_code:
# Zero is the regular print, but the code 33 will draw black over black and we dont want that
print(char, end='')
else:
print('\033[0;3', color_code, 'm', char, '\033[0m', sep='', end='')
else:
self.win_program.addstr(row, col, char, curses.color_pair(color_code))
评论列表
文章目录