-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
51 lines (40 loc) · 1.31 KB
/
run.py
File metadata and controls
51 lines (40 loc) · 1.31 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
import os, json
from ursina import Ursina
from menus.main import Main
from utils.utils import get_closest_resolution
from ursina import window
if os.path.exists('settings.json'):
with open('settings.json', 'r') as settings_file:
settings = json.load(settings_file)
else:
resolution = get_closest_resolution()
settings = {
"music": True,
"music_volume": 50,
"resolution": f"{resolution[0]}x{resolution[1]}",
"window_mode": "Windowed",
"vsync": True,
"discord_rpc": True
}
with open("settings.json", "w") as file:
file.write(json.dumps(settings))
args = {
"fullscreen": settings['window_mode'] == 'Fullscreen',
"borderless": settings['window_mode'] == 'Borderless',
"vsync": settings["vsync"]
}
if not args["fullscreen"]:
args["size"] = list(map(int, settings['resolution'].split('x')))
app = Ursina(title="Aim Trainer", development_mode=False, **args)
window.cog_button.enabled = False
window.editor_ui.enabled = True
window.fps_counter.enabled = True
window.collider_counter.enabled = False
window.entity_counter.enabled = False
if settings.get("music", True):
from utils.preload import music_sound
music_sound.play()
music_sound.volume = settings.get("music_volume", 50) / 100
music_sound.loop = True
Main()
app.run()