mirror of
https://github.com/csd4ni3l/aim-trainer.git
synced 2026-01-01 04:03:42 +01:00
Initial version
This commit is contained in:
44
run.py
Normal file
44
run.py
Normal file
@@ -0,0 +1,44 @@
|
||||
import os, pypresence, json
|
||||
from ursina import Ursina
|
||||
from menus.main import Main
|
||||
from utils.utils import get_closest_resolution
|
||||
|
||||
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)
|
||||
|
||||
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()
|
||||
Reference in New Issue
Block a user