diff --git a/.efrocachemap b/.efrocachemap index b38e80e7..12fe1448 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4135,16 +4135,16 @@ "assets/build/windows/x64/vc_redist.x64.exe": "https://files.ballistica.net/cache/ba1/ea/19/8b8787d81abcdce158ba608cd24f", "assets/build/windows/x64/vcruntime140_1d.dll": "https://files.ballistica.net/cache/ba1/11/d8/ff6344b429b00c24d9a1930d4338", "assets/build/windows/x64/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/20/33/0825e11e6518f87ece3009309933", - "build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/b6/f3/a034a7393edf52eefe644e6aa642", - "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/5d/e2/c45ee46dc39c32aa4bff0d50ef2c", - "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/25/3d/f3cce76ed1c66e39b6e07d199696", - "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/cf/8b/5c09d999c0d6b160e34d69f1f710", - "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/c7/b6/18b0280b4c99aaf48fb3bfcc4fac", - "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/c4/65/dd50a2026be7df75e3d280a2efc3", - "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/62/4e/f6a184076ad4676ad6b4cf9d4d01", - "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/20/d9/f86cd5d9fb67183e0a2ceda0e897", - "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/e4/da/0b43bb125048696f4514eaca1e56", - "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/d6/46/d0e647509453bc2125ccbe7eba09", - "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/c2/a8/fee89fe0a3d76489b5b26a2c5fac", - "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/70/d5/86c8bdb5cf1dd15d9b9a0c7490da" + "build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/ff/36/ca09cc3913ae40382d73340f62ab", + "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/ca/30/613d0c5acf97d7eb7770c4138a3b", + "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/cb/58/e668468c6ebe7b3b1bacc7079f16", + "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/3a/93/215ba8579ffc8bc5fc67aa6d1bfc", + "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/a1/c5/b0be277a5324eccf97218644f429", + "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/7c/f3/f82f3a29652ed279447dc5b1c4a5", + "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/21/aa/312efa59677ebd9a97b8f7f48796", + "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/7c/de/c926cf39c972f1084762c917bb9c", + "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/bd/bb/bfb59d70d101eefd14987007225d", + "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/df/d3/3e91ec5117fe359c2e94818b9788", + "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/20/c0/cad3a08df13d190bbeff26bb901f", + "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/ea/28/efe665eddea710871da829ad2dce" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 791eac14..def8e616 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ - Added 'selection_loops_to_parent', 'claims_left_right', and 'claims_tab' args to ba.rowwidget. - Added 'claims_left_right' and 'claims_tab' to ba.hscrollwidget(). - Default widget 'show_buffer' is now 20 instead of 0 (causes scrolling to stay slightly ahead of widget selection). This can be overridden with the ba.widget() call if anything breaks. +- Relocated ba.app.uiscale to ba.app.ui.uiscale +- Top level settings window now properly saves/restores its state again. - BombSquad now has its own Exclusive Emojis in the Internal Game Keyboard. - Added continuos CAPITAL letters typing feature in the Internal Game Keyboard. diff --git a/assets/src/ba_data/python/_ba.py b/assets/src/ba_data/python/_ba.py index bbffcfcb..9ead9791 100644 --- a/assets/src/ba_data/python/_ba.py +++ b/assets/src/ba_data/python/_ba.py @@ -2819,6 +2819,14 @@ def is_running_on_ouya() -> bool: return bool() +def is_xcode_build() -> bool: + """is_xcode_build() -> bool + + (internal) + """ + return bool() + + def lock_all_input() -> None: """lock_all_input() -> None diff --git a/assets/src/ba_data/python/ba/_activitytypes.py b/assets/src/ba_data/python/ba/_activitytypes.py index 065c47e2..2d8b917e 100644 --- a/assets/src/ba_data/python/ba/_activitytypes.py +++ b/assets/src/ba_data/python/ba/_activitytypes.py @@ -191,7 +191,7 @@ class ScoreScreenActivity(Activity[EmptyPlayer, EmptyTeam]): # Pop up a 'press any button to continue' statement after our # min-view-time show a 'press any button to continue..' # thing after a bit. - if _ba.app.uiscale is UIScale.LARGE: + if _ba.app.ui.uiscale is UIScale.LARGE: # FIXME: Need a better way to determine whether we've probably # got a keyboard. sval = _lang.Lstr(resource='pressAnyKeyButtonText') diff --git a/assets/src/ba_data/python/ba/_app.py b/assets/src/ba_data/python/ba/_app.py index 023f3957..4c136eeb 100644 --- a/assets/src/ba_data/python/ba/_app.py +++ b/assets/src/ba_data/python/ba/_app.py @@ -30,7 +30,6 @@ import _ba if TYPE_CHECKING: import ba from ba import _lang, _meta - from ba.ui import UICleanupCheck from bastd.actor import spazappearance from typing import Optional, Dict, Set, Any, Type, Tuple, Callable, List @@ -230,11 +229,6 @@ class App: from ba._meta import CURRENT_API_VERSION return CURRENT_API_VERSION - @property - def uiscale(self) -> ba.UIScale: - """Current ui scale for the app.""" - return self._uiscale - @property def on_tv(self) -> bool: """Bool value for if the game is running on a TV.""" @@ -261,7 +255,6 @@ class App: """ # pylint: disable=too-many-statements from ba._music import MusicController - from ba._enums import UIScale from ba._ui import UI # Config. @@ -299,16 +292,6 @@ class App: assert isinstance(self._platform, str) self._subplatform: str = env['subplatform'] assert isinstance(self._subplatform, str) - self._uiscale: ba.UIScale - interfacetype = env['interface_type'] - if interfacetype == 'large': - self._uiscale = UIScale.LARGE - elif interfacetype == 'medium': - self._uiscale = UIScale.MEDIUM - elif interfacetype == 'small': - self._uiscale = UIScale.SMALL - else: - raise RuntimeError('Invalid UIScale value: {interfacetype}') self._on_tv: bool = env['on_tv'] assert isinstance(self._on_tv, bool) self._vr_mode: bool = env['vr_mode'] @@ -422,8 +405,6 @@ class App: """Runs after the app finishes bootstrapping. (internal)""" - # FIXME: Break this up. - # pylint: disable=too-many-statements # pylint: disable=too-many-locals # pylint: disable=cyclic-import from ba import _apputils @@ -435,7 +416,7 @@ class App: from bastd import appdelegate from bastd import maps as stdmaps from bastd.actor import spazappearance - from ba._enums import TimeType, UIScale + from ba._enums import TimeType cfg = self.config @@ -464,29 +445,6 @@ class App: and not _ba.is_blessed()): _ba.screenmessage('WARNING: NON-BLESSED BUILD', color=(1, 0, 0)) - # IMPORTANT: If tweaking UI stuff, make sure it behaves for small, - # medium, and large UI modes. (doesn't run off screen, etc). - # The overrides below can be used to test with different sizes. - # Generally small is used on phones, medium is used on tablets/tvs, - # and large is on desktop computers or perhaps large tablets. When - # possible, run in windowed mode and resize the window to assure - # this holds true at all aspect ratios. - - # UPDATE: A better way to test this is now by setting the environment - # variable BA_FORCE_UI_SCALE to "small", "medium", or "large". - # This will affect system UIs not covered by the values below such - # as screen-messages. The below values remain functional, however, - # for cases such as Android where environment variables can't be set - # easily. - - if bool(False): # force-test ui scale - self._uiscale = UIScale.SMALL - with _ba.Context('ui'): - _ba.pushcall(lambda: _ba.screenmessage( - f'FORCING UISCALE {self._uiscale.name} FOR TESTING', - color=(1, 0, 1), - log=True)) - # If there's a leftover log file, attempt to upload it to the # master-server and/or get rid of it. _apputils.handle_leftover_log_file() diff --git a/assets/src/ba_data/python/ba/_gameutils.py b/assets/src/ba_data/python/ba/_gameutils.py index dbe0c6d0..6679b685 100644 --- a/assets/src/ba_data/python/ba/_gameutils.py +++ b/assets/src/ba_data/python/ba/_gameutils.py @@ -224,7 +224,7 @@ def show_damage_count(damage: str, position: Sequence[float], # FIXME: Should never vary game elements based on local config. # (connected clients may have differing configs so they won't # get the intended results). - do_big = app.uiscale is UIScale.SMALL or app.vr_mode + do_big = app.ui.uiscale is UIScale.SMALL or app.vr_mode txtnode = _ba.newnode('text', attrs={ 'text': damage, diff --git a/assets/src/ba_data/python/ba/_ui.py b/assets/src/ba_data/python/ba/_ui.py index 5c612bf2..f2a5537c 100644 --- a/assets/src/ba_data/python/ba/_ui.py +++ b/assets/src/ba_data/python/ba/_ui.py @@ -25,6 +25,7 @@ from __future__ import annotations from typing import TYPE_CHECKING import _ba +from ba._enums import UIScale if TYPE_CHECKING: from typing import Optional, Dict, Any, Callable, List @@ -43,8 +44,19 @@ class UI: self._main_menu_window: Optional[ba.Widget] = None self._main_menu_location: Optional[str] = None + self._uiscale: ba.UIScale + + interfacetype = env['interface_type'] + if interfacetype == 'large': + self._uiscale = UIScale.LARGE + elif interfacetype == 'medium': + self._uiscale = UIScale.MEDIUM + elif interfacetype == 'small': + self._uiscale = UIScale.SMALL + else: + raise RuntimeError('Invalid UIScale value: {interfacetype}') + self.window_states: Dict = {} # FIXME: Kill this. - # self.windows: Dict = {} # FIXME: Kill this. self.main_menu_selection: Optional[str] = None # FIXME: Kill this. self.have_party_queue_window = False self.quit_window: Any = None @@ -58,11 +70,39 @@ class UI: self.heading_color = (0.72, 0.7, 0.75) self.infotextcolor = (0.7, 0.9, 0.7) + @property + def uiscale(self) -> ba.UIScale: + """Current ui scale for the app.""" + return self._uiscale + def on_app_launch(self) -> None: """Should be run on app launch.""" from ba.ui import UIController, ui_upkeep from ba._enums import TimeType + # IMPORTANT: If tweaking UI stuff, make sure it behaves for small, + # medium, and large UI modes. (doesn't run off screen, etc). + # The overrides below can be used to test with different sizes. + # Generally small is used on phones, medium is used on tablets/tvs, + # and large is on desktop computers or perhaps large tablets. When + # possible, run in windowed mode and resize the window to assure + # this holds true at all aspect ratios. + + # UPDATE: A better way to test this is now by setting the environment + # variable BA_FORCE_UI_SCALE to "small", "medium", or "large". + # This will affect system UIs not covered by the values below such + # as screen-messages. The below values remain functional, however, + # for cases such as Android where environment variables can't be set + # easily. + + if bool(False): # force-test ui scale + self._uiscale = UIScale.SMALL + with _ba.Context('ui'): + _ba.pushcall(lambda: _ba.screenmessage( + f'FORCING UISCALE {self._uiscale.name} FOR TESTING', + color=(1, 0, 1), + log=True)) + self.controller = UIController() # Kick off our periodic UI upkeep. diff --git a/assets/src/ba_data/python/bastd/activity/multiteamvictory.py b/assets/src/ba_data/python/bastd/activity/multiteamvictory.py index 6f0bd926..352febc7 100644 --- a/assets/src/ba_data/python/bastd/activity/multiteamvictory.py +++ b/assets/src/ba_data/python/bastd/activity/multiteamvictory.py @@ -54,7 +54,7 @@ class TeamSeriesVictoryScoreScreenActivity(MultiTeamScoreScreenActivity): from ba.deprecated import get_resource ba.set_analytics_screen('FreeForAll Series Victory Screen' if self. _is_ffa else 'Teams Series Victory Screen') - if ba.app.uiscale is ba.UIScale.LARGE: + if ba.app.ui.uiscale is ba.UIScale.LARGE: sval = ba.Lstr(resource='pressAnyKeyButtonPlayAgainText') else: sval = ba.Lstr(resource='pressAnyButtonPlayAgainText') diff --git a/assets/src/ba_data/python/bastd/game/runaround.py b/assets/src/ba_data/python/bastd/game/runaround.py index 66cd18b0..0813b076 100644 --- a/assets/src/ba_data/python/bastd/game/runaround.py +++ b/assets/src/ba_data/python/bastd/game/runaround.py @@ -398,7 +398,7 @@ class RunaroundGame(ba.CoopGameActivity[Player, Team]): self._tntspawner = TNTSpawner(position=self._tntspawnpos) # Make sure to stay out of the way of menu/party buttons in the corner. - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale l_offs = (-80 if uiscale is ba.UIScale.SMALL else -40 if uiscale is ba.UIScale.MEDIUM else 0) diff --git a/assets/src/ba_data/python/bastd/mainmenu.py b/assets/src/ba_data/python/bastd/mainmenu.py index 6b275cd9..99795e68 100644 --- a/assets/src/ba_data/python/bastd/mainmenu.py +++ b/assets/src/ba_data/python/bastd/mainmenu.py @@ -65,7 +65,7 @@ class MainMenuActivity(ba.Activity[ba.Player, ba.Team]): color = ((1.0, 1.0, 1.0, 1.0) if vr_mode else (0.5, 0.6, 0.5, 0.6)) # FIXME: Need a node attr for vr-specific-scale. scale = (0.9 if - (app.uiscale is ba.UIScale.SMALL or vr_mode) else 0.7) + (app.ui.uiscale is ba.UIScale.SMALL or vr_mode) else 0.7) self.my_name = ba.NodeActor( ba.newnode('text', attrs={ @@ -104,7 +104,7 @@ class MainMenuActivity(ba.Activity[ba.Player, ba.Team]): # Any differences need to happen at the engine level so everyone sees # things in their own optimal way. vr_mode = app.vr_mode - uiscale = app.uiscale + uiscale = app.ui.uiscale # In cases where we're doing lots of dev work lets always show the # build number. @@ -373,7 +373,7 @@ class MainMenuActivity(ba.Activity[ba.Player, ba.Team]): ba.WeakCall(self._change_phrase), repeat=True) - scl = 1.2 if (ba.app.uiscale is ba.UIScale.SMALL + scl = 1.2 if (ba.app.ui.uiscale is ba.UIScale.SMALL or ba.app.vr_mode) else 0.8 color2 = ((1, 1, 1, 1) if ba.app.vr_mode else diff --git a/assets/src/ba_data/python/bastd/ui/account/link.py b/assets/src/ba_data/python/bastd/ui/account/link.py index 8f0c238d..261b358b 100644 --- a/assets/src/ba_data/python/bastd/ui/account/link.py +++ b/assets/src/ba_data/python/bastd/ui/account/link.py @@ -49,7 +49,7 @@ class AccountLinkWindow(ba.Window): bg_color = (0.4, 0.4, 0.5) self._width = 560 self._height = 420 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale base_scale = (1.65 if uiscale is ba.UIScale.SMALL else 1.5 if uiscale is ba.UIScale.MEDIUM else 1.1) super().__init__(root_widget=ba.containerwidget( @@ -132,7 +132,7 @@ class AccountLinkCodeWindow(ba.Window): def __init__(self, data: Dict[str, Any]): self._width = 350 self._height = 200 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), color=(0.45, 0.63, 0.15), diff --git a/assets/src/ba_data/python/bastd/ui/account/settings.py b/assets/src/ba_data/python/bastd/ui/account/settings.py index 3ec9adf8..bf970745 100644 --- a/assets/src/ba_data/python/bastd/ui/account/settings.py +++ b/assets/src/ba_data/python/bastd/ui/account/settings.py @@ -77,7 +77,7 @@ class AccountSettingsWindow(ba.Window): self._can_reset_achievements = (account_type == 'Game Center') app = ba.app - uiscale = app.uiscale + uiscale = app.ui.uiscale self._width = 760 if uiscale is ba.UIScale.SMALL else 660 x_offs = 50 if uiscale is ba.UIScale.SMALL else 0 diff --git a/assets/src/ba_data/python/bastd/ui/account/unlink.py b/assets/src/ba_data/python/bastd/ui/account/unlink.py index 214d8f92..83ed0b47 100644 --- a/assets/src/ba_data/python/bastd/ui/account/unlink.py +++ b/assets/src/ba_data/python/bastd/ui/account/unlink.py @@ -50,7 +50,7 @@ class AccountUnlinkWindow(ba.Window): self._height = 350 self._scroll_width = 400 self._scroll_height = 200 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale base_scale = (2.0 if uiscale is ba.UIScale.SMALL else 1.6 if uiscale is ba.UIScale.MEDIUM else 1.1) super().__init__(root_widget=ba.containerwidget( diff --git a/assets/src/ba_data/python/bastd/ui/account/viewer.py b/assets/src/ba_data/python/bastd/ui/account/viewer.py index 044196c7..6560d908 100644 --- a/assets/src/ba_data/python/bastd/ui/account/viewer.py +++ b/assets/src/ba_data/python/bastd/ui/account/viewer.py @@ -46,7 +46,7 @@ class AccountViewerWindow(popup.PopupWindow): self._account_id = account_id self._profile_id = profile_id - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if scale is None: scale = (2.6 if uiscale is ba.UIScale.SMALL else 1.8 if uiscale is ba.UIScale.MEDIUM else 1.4) @@ -161,7 +161,7 @@ class AccountViewerWindow(popup.PopupWindow): choices.append('ban') choices_display.append(ba.Lstr(resource='banThisPlayerText')) - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale popup.PopupMenuWindow( position=self._extras_menu_button.get_screen_space_center(), scale=(2.3 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/achievements.py b/assets/src/ba_data/python/bastd/ui/achievements.py index b63ce088..6c4685a8 100644 --- a/assets/src/ba_data/python/bastd/ui/achievements.py +++ b/assets/src/ba_data/python/bastd/ui/achievements.py @@ -36,7 +36,7 @@ class AchievementsWindow(popup.PopupWindow): def __init__(self, position: Tuple[float, float], scale: float = None): # pylint: disable=too-many-locals - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if scale is None: scale = (2.3 if uiscale is ba.UIScale.SMALL else 1.65 if uiscale is ba.UIScale.MEDIUM else 1.23) diff --git a/assets/src/ba_data/python/bastd/ui/appinvite.py b/assets/src/ba_data/python/bastd/ui/appinvite.py index db1615c4..3ce9270d 100644 --- a/assets/src/ba_data/python/bastd/ui/appinvite.py +++ b/assets/src/ba_data/python/bastd/ui/appinvite.py @@ -42,7 +42,7 @@ class AppInviteWindow(ba.Window): self._width = 650 self._height = 400 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), transition='in_scale', @@ -174,7 +174,7 @@ class ShowFriendCodeWindow(ba.Window): ba.set_analytics_screen('Friend Promo Code') self._width = 650 self._height = 400 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), color=(0.45, 0.63, 0.15), diff --git a/assets/src/ba_data/python/bastd/ui/characterpicker.py b/assets/src/ba_data/python/bastd/ui/characterpicker.py index 4952988c..c18f4806 100644 --- a/assets/src/ba_data/python/bastd/ui/characterpicker.py +++ b/assets/src/ba_data/python/bastd/ui/characterpicker.py @@ -48,7 +48,7 @@ class CharacterPicker(popup.PopupWindow): # pylint: disable=too-many-locals from bastd.actor import spazappearance del parent # unused here - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if scale is None: scale = (1.85 if uiscale is ba.UIScale.SMALL else 1.65 if uiscale is ba.UIScale.MEDIUM else 1.23) diff --git a/assets/src/ba_data/python/bastd/ui/colorpicker.py b/assets/src/ba_data/python/bastd/ui/colorpicker.py index 21f4328e..336be37e 100644 --- a/assets/src/ba_data/python/bastd/ui/colorpicker.py +++ b/assets/src/ba_data/python/bastd/ui/colorpicker.py @@ -52,7 +52,7 @@ class ColorPicker(PopupWindow): assert len(c_raw) == 16 self.colors = [c_raw[0:4], c_raw[4:8], c_raw[8:12], c_raw[12:16]] - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if scale is None: scale = (2.3 if uiscale is ba.UIScale.SMALL else 1.65 if uiscale is ba.UIScale.MEDIUM else 1.23) @@ -191,7 +191,7 @@ class ColorPickerExact(PopupWindow): assert len(c_raw) == 16 self.colors = [c_raw[0:4], c_raw[4:8], c_raw[8:12], c_raw[12:16]] - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if scale is None: scale = (2.3 if uiscale is ba.UIScale.SMALL else 1.65 if uiscale is ba.UIScale.MEDIUM else 1.23) diff --git a/assets/src/ba_data/python/bastd/ui/confirm.py b/assets/src/ba_data/python/bastd/ui/confirm.py index 5874d299..803b5231 100644 --- a/assets/src/ba_data/python/bastd/ui/confirm.py +++ b/assets/src/ba_data/python/bastd/ui/confirm.py @@ -68,7 +68,7 @@ class ConfirmWindow: scale_origin = None transition = 'in_right' - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self.root_widget = ba.containerwidget( size=(width, height), transition=transition, diff --git a/assets/src/ba_data/python/bastd/ui/coop/browser.py b/assets/src/ba_data/python/bastd/ui/coop/browser.py index 840f4fc3..ef313d00 100644 --- a/assets/src/ba_data/python/bastd/ui/coop/browser.py +++ b/assets/src/ba_data/python/bastd/ui/coop/browser.py @@ -40,7 +40,7 @@ class CoopBrowserWindow(ba.Window): """Window for browsing co-op levels/games/etc.""" def _update_corner_button_positions(self) -> None: - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale offs = (-55 if uiscale is ba.UIScale.SMALL and _ba.is_party_icon_visible() else 0) if self._league_rank_button is not None: @@ -98,7 +98,7 @@ class CoopBrowserWindow(ba.Window): self._hard_button_lock_image: Optional[ba.Widget] = None self._campaign_percent_text: Optional[ba.Widget] = None - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 1320 if uiscale is ba.UIScale.SMALL else 1120 self._x_inset = x_inset = 100 if uiscale is ba.UIScale.SMALL else 0 self._height = (657 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/coop/level.py b/assets/src/ba_data/python/bastd/ui/coop/level.py index 85271139..f5b656af 100644 --- a/assets/src/ba_data/python/bastd/ui/coop/level.py +++ b/assets/src/ba_data/python/bastd/ui/coop/level.py @@ -32,7 +32,7 @@ class CoopLevelLockedWindow(ba.Window): width = 550.0 height = 250.0 lock_tex = ba.gettexture('lock') - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(width, height), transition='in_right', diff --git a/assets/src/ba_data/python/bastd/ui/creditslist.py b/assets/src/ba_data/python/bastd/ui/creditslist.py index f2241f8a..84ffa9ea 100644 --- a/assets/src/ba_data/python/bastd/ui/creditslist.py +++ b/assets/src/ba_data/python/bastd/ui/creditslist.py @@ -51,7 +51,7 @@ class CreditsListWindow(ba.Window): scale_origin = None transition = 'in_right' - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale width = 870 if uiscale is ba.UIScale.SMALL else 670 x_inset = 100 if uiscale is ba.UIScale.SMALL else 0 height = 398 if uiscale is ba.UIScale.SMALL else 500 diff --git a/assets/src/ba_data/python/bastd/ui/debug.py b/assets/src/ba_data/python/bastd/ui/debug.py index 8470d1df..c523047b 100644 --- a/assets/src/ba_data/python/bastd/ui/debug.py +++ b/assets/src/ba_data/python/bastd/ui/debug.py @@ -38,7 +38,7 @@ class DebugWindow(ba.Window): # pylint: disable=cyclic-import from bastd.ui import popup - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = width = 580 self._height = height = (350 if uiscale is ba.UIScale.SMALL else 420 if uiscale is ba.UIScale.MEDIUM else 520) @@ -55,7 +55,7 @@ class DebugWindow(ba.Window): self._stress_test_round_duration = 30 self._r = 'debugWindow' - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(width, height), transition=transition, diff --git a/assets/src/ba_data/python/bastd/ui/feedback.py b/assets/src/ba_data/python/bastd/ui/feedback.py index 5f5fb37b..0ecfe985 100644 --- a/assets/src/ba_data/python/bastd/ui/feedback.py +++ b/assets/src/ba_data/python/bastd/ui/feedback.py @@ -41,7 +41,7 @@ def ask_for_rating() -> Optional[ba.Widget]: width = 700 height = 400 spacing = 40 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale dlg = ba.containerwidget( size=(width, height), transition='in_right', diff --git a/assets/src/ba_data/python/bastd/ui/fileselector.py b/assets/src/ba_data/python/bastd/ui/fileselector.py index cc5badc3..00fb2fba 100644 --- a/assets/src/ba_data/python/bastd/ui/fileselector.py +++ b/assets/src/ba_data/python/bastd/ui/fileselector.py @@ -45,7 +45,7 @@ class FileSelectorWindow(ba.Window): allow_folders: bool = False): if valid_file_extensions is None: valid_file_extensions = [] - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 700 if uiscale is ba.UIScale.SMALL else 600 self._x_inset = x_inset = 50 if uiscale is ba.UIScale.SMALL else 0 self._height = 365 if uiscale is ba.UIScale.SMALL else 418 diff --git a/assets/src/ba_data/python/bastd/ui/gather.py b/assets/src/ba_data/python/bastd/ui/gather.py index 2347e3af..5df5bf23 100644 --- a/assets/src/ba_data/python/bastd/ui/gather.py +++ b/assets/src/ba_data/python/bastd/ui/gather.py @@ -58,7 +58,7 @@ class GatherWindow(ba.Window): ba.app.ui.set_main_menu_location('Gather') _ba.set_party_icon_always_visible(True) self._public_parties: Dict[str, Dict[str, Any]] = {} - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 1240 if uiscale is ba.UIScale.SMALL else 1040 x_offs = 100 if uiscale is ba.UIScale.SMALL else 0 self._height = (582 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/getcurrency.py b/assets/src/ba_data/python/bastd/ui/getcurrency.py index b3524168..78f28a62 100644 --- a/assets/src/ba_data/python/bastd/ui/getcurrency.py +++ b/assets/src/ba_data/python/bastd/ui/getcurrency.py @@ -65,7 +65,7 @@ class GetCurrencyWindow(ba.Window): self._transition_out = 'out_right' scale_origin = None - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 1000.0 if uiscale is ba.UIScale.SMALL else 800.0 x_inset = 100.0 if uiscale is ba.UIScale.SMALL else 0.0 self._height = 480.0 diff --git a/assets/src/ba_data/python/bastd/ui/getremote.py b/assets/src/ba_data/python/bastd/ui/getremote.py index 4d7c6a84..3dcae3f3 100644 --- a/assets/src/ba_data/python/bastd/ui/getremote.py +++ b/assets/src/ba_data/python/bastd/ui/getremote.py @@ -36,7 +36,7 @@ class GetBSRemoteWindow(popup.PopupWindow): def __init__(self) -> None: position = (0.0, 0.0) - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale scale = (2.3 if uiscale is ba.UIScale.SMALL else 1.65 if uiscale is ba.UIScale.MEDIUM else 1.23) self._transitioning_out = False diff --git a/assets/src/ba_data/python/bastd/ui/helpui.py b/assets/src/ba_data/python/bastd/ui/helpui.py index e0a49083..259977d4 100644 --- a/assets/src/ba_data/python/bastd/ui/helpui.py +++ b/assets/src/ba_data/python/bastd/ui/helpui.py @@ -57,7 +57,7 @@ class HelpWindow(ba.Window): self._r = 'helpWindow' self._main_menu = main_menu - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale width = 950 if uiscale is ba.UIScale.SMALL else 750 x_offs = 100 if uiscale is ba.UIScale.SMALL else 0 height = (460 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/iconpicker.py b/assets/src/ba_data/python/bastd/ui/iconpicker.py index d2cc9794..2633aba1 100644 --- a/assets/src/ba_data/python/bastd/ui/iconpicker.py +++ b/assets/src/ba_data/python/bastd/ui/iconpicker.py @@ -50,7 +50,7 @@ class IconPicker(popup.PopupWindow): del parent # unused here del tint_color # unused_here del tint2_color # unused here - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if scale is None: scale = (1.85 if uiscale is ba.UIScale.SMALL else 1.65 if uiscale is ba.UIScale.MEDIUM else 1.23) diff --git a/assets/src/ba_data/python/bastd/ui/kiosk.py b/assets/src/ba_data/python/bastd/ui/kiosk.py index 1b6625aa..3d21fae6 100644 --- a/assets/src/ba_data/python/bastd/ui/kiosk.py +++ b/assets/src/ba_data/python/bastd/ui/kiosk.py @@ -311,7 +311,7 @@ class KioskWindow(ba.Window): self._b4 = self._b5 = self._b6 = None self._b7: Optional[ba.Widget] - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if bool(False): self._b7 = ba.buttonwidget( parent=self._root_widget, diff --git a/assets/src/ba_data/python/bastd/ui/league/rankwindow.py b/assets/src/ba_data/python/bastd/ui/league/rankwindow.py index 6bfc30b0..0c83c884 100644 --- a/assets/src/ba_data/python/bastd/ui/league/rankwindow.py +++ b/assets/src/ba_data/python/bastd/ui/league/rankwindow.py @@ -58,7 +58,7 @@ class LeagueRankWindow(ba.Window): self._transition_out = 'out_right' scale_origin = None - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 1320 if uiscale is ba.UIScale.SMALL else 1120 x_inset = 100 if uiscale is ba.UIScale.SMALL else 0 self._height = (657 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/mainmenu.py b/assets/src/ba_data/python/bastd/ui/mainmenu.py index 99a36922..070dc893 100644 --- a/assets/src/ba_data/python/bastd/ui/mainmenu.py +++ b/assets/src/ba_data/python/bastd/ui/mainmenu.py @@ -187,7 +187,7 @@ class MainMenuWindow(ba.Window): self._r = 'mainMenu' app = ba.app - self._have_quit_button = (app.uiscale is ba.UIScale.LARGE + self._have_quit_button = (app.ui.uiscale is ba.UIScale.LARGE or (app.platform == 'windows' and app.subplatform == 'oculus')) @@ -288,7 +288,7 @@ class MainMenuWindow(ba.Window): sale_scale=1.3, transition_delay=self._tdelay) self._store_button = store_button = sbtn.get_button() - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale icon_size = (55 if uiscale is ba.UIScale.SMALL else 55 if uiscale is ba.UIScale.MEDIUM else 70) ba.imagewidget( @@ -357,7 +357,7 @@ class MainMenuWindow(ba.Window): b_size = 50.0 b_buffer = 10.0 t_scale = 0.75 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if uiscale is ba.UIScale.SMALL: b_size *= 0.6 b_buffer *= 1.0 @@ -459,7 +459,7 @@ class MainMenuWindow(ba.Window): b_count += 1 if self._have_store_button: b_count += 1 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if uiscale is ba.UIScale.SMALL: root_widget_scale = 1.6 play_button_width = self._button_width * 0.65 @@ -517,7 +517,7 @@ class MainMenuWindow(ba.Window): on_activate_call=self._demo_menu_press) else: self._demo_menu_button = None - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale foof = (-1 if uiscale is ba.UIScale.SMALL else 1 if uiscale is ba.UIScale.MEDIUM else 3) h, v, scale = positions[self._p_index] @@ -715,7 +715,7 @@ class MainMenuWindow(ba.Window): # In this case we have a leave *and* a disconnect button. self._height += 50 self._height += 50 * (len(custom_menu_entries)) - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale ba.containerwidget( edit=self._root_widget, size=(self._width, self._height), diff --git a/assets/src/ba_data/python/bastd/ui/onscreenkeyboard.py b/assets/src/ba_data/python/bastd/ui/onscreenkeyboard.py index 9164c492..7f60ff3f 100644 --- a/assets/src/ba_data/python/bastd/ui/onscreenkeyboard.py +++ b/assets/src/ba_data/python/bastd/ui/onscreenkeyboard.py @@ -41,7 +41,7 @@ class OnScreenKeyboardWindow(ba.Window): self._target_text = textwidget self._width = 700 self._height = 400 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale top_extra = 20 if uiscale is ba.UIScale.SMALL else 0 super().__init__(root_widget=ba.containerwidget( parent=_ba.get_special_widget('overlay_stack'), diff --git a/assets/src/ba_data/python/bastd/ui/party.py b/assets/src/ba_data/python/bastd/ui/party.py index 52fcc10a..46dd70eb 100644 --- a/assets/src/ba_data/python/bastd/ui/party.py +++ b/assets/src/ba_data/python/bastd/ui/party.py @@ -47,7 +47,7 @@ class PartyWindow(ba.Window): self._popup_party_member_client_id: Optional[int] = None self._popup_party_member_is_host: Optional[bool] = None self._width = 500 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._height = (365 if uiscale is ba.UIScale.SMALL else 480 if uiscale is ba.UIScale.MEDIUM else 600) super().__init__(root_widget=ba.containerwidget( @@ -202,7 +202,7 @@ class PartyWindow(ba.Window): def _on_menu_button_press(self) -> None: is_muted = ba.app.config.resolve('Chat Muted') - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale popup.PopupMenuWindow( position=self._menu_button.get_screen_space_center(), scale=(2.3 if uiscale is ba.UIScale.SMALL else @@ -406,7 +406,7 @@ class PartyWindow(ba.Window): 14248): return kick_str = ba.Lstr(resource='kickVoteText') - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale popup.PopupMenuWindow( position=widget.get_screen_space_center(), scale=(2.3 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/partyqueue.py b/assets/src/ba_data/python/bastd/ui/partyqueue.py index 0a1e8dc6..3d5c2df7 100644 --- a/assets/src/ba_data/python/bastd/ui/partyqueue.py +++ b/assets/src/ba_data/python/bastd/ui/partyqueue.py @@ -223,7 +223,7 @@ class PartyQueueWindow(ba.Window): self._line_image: Optional[ba.Widget] = None self.eyes_model = ba.getmodel('plasticEyesTransparent') self._white_tex = ba.gettexture('white') - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), color=(0.45, 0.63, 0.15), diff --git a/assets/src/ba_data/python/bastd/ui/play.py b/assets/src/ba_data/python/bastd/ui/play.py index d097dfde..82eabd59 100644 --- a/assets/src/ba_data/python/bastd/ui/play.py +++ b/assets/src/ba_data/python/bastd/ui/play.py @@ -46,7 +46,7 @@ class PlayWindow(ba.Window): threading.Thread(target=self._preload_modules).start() new_style = True - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale width = 1000 if uiscale is ba.UIScale.SMALL else 800 x_offs = 100 if uiscale is ba.UIScale.SMALL else 0 height = 550 if new_style else 400 diff --git a/assets/src/ba_data/python/bastd/ui/playlist/addgame.py b/assets/src/ba_data/python/bastd/ui/playlist/addgame.py index f93779ef..e2902826 100644 --- a/assets/src/ba_data/python/bastd/ui/playlist/addgame.py +++ b/assets/src/ba_data/python/bastd/ui/playlist/addgame.py @@ -40,7 +40,7 @@ class PlaylistAddGameWindow(ba.Window): transition: str = 'in_right'): self._editcontroller = editcontroller self._r = 'addGameWindow' - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 750 if uiscale is ba.UIScale.SMALL else 650 x_inset = 50 if uiscale is ba.UIScale.SMALL else 0 self._height = (346 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/playlist/browser.py b/assets/src/ba_data/python/bastd/ui/playlist/browser.py index abaf4ed1..d9600955 100644 --- a/assets/src/ba_data/python/bastd/ui/playlist/browser.py +++ b/assets/src/ba_data/python/bastd/ui/playlist/browser.py @@ -218,7 +218,7 @@ class PlaylistBrowserWindow(ba.Window): self._selected_playlist = ba.app.config.get(self._pvars.config_name + ' Playlist Selection') - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 900 if uiscale is ba.UIScale.SMALL else 800 x_inset = 50 if uiscale is ba.UIScale.SMALL else 0 self._height = (480 if uiscale is ba.UIScale.SMALL else @@ -366,7 +366,7 @@ class PlaylistBrowserWindow(ba.Window): h_offs = 225 if count == 1 else 115 if count == 2 else 0 h_offs_bottom = 0 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale for y in range(rows): for x in range(columns): name = items[index][0] diff --git a/assets/src/ba_data/python/bastd/ui/playlist/customizebrowser.py b/assets/src/ba_data/python/bastd/ui/playlist/customizebrowser.py index 640f73a6..b71a7575 100644 --- a/assets/src/ba_data/python/bastd/ui/playlist/customizebrowser.py +++ b/assets/src/ba_data/python/bastd/ui/playlist/customizebrowser.py @@ -59,7 +59,7 @@ class PlaylistCustomizeBrowserWindow(ba.Window): self._pvars = playlist.PlaylistTypeVars(sessiontype) self._max_playlists = 30 self._r = 'gameListWindow' - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 750.0 if uiscale is ba.UIScale.SMALL else 650.0 x_inset = 50.0 if uiscale is ba.UIScale.SMALL else 0.0 self._height = (380.0 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/playlist/edit.py b/assets/src/ba_data/python/bastd/ui/playlist/edit.py index 3b5dda02..35739c28 100644 --- a/assets/src/ba_data/python/bastd/ui/playlist/edit.py +++ b/assets/src/ba_data/python/bastd/ui/playlist/edit.py @@ -45,7 +45,7 @@ class PlaylistEditWindow(ba.Window): self._r = 'editGameListWindow' prev_selection = self._editcontroller.get_edit_ui_selection() - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 770 if uiscale is ba.UIScale.SMALL else 670 x_inset = 50 if uiscale is ba.UIScale.SMALL else 0 self._height = (400 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/playlist/editgame.py b/assets/src/ba_data/python/bastd/ui/playlist/editgame.py index 78a67007..1241c9d5 100644 --- a/assets/src/ba_data/python/bastd/ui/playlist/editgame.py +++ b/assets/src/ba_data/python/bastd/ui/playlist/editgame.py @@ -106,7 +106,7 @@ class PlaylistEditGameWindow(ba.Window): self._choice_selections: Dict[str, int] = {} - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale width = 720 if uiscale is ba.UIScale.SMALL else 620 x_inset = 50 if uiscale is ba.UIScale.SMALL else 0 height = (365 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/playlist/mapselect.py b/assets/src/ba_data/python/bastd/ui/playlist/mapselect.py index 50adc5c9..1bcc15d1 100644 --- a/assets/src/ba_data/python/bastd/ui/playlist/mapselect.py +++ b/assets/src/ba_data/python/bastd/ui/playlist/mapselect.py @@ -55,7 +55,7 @@ class PlaylistMapSelectWindow(ba.Window): except Exception: self._previous_map = '' - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale width = 715 if uiscale is ba.UIScale.SMALL else 615 x_inset = 50 if uiscale is ba.UIScale.SMALL else 0 height = (400 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/playlist/share.py b/assets/src/ba_data/python/bastd/ui/playlist/share.py index 26b47daf..4c2c27e1 100644 --- a/assets/src/ba_data/python/bastd/ui/playlist/share.py +++ b/assets/src/ba_data/python/bastd/ui/playlist/share.py @@ -89,7 +89,7 @@ class SharePlaylistResultsWindow(ba.Window): del origin # unused arg self._width = 450 self._height = 300 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), color=(0.45, 0.63, 0.15), diff --git a/assets/src/ba_data/python/bastd/ui/playoptions.py b/assets/src/ba_data/python/bastd/ui/playoptions.py index 2e9267d4..958c90be 100644 --- a/assets/src/ba_data/python/bastd/ui/playoptions.py +++ b/assets/src/ba_data/python/bastd/ui/playoptions.py @@ -149,7 +149,7 @@ class PlayOptionsWindow(popup.PopupWindow): self._height += 40 # Creates our _root_widget. - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale scale = (1.69 if uiscale is ba.UIScale.SMALL else 1.1 if uiscale is ba.UIScale.MEDIUM else 0.85) super().__init__(position=scale_origin, diff --git a/assets/src/ba_data/python/bastd/ui/popup.py b/assets/src/ba_data/python/bastd/ui/popup.py index 8386b821..517e3a05 100644 --- a/assets/src/ba_data/python/bastd/ui/popup.py +++ b/assets/src/ba_data/python/bastd/ui/popup.py @@ -300,7 +300,7 @@ class PopupMenu: choices_disabled = [] if choices_display is None: choices_display = [] - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if scale is None: scale = (2.3 if uiscale is ba.UIScale.SMALL else 1.65 if uiscale is ba.UIScale.MEDIUM else 1.23) diff --git a/assets/src/ba_data/python/bastd/ui/profile/browser.py b/assets/src/ba_data/python/bastd/ui/profile/browser.py index 4feefaf1..3a471cb4 100644 --- a/assets/src/ba_data/python/bastd/ui/profile/browser.py +++ b/assets/src/ba_data/python/bastd/ui/profile/browser.py @@ -47,7 +47,7 @@ class ProfileBrowserWindow(ba.Window): back_label = ba.Lstr(resource='backText') else: back_label = ba.Lstr(resource='doneText') - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 700.0 if uiscale is ba.UIScale.SMALL else 600.0 x_inset = 50.0 if uiscale is ba.UIScale.SMALL else 0.0 self._height = (360.0 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/profile/edit.py b/assets/src/ba_data/python/bastd/ui/profile/edit.py index 0577a769..36f62bb8 100644 --- a/assets/src/ba_data/python/bastd/ui/profile/edit.py +++ b/assets/src/ba_data/python/bastd/ui/profile/edit.py @@ -63,7 +63,7 @@ class EditProfileWindow(ba.Window): # Grab profile colors or pick random ones. self._color, self._highlight = get_player_profile_colors( existing_profile) - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = width = 780.0 if uiscale is ba.UIScale.SMALL else 680.0 self._x_inset = x_inset = 50.0 if uiscale is ba.UIScale.SMALL else 0.0 self._height = height = ( diff --git a/assets/src/ba_data/python/bastd/ui/profile/upgrade.py b/assets/src/ba_data/python/bastd/ui/profile/upgrade.py index a08de529..c46133c9 100644 --- a/assets/src/ba_data/python/bastd/ui/profile/upgrade.py +++ b/assets/src/ba_data/python/bastd/ui/profile/upgrade.py @@ -45,7 +45,7 @@ class ProfileUpgradeWindow(ba.Window): self._width = 680 self._height = 350 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._base_scale = (2.05 if uiscale is ba.UIScale.SMALL else 1.5 if uiscale is ba.UIScale.MEDIUM else 1.2) self._upgrade_start_time: Optional[float] = None diff --git a/assets/src/ba_data/python/bastd/ui/promocode.py b/assets/src/ba_data/python/bastd/ui/promocode.py index 5959a411..7d0d9a93 100644 --- a/assets/src/ba_data/python/bastd/ui/promocode.py +++ b/assets/src/ba_data/python/bastd/ui/promocode.py @@ -53,7 +53,7 @@ class PromoCodeWindow(ba.Window): self._modal = modal self._r = 'promoCodeWindow' - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(width, height), transition=transition, diff --git a/assets/src/ba_data/python/bastd/ui/purchase.py b/assets/src/ba_data/python/bastd/ui/purchase.py index 6189e937..9fdd6279 100644 --- a/assets/src/ba_data/python/bastd/ui/purchase.py +++ b/assets/src/ba_data/python/bastd/ui/purchase.py @@ -48,7 +48,7 @@ class PurchaseWindow(ba.Window): self._items = list(items) self._width = 580 self._height = 520 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), transition=transition, diff --git a/assets/src/ba_data/python/bastd/ui/qrcode.py b/assets/src/ba_data/python/bastd/ui/qrcode.py index fbe234a1..42ac8a7d 100644 --- a/assets/src/ba_data/python/bastd/ui/qrcode.py +++ b/assets/src/ba_data/python/bastd/ui/qrcode.py @@ -31,7 +31,7 @@ class QRCodeWindow(popup.PopupWindow): def __init__(self, origin_widget: ba.Widget, qr_tex: ba.Texture): position = origin_widget.get_screen_space_center() - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale scale = (2.3 if uiscale is ba.UIScale.SMALL else 1.65 if uiscale is ba.UIScale.MEDIUM else 1.23) self._transitioning_out = False diff --git a/assets/src/ba_data/python/bastd/ui/report.py b/assets/src/ba_data/python/bastd/ui/report.py index afe54852..88600e79 100644 --- a/assets/src/ba_data/python/bastd/ui/report.py +++ b/assets/src/ba_data/python/bastd/ui/report.py @@ -37,7 +37,7 @@ class ReportPlayerWindow(ba.Window): scale_origin = origin_widget.get_screen_space_center() overlay_stack = _ba.get_special_widget('overlay_stack') - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), parent=overlay_stack, diff --git a/assets/src/ba_data/python/bastd/ui/resourcetypeinfo.py b/assets/src/ba_data/python/bastd/ui/resourcetypeinfo.py index 7b3d3cf3..2ebe9728 100644 --- a/assets/src/ba_data/python/bastd/ui/resourcetypeinfo.py +++ b/assets/src/ba_data/python/bastd/ui/resourcetypeinfo.py @@ -30,7 +30,7 @@ class ResourceTypeInfoWindow(popup.PopupWindow): """Popup window providing info about resource types.""" def __init__(self, origin_widget: ba.Widget): - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale scale = (2.3 if uiscale is ba.UIScale.SMALL else 1.65 if uiscale is ba.UIScale.MEDIUM else 1.23) self._transitioning_out = False diff --git a/assets/src/ba_data/python/bastd/ui/serverdialog.py b/assets/src/ba_data/python/bastd/ui/serverdialog.py index 8cdf820d..4a803f3f 100644 --- a/assets/src/ba_data/python/bastd/ui/serverdialog.py +++ b/assets/src/ba_data/python/bastd/ui/serverdialog.py @@ -44,7 +44,7 @@ class ServerDialogWindow(ba.Window): txt_scale) self._width = 500 self._height = 130 + min(200, txt_height) - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), transition='in_scale', diff --git a/assets/src/ba_data/python/bastd/ui/settings/advanced.py b/assets/src/ba_data/python/bastd/ui/settings/advanced.py index 6afca8f3..538f5f47 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/advanced.py +++ b/assets/src/ba_data/python/bastd/ui/settings/advanced.py @@ -59,7 +59,7 @@ class AdvancedSettingsWindow(ba.Window): self._transition_out = 'out_right' scale_origin = None - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 870.0 if uiscale is ba.UIScale.SMALL else 670.0 x_inset = 100 if uiscale is ba.UIScale.SMALL else 0 self._height = (390.0 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/settings/allsettings.py b/assets/src/ba_data/python/bastd/ui/settings/allsettings.py index ab9476c9..0488ce79 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/allsettings.py +++ b/assets/src/ba_data/python/bastd/ui/settings/allsettings.py @@ -54,15 +54,14 @@ class AllSettingsWindow(ba.Window): else: self._transition_out = 'out_right' scale_origin = None - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale width = 900 if uiscale is ba.UIScale.SMALL else 580 x_inset = 75 if uiscale is ba.UIScale.SMALL else 0 height = 435 - # button_height = 42 self._r = 'settingsWindow' top_extra = 20 if uiscale is ba.UIScale.SMALL else 0 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(width, height + top_extra), transition=transition, @@ -204,6 +203,7 @@ class AllSettingsWindow(ba.Window): color=(0.8, 0.95, 1), texture=ba.gettexture('advancedIcon'), draw_controller=avb) + self._restore_state() @staticmethod def _preload_modules() -> None: diff --git a/assets/src/ba_data/python/bastd/ui/settings/audio.py b/assets/src/ba_data/python/bastd/ui/settings/audio.py index 185339c9..2ef25547 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/audio.py +++ b/assets/src/ba_data/python/bastd/ui/settings/audio.py @@ -74,7 +74,7 @@ class AudioSettingsWindow(ba.Window): show_soundtracks = True height += spacing * 2.0 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale base_scale = (2.05 if uiscale is ba.UIScale.SMALL else 1.6 if uiscale is ba.UIScale.MEDIUM else 1.0) popup_menu_scale = base_scale * 1.2 diff --git a/assets/src/ba_data/python/bastd/ui/settings/controls.py b/assets/src/ba_data/python/bastd/ui/settings/controls.py index 6337af17..0e6d0fd9 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/controls.py +++ b/assets/src/ba_data/python/bastd/ui/settings/controls.py @@ -64,12 +64,12 @@ class ControlsSettingsWindow(ba.Window): spacing = 50.0 button_width = 350.0 width = 460.0 - height = 85.0 + height = 130.0 space_height = spacing * 0.3 # FIXME: should create vis settings in platform for these, - # not hard code them here.. + # not hard code them here. show_gamepads = False platform = app.platform @@ -93,7 +93,7 @@ class ControlsSettingsWindow(ba.Window): show_keyboard = False if _ba.getinputdevice('Keyboard', '#1', doraise=False) is not None: show_keyboard = True - height += spacing * 2 + height += spacing show_keyboard_p2 = False if app.vr_mode else show_keyboard if show_keyboard_p2: height += spacing @@ -120,36 +120,36 @@ class ControlsSettingsWindow(ba.Window): # height += spacing show_mac_wiimote = False - if platform == 'mac' and subplatform == 'appstore': - show_mac_wiimote = True - height += spacing + # if platform == 'mac' and _ba.is_xcode_build(): + # show_mac_wiimote = True + # height += spacing - # on non-oculus-vr windows, show an option to disable xinput + # On windows (outside of oculus/vr), show an option to disable xinput. show_xinput_toggle = False - if platform == 'windows' and (subplatform != 'oculus' - or not app.vr_mode): + if platform == 'windows' and not app.vr_mode: show_xinput_toggle = True - # on mac builds, show an option to switch between generic and + # On mac builds, show an option to switch between generic and # made-for-iOS/Mac systems # (we can run into problems where devices register as one of each # type otherwise).. show_mac_controller_subsystem = False - if platform == 'mac' and subplatform == 'appstore': + if platform == 'mac' and _ba.is_xcode_build(): show_mac_controller_subsystem = True if show_mac_controller_subsystem: - height += spacing + height += spacing * 1.5 if show_xinput_toggle: height += spacing - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale smallscale = (1.7 if show_keyboard else 2.2) super().__init__(root_widget=ba.containerwidget( size=(width, height), transition=transition, scale_origin_stack_offset=scale_origin, + stack_offset=((0, -10) if uiscale is ba.UIScale.SMALL else (0, 0)), scale=(smallscale if uiscale is ba.UIScale.SMALL else 1.5 if uiscale is ba.UIScale.MEDIUM else 1.0))) self._back_button = btn = ba.buttonwidget( @@ -381,7 +381,7 @@ class ControlsSettingsWindow(ba.Window): v_align='center', color=ba.app.ui.infotextcolor, maxwidth=width * 0.8) - v -= spacing + v -= spacing * 1.5 self._restore_state() def _set_mac_controller_subsystem(self, val: str) -> None: diff --git a/assets/src/ba_data/python/bastd/ui/settings/gamepad.py b/assets/src/ba_data/python/bastd/ui/settings/gamepad.py index 680a20c1..bdc9d4d9 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/gamepad.py +++ b/assets/src/ba_data/python/bastd/ui/settings/gamepad.py @@ -60,7 +60,7 @@ class GamepadSettingsWindow(ba.Window): self._width = 700 if self._is_secondary else 730 self._height = 440 if self._is_secondary else 450 self._spacing = 40 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), scale=(1.63 if uiscale is ba.UIScale.SMALL else @@ -783,7 +783,7 @@ class AwaitGamepadInputWindow(ba.Window): self._capture_button = button width = 400 height = 150 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( scale=(2.0 if uiscale is ba.UIScale.SMALL else 1.9 if uiscale is ba.UIScale.MEDIUM else 1.0), diff --git a/assets/src/ba_data/python/bastd/ui/settings/gamepadadvanced.py b/assets/src/ba_data/python/bastd/ui/settings/gamepadadvanced.py index 35f3e336..c9893141 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/gamepadadvanced.py +++ b/assets/src/ba_data/python/bastd/ui/settings/gamepadadvanced.py @@ -41,7 +41,7 @@ class GamepadAdvancedSettingsWindow(ba.Window): app = ba.app self._r = parent_window.get_r() - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 900 if uiscale is ba.UIScale.SMALL else 700 self._x_inset = x_inset = 100 if uiscale is ba.UIScale.SMALL else 0 self._height = 402 if uiscale is ba.UIScale.SMALL else 512 diff --git a/assets/src/ba_data/python/bastd/ui/settings/gamepadselect.py b/assets/src/ba_data/python/bastd/ui/settings/gamepadselect.py index e2b14c5e..72c7864e 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/gamepadselect.py +++ b/assets/src/ba_data/python/bastd/ui/settings/gamepadselect.py @@ -55,7 +55,7 @@ def gamepad_configure_callback(event: Dict[str, Any]) -> None: width = 700 height = 200 button_width = 100 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale dlg = (ba.containerwidget( scale=(1.7 if uiscale is ba.UIScale.SMALL else 1.4 if uiscale is ba.UIScale.MEDIUM else 1.0), @@ -101,7 +101,7 @@ class GamepadSelectWindow(ba.Window): spacing = 40 self._r = 'configGamepadSelectWindow' - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( scale=(2.3 if uiscale is ba.UIScale.SMALL else 1.5 if uiscale is ba.UIScale.MEDIUM else 1.0), 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 3bda574b..addcce11 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/graphics.py +++ b/assets/src/ba_data/python/bastd/ui/settings/graphics.py @@ -57,7 +57,7 @@ class GraphicsSettingsWindow(ba.Window): spacing = 32 self._have_selected_child = False - uiscale = app.uiscale + uiscale = app.ui.uiscale width = 450.0 height = 302.0 @@ -83,7 +83,7 @@ class GraphicsSettingsWindow(ba.Window): show_resolution = (app.platform == 'android' and app.subplatform == 'cardboard') - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale base_scale = (2.4 if uiscale is ba.UIScale.SMALL else 1.5 if uiscale is ba.UIScale.MEDIUM else 1.0) popup_menu_scale = base_scale * 1.2 diff --git a/assets/src/ba_data/python/bastd/ui/settings/keyboard.py b/assets/src/ba_data/python/bastd/ui/settings/keyboard.py index f030eba1..8ed9fc65 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/keyboard.py +++ b/assets/src/ba_data/python/bastd/ui/settings/keyboard.py @@ -49,7 +49,7 @@ class ConfigKeyboardWindow(ba.Window): else: self._height = 375 self._spacing = 40 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), scale=(1.6 if uiscale is ba.UIScale.SMALL else @@ -272,7 +272,7 @@ class AwaitKeyboardInputWindow(ba.Window): width = 400 height = 150 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(width, height), transition='in_right', diff --git a/assets/src/ba_data/python/bastd/ui/settings/plugins.py b/assets/src/ba_data/python/bastd/ui/settings/plugins.py index 8a953054..c550f6a6 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/plugins.py +++ b/assets/src/ba_data/python/bastd/ui/settings/plugins.py @@ -49,7 +49,7 @@ class PluginSettingsWindow(ba.Window): self._transition_out = 'out_right' scale_origin = None - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 870.0 if uiscale is ba.UIScale.SMALL else 670.0 x_inset = 100 if uiscale is ba.UIScale.SMALL else 0 self._height = (390.0 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/settings/ps3controller.py b/assets/src/ba_data/python/bastd/ui/settings/ps3controller.py index 25b6eada..f9898611 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/ps3controller.py +++ b/assets/src/ba_data/python/bastd/ui/settings/ps3controller.py @@ -34,7 +34,7 @@ class PS3ControllerSettingsWindow(ba.Window): height = 330 if _ba.is_running_on_fire_tv() else 540 spacing = 40 self._r = 'ps3ControllersWindow' - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(width, height), transition='in_right', diff --git a/assets/src/ba_data/python/bastd/ui/settings/remoteapp.py b/assets/src/ba_data/python/bastd/ui/settings/remoteapp.py index 8c4bf58f..81569f2b 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/remoteapp.py +++ b/assets/src/ba_data/python/bastd/ui/settings/remoteapp.py @@ -34,7 +34,7 @@ class RemoteAppSettingsWindow(ba.Window): width = 700 height = 390 spacing = 40 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(width, height), transition='in_right', diff --git a/assets/src/ba_data/python/bastd/ui/settings/testing.py b/assets/src/ba_data/python/bastd/ui/settings/testing.py index 58c9427b..b413df62 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/testing.py +++ b/assets/src/ba_data/python/bastd/ui/settings/testing.py @@ -39,7 +39,7 @@ class TestingWindow(ba.Window): title: ba.Lstr, entries: List[Dict[str, Any]], transition: str = 'in_right'): - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 600 self._height = 324 if uiscale is ba.UIScale.SMALL else 400 self._entries = copy.deepcopy(entries) diff --git a/assets/src/ba_data/python/bastd/ui/settings/touchscreen.py b/assets/src/ba_data/python/bastd/ui/settings/touchscreen.py index 311e5be2..6e6d75eb 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/touchscreen.py +++ b/assets/src/ba_data/python/bastd/ui/settings/touchscreen.py @@ -45,7 +45,7 @@ class TouchscreenSettingsWindow(ba.Window): _ba.set_touchscreen_editing(True) - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), transition='in_right', diff --git a/assets/src/ba_data/python/bastd/ui/settings/xbox360controller.py b/assets/src/ba_data/python/bastd/ui/settings/xbox360controller.py index 334431a9..a91037ca 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/xbox360controller.py +++ b/assets/src/ba_data/python/bastd/ui/settings/xbox360controller.py @@ -39,7 +39,7 @@ class XBox360ControllerSettingsWindow(ba.Window): width = 700 height = 300 if _ba.is_running_on_fire_tv() else 485 spacing = 40 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(width, height), transition='in_right', diff --git a/assets/src/ba_data/python/bastd/ui/soundtrack/browser.py b/assets/src/ba_data/python/bastd/ui/soundtrack/browser.py index 3db1035e..2e1c5d97 100644 --- a/assets/src/ba_data/python/bastd/ui/soundtrack/browser.py +++ b/assets/src/ba_data/python/bastd/ui/soundtrack/browser.py @@ -52,7 +52,7 @@ class SoundtrackBrowserWindow(ba.Window): scale_origin = None self._r = 'editSoundtrackWindow' - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 800 if uiscale is ba.UIScale.SMALL else 600 x_inset = 100 if uiscale is ba.UIScale.SMALL else 0 self._height = (340 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/soundtrack/edit.py b/assets/src/ba_data/python/bastd/ui/soundtrack/edit.py index c31d9e66..c6ce84b7 100644 --- a/assets/src/ba_data/python/bastd/ui/soundtrack/edit.py +++ b/assets/src/ba_data/python/bastd/ui/soundtrack/edit.py @@ -43,7 +43,7 @@ class SoundtrackEditWindow(ba.Window): self._r = 'editSoundtrackWindow' self._folder_tex = ba.gettexture('folder') self._file_tex = ba.gettexture('file') - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 848 if uiscale is ba.UIScale.SMALL else 648 x_inset = 100 if uiscale is ba.UIScale.SMALL else 0 self._height = (395 if uiscale is ba.UIScale.SMALL else diff --git a/assets/src/ba_data/python/bastd/ui/soundtrack/entrytypeselect.py b/assets/src/ba_data/python/bastd/ui/soundtrack/entrytypeselect.py index 6c105975..839a0753 100644 --- a/assets/src/ba_data/python/bastd/ui/soundtrack/entrytypeselect.py +++ b/assets/src/ba_data/python/bastd/ui/soundtrack/entrytypeselect.py @@ -64,7 +64,7 @@ class SoundtrackEntryTypeSelectWindow(ba.Window): if do_music_folder: self._height += spacing - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), transition=transition, diff --git a/assets/src/ba_data/python/bastd/ui/specialoffer.py b/assets/src/ba_data/python/bastd/ui/specialoffer.py index 8d7d2764..6c7b2618 100644 --- a/assets/src/ba_data/python/bastd/ui/specialoffer.py +++ b/assets/src/ba_data/python/bastd/ui/specialoffer.py @@ -91,7 +91,7 @@ class SpecialOfferWindow(ba.Window): self._offer = copy.deepcopy(offer) self._width = 580 self._height = 590 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(self._width, self._height), transition=transition, diff --git a/assets/src/ba_data/python/bastd/ui/store/browser.py b/assets/src/ba_data/python/bastd/ui/store/browser.py index 627308e4..1e6f110f 100644 --- a/assets/src/ba_data/python/bastd/ui/store/browser.py +++ b/assets/src/ba_data/python/bastd/ui/store/browser.py @@ -39,7 +39,7 @@ class StoreBrowserWindow(ba.Window): """Window for browsing the store.""" def _update_get_tickets_button_pos(self) -> None: - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if self._get_tickets_button: pos = (self._width - 252 - (self._x_inset + (47 if uiscale is ba.UIScale.SMALL @@ -60,7 +60,7 @@ class StoreBrowserWindow(ba.Window): from ba import SpecialChar app = ba.app - uiscale = app.uiscale + uiscale = app.ui.uiscale ba.set_analytics_screen('Store Window') @@ -717,7 +717,7 @@ class StoreBrowserWindow(ba.Window): self._sections = copy.deepcopy(store_data[sdata['tab']]) self._height: Optional[float] = None - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale # Pre-calc a few things and add them to store-data. for section in self._sections: diff --git a/assets/src/ba_data/python/bastd/ui/teamnamescolors.py b/assets/src/ba_data/python/bastd/ui/teamnamescolors.py index a49725f3..8ebea612 100644 --- a/assets/src/ba_data/python/bastd/ui/teamnamescolors.py +++ b/assets/src/ba_data/python/bastd/ui/teamnamescolors.py @@ -43,7 +43,7 @@ class TeamNamesColorsWindow(popup.PopupWindow): self._max_name_length = 16 # Creates our _root_widget. - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale scale = (1.69 if uiscale is ba.UIScale.SMALL else 1.1 if uiscale is ba.UIScale.MEDIUM else 0.85) super().__init__(position=scale_origin, diff --git a/assets/src/ba_data/python/bastd/ui/telnet.py b/assets/src/ba_data/python/bastd/ui/telnet.py index 4b7f2737..869d60fb 100644 --- a/assets/src/ba_data/python/bastd/ui/telnet.py +++ b/assets/src/ba_data/python/bastd/ui/telnet.py @@ -34,7 +34,7 @@ class TelnetAccessRequestWindow(ba.Window): height = 100 text = ba.Lstr(resource='telnetAccessText') - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale super().__init__(root_widget=ba.containerwidget( size=(width, height + 40), transition='in_right', diff --git a/assets/src/ba_data/python/bastd/ui/tournamententry.py b/assets/src/ba_data/python/bastd/ui/tournamententry.py index 6e255229..7238a753 100644 --- a/assets/src/ba_data/python/bastd/ui/tournamententry.py +++ b/assets/src/ba_data/python/bastd/ui/tournamententry.py @@ -78,7 +78,7 @@ class TournamentEntryWindow(popup.PopupWindow): self._on_close_call = on_close_call if scale is None: - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale scale = (2.3 if uiscale is ba.UIScale.SMALL else 1.65 if uiscale is ba.UIScale.MEDIUM else 1.23) self._delegate = delegate diff --git a/assets/src/ba_data/python/bastd/ui/tournamentscores.py b/assets/src/ba_data/python/bastd/ui/tournamentscores.py index fc34f17a..d5e65142 100644 --- a/assets/src/ba_data/python/bastd/ui/tournamentscores.py +++ b/assets/src/ba_data/python/bastd/ui/tournamentscores.py @@ -53,7 +53,7 @@ class TournamentScoresWindow(popup_ui.PopupWindow): self._tournament_id = tournament_id self._subcontainer: Optional[ba.Widget] = None self._on_close_call = on_close_call - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if scale is None: scale = (2.3 if uiscale is ba.UIScale.SMALL else 1.65 if uiscale is ba.UIScale.MEDIUM else 1.23) diff --git a/assets/src/ba_data/python/bastd/ui/trophies.py b/assets/src/ba_data/python/bastd/ui/trophies.py index 4009fc28..aa7d52ac 100644 --- a/assets/src/ba_data/python/bastd/ui/trophies.py +++ b/assets/src/ba_data/python/bastd/ui/trophies.py @@ -40,7 +40,7 @@ class TrophiesWindow(popup.PopupWindow): scale: float = None): from ba.deprecated import get_resource self._data = data - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if scale is None: scale = (2.3 if uiscale is ba.UIScale.SMALL else 1.65 if uiscale is ba.UIScale.MEDIUM else 1.23) diff --git a/assets/src/ba_data/python/bastd/ui/url.py b/assets/src/ba_data/python/bastd/ui/url.py index cb47c26c..413b257a 100644 --- a/assets/src/ba_data/python/bastd/ui/url.py +++ b/assets/src/ba_data/python/bastd/ui/url.py @@ -34,7 +34,7 @@ class ShowURLWindow(ba.Window): # in some cases we might want to show it as a qr code # (for long URLs especially) app = ba.app - uiscale = app.uiscale + uiscale = app.ui.uiscale if app.platform == 'android' and app.subplatform == 'alibaba': self._width = 500 self._height = 500 diff --git a/assets/src/ba_data/python/bastd/ui/watch.py b/assets/src/ba_data/python/bastd/ui/watch.py index c99884d8..d2ef27da 100644 --- a/assets/src/ba_data/python/bastd/ui/watch.py +++ b/assets/src/ba_data/python/bastd/ui/watch.py @@ -60,7 +60,7 @@ class WatchWindow(ba.Window): self._my_replays_rename_window: Optional[ba.Widget] = None self._my_replay_rename_text: Optional[ba.Widget] = None self._r = 'watchWindow' - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._width = 1240 if uiscale is ba.UIScale.SMALL else 1040 x_inset = 100 if uiscale is ba.UIScale.SMALL else 0 self._height = (578 if uiscale is ba.UIScale.SMALL else @@ -174,7 +174,7 @@ class WatchWindow(ba.Window): # switching to a different tab self._tab_data = {} - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale if tab == 'my_replays': c_width = self._scroll_width c_height = self._scroll_height - 20 @@ -316,7 +316,7 @@ class WatchWindow(ba.Window): return c_width = 600 c_height = 250 - uiscale = ba.app.uiscale + uiscale = ba.app.ui.uiscale self._my_replays_rename_window = cnt = ba.containerwidget( scale=(1.8 if uiscale is ba.UIScale.SMALL else 1.55 if uiscale is ba.UIScale.MEDIUM else 1.0), diff --git a/docs/ba_module.md b/docs/ba_module.md index 29e8a007..4d050df1 100644 --- a/docs/ba_module.md +++ b/docs/ba_module.md @@ -1,5 +1,5 @@ -

last updated on 2020-07-21 for Ballistica version 1.5.23 build 20149

+

last updated on 2020-07-21 for Ballistica version 1.5.23 build 20150

This page documents the Python classes and functions in the 'ba' module, which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please let me know. Happy modding!


@@ -806,7 +806,7 @@ likely result in errors.

Attributes:

-
api_version, build_number, config, config_file_path, debug_build, language, locale, on_tv, platform, python_directory_app, python_directory_app_site, python_directory_user, subplatform, test_build, ui_bounds, uiscale, user_agent_string, version, vr_mode
+
api_version, build_number, config, config_file_path, debug_build, language, locale, on_tv, platform, python_directory_app, python_directory_app_site, python_directory_user, subplatform, test_build, ui_bounds, user_agent_string, version, vr_mode

api_version

int

@@ -912,11 +912,6 @@ likely result in errors.

This tuple contains: (x-min, x-max, y-min, y-max)

-
-

uiscale

-

ba.UIScale

-

Current ui scale for the app.

-

user_agent_string

str