def on_ok(self, evt): name = self.profiles[self.profile_listbox.GetSelection()] stats = profiledb.load(name) try: self.player = Player(stats) except: gui.notification(None, 'Your profile cannot be loaded.') sys.exit() gui.notification(None, 'You are now ready to play!', caption="Loaded player profile") self.parent.main_menu(self.options)
def get_stats(self,parent,name): stats = profiledb.load(name) s = ("Name: {}\n" "Level: {}\n" "Exp: {}\n" "Money: {}\n" "Vitality: {}\n" "Strength: {}\n" "Resistance: {}\n" "Agility: {}\n" "Intelligence: {}\n" "Weapon: {}\n" "Armor: {}\n" "Skill: {}").format(stats['NAME'],stats['LEVEL'],stats['EXP'], stats['MONEY'],stats['VIT'],stats['STR'], stats['RES'],stats['AGI'],stats['INT'],stats['WEAPON'],stats['ARMOR'],stats['SKILL']) return s
def get_stats(self, parent, name): stats = profiledb.load(name) s = ("Name: {}\n" "Level: {}\n" "Exp: {}\n" "Money: {}\n" "Vitality: {}\n" "Strength: {}\n" "Resistance: {}\n" "Agility: {}\n" "Intelligence: {}\n" "Weapon: {}\n" "Armor: {}\n" "Skill: {}").format(stats['NAME'], stats['LEVEL'], stats['EXP'], stats['MONEY'], stats['VIT'], stats['STR'], stats['RES'], stats['AGI'], stats['INT'], stats['WEAPON'], stats['ARMOR'], stats['SKILL']) return s
def ok(self,evt): name = self.profiles[self.profile_listbox.GetSelection()] stats = profiledb.load(name) self.stats = stats self.Close() self.MakeModal(False)
def ok(self, evt): name = self.profiles[self.profile_listbox.GetSelection()] stats = profiledb.load(name) self.stats = stats self.Close() self.MakeModal(False)