Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- from tkinter import ttk
- import tkinter as tk
- from tkinter.messagebox import showinfo
- import tkinter.simpledialog
- import tkinter.messagebox
- import datetime
- ################################################################################################################################################################################################
- class Game:
- def __init__(self, name, rating, price, publisher, sales):
- self.name = name
- self.rating = rating
- self.price = price
- self.publisher = publisher
- self.sales = sales
- gameName.append(self)
- gameList.append(self.name)
- gamePrice.append(self.price)
- gameSales.append(self.sales)
- ################################################################################################################################################################################################
- class User:
- def __init__(self, username, password, balance, credit, EXPD, CVC, library):
- self.username = username
- self.password = password
- self.balance = balance
- self.credit = credit
- self.EXPD = EXPD
- self.CVC = CVC
- self.library = library #this will be an array which will be added via, gta.name etc
- userList.append(self)
- userLib.append(self.library)
- ################################################################################################################################################################################################
- class Buying():
- global selectedgame, sessionlibrary, sessionbalance, cart, checkout_price
- def __init__(self, *args): #REPEATED CODE IS NEEDED for some of the part,
- self.buywindow = Toplevel(root)
- self.buywindow.title("buy a game")
- self.buywindow.geometry('{}x{}'.format(510, 300))
- self.buywindow.resizable(0,0)
- self.buywindow.grab_set()#made it unclickable
- #########################
- labelCom = Label(self.buywindow, text="Purchase", font=("arial", 24), background="#999", width=10).grid(row=0, column=1, sticky=N, padx=6, pady=6)
- labelgame = Label(self.buywindow, text="game avaliable", font=("arial", 18)).grid(row=1, column=0, sticky=N, padx=6, pady=6)
- #labelCopies = Label(self.buywindow, text="how many copies", font=("arial", 18)).grid(row=2, column=0, sticky=N, padx=6, pady=6)
- ########################
- self.labelCartlist = StringVar()
- self.labelCartlist.set("cart list:")
- self.labelCartContent = Label(self.buywindow, textvariable=self.labelCartlist, font=("arial 10 bold")).grid(row=4, column=0, sticky=N, padx=6, pady=6)
- ########################
- labelremove = Label(self.buywindow, text="to remove from your cart", font=("arial 10 bold")).grid(row=4, column=1, sticky=N, padx=6, pady=6)
- ########################
- self.removeEntry = StringVar()
- self.removeEntry.trace("w", lambda name, index, mode, removeEntry=self.removeEntry: self.delete(self.removeEntry))
- self.removeEntrytext = Entry(self.buywindow, textvariable="", state='disabled')
- self.removeEntrytext.grid(row=5, column=1, padx=6, pady=6, ipadx=10, ipady=8)
- ########################
- self.removedbutton = Button(self.buywindow, text="remove from cart", command=self.delete, state="disabled")#changing test() to test make it so that a button is needed,
- self.removedbutton.grid(row=5, column=2)
- ########################
- self.labelCart = StringVar() ###### tempcart thingy
- self.labelCart.set("")
- self.labelCartContent = Label(self.buywindow, textvariable=self.labelCart, font=("arial", 10)).grid(row=5, column=0, sticky=N, padx=6, pady=6)
- ########################
- self.labelNoti = StringVar()
- self.labelNoti.set("")
- self.labelNotiContent = Label(self.buywindow, textvariable=self.labelNoti, font=("arial", 8)).grid(row=3, column=0, sticky=N, padx=6, pady=6)
- ########################
- self.labelPrice = StringVar()
- self.labelPrice.set("$0")
- self.labelPriceContent = Label(self.buywindow, textvariable=self.labelPrice, font=("arial", 14)).grid(row=1, column=2, sticky=N, padx=6, pady=6)
- ######################### dynamic label working :D ######################
- self.store_menu = StringVar()
- self.store_menu.set("please select a game")
- self.store_menu.trace("w", self.select_game)
- self.store_menuoption = OptionMenu(self.buywindow, self.store_menu, command=self.update, *gameList).grid(row=1, column=1, sticky=N, padx=6, rowspan=1)
- ########################
- self.loading = Button(self.buywindow, text="add to cart", command=self.purchasing, state="disabled")#changing test() to test make it so that a button is needed,
- self.loading.grid(row=3, column=1)
- #############buying process
- self.buy = Button(self.buywindow, text="checkout!", command=self.checkout, state="disabled")#changing test() to test make it so that a button is needed,
- self.buy.grid(row=3, column=2)
- def update(self, *args): #price update
- for selling_price in gameName:
- if selectedgame == selling_price.name:
- print("game name:",selectedgame, "game price:",selling_price.price)
- post = "$" +str(selling_price.price)
- self.labelPrice.set(post)
- def delete(self, *args): #work on this make it so that they remove an item
- global cart, checkout_price
- print("")
- print("first cart: ", cart)
- removing_item = str(self.removeEntrytext.get())
- print("removing_game: ", removing_item)
- print("")
- for x in range(0, len(cart)):
- if removing_item in cart: #don't put it as cart[x] ever again >:C
- if removing_item == cart[x]: #i did it
- del cart[int(x)] #del that item in the array
- print("new cart: ", cart)
- self.labelNoti.set("item removed")
- for selling_price in gameName: #refunding the price owo
- if removing_item == selling_price.name: #checking if the removes work
- print("2 game name:",removing_item, ", 2 game price: $",selling_price.price)
- checkout_price -= int(selling_price.price)
- print(checkout_price)
- else:
- self.labelNoti.set("item not found or has been removed")
- ###########################################################
- #resetting the text box and the button
- #find a way to refersh the tempcart or display cart
- ###########################################################
- tempcart = ""
- for i in range(0, len(cart)): #temp cart is just cart display
- tempcart += str(cart[i]) + "\n"
- self.labelCart.set(tempcart)#notifications to show what the user have probably should make a remove cart :/
- i += 1
- self.removeEntrytext.delete(0, 'end')
- if len(cart) == 0:
- self.removeEntrytext.config(state='disabled')
- self.removedbutton.config(state="disabled")
- print("new checkout price",checkout_price)
- self.labelCart.set("")
- else:
- pass
- print("new checkout price",checkout_price)
- def purchasing(self, *args):
- global sessionlibrary, selectedgame, sessionbalance, cart, checkout_price, tempcart
- tempcart = ""
- print(selectedgame)
- print("old sesh ", sessionlibrary)
- print("selectedgame: ", selectedgame)
- if str(selectedgame) not in sessionlibrary and str(selectedgame) not in cart: #if it's not in cart or library
- for selling_price in gameName:
- if selectedgame == selling_price.name:
- print("2 game name:",selectedgame, ", 2 game price: $",selling_price.price)
- checkout_price += int(selling_price.price)
- print("old checkout_price: ",checkout_price) #adding the prices to the checkout price which will remove from the sessionbalance
- cart += str(selectedgame).strip().split(',')#adds in stuff
- print("cart ", cart)
- print("sessionlibrary: ", sessionlibrary)
- self.store_menu.set("please select a game")
- self.labelNoti.set("added to cart!")
- for i in range(0, len(cart)): #temp cart is just cart display
- tempcart += str(cart[i]) + "\n"
- self.labelCart.set(tempcart)#notifications to show what the user have probably should make a remove cart :/
- i += 1
- self.loading.config(state='disabled')
- self.buy.config(state='normal')
- selectedgame = "" #resetting selected game
- self.removeEntrytext.config(state='normal')
- self.removedbutton.config(state="normal") #setting it so you can remove from the cart
- else:
- self.store_menu.set("please select a game")
- self.labelNoti.set("you've already bourght \n that game or it's in your\ncart")
- self.loading.config(state='disabled')
- pass
- def checkout(self, *args):
- global sessionlibrary, cart, selectedgame, sessionbalance, checkout_price
- if sessionbalance <= 0:
- self.labelNoti.set("you're broke get \nsome money")
- elif len(cart) <= 0:
- self.labelNoti.set("nothing to check \nout")
- else:
- print("cart items: ", cart[0])
- #adding the game to the new library
- for i in range(0, len(cart)):
- sessionlibrary += str(cart[i]).strip().split(',')
- print("new sessionlibrary: ", sessionlibrary)
- i += 1
- cart = []#resstting cart
- self.labelCart.set("")
- selectedgame = ""
- self.buy.config(state='disabled')
- self.labelPrice.set("$0")
- sessionbalance -= checkout_price
- #print(sessionbalance) testting to see if it even gets through
- LabelbalanceTitle.set("your current balance is $" +str(sessionbalance))
- checkout_price = 0 #ressetting checkout price for the next round :D
- self.removeEntrytext.config(state='disabled')
- self.removedbutton.config(state="disabled") #setting it so you can remove from the cart
- def select_game(self, *args):
- global sessionlibrary, selectedgame
- selectedgame = str(self.store_menu.get())
- print(selectedgame)
- print(sessionlibrary)
- self.store_menu.set(selectedgame)
- self.loading.config(state='normal')
- ################################################################################################################################################################################################
- class logining():
- def __init__(self, *args):
- self.loginwindow = Toplevel(root)
- self.loginwindow.title("Login")
- self.loginwindow.geometry('{}x{}'.format(400, 200))
- self.loginwindow.resizable(0,0)
- self.loginwindow.grab_set()#made it unclickable
- ############################################
- labelCom = Label(self.loginwindow, text="login", font=("arial", 24), background="#999", width=10).grid(row=0, column=1, sticky=N, padx=6, pady=6)#login window is 1 frame
- labelCom = Label(self.loginwindow, text="username", font=("arial", 18)).grid(row=1, column=0, sticky=N, padx=6, pady=6)
- labelCom = Label(self.loginwindow, text="password", font=("arial", 18)).grid(row=2, column=0, sticky=N, padx=6, pady=6)
- ############################################
- self.usernameEntry = StringVar()
- self.usernameEntry.trace("w", lambda name, index, mode, usernameEntry=self.usernameEntry: self.test(self.usernameEntry))
- self.usernameEntrytext = Entry(self.loginwindow, textvariable="", state='normal')
- self.usernameEntrytext.grid(row=1, column=1, padx=6, pady=6, ipadx=15, ipady=8, rowspan=1, sticky="ew")
- ############################################
- self.passwordEntry = StringVar()
- self.passwordEntry.trace("w", lambda name, index, mode, passwordEntry=self.passwordEntry: self.test(self.passwordEntry))#make sure to add stake holder on the hide password
- self.passwordEntrytext = Entry(self.loginwindow, show="*", textvariable="", state='normal')#password thingy
- self.passwordEntrytext.grid(row=2, column=1, padx=6, pady=6, ipadx=15, ipady=8, rowspan=1, sticky="ew")
- ############################################
- #login button
- signinButton = Button(self.loginwindow, text="login", command=self.test, state="normal")#changing test() to test make it so that a button is needed,
- signinButton.grid(row=3, column=1)
- def test(self, *args): #*args is very important
- global sessionusername, sessionpassword, sessionlibrary, sessionbalance, sessioncredit, sessionEXPD, sessionCVC
- entereduser = str(self.usernameEntrytext.get())
- enteredpass = str(self.passwordEntrytext.get())
- print("####")
- print("")
- for users in userList:
- if entereduser == str(users.username) and enteredpass == str(users.password):
- sessionusername = entereduser
- sessionpassword = enteredpass
- sessionlibrary = users.library
- sessionbalance = users.balance
- sessioncredit = users.credit
- sessionEXPD = users.EXPD
- sessionCVC = users.CVC
- ##################################
- print("current username: " +str(sessionusername), " current password: " +str(sessionpassword), "current library: " +str(sessionlibrary), "current balance:" +str(sessionbalance))
- loginButton.config(state="disabled")
- logoutButton.config(state="normal")
- buyButton.config(state="normal")
- salesButton.config(state="normal")
- libraryButton.config(state="normal")
- usersetButton.config(state="normal")
- LabelbalanceTitle.set("your current balance is $" +str(sessionbalance)) #this one actually worked hmm\
- LabelusernameTitle.set("Username: \n"+str(sessionusername))
- self.loginwindow.destroy()
- else:
- self.loginwindow.destroy()
- print("")
- print("####")
- def logoutfunc(*args):
- global sessionusername, sessionpassword, sessionlibrary, sessionbalance
- sessionusername = ""
- sessionpassword = ""
- sessionlibrary = []
- sessionbalance = 0
- LabelbalanceTitle.set("your current balance is $" +str(sessionbalance))
- buyButton.config(state="disabled")
- salesButton.config(state="disabled")
- libraryButton.config(state="disabled")
- usersetButton.config(state="disabled")
- loginButton.config(state="normal")
- logoutButton.config(state="disabled") #after loging out it should pretty much reset everything that means clearing everything
- print("current username: " +str(sessionusername), " current username: " +str(sessionpassword), "current library: " +str(sessionlibrary), "current balance:" +str(sessionbalance))
- ################################################################################################################################################################################################
- class salesfunc(): #gotta finish this for the last day yaayyyyyy
- global selectedgame, sessionlibrary, sessionbalance, cart
- tempsales = ""
- def __init__(self, *args): #REPEATED CODE IS NEEDED for some of the part,
- self.saleswindow = Toplevel(root)
- self.saleswindow.title("Sales!")
- self.saleswindow.geometry('{}x{}'.format(700, 300))
- self.saleswindow.resizable(0,0)
- self.saleswindow.grab_set()#made it unclickable
- #########################
- labelCom = Label(self.saleswindow, text="SALES!", font=("arial", 24), background="#999", width=10).grid(row=0, column=1, sticky=N, padx=6, pady=6)
- labelgame = Label(self.saleswindow, text="game avaliable", font=("arial", 18)).grid(row=1, column=0, sticky=N, padx=6, pady=6)
- #########################
- self.labelsales = StringVar()
- self.labelsales.set("games on sale")
- self.labelsalesContent = Label(self.saleswindow, textvariable=self.labelsales, font=("arial", 16)).grid(row=2, column=1, sticky=N, padx=6, pady=6)
- #########################
- self.buy = Button(self.saleswindow, text="buy a game!", command=lambda: Buying(), state="normal")#changing test() to test make it so that a button is needed,
- self.buy.grid(row=1, column=1, ipadx=40, ipady=5)
- for selling_price in gameName:
- if gameSales == selling_price.sales:
- print("gameSales :",gameSales, "selling_prices:",selling_price.sales)
- self.labelsales.set("")
- ################################################################################################################################################################################################
- class usersetfunc():
- def __init__(self, *args):
- self.usersetwindow = Toplevel(root)
- self.usersetwindow.title("User Setting")
- self.usersetwindow.geometry('{}x{}'.format(500, 400))
- self.usersetwindow.resizable(0,0)
- self.usersetwindow.grab_set()#made it unclickable
- ########################
- labelUSET = Label(self.usersetwindow, text="User Settings", font=("arial", 24), background="#999", width=10).grid(row=0, column=1, sticky=N, padx=6, pady=6)#login window is 1 frame
- labelUSER = Label(self.usersetwindow, text="username", font=("arial", 18)).grid(row=1, column=0, sticky=N, padx=6, pady=6)
- labelPASS = Label(self.usersetwindow, text="password", font=("arial", 18)).grid(row=2, column=0, sticky=N, padx=6, pady=6)
- labelCOMF = Label(self.usersetwindow, text="password confirm", font=("arial", 18)).grid(row=3, column=0, sticky=N, padx=6, pady=6)
- labelCCNO = Label(self.usersetwindow, text="credit card number", font=("arial", 18)).grid(row=4, column=0, sticky=N, padx=6, pady=6)
- labelEXPD = Label(self.usersetwindow, text="expiry date", font=("arial", 18)).grid(row=5, column=0, sticky=N, padx=6, pady=6)
- labelCVVC = Label(self.usersetwindow, text="CVV number", font=("arial", 18)).grid(row=6, column=0, sticky=N, padx=6, pady=6)
- ############################################label USER
- self.USER = StringVar()
- self.USER.trace("w", lambda name, index, mode, USER=self.USER: self.updatefunc(self.USER))
- self.USERtext = Entry(self.usersetwindow, textvariable="", state='normal')
- self.USERtext.grid(row=1, column=1, padx=6, pady=6, ipadx=15, ipady=8, rowspan=1, sticky="ew")
- ############################################label PASS
- self.PASS = StringVar()
- self.PASS.trace("w", lambda name, index, mode, PASS=self.PASS: self.updatefunc(self.PASS))
- self.PASStext = Entry(self.usersetwindow, textvariable="", state='normal')
- self.PASStext.grid(row=2, column=1, padx=6, pady=6, ipadx=15, ipady=8, rowspan=1, sticky="ew")
- ############################################label COMF
- self.COMF = StringVar()
- self.COMF.trace("w", lambda name, index, mode, COMF=self.COMF: self.updatefunc(self.COMF))
- self.COMFtext = Entry(self.usersetwindow, textvariable="", state='normal')
- self.COMFtext.grid(row=3, column=1, padx=6, pady=6, ipadx=15, ipady=8, rowspan=1, sticky="ew")
- ############################################label CCNO
- self.CCNO = StringVar()
- self.CCNO.trace("w", lambda name, index, mode, CCNO=self.CCNO: self.updatefunc(self.CCNO))
- self.CCNOtext = Entry(self.usersetwindow, textvariable="", state='normal')
- self.CCNOtext.grid(row=4, column=1, padx=6, pady=6, ipadx=15, ipady=8, rowspan=1, sticky="ew")
- ############################################label EXPD
- self.EXPD = StringVar()
- self.EXPD.trace("w", lambda name, index, mode, EXPD=self.EXPD: self.updatefunc(self.EXPD))
- self.EXPDtext = Entry(self.usersetwindow, textvariable="", state='normal')
- self.EXPDtext.grid(row=5, column=1, padx=6, pady=6, ipadx=15, ipady=8, rowspan=1, sticky="ew")
- ############################################label CVVC
- self.CVVC = StringVar()
- self.CVVC.trace("w", lambda name, index, mode, CVVC=self.CVVC: self.updatefunc(self.CVVC))
- self.CVVCtext = Entry(self.usersetwindow, textvariable="", state='normal')
- self.CVVCtext.grid(row=6, column=1, padx=6, pady=6, ipadx=15, ipady=8, rowspan=1, sticky="ew")
- ############################################
- self.changeButton = Button(self.usersetwindow, text="update", command=self.updatefunc, state="normal")#changing test() to test make it so that a button is needed,
- self.changeButton.grid(row=7, column=1, ipadx=40, ipady=5)
- ############################################
- self.labelNoti = StringVar()
- self.labelNoti.set("")
- self.labelNotiContent = Label(self.usersetwindow, textvariable=self.labelNoti, font=("arial", 10)).grid(row=7, column=0, sticky=N, padx=6, pady=6)
- def updatefunc(self, *args):
- global sessionusername, sessionpassword, sessioncredit, sessionEXPD, sessionCVC
- updating_USER = str(self.USERtext.get())
- updating_PASS = str(self.PASStext.get())
- updating_COMF = str(self.COMFtext.get())
- updating_CCNO = str(self.CCNOtext.get()) #got a credit card system working today finally didn't took as long as i thought it would which is nice
- updating_EXPD = str(self.EXPDtext.get())
- updating_CVVC = str(self.CVVCtext.get())
- if updating_USER == "":
- self.labelNoti.set("make sure to fill \nin the blank")
- elif updating_PASS == "":
- self.labelNoti.set("make sure to fill \nin the blank")
- elif updating_COMF == "":
- self.labelNoti.set("make sure to fill \nin the blank")
- elif updating_CCNO == "":
- self.labelNoti.set("make sure to fill \nin the blank")
- elif updating_EXPD == "":
- self.labelNoti.set("make sure to fill \nin the blank")
- elif updating_CVVC == "":
- self.labelNoti.set("make sure to fill \nin the blank")
- elif updating_CCNO.isnumeric() == False or updating_CVVC.isnumeric() == False:
- self.labelNoti.set("please make sure you\n the correct credit card info")
- elif len(updating_CCNO) < 15 or len(updating_CCNO) > 19: #credit card number ranges from 15 to 19
- self.labelNoti.set("make sure to fill \nin 19 digits of the card")
- elif len(updating_CVVC) != 3:#more effective than > 3 or < 3 since there can only be 3 digits
- self.labelNoti.set("make sure to fill \nin 3 digits of the CVV")
- elif len(updating_EXPD) != 4:#more effective than > 4 or < 4 since there can only be 3 digits
- self.labelNoti.set("make sure to fill \nin 4 digits of the date \ne.g. 0319 = march-19")
- elif updating_COMF != updating_PASS:
- self.labelNoti.set("passwords do not \nmatch")
- else: #all fool proofing it before updating it :D
- sessionusername = updating_USER
- sessionpassword = updating_PASS
- sessioncredit = updating_CCNO #session and library are missing as it's just the same user updating is information
- sessionEXPD = updating_EXPD
- sessionCVC = updating_CVVC
- self.labelNoti.set("update complete!")
- LabelusernameTitle.set("Username: \n"+str(sessionusername))
- print("sessionusername",sessionusername,"sessionpassword",sessionpassword,"sessioncredit",sessioncredit,"sessionEXPD",sessionEXPD,"sessionCVC",sessionCVC)
- ################################################################################################################################################################################################
- class library():
- def __init__(self, *args):
- global sessionlibrary
- templibrary = "" #making it [] would mess up formatting
- self.librarywindow = Toplevel(root)
- self.librarywindow.title("User Setting")
- self.librarywindow.geometry('{}x{}'.format(500, 300))
- self.librarywindow.resizable(0,0)
- self.librarywindow.grab_set()#made it unclickable
- #################################################
- labelTitle = Label(self.librarywindow, text="Library", font=("arial", 24), background="#999", width=10).grid(row=0, column=1, sticky=N, padx=6, pady=6)#login window is 1 frame
- labelUSER = Label(self.librarywindow, text="Games you own: ", font=("arial", 18)).grid(row=1, column=0, sticky=N, padx=6, pady=6)
- #################################################
- self.labelLibrarylist = StringVar()
- self.labelLibrarylist.set("")
- self.labelLibrarylistContent = Label(self.librarywindow, textvariable=self.labelLibrarylist, font=("arial", 16)).grid(row=1, column=1, sticky=N, padx=6, pady=6)
- ############################################
- self.gaming = StringVar()
- self.gaming.trace("w", lambda name, index, mode, gaming=self.gaming: self.passing(self.gaming))
- self.gamingtext = Entry(self.librarywindow, textvariable=self.gaming, state='normal')
- self.gamingtext.grid(row=2, column=0, padx=6, pady=6, ipadx=15, ipady=8, rowspan=1, sticky="ew")
- ############################################
- self.changeButton = Button(self.librarywindow, text="launch a game", command=self.gamelauncher, state="normal")#changing test() to test make it so that a button is needed,
- self.changeButton.grid(row=2, column=1, ipadx=40, ipady=5)
- #################################################
- self.labelNoti = StringVar()
- self.labelNoti.set("")
- self.labelNotiContent = Label(self.librarywindow, textvariable=self.labelNoti, font=("arial", 10)).grid(row=7, column=0, sticky=N, padx=6, pady=6)
- ################################################# pre loading'''
- for i in range(0, len(sessionlibrary)): #working
- templibrary += str(sessionlibrary[i]) + "\n"
- self.labelLibrarylist.set(templibrary)#display all games in the library
- i += 1
- def gamelauncher(self, *args):
- global sessionlibrary
- print(sessionlibrary)
- game = self.gaming.get()
- print("game selected:"+str(game), " |")
- if game not in sessionlibrary:
- self.labelNoti.set("you don't own \nthat game")
- else:
- self.gamingtext.delete(0, 'end')
- self.changeButton.config(state='disabled')
- self.gamingtext.config(state="disabled") #setting it so you can remove from the cart
- ################################################################################################################################################################################################
- #interface code it's pretty aesthetic i know
- root = Tk()
- root.title('Steam Backup Launcher')
- root.resizable(0,0)
- root.geometry('{}x{}'.format(600, 400))
- root.configure(background="black")
- mainFrame = Frame(root)
- BotFrame = Frame(root)
- #all these arrays are for filters uwu
- gameName = []
- gameList = []
- userList = []
- userName = []
- userPass = []
- userLib = []
- gameSales = []
- gamePrice = []
- cart = []
- tempcart = []
- GTA4 = Game("Grand Theft Auto 4", "3/5", 45, "rockstar", False) #name, stock, price, publisher
- destiny = Game("Destiny", "4/5", 75, "bungie", True) #name, stock, price, publisher
- overwatch = Game("Overwatch", "4/5", 20, "blizzard", False) #name, stock, price, publisher
- red_dead_2 = Game("Red Dead Redemption", "4/5", 90, "rockstar", False) #name, stock, price, publisher
- LOL = Game("League of Legends", "4/5", 10, "riot games", False) #name, stock, price, publisher
- jamie = User("t", "t", 0, 4536955883665515, 1232, 121, [GTA4.name, destiny.name, overwatch.name])#game library working! #make a loop that runs througha list
- ray = User("test", "test", 244, 4924087596280182, 1222, 431, [GTA4.name, overwatch.name])
- #globals
- sessionusername = ""
- sessionpassword = ""
- sessioncredit = ""
- sessionEXPD = ""
- sessionCVC = ""
- sessionlibrary = []
- sessionbalance = 0
- checkout_price = 0
- selectedgame = ''#needed it for buying class
- #currentlibrary = ['gta','overwatch','destiny']
- #print(GTA4.name + GTA4.rating)
- #print(jamie.username + " " + str(jamie.library))
- #title
- labelCom = Label(mainFrame, text="steam", font=("arial", 34), background="#999", width=10).grid(row=0, column=1, sticky=N, padx=6, pady=6)
- #buy pop up box i want to make a list of avaliable game where they can be displayed
- buyButton = Button(mainFrame, text="Buy", state='disabled', command=lambda: Buying())
- buyButton.grid(row=1, column=0, ipadx=60, ipady=30, sticky=NSEW)
- #login button
- loginButton = Button(mainFrame, text="Login", command=lambda: logining())
- loginButton.grid(row=1, column=2, ipadx=60, ipady=30, sticky=NSEW)
- #logout pop up box i want to make a list of avaliable game where they can be displayed
- logoutButton = Button(BotFrame, text="Logout", state='disabled', command=root.destroy)
- logoutButton.grid(row=3, column=2, ipadx=60, ipady=30, sticky=NSEW)
- #sales pop up box i want to make a list of games of sale
- salesButton = Button(BotFrame, text="Sales!", state='disabled', command=lambda: salesfunc())
- salesButton.grid(row=3, column=0, ipadx=60, ipady=30, sticky=NSEW)
- #settings pop up box i want to make a list of games of sale
- usersetButton = Button(BotFrame, text="user setting", state='disabled', command=usersetfunc)
- usersetButton.grid(row=3, column=1, ipadx=70, ipady=30, sticky=NSEW)
- #library
- libraryButton = Button(mainFrame, text="library", state='disabled', command=library, width=10)#run a funciton in login that sets jamie.library to different users
- libraryButton.grid(row=1, column=1, ipadx=70, ipady=30, sticky=NSEW)
- # i just need to make a button to send it info in since it activates the funciton when a new product is selected (sell button)
- #balance display
- LabelbalanceTitle = StringVar()
- LabelbalanceTitle.set("your current balance is $")
- LabelbalanceTitleContent = Label(BotFrame, textvariable=LabelbalanceTitle, font=("arial", 9), background="#999", width=30).grid(row=2, column=1, sticky=NSEW, padx=20, pady=3)
- #balance display
- LabelusernameTitle = StringVar()
- LabelusernameTitle.set("Username: ")
- LabelusernameTitleContent = Label(mainFrame, textvariable=LabelusernameTitle, font=("arial", 12), background="#999").grid(row=0, column=2)
- #main frame
- mainFrame.pack(side=TOP, fill=BOTH, expand=TRUE)
- BotFrame.pack(side=BOTTOM, fill=BOTH, expand=TRUE)
- root.mainloop()
- #all prints are for testing purposes
Add Comment
Please, Sign In to add comment