diff --git a/assets/src/ba_data/python/_ba.py b/assets/src/ba_data/python/_ba.py index 73491b72..16b4c4d9 100644 --- a/assets/src/ba_data/python/_ba.py +++ b/assets/src/ba_data/python/_ba.py @@ -34,7 +34,7 @@ NOTE: This file was autogenerated by gendummymodule; do not edit by hand. """ # (hash we can use to see if this file is out of date) -# SOURCES_HASH=293498427545140555839175614948455855333 +# SOURCES_HASH=126196922259492504803685031830587478733 # I'm sorry Pylint. I know this file saddens you. Be strong. # pylint: disable=useless-suppression @@ -1987,8 +1987,8 @@ def get_connection_to_host_info() -> dict: return dict() -def get_display_resolution() -> Tuple[int, int]: - """get_display_resolution() -> Tuple[int, int] +def get_display_resolution() -> Optional[Tuple[int, int]]: + """get_display_resolution() -> Optional[Tuple[int, int]] (internal) diff --git a/assets/src/ba_data/python/bastd/ui/settings/graphics.py b/assets/src/ba_data/python/bastd/ui/settings/graphics.py index 010bd81a..0fda19b6 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/graphics.py +++ b/assets/src/ba_data/python/bastd/ui/settings/graphics.py @@ -256,6 +256,7 @@ class GraphicsSettingsWindow(ba.Window): on_value_change_call=self._set_gvr_render_target_scale) else: native_res = _ba.get_display_resolution() + assert native_res is not None choices = ['Auto', 'Native'] choices_display = [ ba.Lstr(resource='autoText'), @@ -283,7 +284,7 @@ class GraphicsSettingsWindow(ba.Window): # set pixel-scale instead current_res = _ba.get_display_resolution() if current_res is None: - current_res = (str(min(100, max(10, int(round( + current_res2 = (str(min(100, max(10, int(round( ba.app.config.resolve('Screen Pixel Scale') * 100.0))))) + '%') # yapf: disable popup.PopupMenu( @@ -292,7 +293,7 @@ class GraphicsSettingsWindow(ba.Window): width=120, scale=popup_menu_scale, choices=['100%', '88%', '75%', '63%', '50%'], - current_choice=current_res, + current_choice=current_res2, on_value_change_call=self._set_pixel_scale) else: raise Exception('obsolete path; discrete resolutions'