def initialSetup(): #********INITIAL SETUP********* dlg = wx.MessageDialog(None, "This is a choose your own adventure game. Before we get started we'll need to set up your character","Welcome!",wx.OK_DEFAULT) dlg.ShowModal() dlg.Destroy() raceChoice = wx.SingleChoiceDialog(None,"CHOOSE YOUR RACE:","RACE",["Human","Elf","Dwarf"]) if raceChoice.ShowModal()==wx.ID_OK: raceAnswer=raceChoice.GetStringSelection() else: raceAnswer = "Human" classChoice = wx.SingleChoiceDialog(None,"CHOOSE YOUR CLASS:","CLASS", ["Fighter","Wizard","Rogue","Priest"]) if classChoice.ShowModal()==wx.ID_OK: classAnswer = classChoice.GetStringSelection() else: classAnswer="Fighter" nameDialog = wx.TextEntryDialog(None,"Finally, what is your character's name?","NAME") if nameDialog.ShowModal() == wx.ID_OK: nameSet = nameDialog.GetValue() else: nameSet = "Bob" #call to the choose your own adventure to get starting path settings pathDictionary = db_connect.getPath(0, nameSt = nameSet, raceAns=raceAnswer,classAns=classAnswer) print (pathDictionary) GUIWindow(0, **pathDictionary)
def selectMade(self, event, chosenPath,): self.currentPath.append(chosenPath) self.pathDictionary = db_connect.getPath(*self.currentPath, **self.pathDictionary) self.adventureText.SetValue(self.pathDictionary["advText"]) self.choiceAText.SetValue(self.pathDictionary["afill"]) self.choiceBText.SetValue(self.pathDictionary["bfill"]) self.choiceCText.SetValue(self.pathDictionary["cfill"])