mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-19 21:37:57 +08:00
co-op window is now screen-size-responsive
This commit is contained in:
parent
2a8612ed28
commit
3ab7a1a7c3
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": "bf27c876cc533bb0b444bb4d27fbc0c5",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "a6e1b57b3f35a20682ffeac484b35072",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "0aa38cf85d604f87316dbc64a77ab596",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "779c1acad5bc8d667d870dbdb049857a",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "7d33f9c6b1eac466e140212126acfe2c",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "099c6b091e7c6b50ef01372102c453f8",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "4609ee8aefbbe2fabd467e1600830938",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "cd5213a585776fd499a6273837c3c140",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "68d0d3642a0dbc73b4fe16b444f30804",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "4e06b1af4cead60bcdd1e47809c3d2e9",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "eb65be762e826b5d5c5174f104aef345",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "e146aec273872cd5285ca3210c3496f4",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "429f1fe47e67ca2a9dcf514792b84be1",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "69868dc1a8e6041e11ec0c7c198d5e5e",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "525eb603a46789f43fda4b57ad155343",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "833a304c39d99ad21b20bb4203269653",
|
||||
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "bf3b7b4a3288f886a9fb7c5da960f119",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "f5bdfc3b103ca266540d7666da45465e",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "167e94a5abe297f6ecf1e68d2e322c0c",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "067f4cbd2cff445c54a0b4ff5ed51588",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "fc3b241d6f12f556317346bd6ecac649",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "dd1c7409c2f10287242b336fcd116c5f",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "dd4202d0c869c986e81421faec2f421c",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "88413e877960d7dd3e2bf4e1c7f0fbc6",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "9704b8bbef614e3a99361ad4a5f22be5",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "174118c9c6ab6e22356b9d9af4041566",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "d08abaa6613697c99484ce092c69800e",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "4a0d32380a824d0ac5f972734f5fe827",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "4d838790343991aa343942ea2358bc90",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "c28966f4b3d1ea3e98890b96f8ae374a",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "6149a44a7ac0e26ccecb88704216885c",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "123dc31083e4fd574c917364050aa4a4",
|
||||
"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": "83f8e54bae6a5ee4c9bb187806c1c154",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "8fa18ec784b59f9b5598c372f3b4856a",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "60181a48acfa4e8d2290f6d12559e748",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "b05b52b10a6b3b3abbe4982a853d5f71",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "1e98b894cdeaf679327b47f551ff9db6",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "4d31a7110bc1ac7511b47888b9515d44",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "084979bf93d7bdd9ba6a884244fc5e19",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "62555e2a160913f5b3b8b8389953cc09",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "92e474de293287bfe17a3c81f7adfd8c",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "ff2215385d5fd68ac0078ce86ef06003",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "ea497a717d76a5525476a14590dab4fa",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "21fb3479c8753f3722dc63d3dd122748",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "261c905e45c1f30dc975e2a074e4fa4d",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "387da3db2df75624ae685e1f06a8cdb7",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "5178f6943d3190e42456f760bd645456",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "f6dcd5a08c27fde4ace634b667271d2f",
|
||||
"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 22235, api 9, 2025-01-22)
|
||||
### 1.7.37 (build 22236, 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.
|
||||
|
||||
@ -53,7 +53,7 @@ if TYPE_CHECKING:
|
||||
|
||||
# Build number and version of the ballistica binary we expect to be
|
||||
# using.
|
||||
TARGET_BALLISTICA_BUILD = 22235
|
||||
TARGET_BALLISTICA_BUILD = 22236
|
||||
TARGET_BALLISTICA_VERSION = '1.7.37'
|
||||
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@ class CoopBrowserWindow(bui.MainWindow):
|
||||
origin_widget: bui.Widget | None = None,
|
||||
):
|
||||
# pylint: disable=too-many-statements
|
||||
# pylint: disable=too-many-locals
|
||||
# pylint: disable=cyclic-import
|
||||
|
||||
plus = bui.app.plus
|
||||
@ -74,10 +75,9 @@ class CoopBrowserWindow(bui.MainWindow):
|
||||
self._campaign_percent_text: bui.Widget | None = None
|
||||
|
||||
uiscale = app.ui_v1.uiscale
|
||||
self._width = 1520 if uiscale is bui.UIScale.SMALL else 1120
|
||||
self._x_inset = x_inset = 200 if uiscale is bui.UIScale.SMALL else 0
|
||||
self._width = 1600 if uiscale is bui.UIScale.SMALL else 1120
|
||||
self._height = (
|
||||
585
|
||||
1200
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else 730 if uiscale is bui.UIScale.MEDIUM else 800
|
||||
)
|
||||
@ -104,15 +104,32 @@ class CoopBrowserWindow(bui.MainWindow):
|
||||
)
|
||||
self._campaign_difficulty = 'easy'
|
||||
|
||||
# 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.31
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else 0.8 if uiscale is bui.UIScale.MEDIUM else 0.75
|
||||
)
|
||||
# Calc screen size in our local container space and clamp to a
|
||||
# bit smaller than our container size.
|
||||
target_width = min(self._width - 120, screensize[0] / scale)
|
||||
target_height = min(self._height - 120, 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 - 40
|
||||
self._scroll_bottom = yoffs - 70 - self._scroll_height
|
||||
|
||||
super().__init__(
|
||||
root_widget=bui.containerwidget(
|
||||
size=(self._width, self._height + top_extra),
|
||||
toolbar_visibility='menu_full',
|
||||
stack_offset=(
|
||||
(0, -8)
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else (0, 0) if uiscale is bui.UIScale.MEDIUM else (0, 0)
|
||||
),
|
||||
scale=(
|
||||
1.31
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
@ -121,6 +138,8 @@ class CoopBrowserWindow(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:
|
||||
@ -131,23 +150,13 @@ class CoopBrowserWindow(bui.MainWindow):
|
||||
else:
|
||||
self._back_button = bui.buttonwidget(
|
||||
parent=self._root_widget,
|
||||
position=(75 + x_inset, self._height - 87),
|
||||
size=(120, 60),
|
||||
position=(75, yoffs - 48.0),
|
||||
size=(60, 50),
|
||||
scale=1.2,
|
||||
autoselect=True,
|
||||
label=bui.Lstr(resource='backText'),
|
||||
button_type='back',
|
||||
on_activate_call=self.main_window_back,
|
||||
)
|
||||
bui.buttonwidget(
|
||||
edit=self._back_button,
|
||||
button_type='backSmall',
|
||||
size=(60, 50),
|
||||
position=(
|
||||
75 + x_inset,
|
||||
self._height - 87 + 6,
|
||||
),
|
||||
label=bui.charstr(bui.SpecialChar.BACK),
|
||||
button_type='backSmall',
|
||||
on_activate_call=self.main_window_back,
|
||||
)
|
||||
bui.containerwidget(
|
||||
edit=self._root_widget, cancel_button=self._back_button
|
||||
@ -166,12 +175,11 @@ class CoopBrowserWindow(bui.MainWindow):
|
||||
|
||||
# Don't want initial construction affecting our last-selected.
|
||||
self._do_selection_callbacks = False
|
||||
v = self._height - 95
|
||||
bui.textwidget(
|
||||
parent=self._root_widget,
|
||||
position=(
|
||||
self._width * 0.5,
|
||||
v + 40 - (25 if uiscale is bui.UIScale.SMALL else 0),
|
||||
yoffs - (50 if uiscale is bui.UIScale.SMALL else 24),
|
||||
),
|
||||
size=(0, 0),
|
||||
text=bui.Lstr(
|
||||
@ -187,27 +195,17 @@ class CoopBrowserWindow(bui.MainWindow):
|
||||
|
||||
self._selected_row = cfg.get('Selected Coop Row', None)
|
||||
|
||||
self._scroll_width = self._width - (130 + 2 * x_inset)
|
||||
self._scroll_height = self._height - (
|
||||
# 219 if uiscale is bui.UIScale.SMALL else 160
|
||||
170
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else 160
|
||||
)
|
||||
|
||||
self._subcontainerwidth = 800.0
|
||||
self._subcontainerheight = 1400.0
|
||||
|
||||
self._scrollwidget = bui.scrollwidget(
|
||||
parent=self._root_widget,
|
||||
highlight=False,
|
||||
position=(
|
||||
# (65 + x_inset, 120)
|
||||
(65 + x_inset, 70)
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else (65 + x_inset, 70)
|
||||
),
|
||||
size=(self._scroll_width, self._scroll_height),
|
||||
position=(
|
||||
self._width * 0.5 - self._scroll_width * 0.5,
|
||||
self._scroll_bottom,
|
||||
),
|
||||
simple_culling_v=10.0,
|
||||
claims_left_right=True,
|
||||
selection_loops_to_parent=True,
|
||||
@ -215,12 +213,20 @@ class CoopBrowserWindow(bui.MainWindow):
|
||||
)
|
||||
|
||||
if uiscale is bui.UIScale.SMALL:
|
||||
blotchwidth = 500.0
|
||||
blotchheight = 200.0
|
||||
bimg = bui.imagewidget(
|
||||
parent=self._root_widget,
|
||||
texture=bui.gettexture('uiAtlas'),
|
||||
mesh_transparent=bui.getmesh('windowBGBlotch'),
|
||||
position=(x_inset + 10.0, -20),
|
||||
size=(500.0, 200.0),
|
||||
position=(
|
||||
self._width * 0.5
|
||||
- self._scroll_width * 0.5
|
||||
+ 60.0
|
||||
- blotchwidth * 0.5,
|
||||
self._scroll_bottom - blotchheight * 0.5,
|
||||
),
|
||||
size=(blotchwidth, blotchheight),
|
||||
color=(0.4, 0.37, 0.49),
|
||||
# color=(1, 0, 0),
|
||||
)
|
||||
@ -229,8 +235,14 @@ class CoopBrowserWindow(bui.MainWindow):
|
||||
parent=self._root_widget,
|
||||
texture=bui.gettexture('uiAtlas'),
|
||||
mesh_transparent=bui.getmesh('windowBGBlotch'),
|
||||
position=(x_inset + self._scroll_width - 270, -20),
|
||||
size=(500.0, 200.0),
|
||||
position=(
|
||||
self._width * 0.5
|
||||
+ self._scroll_width * 0.5
|
||||
- 60.0
|
||||
- blotchwidth * 0.5,
|
||||
self._scroll_bottom - blotchheight * 0.5,
|
||||
),
|
||||
size=(blotchwidth, blotchheight),
|
||||
color=(0.4, 0.37, 0.49),
|
||||
# color=(1, 0, 0),
|
||||
)
|
||||
@ -604,8 +616,6 @@ class CoopBrowserWindow(bui.MainWindow):
|
||||
|
||||
bui.widget(edit=campaign_buttons[0], left_widget=self._easy_button)
|
||||
|
||||
# bui.widget(edit=self._easy_button)
|
||||
# if self._back_button is not None:
|
||||
bui.widget(
|
||||
edit=self._easy_button,
|
||||
left_widget=self._back_button,
|
||||
@ -1159,10 +1169,6 @@ class CoopBrowserWindow(bui.MainWindow):
|
||||
sel = self._back_button
|
||||
elif sel_name == 'Scroll':
|
||||
sel = self._scrollwidget
|
||||
# elif sel_name == 'PowerRanking':
|
||||
# sel = self._league_rank_button_widget
|
||||
# elif sel_name == 'Store':
|
||||
# sel = self._store_button_widget
|
||||
else:
|
||||
sel = self._scrollwidget
|
||||
bui.containerwidget(edit=self._root_widget, selected_child=sel)
|
||||
|
||||
@ -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 = 22235;
|
||||
const int kEngineBuildNumber = 22236;
|
||||
const char* kEngineVersion = "1.7.37";
|
||||
const int kEngineApiVersion = 9;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user