mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-19 13:25:31 +08:00
testing-window is now screen-size-responsive
This commit is contained in:
parent
5a08a4054a
commit
cd4f2b2ed7
48
.efrocachemap
generated
48
.efrocachemap
generated
@ -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": "ff6445c9cec679efa3ce701d65e32ad4",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "381d0ede50695aa6bfcabd6c02784328",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "1915debfff28b2067c8d653e216b2816",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "24e82e8becbe0d1132b8f7ceea7e2173",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "ee9d05a24152788cb9b759463455cd3b",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "6adabec38f87e3b481d1f7de77a6f391",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "b98c235ff4ae2943818795f2be341ad1",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "bbc7fb28cc4045bbfdfe5da34484892b",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "3f300e51ea39567eb32846513a40d05d",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "449650cc0b09a7b3297e9cd8db97181f",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "bf2680c6f2682b01717581feb3d9eb3f",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "5eaf3b689c665a703a2911ed6550f02f",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "7563bb784660a69629148ac07ba53ccf",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "e0747c56bbf8fc8a2115fbf0c619c37f",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "fa43b5cffd659de45f4bf0a3694fb2cc",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "c31826c9e8ce27c00d127a6bd1b7298d",
|
||||
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "722e924999f96723422c4c51ccc4301e",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "e1d195dde44deb8504bb07079e2e01c5",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "7ec7c9ba69a3711ab8491212feb57967",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "ec6b2b506d5724dad82b65066f6ac1d9",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "b2115191844630e8521cbaac8073aead",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "1bfe173f33cf77fa3d981974e5c4f7a3",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "66f0835ba780aa1b5c32ef283ffd2cff",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "4b43abb7429c00579b7ee3790efc7a5b",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "4b9a8dbcc1a6bbb03fc36b0028fe7868",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "d20aa0c6d35d5cc8af5f9ae7a9d11cfe",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "6588113ddee0dd658238048f3a5ae3fc",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "3b7e9f20b7c12f881e77069437c17964",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "4eafd8d6c03dd4f384088ee4cfb53ab1",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "4989042f5c08f1f3c8906cd470c907fc",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "42eede22654e3aeca5c8a45165892e6e",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "0e61494f5be147aad419577a3f61c397",
|
||||
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "2ee184af9b80d60afea7f97aba29cb16",
|
||||
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "37c5f795ccbaeffeb5d6ede4fe9f3c19",
|
||||
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "2ee184af9b80d60afea7f97aba29cb16",
|
||||
@ -4202,14 +4202,14 @@
|
||||
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "d258789fd7bdc5092aab87ccb4601921",
|
||||
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "314516411d5ac8e991a6f742f399d4de",
|
||||
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "d258789fd7bdc5092aab87ccb4601921",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "1653040bcf8a918c03410089609d0fca",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "db68ad522aed3599657bfffc07d36844",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "05ff157096d3e8a99d1b6a41181890b8",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "a312ae2f510d838451f79ec68f9339d0",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "c49e1c02cc41ef90666501e142878404",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "34d963e633901b87848b9811cfaaee7d",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "d010e2a87022b414a6625df508f011c7",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "b2027a4ed6adddc025272fca7cfa4778",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "87cfba45006c71fbabbf14ed9bd18be1",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "5a7ff141644a21ecf7c80caf5f854301",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "ae4a8e4c787da6936f721142b62aee5e",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "7c3e81103f2d5639c3457d55c984cb04",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "61fbdcc344575d6ebef55d74174fd8fe",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "971810c64b64a8c399bcd2ea57bf23b0",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "a10155f887a3d8d116a97ed9517ef0c8",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "ce5b7c177301bd05f671b43610748299",
|
||||
"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",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
### 1.7.37 (build 22254, api 9, 2025-01-26)
|
||||
### 1.7.37 (build 22255, api 9, 2025-01-26)
|
||||
- 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.
|
||||
|
||||
@ -53,7 +53,7 @@ if TYPE_CHECKING:
|
||||
|
||||
# Build number and version of the ballistica binary we expect to be
|
||||
# using.
|
||||
TARGET_BALLISTICA_BUILD = 22254
|
||||
TARGET_BALLISTICA_BUILD = 22255
|
||||
TARGET_BALLISTICA_VERSION = '1.7.37'
|
||||
|
||||
|
||||
|
||||
@ -23,25 +23,40 @@ class TestingWindow(bui.MainWindow):
|
||||
transition: str | None = 'in_right',
|
||||
origin_widget: bui.Widget | None = None,
|
||||
):
|
||||
# pylint: disable=too-many-locals
|
||||
assert bui.app.classic is not None
|
||||
uiscale = bui.app.ui_v1.uiscale
|
||||
self._width = 690 if uiscale is bui.UIScale.SMALL else 600
|
||||
self._height = 400 if uiscale is bui.UIScale.SMALL else 400
|
||||
self._width = 1200 if uiscale is bui.UIScale.SMALL else 600
|
||||
self._height = 800 if uiscale is bui.UIScale.SMALL else 400
|
||||
self._entries_orig = copy.deepcopy(entries)
|
||||
self._entries = copy.deepcopy(entries)
|
||||
yoffs = -50 if uiscale is bui.UIScale.SMALL else 0
|
||||
|
||||
# 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 = (
|
||||
2.27
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else 1.2 if uiscale is bui.UIScale.MEDIUM else 1.0
|
||||
)
|
||||
# Calc screen size in our local container space and clamp to a
|
||||
# bit smaller than our container size.
|
||||
target_width = min(self._width - 60, screensize[0] / scale)
|
||||
target_height = min(self._height - 70, 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 * self._height + 0.5 * target_height + 30.0
|
||||
|
||||
self._scroll_width = target_width
|
||||
self._scroll_height = target_height - 47
|
||||
self._scroll_bottom = yoffs - 78 - self._scroll_height
|
||||
|
||||
super().__init__(
|
||||
root_widget=bui.containerwidget(
|
||||
size=(self._width, self._height),
|
||||
scale=(
|
||||
2.27
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else 1.2 if uiscale is bui.UIScale.MEDIUM else 1.0
|
||||
),
|
||||
stack_offset=(
|
||||
(0, 0) if uiscale is bui.UIScale.SMALL else (0, 0)
|
||||
),
|
||||
scale=scale,
|
||||
toolbar_visibility=(
|
||||
'menu_minimal'
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
@ -50,6 +65,8 @@ class TestingWindow(bui.MainWindow):
|
||||
),
|
||||
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,
|
||||
)
|
||||
|
||||
if uiscale is bui.UIScale.SMALL:
|
||||
@ -61,7 +78,7 @@ class TestingWindow(bui.MainWindow):
|
||||
self._back_button = btn = bui.buttonwidget(
|
||||
parent=self._root_widget,
|
||||
autoselect=True,
|
||||
position=(65, self._height - 59 + yoffs),
|
||||
position=(35, yoffs - 59),
|
||||
size=(130, 60),
|
||||
scale=0.8,
|
||||
text_scale=1.2,
|
||||
@ -82,11 +99,10 @@ class TestingWindow(bui.MainWindow):
|
||||
parent=self._root_widget,
|
||||
position=(
|
||||
self._width * 0.5,
|
||||
self._height
|
||||
- (42 if uiscale is bui.UIScale.SMALL else 35)
|
||||
+ yoffs,
|
||||
yoffs - (43 if uiscale is bui.UIScale.SMALL else 35),
|
||||
),
|
||||
size=(0, 0),
|
||||
scale=0.7 if uiscale is bui.UIScale.SMALL else 1.0,
|
||||
color=bui.app.ui_v1.title_color,
|
||||
h_align='center',
|
||||
v_align='center',
|
||||
@ -98,29 +114,25 @@ class TestingWindow(bui.MainWindow):
|
||||
parent=self._root_widget,
|
||||
position=(
|
||||
self._width * 0.5,
|
||||
self._height
|
||||
- (80 if uiscale is bui.UIScale.SMALL else 80)
|
||||
+ yoffs,
|
||||
yoffs - 65,
|
||||
),
|
||||
size=(0, 0),
|
||||
scale=0.5,
|
||||
color=bui.app.ui_v1.infotextcolor,
|
||||
h_align='center',
|
||||
v_align='center',
|
||||
maxwidth=self._width * 0.75,
|
||||
maxwidth=self._scroll_width * 0.75,
|
||||
text=bui.Lstr(resource='settingsWindowAdvanced.forTestingText'),
|
||||
)
|
||||
self._scroll_width = self._width - 130
|
||||
self._scroll_height = self._height - (
|
||||
220 if uiscale is bui.UIScale.SMALL else 140
|
||||
)
|
||||
self._scrollwidget = bui.scrollwidget(
|
||||
parent=self._root_widget,
|
||||
size=(self._scroll_width, self._scroll_height),
|
||||
highlight=False,
|
||||
position=(
|
||||
(self._width - self._scroll_width) * 0.5,
|
||||
(120 if uiscale is bui.UIScale.SMALL else 40) + yoffs,
|
||||
self._width * 0.5 - self._scroll_width * 0.5,
|
||||
self._scroll_bottom,
|
||||
),
|
||||
highlight=False,
|
||||
border_opacity=0.4,
|
||||
)
|
||||
bui.containerwidget(edit=self._scrollwidget, claims_left_right=True)
|
||||
|
||||
@ -140,8 +152,8 @@ class TestingWindow(bui.MainWindow):
|
||||
for i, entry in enumerate(self._entries):
|
||||
entry_name = entry['name']
|
||||
|
||||
# If we haven't yet, record the default value for this name so
|
||||
# we can reset if we want..
|
||||
# If we haven't yet, record the default value for this name
|
||||
# so we can reset if we want..
|
||||
if entry_name not in bui.app.classic.value_test_defaults:
|
||||
bui.app.classic.value_test_defaults[entry_name] = (
|
||||
bui.app.classic.value_test(entry_name)
|
||||
@ -245,8 +257,8 @@ class TestingWindow(bui.MainWindow):
|
||||
# Support recreating our window for back/refresh purposes.
|
||||
cls = type(self)
|
||||
|
||||
# Pull values from self here; if we do it in the lambda we'll keep
|
||||
# self alive which we don't want.
|
||||
# Pull values from self here; if we do it in the lambda we'll
|
||||
# keep self alive which we don't want.
|
||||
title = self.title
|
||||
entries = self._entries_orig
|
||||
|
||||
|
||||
@ -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 = 22254;
|
||||
const int kEngineBuildNumber = 22255;
|
||||
const char* kEngineVersion = "1.7.37";
|
||||
const int kEngineApiVersion = 9;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user