mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 13:04:01 +08:00
ui: fix raylib init spam (#36947)
* lil more * not none * don't need that either * too spammy now?
This commit is contained in:
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@@ -22,7 +22,7 @@ shopt -s huponexit # kill all child processes when the shell exits
|
|||||||
|
|
||||||
export CI=1
|
export CI=1
|
||||||
export PYTHONWARNINGS=error
|
export PYTHONWARNINGS=error
|
||||||
export LOGPRINT=debug
|
#export LOGPRINT=debug # this has gotten too spammy...
|
||||||
export TEST_DIR=${env.TEST_DIR}
|
export TEST_DIR=${env.TEST_DIR}
|
||||||
export SOURCE_DIR=${env.SOURCE_DIR}
|
export SOURCE_DIR=${env.SOURCE_DIR}
|
||||||
export GIT_BRANCH=${env.GIT_BRANCH}
|
export GIT_BRANCH=${env.GIT_BRANCH}
|
||||||
|
|||||||
@@ -192,6 +192,8 @@ class MouseState:
|
|||||||
|
|
||||||
class GuiApplication:
|
class GuiApplication:
|
||||||
def __init__(self, width: int | None = None, height: int | None = None):
|
def __init__(self, width: int | None = None, height: int | None = None):
|
||||||
|
self._set_log_callback()
|
||||||
|
|
||||||
self._fonts: dict[FontWeight, rl.Font] = {}
|
self._fonts: dict[FontWeight, rl.Font] = {}
|
||||||
self._width = width if width is not None else GuiApplication._default_width()
|
self._width = width if width is not None else GuiApplication._default_width()
|
||||||
self._height = height if height is not None else GuiApplication._default_height()
|
self._height = height if height is not None else GuiApplication._default_height()
|
||||||
@@ -215,7 +217,6 @@ class GuiApplication:
|
|||||||
self._last_fps_log_time: float = time.monotonic()
|
self._last_fps_log_time: float = time.monotonic()
|
||||||
self._frame = 0
|
self._frame = 0
|
||||||
self._window_close_requested = False
|
self._window_close_requested = False
|
||||||
self._trace_log_callback = None
|
|
||||||
self._modal_overlay = ModalOverlay()
|
self._modal_overlay = ModalOverlay()
|
||||||
self._modal_overlay_shown = False
|
self._modal_overlay_shown = False
|
||||||
self._modal_overlay_tick: Callable[[], None] | None = None
|
self._modal_overlay_tick: Callable[[], None] | None = None
|
||||||
@@ -260,9 +261,6 @@ class GuiApplication:
|
|||||||
signal.signal(signal.SIGINT, _close)
|
signal.signal(signal.SIGINT, _close)
|
||||||
atexit.register(self.close)
|
atexit.register(self.close)
|
||||||
|
|
||||||
self._set_log_callback()
|
|
||||||
rl.set_trace_log_level(rl.TraceLogLevel.LOG_WARNING)
|
|
||||||
|
|
||||||
flags = rl.ConfigFlags.FLAG_MSAA_4X_HINT
|
flags = rl.ConfigFlags.FLAG_MSAA_4X_HINT
|
||||||
if ENABLE_VSYNC:
|
if ENABLE_VSYNC:
|
||||||
flags |= rl.ConfigFlags.FLAG_VSYNC_HINT
|
flags |= rl.ConfigFlags.FLAG_VSYNC_HINT
|
||||||
@@ -640,6 +638,9 @@ class GuiApplication:
|
|||||||
else:
|
else:
|
||||||
cloudlog.error(f"raylib: Unknown level {log_level}: {text_str}")
|
cloudlog.error(f"raylib: Unknown level {log_level}: {text_str}")
|
||||||
|
|
||||||
|
# ensure we get all the logs forwarded to us
|
||||||
|
rl.set_trace_log_level(rl.TraceLogLevel.LOG_DEBUG)
|
||||||
|
|
||||||
# Store callback reference
|
# Store callback reference
|
||||||
self._trace_log_callback = trace_log_callback
|
self._trace_log_callback = trace_log_callback
|
||||||
rl.set_trace_log_callback(self._trace_log_callback)
|
rl.set_trace_log_callback(self._trace_log_callback)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class Multilang:
|
|||||||
translation = gettext.GNUTranslations(fh)
|
translation = gettext.GNUTranslations(fh)
|
||||||
translation.install()
|
translation.install()
|
||||||
self._translation = translation
|
self._translation = translation
|
||||||
cloudlog.warning(f"Loaded translations for language: {self._language}")
|
cloudlog.debug(f"Loaded translations for language: {self._language}")
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
cloudlog.error(f"No translation file found for language: {self._language}, using default.")
|
cloudlog.error(f"No translation file found for language: {self._language}, using default.")
|
||||||
gettext.install('app')
|
gettext.install('app')
|
||||||
|
|||||||
Reference in New Issue
Block a user