Update to newest version of template

This commit is contained in:
csd4ni3l
2025-12-13 15:43:58 +01:00
parent 3584f9c08a
commit 29f59bf570
5 changed files with 257 additions and 163 deletions

View File

@@ -1,5 +1,4 @@
import logging, arcade, arcade.gui, sys, traceback
import logging, arcade, traceback, pyglet.display
from utils.constants import menu_background_color
import pyglet.display
@@ -72,29 +71,6 @@ def print_debug_info():
logging.debug('########################## DEBUG INFO ##########################')
logging.debug('')
class ErrorView(arcade.gui.UIView):
def __init__(self, message, title):
super().__init__()
self.message = message
self.title = title
def exit(self):
logging.fatal('Exited with error code 1.')
sys.exit(1)
def on_show_view(self):
super().on_show_view()
self.window.set_caption('Logical Signals - Error')
self.window.set_mouse_visible(True)
self.window.set_exclusive_mouse(False)
arcade.set_background_color(menu_background_color)
msgbox = arcade.gui.UIMessageBox(width=self.window.width / 2, height=self.window.height / 2, message_text=self.message, title=self.title)
msgbox.on_action = lambda _: self.exit()
self.add_widget(msgbox)
def on_exception(*exc_info):
logging.error(f"Unhandled exception:\n{''.join(traceback.format_exception(exc_info[1], limit=None))}")