From 349a4b1e9563d64bb6ccdb48cfb6de0d7b801fd9 Mon Sep 17 00:00:00 2001 From: pokepetter Date: Sat, 9 Nov 2024 18:49:16 +0100 Subject: [PATCH] fixed window settings not honoring development_mode settings by ching default values to None and only change when if they're not. This was an issue where builds wouldn't automatically open in fullscreen, and editor ui was still visible. --- ursina/main.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ursina/main.py b/ursina/main.py index 95af8563..23296c84 100644 --- a/ursina/main.py +++ b/ursina/main.py @@ -24,7 +24,7 @@ from ursina.scripts.singleton_decorator import singleton @singleton class Ursina(ShowBase): - def __init__(self, title='ursina', icon='textures/ursina.ico', borderless=False, fullscreen=False, size=None, forced_aspect_ratio=None, position=None, vsync=True, editor_ui_enabled=True, window_type='onscreen', development_mode=True, render_mode=None, show_ursina_splash=False, use_ingame_console=False, **kwargs): + def __init__(self, title='ursina', icon='textures/ursina.ico', borderless:bool=None, fullscreen:bool=None, size=None, forced_aspect_ratio=None, position=None, vsync=True, editor_ui_enabled:bool=None, window_type='onscreen', development_mode:bool=None, render_mode=None, show_ursina_splash=False, use_ingame_console=False, **kwargs): """The main class of Ursina. This class is a singleton, so you can only have one instance of it. Keyword Args (optional): @@ -44,7 +44,9 @@ def __init__(self, title='ursina', icon='textures/ursina.ico', borderless=False, entity._warn_if_ursina_not_instantiated = False application.window_type = window_type application.base = self - application.development_mode = development_mode + if development_mode is not None: + application.development_mode = development_mode + application.show_ursina_splash = show_ursina_splash try: @@ -56,8 +58,12 @@ def __init__(self, title='ursina', icon='textures/ursina.ico', borderless=False, if 'gltf_no_srgb' in kwargs: application.gltf_no_srgb = kwargs['gltf_no_srgb'] - if not application.development_mode: + if fullscreen is None and not application.development_mode: fullscreen = True + if borderless is None: + borderless = True + if editor_ui_enabled is None: + editor_ui_enabled = False window.ready(title=title, icon=icon, borderless=borderless, fullscreen=fullscreen, size=size, forced_aspect_ratio=forced_aspect_ratio, position=position, vsync=vsync, window_type=window_type,