-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloader.py
More file actions
89 lines (75 loc) · 3.51 KB
/
Copy pathloader.py
File metadata and controls
89 lines (75 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# -*- coding: utf-8 -*-
import Tkinter as tk
import time
from threading import Thread
class Screen:
def __init__(self):
self.btnfn = None
self.startTrigger = False
print('Screen Started')
self.window = tk.Tk()
self.window.geometry('250x355')
self.window.title('face2face')
self.window.resizable(0, 0)
for i in range(6):
self.window.rowconfigure(i, minsize=50)
self.window.columnconfigure(0, minsize=250)
self.title = tk.Label(self.window)
self.title.configure(text='face²face',fg='white',bg='#3b5998')
self.title.configure(font=('calibri', 15, 'bold'))
self.title.grid(row=0, rowspan=1, column=0, sticky='nsew')
self.title2 = tk.Label(self.window)
self.title2.configure(text= '👍 ❤️ 😂 😯 😢 😡',fg='white',bg='#8b9dc3')
self.title2.configure(font=('calibri', 15, 'bold'))
self.title2.grid(row=1, rowspan=1, column=0, sticky='nsew')
self.warningLabel = tk.Label(self.window)
self.warningLabel.configure(text='WARNING:\n\n This will open your camera \n and close Google Chrome',fg='red',bg='#f7f7f7')
self.warningLabel.configure(font=('calibri', 12,'bold'))
self.warningLabel.grid(row=2, rowspan=2, column=0, sticky='nsew')
self.infoLabel = tk.Label(self.window)
self.infoLabel.configure(text='Click on the button\n bellow to begin'.upper(),bg='#dfe3ee')
self.infoLabel.configure(font=('calibri', 12,'bold'))
self.infoLabel.grid(row=4, rowspan=2, column=0, sticky='nsew')
self.startButton = tk.Button(self.window)
self.startButton.configure(text='START', command=self.StartScript)
self.startButton.configure(font=('pixelmix', 11))
self.startButton.grid(row=6, rowspan=1, column=0, sticky='nsew')
self.exitButton = tk.Button(self.window)
self.exitButton.configure(text='EXIT', command=self.on_closing)
self.exitButton.configure(font=('pixelmix', 11))
self.exitButton.grid(row=7, rowspan=1, column=0, sticky='nsew')
def updateText(self,txt):
self.infoLabel.configure(text=txt.upper())
def setFn(self,fn):
self.btnfn = fn
def onScriptStopped(self):
self.startTrigger = False
def StartScript(self):
if not self.startTrigger:
self.startTrigger = True
# mainThread = Thread(target=self.btnfn)
self.btnfn()
# mainThread.start()
# self.infoLabel.configure(text='Click "Close Connection" to\n\nstop accepting new players'.upper())
# self.infoLabel.configure(font=('pixelmix', 8))
# self.infoLabel.grid(row=2, rowspan=2, column=0, sticky='nsew')
def stopAcpt(self):
self.server.stopAccepting()
self.StartWindow()
def StartWindow(self):
self.infoLabel.configure(text='Good Luck'.upper())
self.infoLabel.configure(font=('pixelmix', 12))
self.infoLabel.grid(row=2, rowspan=2, column=0, sticky='nsew')
self.bot_start = tk.Button(self.window)
self.bot_start.configure(text='START GAME', command=self.CommandStart)
self.bot_start.configure(font=('pixelmix', 11))
self.bot_start.grid(row=4, rowspan=2, column=0, sticky='nsew')
def CommandStart(self):
self.server.startGame()
self.window.destroy()
def start(self):
self.window.protocol("WM_DELETE_WINDOW", self.on_closing)
self.window.mainloop()
def on_closing(self):
self.window.destroy()
raise SystemExit