play window is now screen-size-responsive

This commit is contained in:
Eric Froemling 2025-01-22 15:30:36 -08:00
parent 639359285f
commit 21af1d1b0b
No known key found for this signature in database
6 changed files with 70 additions and 79 deletions

48
.efrocachemap generated
View File

@ -4174,22 +4174,22 @@
"build/assets/windows/Win32/ucrtbased.dll": "bfd1180c269d3950b76f35a63655e9e1",
"build/assets/windows/Win32/vc_redist.x86.exe": "15a5f1f876503885adbdf5b3989b3718",
"build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "d2ace4eb71e1ab58cb253455ddaa8a1e",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "b10e808844e4630de445d4a6384ddc84",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "4a96fa2ffe45b543b6f342e6b03be506",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "664b383d3d8e02fcebaa197435db702f",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "b89aeb6deaeaf5f6be6f75bfca959ca0",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "c5c5866a0f65ec311b9d71618f742bf5",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "6ef47107865b4f5c26966aa62739e338",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "1746b9f1ab4e45e59abd086ac1faa444",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "b128f7bfd17b44bbe8d5982744dda8f1",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "82f26af87fa79c563758875f610ef996",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "d47e44813f76272f0d1f908c6fedc4b9",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "0aa5733b5cdbf60a88e5502fcb3ca486",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "bb8a0f22da4e27eda758615698268802",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "f57c5e729e8c0a2ae2163f22e0245d77",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "1979c6e54e64585a694542d88025bafa",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "a416831f86049d2fd94dcc3d097f5a29",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "f7d08fbd72a0894dfce797e51f914b1c",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "73957f49ba4a098666812912f16487ca",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "4cf6065ea0c4581b1bd87cae43ade7ec",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "8ab9225590a1d42e3d8f5e65086adb27",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "d67ba5cfaee14bd72a90e4b7ef98c69a",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "29422b5c4f29d1c7992748a1fd04a1c1",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "c0f1dc95fcb52f58d521d3b23aef828e",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "f92c50cd9f6f199d22e6774bc7771bb4",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "2a38cd1c3d6d728a883a2d06036f3ec5",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "055d3ca125ec2cc4cab88debe636dbe7",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "0991af62f830aae31440482346b1853a",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "968b0055431f6451710d21107a69c70f",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "2f0a75fcc42fd892891f57e9d09119d9",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "95d81b0594bc799751bf09933c7c8a59",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "7bf397cb08bbc5bc9e0936040cfaeb88",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "ee8054ee2d6b93e76e2f213399a03101",
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "4d70703c4eba1a402fbc2d997d84aa93",
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "bb64e2182b1a533679f93c5997f14584",
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "4d70703c4eba1a402fbc2d997d84aa93",
@ -4202,14 +4202,14 @@
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "116b500c2d57caf06619408b2176e83b",
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "e3e9d9c7a94f8cd22939839fd8fbc178",
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "116b500c2d57caf06619408b2176e83b",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "6be4291d37aabee7a0e93409d251d6b1",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "e361ed6b27848849d996ad38255e3c2f",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "db69b0a9540ba7fac204570d0ae1fb5a",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "a51d83807874d0f49432aa7e35fb254e",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "2c2f707147183ef4e8deafe33a5b74d1",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "ffdf6fad9a56aba019e35d7015c684e2",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "dd75a346a12885db2502cd37be01c726",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "4c32a8fe55af58faa3b61c07e6e12133",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "5cd6e9333aa2c9d61dc69f29589d94cc",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "5103063455737d3b3d0c18a9114c93a6",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "acfcba3bf3563a937dc194943ab88fae",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "58d7a1a07846fbe7c2bae5ee242d4c5e",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "4ae23279264f000a37ba8edb19202143",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "e863e776c82a7067cbb282e424e12751",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "b93097028fd07dc5b841d04761a04a57",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "a310808f5852a7d6974e738f40b26e53",
"src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c",
"src/assets/ba_data/python/babase/_mgen/enums.py": "794d258d59fd17a61752843a9a0551ad",
"src/ballistica/base/mgen/pyembed/binding_base.inc": "06042d31df0ff9af96b99477162e2a91",

View File

@ -1,4 +1,4 @@
### 1.7.37 (build 22230, api 9, 2025-01-22)
### 1.7.37 (build 22232, api 9, 2025-01-22)
- Bumping api version to 9. As you'll see below, there's some UI changes that
will require a bit of work for any UI mods to adapt to. If your mods don't
touch UI stuff at all you can simply bump your api version and call it a day.

View File

@ -53,7 +53,7 @@ if TYPE_CHECKING:
# Build number and version of the ballistica binary we expect to be
# using.
TARGET_BALLISTICA_BUILD = 22230
TARGET_BALLISTICA_BUILD = 22232
TARGET_BALLISTICA_VERSION = '1.7.37'

View File

@ -105,6 +105,7 @@ class HelpWindow(bui.MainWindow):
resource=f'{self._r}.titleText',
subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))],
),
scale=0.9,
maxwidth=scroll_width * 0.7,
color=bui.app.ui_v1.title_color,
h_align='center',

View File

@ -42,11 +42,12 @@ class PlayWindow(bui.MainWindow):
self._playlist_select_context = playlist_select_context
uiscale = bui.app.ui_v1.uiscale
width = 1100 if uiscale is bui.UIScale.SMALL else 1000
x_offs = 150 if uiscale is bui.UIScale.SMALL else 90
y_offs = -60 if uiscale is bui.UIScale.SMALL else 45
height = 650 if uiscale is bui.UIScale.SMALL else 550
button_width = 400
width = 1300 if uiscale is bui.UIScale.SMALL else 1000
height = 1000 if uiscale is bui.UIScale.SMALL else 550
button_width = 400.0
button_height = 360.0
button_spacing = 3.0
if origin_widget is not None:
@ -58,6 +59,23 @@ class PlayWindow(bui.MainWindow):
self._r = 'playWindow'
# Do some fancy math to fill all available screen area up to the
# size of our backing container. This lets us fit to the exact
# screen shape at small ui scale.
screensize = bui.get_virtual_screen_size()
scale = (
1.35
if uiscale is bui.UIScale.SMALL
else 0.9 if uiscale is bui.UIScale.MEDIUM else 0.8
)
# Calc screen size in our local container space and clamp to a
# bit smaller than our container size.
target_height = min(height - 80, screensize[1] / scale)
# To get top/left coords, go to the center of our window and
# offset by half the width/height of our target area.
yoffs = 0.5 * height + 0.5 * target_height + 30.0
super().__init__(
root_widget=bui.containerwidget(
size=(width, height),
@ -66,17 +84,12 @@ class PlayWindow(bui.MainWindow):
if playlist_select_context is None
else 'menu_minimal'
),
scale=(
1.35
if uiscale is bui.UIScale.SMALL
else 0.9 if uiscale is bui.UIScale.MEDIUM else 0.8
),
stack_offset=(
(0, 20) if uiscale is bui.UIScale.SMALL else (0, 0)
),
scale=scale,
),
transition=transition,
origin_widget=origin_widget,
# We're affected by screen size only at small ui-scale.
refresh_on_screen_size_changes=uiscale is bui.UIScale.SMALL,
)
self._back_button: bui.Widget | None
@ -89,7 +102,7 @@ class PlayWindow(bui.MainWindow):
else:
self._back_button = bui.buttonwidget(
parent=self._root_widget,
position=(5 + x_offs, height - 162 + y_offs),
position=(50, yoffs - 100),
size=(60, 60),
scale=1.1,
text_res_scale=1.5,
@ -107,7 +120,7 @@ class PlayWindow(bui.MainWindow):
parent=self._root_widget,
position=(
width * 0.5,
height - (83 if uiscale is bui.UIScale.SMALL else 131) + y_offs,
yoffs - (50 if uiscale is bui.UIScale.SMALL else 70),
),
size=(0, 0),
text=bui.Lstr(
@ -119,26 +132,18 @@ class PlayWindow(bui.MainWindow):
),
scale=1.2 if uiscale is bui.UIScale.SMALL else 1.7,
res_scale=2.0,
maxwidth=400,
maxwidth=250,
color=bui.app.ui_v1.heading_color,
h_align='center',
v_align='center',
)
v = (
height
- (110 if self._playlist_select_context is None else 90)
+ y_offs
)
v -= 100
clr = (0.6, 0.7, 0.6, 1.0)
v -= 270 if self._playlist_select_context is None else 280
v += 65 if uiscale is bui.UIScale.SMALL else 0
hoffs = (
x_offs - 45
if self._playlist_select_context is None
else x_offs - 100
)
scl = 0.75 if self._playlist_select_context is None else 0.68
v = height * 0.5 - button_height * scl * 0.5
clr = (0.6, 0.7, 0.6, 1.0)
total_b_width = 3 * button_width * scl + 2 * button_spacing
hoffs = (width - total_b_width) * 0.5
self._lineup_tex = bui.gettexture('playerLineup')
angry_computer_transparent_mesh = bui.getmesh(
@ -167,7 +172,7 @@ class PlayWindow(bui.MainWindow):
position=(hoffs, v),
size=(
scl * button_width,
scl * 360,
scl * button_height,
),
extra_touch_border_scale=0.1,
autoselect=True,
@ -260,21 +265,15 @@ class PlayWindow(bui.MainWindow):
color=clr,
)
scl = 0.75 if self._playlist_select_context is None else 0.68
hoffs += 300 if self._playlist_select_context is None else 216
hoffs += scl * button_width + button_spacing
# v += 0 if self._playlist_select_context is None else -68
self._teams_button = btn = bui.buttonwidget(
parent=self._root_widget,
position=(
hoffs,
v,
# v + (scl * 15 if
# self._playlist_select_context is None else 0),
),
position=(hoffs, v),
size=(
scl * button_width,
scl * (360 if self._playlist_select_context is None else 360),
scl * button_height,
),
extra_touch_border_scale=0.1,
autoselect=True,
@ -389,20 +388,11 @@ class PlayWindow(bui.MainWindow):
color=clr,
)
hoffs += 300 if self._playlist_select_context is None else 300
# v -= 0 if self._playlist_select_context is None else 0
hoffs += scl * button_width + button_spacing
self._free_for_all_button = btn = bui.buttonwidget(
parent=self._root_widget,
position=(
hoffs,
v,
# v + (scl * 15
# if self._playlist_select_context is None else 0),
),
size=(
scl * button_width,
scl * (360 if self._playlist_select_context is None else 360),
),
position=(hoffs, v),
size=(scl * button_width, scl * button_height),
extra_touch_border_scale=0.1,
autoselect=True,
label='',

View File

@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int {
namespace ballistica {
// These are set automatically via script; don't modify them here.
const int kEngineBuildNumber = 22230;
const int kEngineBuildNumber = 22232;
const char* kEngineVersion = "1.7.37";
const int kEngineApiVersion = 9;