From c2f1ed6a85c3895483d36af0f64e2829c3fa3263 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Fri, 1 Sep 2023 14:54:08 +0200 Subject: Updated 11 files and added 2 files (automated) --- main.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index 6deda5a..2b06d03 100644 --- a/main.py +++ b/main.py @@ -2,6 +2,7 @@ from os import environ environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1' import traceback +import datetime import os os.chdir(os.path.dirname(os.path.realpath(__file__))) @@ -10,14 +11,15 @@ import pygame import sys sys.path.append("./src") -from src import audio, window, loader, menu +from src import audio, window, loader, menu, helper +helper.get_data_path() pygame.font.init() pygame.init() window.init() clock = pygame.time.Clock() -screen = pygame.display.set_mode((1280, 720), pygame.RESIZABLE) +screen = pygame.display.set_mode((1280, 720), pygame.RESIZABLE, vsync=True) running = True index = 0 @@ -79,6 +81,12 @@ while running: print(traceback.format_exc()) + try: + with open(helper.get_data_path() + "/crash_reports/" + datetime.datetime.now().isoformat().replace(":", "-") + ".txt", "w") as f: + f.write(traceback.format_exc()) + except Exception: + print(traceback.format_exc()) + while running: for event in pygame.event.get(): if event.type == pygame.QUIT: -- cgit