From b4b44790cb45c9d887e7ad58c6ef8b2cbe996943 Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Mon, 20 Jan 2025 16:36:42 -0800 Subject: [PATCH] updated achievements window to exactly fit screen on small ui mode --- .efrocachemap | 54 ++++++++-------- CHANGELOG.md | 2 +- src/assets/ba_data/python/baenv.py | 2 +- .../python/bauiv1lib/account/settings.py | 4 +- .../ba_data/python/bauiv1lib/achievements.py | 61 +++++++++++-------- src/assets/ba_data/python/bauiv1lib/chest.py | 2 +- src/ballistica/shared/ballistica.cc | 2 +- 7 files changed, 67 insertions(+), 60 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index 3dad1b46..cad0d3b8 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -432,7 +432,7 @@ "build/assets/ba_data/audio/zoeOw.ogg": "b2d705c31c9dcc1efdc71394764c3beb", "build/assets/ba_data/audio/zoePickup01.ogg": "e9366dc2d2b8ab8b0c4e2c14c02d0789", "build/assets/ba_data/audio/zoeScream01.ogg": "903e0e45ee9b3373e9d9ce20c814374e", - "build/assets/ba_data/data/langdata.json": "04c3a9025032c947139a40e83c2625c3", + "build/assets/ba_data/data/langdata.json": "68bb24b898213188cd0d3dc0ba7cc1a4", "build/assets/ba_data/data/languages/arabic.json": "32b9849fb8389b8c7798f0b744620318", "build/assets/ba_data/data/languages/belarussian.json": "009b452aa308bf2b2f7e92d9b78ba5ff", "build/assets/ba_data/data/languages/chinese.json": "5363a79f843e6be7ef47a840f47cc17d", @@ -441,12 +441,12 @@ "build/assets/ba_data/data/languages/czech.json": "3418bee44e69be13b7f72996abe96921", "build/assets/ba_data/data/languages/danish.json": "8e57db30c5250df2abff14a822f83ea7", "build/assets/ba_data/data/languages/dutch.json": "4ba5bbcc0fecddd0aac6ee2c165d1e40", - "build/assets/ba_data/data/languages/english.json": "f076808bad5fb60e9c47604ab9f35eff", + "build/assets/ba_data/data/languages/english.json": "eb90ceebf5e090911881b20040578552", "build/assets/ba_data/data/languages/esperanto.json": "0e397cfa5f3fb8cef5f4a64f21cda880", "build/assets/ba_data/data/languages/filipino.json": "1894fc331dcad7ce9cf4c180843f548f", "build/assets/ba_data/data/languages/french.json": "6d20655730b1017ef187fd828b91d43c", "build/assets/ba_data/data/languages/german.json": "bc656f1ada467161c23546f48d0dacc5", - "build/assets/ba_data/data/languages/gibberish.json": "b54fc8fc0ce51416adccfb14876dc402", + "build/assets/ba_data/data/languages/gibberish.json": "ef1dc16a451da31390ccf3e88aa7d6d1", "build/assets/ba_data/data/languages/greek.json": "d28d1092fbb00ed857cbd53124c0dc78", "build/assets/ba_data/data/languages/hindi.json": "567e6976b3c72f891431ad7fcc62ab16", "build/assets/ba_data/data/languages/hungarian.json": "af801baffb2c06460635dfb04c34bb3e", @@ -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": "47dce4282bd85185702105b6c9e6d66c", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "1d70bb3e52b11c5c88587b2c39a2dae2", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "747d4776790eae4da628446d1175ff69", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "d4967cdeefb8a56712d9e18b62c94c08", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "af062034e6763f3035657aca63a7c874", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "f45d96bc415a266f984bb47a594567c5", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "439935ffddb7d208fb7fb9ead59c73e5", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "d92468754fc64ffa7b4d57483af236cb", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "76c8947b7adc9e5ced586727f5f8de51", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "55cd0e2c5d80d6cfc9a651a3d41073ab", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "6943644180a6d8665c6268da53802d13", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "e1158323ae584a0a7928ca1097e8a0d0", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "94132827e92c991753eed27bbee63e78", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "ed802643094a562217bb7a464cce700d", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "ff8dfdedaac9747d6f22a623005a2196", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "d3a7d2bc7c7a749f49fe71abba0408d8", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "c1d6a9f331f9defedb0356017b436dfa", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "8a7b84d1522ceb056a0dba72a5fb567a", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "e218c8034bf1c8ee3593404706881788", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "d8ddc90445b569a14ac5386af0655650", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "1d16147a14e887edb2e58655265b47b3", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "b6a9d6fbba3bf186692b9a72846af373", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "d1169b7d48ce3f7255fa324bb0e41e5e", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "280a58af50d33f93f5e5e259d7b5e660", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "0885cb3baf58ca2cdf35f3aba923872d", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "f97dea463227677f13ca43005a7e9a52", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "9640022b959d9d088cffc2c56e7f6e6d", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "c6db1901367a3e49b901016a1160704b", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "ef708586f854cab45a3f6bb08a3b993e", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "2452545a539df2f1d1582c97c191bb76", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "b651c703b353c9d821e63131ee50dff2", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "275356349c832c7b9547343ea620ab39", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "7497894d2943b75b6ac830cdba8481af", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "273a6f64cac5a233694223b85cd0f22b", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "7497894d2943b75b6ac830cdba8481af", @@ -4202,14 +4202,14 @@ "build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "7e071962108a8d1727525fb331b70ee4", "build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "55a2b0c2d1db4d70627c901471d05fc7", "build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "7e071962108a8d1727525fb331b70ee4", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "52ac134987403fdc641e0541e60d4397", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "6d8713677348f775d932b1d9620fb80b", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "c66db5450aa9c3997bc798752fe0e89d", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "cd165e9ad6167936c4a047b826001fde", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "ae5a43d09e4112fe5e014fed52bb5690", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "fb4c93bc16289286b1d325ea8a6843ce", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "f6bbf98914cc300c43afb12ef371bb62", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "33375b5759273a7303a676720569c04c", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "256605f85c5783e642a6c017b6f33529", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "2d8ae34ca74cf04895ab7344c095fc8b", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "61db19c25f5b288bf77658ee6d51de60", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "8c33dea530a9d20109c9162136cd2f43", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "ec60efa0a96b66e1ee37e8089b0961bd", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "b1670cf0be5d26cf8b809334c20c160b", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "4efb2248d04ae76e3120cc8803295e45", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "064488e219c0f9dee4841a1285d66d6c", "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", diff --git a/CHANGELOG.md b/CHANGELOG.md index 885daa0e..c81accb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.37 (build 22219, api 9, 2025-01-20) +### 1.7.37 (build 22220, api 9, 2025-01-20) - 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. diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 72d52cd4..cb6b37eb 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -53,7 +53,7 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 22219 +TARGET_BALLISTICA_BUILD = 22220 TARGET_BALLISTICA_VERSION = '1.7.37' diff --git a/src/assets/ba_data/python/bauiv1lib/account/settings.py b/src/assets/ba_data/python/bauiv1lib/account/settings.py index a996a34c..8e2c36f1 100644 --- a/src/assets/ba_data/python/bauiv1lib/account/settings.py +++ b/src/assets/ba_data/python/bauiv1lib/account/settings.py @@ -849,10 +849,8 @@ class AccountSettingsWindow(bui.MainWindow): position=((self._sub_width - button_width) * 0.5, v - 30), autoselect=True, size=(button_width, 60), - # label=bui.Lstr(resource=f'{self._r}.createAccountText'), - label='Create an Account', + label=bui.Lstr(resource=f'{self._r}.createAnAccountText'), color=(0.55, 0.5, 0.6), - # icon=bui.gettexture('settingsIcon'), textcolor=(0.75, 0.7, 0.8), on_activate_call=bui.WeakCall(self._on_create_account_press), ) diff --git a/src/assets/ba_data/python/bauiv1lib/achievements.py b/src/assets/ba_data/python/bauiv1lib/achievements.py index d5efae0b..e6d900ad 100644 --- a/src/assets/ba_data/python/bauiv1lib/achievements.py +++ b/src/assets/ba_data/python/bauiv1lib/achievements.py @@ -18,6 +18,7 @@ class AchievementsWindow(bui.MainWindow): origin_widget: bui.Widget | None = None, ): # pylint: disable=too-many-locals + # pylint: disable=too-many-statements # pylint: disable=cyclic-import from baclassic import ( CHEST_APPEARANCE_DISPLAY_INFOS, @@ -26,13 +27,38 @@ class AchievementsWindow(bui.MainWindow): assert bui.app.classic is not None uiscale = bui.app.ui_v1.uiscale - self._width = 600 if uiscale is bui.UIScale.SMALL else 550 + + self._width = 700 if uiscale is bui.UIScale.SMALL else 550 self._height = ( - 380 + 450 if uiscale is bui.UIScale.SMALL else 370 if uiscale is bui.UIScale.MEDIUM else 450 ) - yoffs = -45 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. + # + # TODO: We need an auto-refresh mechanism for cases where screen + # size changes under us. Currently one must navigate out and + # back in to properly reflect such changes. + screensize = bui.get_virtual_screen_size() + scale = ( + 2.3 + if uiscale is bui.UIScale.SMALL + else 1.5 if uiscale is bui.UIScale.MEDIUM else 1.2 + ) + # 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 + + scroll_width = target_width + scroll_height = target_height - 25 + scroll_y = yoffs - 54 - scroll_height super().__init__( root_widget=bui.containerwidget( @@ -42,16 +68,7 @@ class AchievementsWindow(bui.MainWindow): if uiscale is bui.UIScale.SMALL else 'menu_full' ), - scale=( - 2.3 - if uiscale is bui.UIScale.SMALL - else 1.6 if uiscale is bui.UIScale.MEDIUM else 1.23 - ), - stack_offset=( - (0, 0) - if uiscale is bui.UIScale.SMALL - else (0, 0) if uiscale is bui.UIScale.MEDIUM else (0, 0) - ), + scale=scale, ), transition=transition, origin_widget=origin_widget, @@ -66,7 +83,7 @@ class AchievementsWindow(bui.MainWindow): self._back_button = bui.buttonwidget( parent=self._root_widget, autoselect=True, - position=(50, self._height - 38 + yoffs), + position=(50, yoffs - 48), size=(60, 60), scale=0.6, label=bui.charstr(bui.SpecialChar.BACK), @@ -91,9 +108,7 @@ class AchievementsWindow(bui.MainWindow): parent=self._root_widget, position=( self._width * 0.5, - self._height - - (27 if uiscale is bui.UIScale.SMALL else 20) - + yoffs, + yoffs - (42 if uiscale is bui.UIScale.SMALL else 30), ), size=(0, 0), h_align='center', @@ -106,14 +121,8 @@ class AchievementsWindow(bui.MainWindow): self._scrollwidget = bui.scrollwidget( parent=self._root_widget, - size=( - self._width - 60, - self._height - (150 if uiscale is bui.UIScale.SMALL else 80), - ), - position=( - 30, - (110 if uiscale is bui.UIScale.SMALL else 35) + yoffs, - ), + size=(scroll_width, scroll_height), + position=(self._width * 0.5 - scroll_width * 0.5, scroll_y), capture_arrows=True, simple_culling_v=10, border_opacity=0.4, @@ -130,7 +139,7 @@ class AchievementsWindow(bui.MainWindow): ) incr = 36 - sub_width = self._width - 90 + sub_width = scroll_width - 25 sub_height = 40 + len(achievements) * incr eq_rsrc = 'coopSelectWindow.powerRankingPointsEqualsText' diff --git a/src/assets/ba_data/python/bauiv1lib/chest.py b/src/assets/ba_data/python/bauiv1lib/chest.py index 23764c36..7134ac1e 100644 --- a/src/assets/ba_data/python/bauiv1lib/chest.py +++ b/src/assets/ba_data/python/bauiv1lib/chest.py @@ -466,7 +466,7 @@ class ChestWindow(bui.MainWindow): if show_ad_button: bui.textwidget( parent=self._root_widget, - text='Reduce Wait', + text=bui.Lstr(resource='chests.reduceWaitText'), position=( self._width * 0.5 + hspace * 0.5 + bwidth * 0.5, self._height + bposy + self._yoffs + bheight * 1.15, diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index 3f6c883f..b5fdf597 100644 --- a/src/ballistica/shared/ballistica.cc +++ b/src/ballistica/shared/ballistica.cc @@ -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 = 22219; +const int kEngineBuildNumber = 22220; const char* kEngineVersion = "1.7.37"; const int kEngineApiVersion = 9;