Beispiel #1
0
def GameMain():
    
    Rc.Recover()
    while True:
    
        Mn.printMenu()

        choice=input('输入您的选择: ')
        if choice == '3':
            AM.AboutMe()
        if choice == '2':
            SU.SignUp()
        if choice == '1':
            SI.SignIn()
        if choice == '0':
            SF.SaveFile()
Beispiel #2
0
    def SaveList(self, destroy=True):
        """
        Sauvegarder le fichier de vocabulaire modifié.
        :return: None
        """

        if len(self.mot) > 2:
            self.sauvegarder = SaveFile.SaveFile()
            self.filepath = self.sauvegarder.getFileName()
            self.activateWindow()
            continuer = True
        else:
            msg = QtWidgets.QMessageBox()
            msg.setWindowTitle("ERREUR")
            msg.setText(
                "Impossible d'enregistrer le fichier: Il n'y a pas assez de mots dans la liste!"
            )
            msg.exec()
            continuer = False
            self.filepath = None

        if self.filepath != None and continuer:
            self.filepath = self.filepath.split(".")
            self.filepath = self.filepath[0]
            file = open(self.filepath + ".vocab", "w+")

            for mot, trad in zip(self.mot, self.trad):
                file.write(mot + "|" + trad + "\n")

            file.close()

            if destroy: self.destroy()
        elif self.filepath == None and continuer:
            msg = QtWidgets.QMessageBox()
            msg.setWindowTitle("ERREUR")
            msg.setText("Impossible d'enregistrer le fichier!")
            msg.exec()
Beispiel #3
0
def gameMenu(user_name, user_password):
    firstGamingGuide(user_name, user_password)
    print('您的基本信息:')
    Ps.persons[SI.users[user_name][2]].printPerson()
    while True:
        print('''
        1 查看关卡
        2 选择关卡
        3 查看背包
        4 穿戴物品
        5 查看人物属性及装备
        0 保存并退出
        ''')
        choice = input('请输入您的选择:')
        if choice == '1':
            GL.printGames()
        if choice == '2':
            pass
        if choice == '3':
            n = 0
            for num in Ps.persons[SI.users[user_name][2]].person_bag:
                print('背包序号:', n)
                Ep.equipments[num].printEquipment()
                n = n + 1
        if choice == '4':
            num = input('请输入您要装备的物品的背包序号或back返回:')
            if num == 'back':
                continue
            elif num not in Ps.persons[SI.users[user_name][2]].person_bag:
                print('没有此装备!')
                continue
            else:
                Ps.persons[SI.users[user_name][2]].updatEquipment(num)
        if choice == '5':
            Ps.persons[SI.users[user_name][2]].printPerson()
        if choice == '0':
            SF.SaveFile()