Skip to content

Commit

Permalink
fixed window settings not honoring development_mode settings by ching…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
pokepetter committed Nov 9, 2024
1 parent f193b8f commit 349a4b1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ursina/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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:
Expand All @@ -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,
Expand Down

0 comments on commit 349a4b1

Please sign in to comment.