def drawInventoryInputParser(self): unicurses.erase() self.camera.drawHUDBoundaries() for index, item in enumerate(self.player.inventory.inventoryList): unicurses.attron(unicurses.COLOR_PAIR(config.colorDict["white"])) unicurses.mvaddstr(index+1, 1, self.player.inventory.letterList[index+1]+") "+self.player.inventory.inventoryList[index].description) unicurses.attroff(unicurses.COLOR_PAIR(config.colorDict["white"]))
def drawHUD(self): if self.player is None: raise RuntimeError("You didn't call levelManager.setPlayer()!!!!") unicurses.attron(unicurses.COLOR_PAIR(config.colorDict["white"])) unicurses.mvaddstr(1, self.lensWidth, self.level.player.playerName) unicurses.mvaddstr(2, self.lensWidth, self.level.player.title) unicurses.mvaddstr(4, self.lensWidth, "Health: "+str(self.level.player.health)+"/"+str(self.level.player.maxHealth)) unicurses.mvaddstr(5, self.lensWidth, "Poise: "+str(self.player.poise)+"/"+str(self.level.player.maxPoise)) unicurses.mvaddstr(8, self.lensWidth, "Turn: "+str(config.world.currentLevel.timeline.absoluteTime)) if(self.player.lastObelisk != None): unicurses.mvaddstr(6, self.lensWidth, "Shards of Divinity: "+str(self.player.shardCount)) unicurses.attroff(unicurses.COLOR_PAIR(config.colorDict["white"])) self.drawHUDBoundaries()
# Set up the global colorPalette for i in range(0, 256): config.colorPalette.update({i:[i, i, unicurses.COLOR_BLACK]}) config.colorDict.update({str(i):i}) for entry in config.colorPalette: unicurses.init_pair(config.colorPalette[entry][0], config.colorPalette[entry][1], config.colorPalette[entry][2]) # Main menu erase() selected = 0 temp_camera = Camera(51, 19, None) temp_camera.drawHUDBoundaries() while(True): if(selected == 0): unicurses.attron(unicurses.COLOR_PAIR(config.colorDict["white"])) unicurses.mvaddstr(1, 1, "New game") unicurses.attroff(unicurses.COLOR_PAIR(config.colorDict["white"])) else: unicurses.attron(unicurses.COLOR_PAIR(config.colorDict["g12"])) unicurses.mvaddstr(1, 1, "New game") unicurses.attroff(unicurses.COLOR_PAIR(config.colorDict["g12"])) if(selected == 1): unicurses.attron(unicurses.COLOR_PAIR(config.colorDict["white"])) unicurses.mvaddstr(2, 1, "Load game") unicurses.attroff(unicurses.COLOR_PAIR(config.colorDict["white"])) else: unicurses.attron(unicurses.COLOR_PAIR(config.colorDict["g12"])) unicurses.mvaddstr(2, 1, "Load game") unicurses.attroff(unicurses.COLOR_PAIR(config.colorDict["g12"])) if(selected == 2): unicurses.attron(unicurses.COLOR_PAIR(config.colorDict["white"]))
def output(self): for tupleCount, inTuple in enumerate(self.oBuffer): unicurses.attron(unicurses.COLOR_PAIR(config.colorDict[inTuple[1]])) unicurses.mvaddstr(self.cameraHeight + tupleCount, 0, str(inTuple[0])) unicurses.attroff(unicurses.COLOR_PAIR(config.colorDict[inTuple[1]])) self.clear()