def __init__(self): IGfxMgr.__init__(self) self.screenChanged = True self.numLines = 25 self.numChars = 80 # assume a standard nethack screen to begin # (does not matter to curses) self.cursesScreen = curses.initscr() curses.noecho() curses.cbreak() self.cursesScreen.keypad(1) curses.start_color() self.cursesScreen.nodelay(1) fil = open('debug', 'w') for bgColor in AsciiPixel.COLORS: for fgColor in AsciiPixel.COLORS: code = CursesGfxMgr.getColorCode(fgColor[0], bgColor[0]) fgCursesColor = self.getCursesColor(fgColor[0]) bgCursesColor = self.getCursesColor(bgColor[0]) fil.write("code=%d,fg=%d,bg=%d" % ( code, fgColor[0], bgColor[0])) curses.init_pair(code, fgCursesColor, bgCursesColor) fil.close()
def __init__(self): IGfxMgr.__init__(self) self.screenChanged = True self.numLines = 25 self.numChars = 80 # assume a standard nethack screen to begin # (does not matter to curses) self.cursesScreen = curses.initscr() curses.noecho() curses.cbreak() self.cursesScreen.keypad(1) curses.start_color() self.cursesScreen.nodelay(1) fil = open('debug', 'w') for bgColor in AsciiPixel.COLORS: for fgColor in AsciiPixel.COLORS: code = CursesGfxMgr.getColorCode(fgColor[0], bgColor[0]) fgCursesColor = self.getCursesColor(fgColor[0]) bgCursesColor = self.getCursesColor(bgColor[0]) fil.write("code=%d,fg=%d,bg=%d" % (code, fgColor[0], bgColor[0])) curses.init_pair(code, fgCursesColor, bgCursesColor) fil.close()
def doQuit(self): curses.nocbreak() self.cursesScreen.keypad(0) curses.echo() curses.endwin() IGfxMgr.doQuit(self)
def updateScreen(self, netScreen): self.screenChanged = True IGfxMgr.updateScreen(self, netScreen)
def updateWindowDimensions(self, numChars, numLines): IGfxMgr.updateWindowDimensions(self, numChars, numLines)
def popEvents(self): return IGfxMgr.popEvents(self)
def hasEvents(self): return IGfxMgr.hasEvents(self)