def verifyAutoGeneration(buttonY, buttonX): for x in range(buttonX, buttonX + 10): console.setXY(x, buttonY, ' ') global CREATING_MAP_AUTO_GENERATION if CREATING_MAP_AUTO_GENERATION == "NAO": console.setColorXY(buttonX + 1, buttonY, "SIM / ", Colors.BACKGROUND_BLACK | Colors.FOREGROUND_WHITE) console.setColorXY(buttonX + 7, buttonY, "NAO", Colors.BACKGROUND_RED) else: console.setColorXY(buttonX + 1 , buttonY, "SIM", Colors.BACKGROUND_GREEN) console.setColorXY(buttonX + 4, buttonY, " / NAO", Colors.BACKGROUND_BLACK | Colors.FOREGROUND_WHITE) option = "SIM" while True: keyword = str(console.getKeyword()) if keyword == 'right' or keyword == 'd': option = "NAO" console.setColorXY(buttonX + 1, buttonY, "SIM / ", Colors.BACKGROUND_BLACK | Colors.FOREGROUND_WHITE) console.setColorXY(buttonX + 7, buttonY, "NAO", Colors.BACKGROUND_RED) elif keyword == 'left' or keyword == 'a': option = "SIM" console.setColorXY(buttonX + 1, buttonY, "SIM", Colors.BACKGROUND_GREEN) console.setColorXY(buttonX + 4, buttonY, " / NAO", Colors.BACKGROUND_BLACK | Colors.FOREGROUND_WHITE) elif keyword == 'enter': for x in range(buttonX, buttonX + 10): console.setColorXY(x, buttonY, ' ', Colors.BACKGROUND_BLACK | Colors.FOREGROUND_WHITE) CREATING_MAP_AUTO_GENERATION = option create_map() break
def verifyTime(buttonY, buttonX): for x in range(buttonX, buttonX + 10): console.setXY(x, buttonY, ' ') global CREATING_MAP_TIME console.setXY(buttonX, buttonY, CREATING_MAP_TIME) while True: keyword = str(console.getKeyword()) if keyword == 'delete': console.setXY(buttonX + len(CREATING_MAP_TIME) - 1, buttonY, ' ') CREATING_MAP_TIME = CREATING_MAP_TIME[0:len(CREATING_MAP_TIME) - 1] if len(CREATING_MAP_TIME) > 1 else "" console.setXY(buttonX, buttonY, CREATING_MAP_TIME) elif keyword == 'enter': create_map() break else: CREATING_MAP_TIME += keyword console.setXY(buttonX, buttonY, CREATING_MAP_TIME)
def verifyHeight(buttonY, buttonX): for x in range(buttonX, buttonX + 10): console.setXY(x, buttonY, ' ') global CREATING_MAP_HEIGHT console.setXY(buttonX, buttonY, CREATING_MAP_HEIGHT) while True: keyword = str(console.getKeyword()) if keyword == 'delete': console.setXY(buttonX + len(CREATING_MAP_HEIGHT) - 1, buttonY, ' ') CREATING_MAP_HEIGHT = CREATING_MAP_HEIGHT[0:len(CREATING_MAP_HEIGHT) - 1] if len(CREATING_MAP_HEIGHT) > 1 else "" console.setXY(buttonX, buttonY, CREATING_MAP_HEIGHT) elif keyword == 'enter': create_map() break else: CREATING_MAP_HEIGHT += keyword console.setXY(buttonX, buttonY, CREATING_MAP_HEIGHT)