def load(self): #makes a menu with title gameName Load name = self.game.name + ' Load' sMenu = simpleMenu(name) #gets list of all the backup folders and adds it to backups #from oldest to newest backups = [] for _, dirs, _ in os.walk(self.game.backupLocation): for directory in dirs: backups.append(directory) #maximum list in menu is set to 9 #check if it's less then that and display up to that number max = 9 numOfBackups = len(backups) if (numOfBackups < max): max = numOfBackups #loop that goes from the lenght of the backups array #down to that lenght reduced by the max variable for i in reversed(range(numOfBackups - max, numOfBackups)): sMenu.menu_option_add(self.loadFromFiles, backups[i], args=backups[i]) #delets the backups afther display since they are no longer needed del backups[:] #start the manual backup menu sMenu.menu_start()
def __init__(self, data): #get game data as gameInfo object self.game = data #sets title to be gameName Manual name = self.game.name + ' Manual' sMenu = simpleMenu(name) #add all the menu option sMenu.menu_option_add(self.save, 'Save') sMenu.menu_option_add(self.load, 'Load') sMenu.menu_option_add(self.openFolder, 'Open Folder') sMenu.menu_option_add(self.openBackups, 'Open Backups') sMenu.menu_option_add(self.hotkeySaving, 'Hotkey') sMenu.menu_start()
def option_branched_backOffsetMenu(): sMenuOffset = simpleMenu('Offset menu') def option_offset_1(): sMenuOffset.description = 'You have selected the offset the First option' def option_offset_2(): sMenuOffset.description = 'You have selected the offset the Second option' sMenuOffset.delBackAndOffset() sMenuOffset.menu_option_add(option_offset_1, 'First option') sMenuOffset.menu_option_add(option_offset_2, 'Second option') sMenuOffset.menu_option_add(sMenuOffset.Back, 'Back') sMenuOffset.menu_start()
def option_newMenu(): sMenuBranched = simpleMenu('Branched menu') def option_description_branched_1(): sMenuBranched.description = 'You have selected the branched the First option' def option_description_branched_2(): sMenuBranched.description = 'You have selected the branched the Second option' sMenuBranched.menu_option_add(option_description_branched_1, 'First option') sMenuBranched.menu_option_add(option_description_branched_2, 'Second option') sMenuBranched.menu_option_add(option_branched_backOffsetMenu, 'Offseted Menu') sMenuBranched.menu_start()
def eliminateMenu(): eliminationMenu = simpleMenu('To Eliminate') #add evidence to elimination menu def addToElimination(toEliminate): if (toEliminate not in possibleEvidence): eliminated.append(toEliminate) eliminationMenu.Back() #empty eliminated list def resetElimination(): eliminated.clear() eliminationMenu.Back() #start eliminated menu eliminationMenu.reset('') eliminationMenu.spacing = [1, len(Evidence) + 1] for i in Evidence: eliminationMenu.menu_option_add(addToElimination, Evidence[i], args=Evidence[i]) eliminationMenu.menu_option_add(resetElimination, 'Reset', customKey='r') eliminationMenu.menu_start()
configDir = workDir + '\\' + 'Configs' backupDir = workDir + '\\' + 'Backups' #loads config #json format { # gamename : path # } configs = gameConfigs('configs.json') if (not os.path.isdir(configDir)): os.mkdir(configDir) if (not os.path.isdir(backupDir)): os.mkdir(backupDir) sMenu = simpleMenu('Main Menu') def makeConfig(): #get input from user on the name of the game #and the save file location gameName = input('Game name ->') pathToDir = input('Save Location ->') #save to json configs.add(gameName, pathToDir) #add to menu gameBackupsDir = backupDir + '\\' + gameName game = gameInfo(gameName, pathToDir, gameBackupsDir) sMenu.menu_option_add(saveTypeMenu_open, gameName, args=game) #c.menu_option_add_withArgs( saveTypeMenu_open, # [ gameName,
Evidence = { 'E': "Emf", 'F': "Fingerprint", 'FT': "Freezing Temp", 'G': "GhostOrb", 'S': "SpiritBox", 'W': "Writing" } def EvidenceList(i, j, k): return [Evidence[i], Evidence[j], Evidence[k]] sMenu = simpleMenu('Phasmophobia') possibleEvidence = [] eliminated = [] ghostList = [] Spirit = Ghost('Spirit', EvidenceList('S', 'F', 'W'), description='Smudge sticks longer') Wraith = Ghost('Wraith', EvidenceList('F', 'FT', 'S'), description='Toxic to Salt, floating, phasing') Phantom = Ghost('Phantom', EvidenceList('E', 'G', 'FT'), description='Looking drops sanity, Photo disappearance') Poltergeist = Ghost('Poltergeist',
def __init__( self, data ): self.game=data sMenu=simpleMenu( self.game.name ) sMenu.menu_option_add( self.openAuto,'AutoSave' ) sMenu.menu_option_add( self.openManual,'ManualSave' ) sMenu.menu_start()