-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
59 lines (48 loc) · 2.04 KB
/
main.py
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
import os
import tkinter
from tkinter import *
#variables
dir_path = os.path.dirname(os.path.realpath(__file__))
text="funloader v0.1"
mom = tkinter.Tk()
mom.overrideredirect(1)
mom.withdraw()
#dictionaries
game_path = {'quarantine':"fun-ctions\\mvolution\\quarantine\\site.html",
'we_need_to_talk':"fun-ctions\\dodoot\\we-need-to-talk\\site.html",
'chrome_dino':"fun-ctions\\yolwoocle\\pico-dino\\site.html",
'eaglercraft':"fun-ctions\\eaglercraft\\main.html",
'intertwine':"fun-ctions\\crescence-studio\\intertwine\\site.html",
}
#functions
def messagewindow(): #main option menu
win = Tk()
win.title(text)
message = "What fun-ction would you like"
screen_width = win.winfo_screenwidth() #get screen measurements
screen_height = win.winfo_screenheight()
window_width = 170 # Adjust when needed
window_height = 200
x_position = (screen_width - window_width) // 2 #find centre window
y_position = (screen_height - window_height) // 2
win.geometry(f"{window_width}x{window_height}+{x_position}+{y_position}") #move window
Label(win, text=message).pack()
#game buttons
Button(win, text='Eaglercraft', command=lambda: run('eaglercraft')).pack()
Button(win, text='Quarantine', command=lambda: run('quarantine')).pack()
Button(win, text='We need to talk', command=lambda: run('we_need_to_talk')).pack()
Button(win, text='Chrome Dino', command=lambda: run('chrome_dino')()).pack()
Button(win, text='Intertwine', command=lambda:run('intertwine')).pack()
Button(win, text='Quit', command=lambda: quit()).pack()
def run(game):
file_path = os.path.join(dir_path,game_path[game])
os.startfile(file_path)
#start
os.chdir(dir_path)
messagewindow()
mom.mainloop()
#how to add a new game
# 1. Add the game to the fun-ctions folder
# 2. Add the game to the dictionary game_path
# 3. Add a button to the messagewindow function
# 4. Your done (might need to adjust the window size)