mirror of
https://github.com/csd4ni3l/chaos-protocol.git
synced 2026-01-01 04:23:43 +01:00
Add sprites sidebar, x and y gravity instead of gravity, fix a bunch of bugs, so now rules work, add input, mouse move and mouse click events, fix color changes, fix very slow loading times, go from is rules to greater, less and between rules
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import logging, arcade, arcade.gui, sys, traceback
|
||||
import logging, arcade, arcade.gui, sys, traceback, pyglet.display
|
||||
|
||||
from utils.constants import menu_background_color
|
||||
|
||||
import pyglet.info, pyglet.event
|
||||
|
||||
def dump_platform():
|
||||
import platform
|
||||
logging.debug(f'Platform: {platform.platform()}')
|
||||
@@ -16,6 +14,7 @@ def dump_gl(context=None):
|
||||
info = context.get_info()
|
||||
else:
|
||||
from pyglet.gl import gl_info as info
|
||||
|
||||
logging.debug(f'gl_info.get_version(): {info.get_version()}')
|
||||
logging.debug(f'gl_info.get_vendor(): {info.get_vendor()}')
|
||||
logging.debug(f'gl_info.get_renderer(): {info.get_renderer()}')
|
||||
@@ -37,30 +36,7 @@ def print_debug_info():
|
||||
logging.debug('')
|
||||
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('Chaos Protocol - 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))}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user