Esempio n. 1
0
def crossIceBridge():
    DialogBox.displayText("What you wouldnt give for a nice pair", yellow,
                          "of golf shoes right now! The bridge is", yellow,
                          "as slick as can be and one stumble could", yellow,
                          "spell doom. You carefully tread across.", yellow,
                          False)
    random.choice([iceDoorRiddles, iceBridgeSlip])()
Esempio n. 2
0
def iceQuestionAnswers1():
    DialogBox.displayText(
        "How will you respond?", yellow,
        "     First Place                 Raspberry Jam", green,
        "     Second Place              I hate running", green,
        "     Third Place                Open the Door!!!", green, True)
    travelOptions(iceQuestionAnswers1)
Esempio n. 3
0
def batTunnel():
    batCave = pygame.image.load('pictures/rooms/bats.jpg')
    gameDisplay.blit(batCave, [250, 0])
    DialogBox.displayText("You make your way down the corridor", yellow,
                          "only to discover a tunnel full of bats.", yellow,
                          "", yellow, "", yellow, False)
    bats()
Esempio n. 4
0
def fireDamageText():
    damage = int(random.randint(savables.fireMin,savables.fireMax)*combat.damageReducer*combat.damageEnhancer)
    combat.monsterHealth -= damage
    combat.monsterBar = (((combat.monsterHealth*100)/combat.totalMhealth)*2)
    DialogBox.displayText("You shoot fire forth from your hands...",yellow,
    "The %s takes %d damage!"%(randMonster.monster,damage),orange,
    "",yellow,"",yellow,False)
Esempio n. 5
0
def startText():
    gameDisplay.blit(corridor1, (250, 0))
    DialogBox.displayText("You see a long corridor in front of you.", yellow,
                          "There is a door on the left wall and a", yellow,
                          "ladder going up on the right wall behind", yellow,
                          "you. What would you like to do?", yellow, False)
    start()
Esempio n. 6
0
def barneyOptions1():
    DialogBox.displayText("What will you do?", yellow,
                          "     Turn back                  Flee", green,
                          "     Run Away                   Retreat", green,
                          "     Escape                       Open door?",
                          green, True)
    actionSelection(barneyOptions1)
Esempio n. 7
0
def pool():
    DialogBox.menuType = "fourChoiceMenu"
    DialogBox.displayText("What will you do?", yellow,
                          "     Drink from pool         Fill a bottle", green,
                          "     Throw a rock in", green, "     Leave", green,
                          True)
    travelOptions(pool)
Esempio n. 8
0
def leprechaunOptionsComplete():
    DialogBox.menuType = "fourChoiceMenu"
    DialogBox.displayText("What will you do?", yellow,
                          "     Train Skills                Leave", green,
                          "     Ask about quest          ", green,
                          "     Ask about...             ", green, True)
    leprechaunSelection(leprechaunOptionsComplete)
Esempio n. 9
0
def askAbout():
    DialogBox.menuType = "fiveChoiceMenu"
    DialogBox.displayText("Ask about:", yellow,
                          "     The Labyrinth            Items", green,
                          "     Weapons                    Combat", green,
                          "     Armor", green, True)
    leprechaunOptionsComplete()
Esempio n. 10
0
def riposte():
    global bleed,weaponAnimations
    damage = int(random.randint(savables.swordMin,savables.swordMax)*combat.damageReducer*combat.damageEnhancer)
    weaponAnimations = True
    DialogBox.displayText("You riposte the %s's"%randMonster.monster,yellow,
    "attack with your sword!",yellow,"",yellow,"",yellow,False)
    audio.monsterHit.play()
    monsterTakeDamage()
    combat.monsterHealth -= damage
    combat.monsterBar = (((combat.monsterHealth*100)/combat.totalMhealth)*2)
    time.sleep(.2)
    DialogBox.displayText("You riposte the %s's"%randMonster.monster,yellow,
    "attack with your sword!",yellow,
    "The %s takes %d damage!"%(randMonster.monster,damage),orange,"",yellow,False)
    roll = random.randint(1,10)
    if savables.swordSkill == 3 and roll < 5:
        time.sleep(.2)
        DialogBox.displayText("You riposte the %s's"%randMonster.monster,yellow,
        "attack with your sword!",yellow,
        "The %s takes %d damage!"%(randMonster.monster,damage),orange,
        "The %s is wounded!"%randMonster.monster,orange,False)
        bleed += (random.randint(5,15))
        weaponAnimations = False
        DialogBox.displayText("You riposte the %s's"%randMonster.monster,yellow,
        "attack with your sword!",yellow,
        "The %s takes %d damage!"%(randMonster.monster,damage),orange,
        "The %s is wounded!"%randMonster.monster,orange,False)
    else:
        weaponAnimations = False
        DialogBox.displayText("You riposte the %s's"%randMonster.monster,yellow,
        "attack with your sword!",yellow,
        "The %s takes %d damage!"%(randMonster.monster,damage),orange,"",yellow,False)
    time.sleep(.3)
Esempio n. 11
0
def exitFadeIn():
    global punishBattle
    x = 70
    for i in range(70):
        clock.tick(40)
        gameDisplay.blit(exitCavern2, [250, 0])
        gameDisplay.blit(lepSitting, [250, 0])
        weapons.redrawBorders()
        pygame.display.update()
    gameDisplay.blit(exitCavern, [250, 0])
    gameDisplay.blit(lepSitting, [250, 0])
    line1 = "'Never let it be said that I am not a"
    line2 = "good sport. I know how hard you have"
    line3 = "worked to build your fighting skills."
    line4 = "Go ahead and take your best shot.'"
    DialogBox.displayText(line1,green,line2,green,line3,\
    green,line4,green,False)
    randMonster.monsterPic = lepSitting
    randMonster.monsterBackground = exitCavern
    randMonster.monsterRoar = audio.leprechaunLaugh
    combat.battle = True
    punishBattle = True
    combat.monsterHealth = 3000
    combat.totalMhealth = 3000
    randMonster.randMonster('boss', 'random')
Esempio n. 12
0
def randMonster(strength, dice):
    global monsterStrength, monsterPic
    monsterStrength = strength
    if dice == "random":
        roll = random.randint(1, 5)
    else:
        roll = dice
    if strength == "weak":
        weakMonsters(roll)
    elif strength == "medium":
        mediumMonsters(roll)
    elif strength == "strong":
        strongMonsters(roll)
    elif strength == "boss":
        setLeprechaunPunish()
    if strength == "weak" or strength == "medium":
        if not keyBattle:
            audio.pygame.mixer.music.load('Audio/battle.ogg')
        else:
            audio.pygame.mixer.music.load('Audio/bossBattle.ogg')
    elif strength == "strong":
        audio.pygame.mixer.music.load('Audio/bossBattle.ogg')
    monsterPic = defaultMonsterPic
    if not finalBattle.punishBattle:
        audio.monsterRoar.play()
        audio.pygame.mixer.music.play(-1)
        pygame.mixer.music.set_volume(.4)
        encounterAnimation()
        DialogBox.displayText("A %s suddenly attacks!" % monster, yellow, "",
                              yellow, "", yellow, "", yellow, False)
    combat.combat()
Esempio n. 13
0
def monsterEncounter():
    DialogBox.displayText("You reach the bottom with a splash and", yellow,
                          "notice a pair of sinister yellow eyes slowly",
                          yellow, "approaching you in the darkness.", yellow,
                          "", yellow, False)
    randMonster.randMonster("weak", "random")
    sewerTravelOptions()
Esempio n. 14
0
def start():
    DialogBox.displayText("What will you do? Make your selection:", yellow,
                          "     Open the door           Yell for help", green,
                          "     Climb the ladder        Monster", green,
                          "     Go down corridor       Drink a Potion", green,
                          True)
    travelOptions(start)
Esempio n. 15
0
def subwayLocked():
    DialogBox.displayText("You come to a junction section of", yellow,
                          "the sewer. There are several doors that are",
                          yellow,
                          "are all locked from the other side. The only",
                          yellow, "way out appears to be the staircase.",
                          yellow, False)
Esempio n. 16
0
def sewerTravelOptions():
    DialogBox.menuType = "fourChoiceMenu"
    DialogBox.displayText("What will you do?", yellow,
                          "     Go down passage        Save Game", orange,
                          "     Yell for help", orange, "     Drink Potion",
                          orange, True)
    sewerSelection(sewerTravelOptions)
Esempio n. 17
0
def barneyOptions2():
    DialogBox.displayText("Open the door? Really?", yellow,
                          "     No                             No", green,
                          "     No                             No", green,
                          "     No                             Not no", green,
                          True)
    actionSelection(barneyOptions2)
Esempio n. 18
0
def grandRoom():
    line1 = "You come to a grand junction room. There"
    line2 = "are many doors and corridors branching"
    line3 = "off of this room. There is no way of"
    line4 = "telling where they might lead to."
    DialogBox.displayText(line1,yellow,line2,yellow,line3,\
    yellow,line4,yellow,False)
Esempio n. 19
0
def fireDoorOptions():
    DialogBox.menuType = "threeChoiceMenu"
    audio.fireBurn.fadeout(2500)
    DialogBox.displayText("What will you do?", yellow, "     Go back in",
                          green, "     Steer clear", green, "     Use Item",
                          green, True)
    travelOptions(fireDoorOptions)
Esempio n. 20
0
def drinkPotion():
    DialogBox.displayText(
        "Which potion will you drink?", yellow,
        "     Red Potion                  Orange Potion", green,
        "     Yellow Potion              Green Potion", green,
        "     Blue Potion                 Purple Potion", green, True)
    downTheHatch()
Esempio n. 21
0
def potionsRoulette():
    gameDisplay.blit(rouletteRoom, [250, 0])
    DialogBox.displayText("You wander into a room that is empty", yellow,
                          "except for a table in the middle with 6", yellow,
                          "potions sitting on it. On the wall is a", yellow,
                          "plack that reads,", yellow, False)
    roulettePlack()
Esempio n. 22
0
def tremor2():
    damage = random.randint(7,12)
    DialogBox.displayText("Your voice reverberates through the halls",yellow,
    "A tremor starts and the ground shakes!",yellow,
    "Something falls and hits you on the head!",yellow, 
    "It was a big rock. You take %d damage!"%damage,orange,False)
    savables.health -= damage
def potionsMenu():
    DialogBox.menuType = "fourChoiceMenu"
    row1 = line1 if savables.healthPotions > 0 else blankRowBack
    row2 = line2 if savables.regenPotions > 0 else blankRow
    row3 = line3 if savables.megaPotions > 0 else blankRow
    DialogBox.displayText("Available potions:",yellow,
    row1,green,row2,green,row3,green,True)
    selectionMenu(potionsMenu)
Esempio n. 24
0
def yell2():
    leprechaunAppear = pygame.image.load('pictures/rooms/leprechaun.jpg')
    gameDisplay.blit(leprechaunAppear,[250,0])    
    DialogBox.displayText("You yell at the top of your lungs hoping",yellow,
    "that somehow, help will arrive.", yellow,
    "A door magically appears on the wall and",yellow,
    "a curious leprechaun pokes its head out.",yellow,False)
    leprechaun.leprechaunOptions()    
Esempio n. 25
0
def yell1():            
    damage = random.randint(7,12)
    DialogBox.displayText("You yell at the top of your lungs hoping",yellow,
    "that somehow, help will arrive.", yellow,
    "Nope. No help arrived. In fact, now your",yellow,
    "throat hurts. You take %d damage. (Idiot!)"%damage,yellow,False)
    savables.health -= damage
    corridor1.tunnelGrateOptions()
Esempio n. 26
0
def openBarneyDoor():
    DialogBox.displayText("That is not a valid option. Try again.", red, "",
                          yellow, "", yellow, "", yellow, False)
    DialogBox.displayText("That is not a valid option. Try again.", red,
                          "Ok, I am lying, it is a valid option", yellow,
                          "but are you sure you want to do this?", yellow, "",
                          yellow, False)
    barneyOptions2()
Esempio n. 27
0
def tunnelGrate():
    tunnelGratePic = pygame.image.load('pictures/rooms/tunnelGrate.jpg')
    gameDisplay.blit(tunnelGratePic, [250, 0])
    DialogBox.displayText("You arrive at another corridor", yellow,
                          "this one having a metal grate in the", yellow,
                          "floor that easily comes off. There is", yellow,
                          "a ladder going down the opening.", yellow, False)
    tunnelGrateOptions()
Esempio n. 28
0
def iceQuestionAnswers3():
    DialogBox.displayText("How will you respond?", yellow,
                          "     Nummy                      Nunu", green,
                          "     Jane                          Is she cute?",
                          green,
                          "     Mary                         I hate you!",
                          green, True)
    travelOptions(iceQuestionAnswers3)
Esempio n. 29
0
def moneyIncorrect():
    line1 = "The keypad goes blank, then resets."
    line2 = "Apparently that answer was not correct."
    line3 = "Maybe you should try again?"
    line4 = ""
    DialogBox.displayText(line1,yellow,line2,yellow,line3,\
    yellow,line4,yellow,False)
    cashOptions()
Esempio n. 30
0
def ladder():
    line1 = "You climb the ladder to a sealed hatch at"
    line2 = "at the top. You try to bash it open but it"
    line3 = "is securely fastened. There is nowhere"
    line4 = "else to go but back down the ladder."
    DialogBox.displayText(line1,yellow,line2,yellow,line3,\
    yellow,line4,yellow,False)
    corridor1.start()
Esempio n. 31
0
 def add_data_event(self,current_table):
     if not hasattr(self,"event_add"):
         self.options = ["Date","CourseID","Laps"]
         self.title_main = "Add Data"
         self.title_box = "Event Add Data"
         self.event_add = DialogBox(self.options,self.title_main,self.title_box)
         self.event_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_1,self.line_2,self.line_3
     else:
         self.event_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1,self.line_add_2,self.line_add_3
Esempio n. 32
0
 def add_data_rider(self,current_table):
     if not hasattr(self,"rider_add"):
         self.options = ["Forename", "Surname"]
         self.title_main = "Add Data"
         self.title_box = "Rider Add Data"
         self.rider_add = DialogBox(self.options,self.title_main,self.title_box)
         self.rider_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1,self.line_add_2
     else:
         self.rider_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1,self.line_add_2
Esempio n. 33
0
 def add_data_club(self,current_table):
     if not hasattr(self,"club_add"):
         self.options = ["Club Name"]
         self.title_main = "Add Data"
         self.title_box = "Club Add Data"
         self.club_add = DialogBox(self.options,self.title_main,self.title_box)
         self.club_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1
     else:
         self.club_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1
Esempio n. 34
0
 def add_data_course(self,current_table):
     if not hasattr(self,"course_add"):
         self.options = ["Course Code","Course Distance"]
         self.title_main = "Add Data"
         self.title_box = "Course Add Data"
         self.course_add = DialogBox(self.options,self.title_main,self.title_box)
         self.course_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1,self.line_add_2
     else:
         self.course_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1,self.line_add_2
Esempio n. 35
0
 def add_data_event_points(self,current_table):
     if not hasattr(self,"event_points_add"):
         self.options = ["Event Points Type","Event Points","RecordID"]
         self.title_main = "Add Data"
         self.title_box = "Event Points Add Data"
         self.event_points_add = DialogBox(self.options,self.title_main,self.title_box)
         self.event_points_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1,self.line_add_2,self.line_add_3
     else:
         self.event_points_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1,self.line_add_2,self.line_add_3
Esempio n. 36
0
 def delete_data(self,current_table):
     if not hasattr(self,"delete_dialog"):
         self.options = ["ID of option"]
         self.title_main = "Delete"
         self.title_box ="ID of item to be deleted"
         self.delete_dialog = DialogBox(self.options,self.title_main,self.title_box)
         self.delete_dialog.exec_()
         self.get_ID()
         return self.line_1
     else:
         self.delete_dialog.exec_()
         self.get_ID()
         return self.line_1
Esempio n. 37
0
 def search_rider(self,current_table):
     if not hasattr(self,"rider_search"):
         self.options = ["Rider ID", "Forename", "Surname"]
         self.title_main = "Search"
         self.title_box = "Rider Search"
         self.rider_search = DialogBox(self.options,self.title_main,self.title_box)
         self.rider_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2,self.line_3
     else:
         self.rider_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2,self.line_3
Esempio n. 38
0
 def search_event_points(self,current_table):
     if not hasattr(self,"event_points_search"):
         self.options = ["Event PointsID", "Event Points Type","RecordID"]
         self.title_main = "Search"
         self.title_box = "Event Points Search"
         self.event_search = DialogBox(self.options,self.title_main,self.title_box)
         self.event_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2,self.line_3
     else:
         self.event_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2,self.line_3
Esempio n. 39
0
 def search_club_reference(self,current_table):
     if not hasattr(self,"club_reference_search"):
         self.options = ["Club RefernceID", "Date Joined","Date Left","RiderID","ClubID"]
         self.title_main = "Search"
         self.title_box = "Club Refernce Search"
         self.club_refernce_search = DialogBox(self.options,self.title_main,self.title_box)
         self.club_refernce_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2,self.line_3,line_4,line_5
     else:
         self.club_refernce_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2,self.line_3,line_4,line_5
Esempio n. 40
0
 def search_record(self,current_table):
     if not hasattr(self,"record_search"):
         self.options = ["RecordID", "Ride Time","Age","Handicap Mod","EventID","RiderID"]
         self.title_main = "Search"
         self.title_box = "Record Search"
         self.record_search = DialogBox(self.options,self.title_main,self.title_box)
         self.record_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2,self.line_3,line_4,line_5,line_6
     else:
         self.record_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2,self.line_3,line_4,line_5,line_6
Esempio n. 41
0
 def search_event(self,current_table):
     if not hasattr(self,"event_search"):
         self.options = ["EventID", "Date","CourseID","Laps"]
         self.title_main = "Search"
         self.title_box = "Event Search"
         self.event_search = DialogBox(self.options,self.title_main,self.title_box)
         self.event_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2,self.line_3,line_4
     else:
         self.event_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2,self.line_3,line_4
Esempio n. 42
0
 def search_event_reference(self,current_table):
     if not hasattr(self,"event_reference_search"):
         self.options = ["Event ReferncerID", "EventID"]
         self.title_main = "Search"
         self.title_box = "Event Reference Search"
         self.event_reference_search = DialogBox(self.options,self.title_main,self.title_box)
         self.event_reference_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2
     else:
         self.event_reference_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2
Esempio n. 43
0
 def search_course(self,current_table):
     if not hasattr(self,"course_search"):
         self.options = ["CourseID", "Course Code","Course Distance"]
         self.title_main = "Search"
         self.title_box = "Course Search"
         self.course_search = DialogBox(self.options,self.title_main,self.title_box)
         self.course_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2,self.line_3
     else:
         self.course_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2,self.line_3
Esempio n. 44
0
 def search_club(self,current_table):
     if not hasattr(self,"club_search"):
         self.options = ["ClubID", "Club Name"]
         self.title_main = "Search"
         self.title_box = "Club Search"
         self.club_search = DialogBox(self.options,self.title_main,self.title_box)
         self.club_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2
     else:
         self.club_search.exec_()
         self.get_user_input(current_table)
         return self.line_1,self.line_2
Esempio n. 45
0
 def add_data_event_reference(self,current_table):
     if not hasattr(self,"event_reference_add"):
         self.options = ["EventID"]
         self.title_main = "Add Data"
         self.title_box = "Event Reference Add Data"
         self.event_reference_add = DialogBox(self.options,self.title_main,self.title_box)
         self.event_reference_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1
     else:
         self.event_reference_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1  
Esempio n. 46
0
 def add_data_club_reference(self,current_table):
     if not hasattr(self,"club_reference_add"):
         self.options = ["Date Joined","Date Left","RiderID","ClubID"]
         self.title_main = "Add Data"
         self.title_box = "Club Refernce Add Data"
         self.club_refernce_add = DialogBox(self.options,self.title_main,self.title_box)
         self.club_refernce_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1,self.line_add_2,self.line_add_3,self.line_add_4
     else:
         self.club_refernce_add.exec_()
         self.get_user_input_add(current_table)
         return self.line_add_1,self.line_add_2,self.line_add_3,self.line_add_4
Esempio n. 47
0
class DisplayWidget(QWidget):
    """The Widget that shows the main layout"""

    def __inti__(self):
        super().__init__()
        self.stacked_layout = QStackedLayout()
        self.model = None
        self.setLayout(self.stacked_layout)
    #
    #table display funcions
    #

    def display_table(self):
        self.table = QTableView()
        self.table_layout = QVBoxLayout()
        self.table_layout.addWidget(self.table)
        self.table_widget = QWidget()
        self.table_widget.setLayout(self.table_layout)
        if not hasattr(self,"stacked_layout"):
            self.stacked_layout = QStackedLayout()
            self.setLayout(self.stacked_layout)
        self.stacked_layout.addWidget(self.table_widget)

    def show_data(self,query):
        if not hasattr(self,"model"):
            self.model = QSqlQueryModel()
        self.model.setQuery(query)
        self.display_table()
        self.table.setModel(self.model)
        self.table.show()

    #
    #get user input from a search Functions
    #

    def get_user_input(self,current_table):
        if current_table == 0:
           self.line_1 = self.rider_search.line_edit_1.text()
           self.line_2 = self.rider_search.line_edit_2.text()
           self.line_3 = self.rider_search.line_edit_3.text()     
        elif current_table == 1:
            self.line_1 = self.club_search.line_edit_1.text()
            self.line_2 = self.club_search.line_edit_2.text()   
        elif current_table == 2:
            self.line_1 = self.event_type_search.line_edit_1.text()
            self.line_2 = self.event_type_search.line_edit_2.text()
            self.line_3 = self.event_type_search.line_edit_3.text()
        elif current_table == 3:
            self.line_1 = self.course_search.line_edit_1.text()
            self.line_2 = self.course_search.line_edit_2.text()
            self.line_3 = self.course_search.line_edit_3.text()
        elif current_table == 4:
            self.line_1 = self.event_reference_search.line_edit_1.text()
            self.line_2 = self.event_reference_search.line_edit_2.text()
        elif current_table == 5:
            self.line_1 = self.event_search.line_edit_1.text()
            self.line_2 = self.event_search.line_edit_2.text()
            self.line_3 = self.event_search.line_edit_3.text()
            self.line_4 = self.event_search.line_edit_4.text()
        elif current_table == 6:
            self.line_1 = self.record_search.line_edit_1.text()
            self.line_2 = self.record_search.line_edit_2.text()
            self.line_3 = self.record_search.line_edit_3.text()
            self.line_4 = self.record_search.line_edit_4.text()
            self.line_5 = self.record_search.line_edit_5.text()
            self.line_6 = self.record_search.line_edit_6.text()
        elif current_table == 7:
            self.line_1 = self.event_points_search.line_edit_1.text()
            self.line_2 = self.event_points_search.line_edit_2.text()
            self.line_3 = self.event_points_search.line_edit_3.text()
            self.line_4 = self.event_points_search.line_edit_4.text()
        elif current_table == 8:
            self.line_1 = self.club_refernce_add.line_edit_1.text()
            self.line_2 = self.club_refernce_add.line_edit_2.text()
            self.line_3 = self.club_refernce_add.line_edit_3.text()
            self.line_4 = self.club_refernce_add.line_edit_4.text()
            self.line_5 = self.club_refernce_add.line_edit_5.text()
                

    def get_user_input_add(self,current_table):
        if current_table == 0:
            self.line_add_1 = self.rider_add.line_edit_1.text()
            self.line_add_2 = self.rider_add.line_edit_2.text()
        elif current_table == 1:
            self.line_add_1 = self.club_add.line_edit_1.text()
        elif current_table == 2:
            self.line_add_1 = self.event_type_add.line_edit_1.text()
            self.line_add_2 = self.event_type_add.line_edit_2.text()
        elif current_table == 3:
            self.line_add_1 = self.course_add.line_edit_1.text()
            self.line_add_2 = self.course_add.line_edit_2.text()
        elif current_table == 4:
             self.line_add_1 = self.event_reference_add.line_edit_1.text()
        elif current_table == 5:
            self.line_add_1 = self.event_add.line_edit_1.text()
            self.line_add_2 = self.event_add.line_edit_2.text()
            self.line_add_3 = self.event_add.line_edit_3.text()
        elif current_table == 6:
            self.line_add_1 = self.record_add.line_edit_1.text()
            self.line_add_2 = self.record_add.line_edit_2.text()
            self.line_add_3 = self.record_add.line_edit_3.text()
            self.line_add_4 = self.record_add.line_edit_4.text()
            self.line_add_5 = self.record_add.line_edit_5.text()
        elif current_table == 7:
            self.line_add_1 = self.event_points_add.line_edit_1.text()
            self.line_add_2 = self.event_points_add.line_edit_2.text()
            self.line_add_3 = self.event_points_add.line_edit_3.text()
        elif current_table == 8:
            self.line_add_1 = self.club_refernce_add.line_edit_1.text()
            self.line_add_2 = self.club_refernce_add.line_edit_2.text()
            self.line_add_3 = self.club_refernce_add.line_edit_3.text()
            self.line_add_4 = self.club_refernce_add.line_edit_4.text()
        
                
    def get_ID(self):
        self.line_1 = self.delete_dialog.line_edit_1.text()
        

    #
    #add data function
    #

    def add_data_rider(self,current_table):
        if not hasattr(self,"rider_add"):
            self.options = ["Forename", "Surname"]
            self.title_main = "Add Data"
            self.title_box = "Rider Add Data"
            self.rider_add = DialogBox(self.options,self.title_main,self.title_box)
            self.rider_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2
        else:
            self.rider_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2

    def add_data_club(self,current_table):
        if not hasattr(self,"club_add"):
            self.options = ["Club Name"]
            self.title_main = "Add Data"
            self.title_box = "Club Add Data"
            self.club_add = DialogBox(self.options,self.title_main,self.title_box)
            self.club_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1
        else:
            self.club_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1
            
    def add_data_event_type(self,current_table):
        if not hasattr(self,"event_type_add"):
            self.options = ["Event Type","Event ReferenceID"]
            self.title_main = "Add Data"
            self.title_box = "Event Type Add Data"
            self.event_type_add = DialogBox(self.options,self.title_main,self.title_box)
            self.event_type_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2
        else:
            self.event_type_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2

    def add_data_course(self,current_table):
        if not hasattr(self,"course_add"):
            self.options = ["Course Code","Course Distance"]
            self.title_main = "Add Data"
            self.title_box = "Course Add Data"
            self.course_add = DialogBox(self.options,self.title_main,self.title_box)
            self.course_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2
        else:
            self.course_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2
        
    def add_data_event_reference(self,current_table):
        if not hasattr(self,"event_reference_add"):
            self.options = ["EventID"]
            self.title_main = "Add Data"
            self.title_box = "Event Reference Add Data"
            self.event_reference_add = DialogBox(self.options,self.title_main,self.title_box)
            self.event_reference_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1
        else:
            self.event_reference_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1  

    def add_data_event(self,current_table):
        if not hasattr(self,"event_add"):
            self.options = ["Date","CourseID","Laps"]
            self.title_main = "Add Data"
            self.title_box = "Event Add Data"
            self.event_add = DialogBox(self.options,self.title_main,self.title_box)
            self.event_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_1,self.line_2,self.line_3
        else:
            self.event_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2,self.line_add_3

    def add_data_record(self,current_table,path):
        if not hasattr(self,"record_add"):
            self.options = ["Ride Time","Age","Handicap Mod","EventID","RiderID"]
            self.title_main = "Add Data"
            self.title_box = "Record Add Data"
            self.record_add = RecordDialogBox(self.options,self.title_main,self.title_box,path)
            self.record_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2,self.line_add_3,self.line_add_4,self.line_add_5
        else:
            self.record_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2,self.line_add_3,self.line_add_4,self.line_add_5

    def add_data_event_points(self,current_table):
        if not hasattr(self,"event_points_add"):
            self.options = ["Event Points Type","Event Points","RecordID"]
            self.title_main = "Add Data"
            self.title_box = "Event Points Add Data"
            self.event_points_add = DialogBox(self.options,self.title_main,self.title_box)
            self.event_points_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2,self.line_add_3
        else:
            self.event_points_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2,self.line_add_3

    def add_data_club_reference(self,current_table):
        if not hasattr(self,"club_reference_add"):
            self.options = ["Date Joined","Date Left","RiderID","ClubID"]
            self.title_main = "Add Data"
            self.title_box = "Club Refernce Add Data"
            self.club_refernce_add = DialogBox(self.options,self.title_main,self.title_box)
            self.club_refernce_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2,self.line_add_3,self.line_add_4
        else:
            self.club_refernce_add.exec_()
            self.get_user_input_add(current_table)
            return self.line_add_1,self.line_add_2,self.line_add_3,self.line_add_4

            
    #
    #search data functions
    #        

    def search_rider(self,current_table):
        if not hasattr(self,"rider_search"):
            self.options = ["Rider ID", "Forename", "Surname"]
            self.title_main = "Search"
            self.title_box = "Rider Search"
            self.rider_search = DialogBox(self.options,self.title_main,self.title_box)
            self.rider_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3
        else:
            self.rider_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3
        
    def search_club(self,current_table):
        if not hasattr(self,"club_search"):
            self.options = ["ClubID", "Club Name"]
            self.title_main = "Search"
            self.title_box = "Club Search"
            self.club_search = DialogBox(self.options,self.title_main,self.title_box)
            self.club_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2
        else:
            self.club_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2

    def search_event_type(self,current_table):
        if not hasattr(self,"event_type_search"):
            self.options = ["Event TypeID", "Event Type","Event ReferenceID"]
            self.title_main = "Search"
            self.title_box = "Event Type Search"
            self.event_type_search = DialogBox(self.options,self.title_main,self.title_box)
            self.event_type_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3
        else:
            self.event_type_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3

    def search_course(self,current_table):
        if not hasattr(self,"course_search"):
            self.options = ["CourseID", "Course Code","Course Distance"]
            self.title_main = "Search"
            self.title_box = "Course Search"
            self.course_search = DialogBox(self.options,self.title_main,self.title_box)
            self.course_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3
        else:
            self.course_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3


    def search_event_reference(self,current_table):
        if not hasattr(self,"event_reference_search"):
            self.options = ["Event ReferncerID", "EventID"]
            self.title_main = "Search"
            self.title_box = "Event Reference Search"
            self.event_reference_search = DialogBox(self.options,self.title_main,self.title_box)
            self.event_reference_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2
        else:
            self.event_reference_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2


    def search_event(self,current_table):
        if not hasattr(self,"event_search"):
            self.options = ["EventID", "Date","CourseID","Laps"]
            self.title_main = "Search"
            self.title_box = "Event Search"
            self.event_search = DialogBox(self.options,self.title_main,self.title_box)
            self.event_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3,line_4
        else:
            self.event_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3,line_4

    def search_record(self,current_table):
        if not hasattr(self,"record_search"):
            self.options = ["RecordID", "Ride Time","Age","Handicap Mod","EventID","RiderID"]
            self.title_main = "Search"
            self.title_box = "Record Search"
            self.record_search = DialogBox(self.options,self.title_main,self.title_box)
            self.record_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3,line_4,line_5,line_6
        else:
            self.record_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3,line_4,line_5,line_6
        
    def search_event_points(self,current_table):
        if not hasattr(self,"event_points_search"):
            self.options = ["Event PointsID", "Event Points Type","RecordID"]
            self.title_main = "Search"
            self.title_box = "Event Points Search"
            self.event_search = DialogBox(self.options,self.title_main,self.title_box)
            self.event_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3
        else:
            self.event_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3
        
    def search_club_reference(self,current_table):
        if not hasattr(self,"club_reference_search"):
            self.options = ["Club RefernceID", "Date Joined","Date Left","RiderID","ClubID"]
            self.title_main = "Search"
            self.title_box = "Club Refernce Search"
            self.club_refernce_search = DialogBox(self.options,self.title_main,self.title_box)
            self.club_refernce_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3,line_4,line_5
        else:
            self.club_refernce_search.exec_()
            self.get_user_input(current_table)
            return self.line_1,self.line_2,self.line_3,line_4,line_5

    def delete_data(self,current_table):
        if not hasattr(self,"delete_dialog"):
            self.options = ["ID of option"]
            self.title_main = "Delete"
            self.title_box ="ID of item to be deleted"
            self.delete_dialog = DialogBox(self.options,self.title_main,self.title_box)
            self.delete_dialog.exec_()
            self.get_ID()
            return self.line_1
        else:
            self.delete_dialog.exec_()
            self.get_ID()
            return self.line_1