mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-25 00:13:27 +08:00
Merge branch 'master' into master
This commit is contained in:
commit
452f0d8bbb
@ -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"
|
||||
}
|
||||
@ -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.
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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')
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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')
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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'),
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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]
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 = (
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<!-- THIS FILE IS AUTO GENERATED; DO NOT EDIT BY HAND -->
|
||||
<h4><em>last updated on 2020-07-21 for Ballistica version 1.5.23 build 20149</em></h4>
|
||||
<h4><em>last updated on 2020-07-21 for Ballistica version 1.5.23 build 20150</em></h4>
|
||||
<p>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 <a href="mailto:support@froemling.net">let me know</a>. Happy modding!</p>
|
||||
<hr>
|
||||
@ -806,7 +806,7 @@ likely result in errors.</p>
|
||||
</p>
|
||||
|
||||
<h3>Attributes:</h3>
|
||||
<h5><a href="#attr_ba_App__api_version">api_version</a>, <a href="#attr_ba_App__build_number">build_number</a>, <a href="#attr_ba_App__config">config</a>, <a href="#attr_ba_App__config_file_path">config_file_path</a>, <a href="#attr_ba_App__debug_build">debug_build</a>, <a href="#attr_ba_App__language">language</a>, <a href="#attr_ba_App__locale">locale</a>, <a href="#attr_ba_App__on_tv">on_tv</a>, <a href="#attr_ba_App__platform">platform</a>, <a href="#attr_ba_App__python_directory_app">python_directory_app</a>, <a href="#attr_ba_App__python_directory_app_site">python_directory_app_site</a>, <a href="#attr_ba_App__python_directory_user">python_directory_user</a>, <a href="#attr_ba_App__subplatform">subplatform</a>, <a href="#attr_ba_App__test_build">test_build</a>, <a href="#attr_ba_App__ui_bounds">ui_bounds</a>, <a href="#attr_ba_App__uiscale">uiscale</a>, <a href="#attr_ba_App__user_agent_string">user_agent_string</a>, <a href="#attr_ba_App__version">version</a>, <a href="#attr_ba_App__vr_mode">vr_mode</a></h5>
|
||||
<h5><a href="#attr_ba_App__api_version">api_version</a>, <a href="#attr_ba_App__build_number">build_number</a>, <a href="#attr_ba_App__config">config</a>, <a href="#attr_ba_App__config_file_path">config_file_path</a>, <a href="#attr_ba_App__debug_build">debug_build</a>, <a href="#attr_ba_App__language">language</a>, <a href="#attr_ba_App__locale">locale</a>, <a href="#attr_ba_App__on_tv">on_tv</a>, <a href="#attr_ba_App__platform">platform</a>, <a href="#attr_ba_App__python_directory_app">python_directory_app</a>, <a href="#attr_ba_App__python_directory_app_site">python_directory_app_site</a>, <a href="#attr_ba_App__python_directory_user">python_directory_user</a>, <a href="#attr_ba_App__subplatform">subplatform</a>, <a href="#attr_ba_App__test_build">test_build</a>, <a href="#attr_ba_App__ui_bounds">ui_bounds</a>, <a href="#attr_ba_App__user_agent_string">user_agent_string</a>, <a href="#attr_ba_App__version">version</a>, <a href="#attr_ba_App__vr_mode">vr_mode</a></h5>
|
||||
<dl>
|
||||
<dt><h4><a name="attr_ba_App__api_version">api_version</a></h4></dt><dd>
|
||||
<p><span>int</span></p>
|
||||
@ -912,11 +912,6 @@ likely result in errors.</p>
|
||||
|
||||
<p> This tuple contains: (x-min, x-max, y-min, y-max)</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="attr_ba_App__uiscale">uiscale</a></h4></dt><dd>
|
||||
<p><span><a href="#class_ba_UIScale">ba.UIScale</a></span></p>
|
||||
<p>Current ui scale for the app.</p>
|
||||
|
||||
</dd>
|
||||
<dt><h4><a name="attr_ba_App__user_agent_string">user_agent_string</a></h4></dt><dd>
|
||||
<p><span>str</span></p>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user