diff --git a/.efrocachemap b/.efrocachemap index d60532a1..01c50f06 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4096,26 +4096,26 @@ "build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1", "build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae", "build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599", - "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "66adb6a7efe291a738213cacf22e7c0e", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "b673694187f5d1997d400fc0ab85dfb4", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "9607ce824cdbbc50bbc0b0db62f5a681", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "68b1b35a0f756edd731f2d80acecd6f6", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "67c867700fc5a64271af014d0b5d3979", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "774ae28d8d5590996bd213e4c727940a", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "d504af98d093549a84d1be53e9975cd5", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "6f73f426095cdc8867843410c9eec2ff", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "c399f425a0c67ee2a72cc1eb64fc6e9f", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "ecfb4208f747fff9824ab17e25b55b63", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "87511e98fa8c05a43589a7f2961fdb33", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "1fe7a8e5c2de3b2131f2e62244764478", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "fac8cb6b7e51f5bc79cfabeb4a437258", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "5e54f822d4c318da162e5acf5b073dbc", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "3cefa0b6e6f6b42a36680a21c1f9156e", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "4181938bacb5dc3205d486a9104bb5a3", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "e8ba8761108783b5afd8dcb3a355a341", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "802d5f7d9a42090247577e650cf8c022", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "cd9bf4cbc6653154160649027e86d4c2", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "f63e7c67c51455340c6c865d8b4f6eaa", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "41a98f2ff00b086a13012b1d41b1b679", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "355efd9eb200adc050f8bf7280bf4ab7", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "99c968cdd2834d4ca0d8cfc1a5a45032", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "d6022d622fe97ca1f53ec82ab7760ba5", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "d940e7a52de205056f514dfb607ae7c2", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "70103854eb9efefbec06170eb180f0b2", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "bce00b851d23d89f79b4fddfdffc450b", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "cd129a1ee5f40d29885b151d7e03c1c9", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "49e4475f1042319638a1ac153179df29", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "82b1318e7502523952b53079298bc8f8", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "1db1588dcd7b6e0f363d136c560c6972", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "24df70b13ce76cb2e7e5a9764c5cbb60", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "5911060f6e9d00c5e2094808892e5498", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "bc46e5358dca0bbf898a3ddb653877e2", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "ceebd7928536a2168e13b2978cbe0f86", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "e42ef061ab1226560cfe85ff211cea73", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "d7aa5a88ad0b480429356b9d864f4cc4", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "ea44279e480430ce8bffbe5ea1c3ac9c", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "d4516c60d83688126ae0c525f5860e1c", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "36c639448372b428d361ad1b11b54754", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "73ad3303fe1a82005918fbc5dae3446c", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "fa659b5d6119acba6570c92ce4d35ae2", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "73ad3303fe1a82005918fbc5dae3446c", @@ -4132,14 +4132,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "3e5c5fd0a09f55ba7b05ce1e2ec7171e", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "1659535e95e3047fda529543e265ac97", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "3e5c5fd0a09f55ba7b05ce1e2ec7171e", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "c0485c893482ed8d4cd58cca89a91bef", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "ff7845b253a5b54a9e3768d2071b945d", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "a49f3aa9afddcc2408807fd275399868", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "2fac5b977c68f28c20f2bb230e15fdac", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "17c44e22e015d13824f1e98f1f632335", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "0237ab1e6ce1d8bea03b85757cd01d8b", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "eedd20534754d746b0ec6c1db4d1af6f", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "f9978fd4147952019a8b643a240fd36e", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "9b192a30bda69790d0b64f91f5e0994f", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "663e75e5c4ef1e7600508bba725c0bc1", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "468ba57dc9006630c0c3c65f660c45cf", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "59e48b3aaca43e98a74c2147a5235c78", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "8219f3131e89ff059d0524d6fbe76e73", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "24254f5fa2d8389a58a86c035a757254", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "cf0bd162dbb597c8f86739547f3cea79", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "85e3392a2b6a05f66eb43efc3045826b", "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": "efa61468cf098f77cc6a234461d8b86d", diff --git a/CHANGELOG.md b/CHANGELOG.md index 15505e78..bd00ec4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.37 (build 21999, api 9, 2024-09-05) +### 1.7.37 (build 22004, api 9, 2024-09-05) - 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 483e28a2..b9de61fd 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -52,7 +52,7 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 21999 +TARGET_BALLISTICA_BUILD = 22004 TARGET_BALLISTICA_VERSION = '1.7.37' diff --git a/src/assets/ba_data/python/bauiv1lib/play.py b/src/assets/ba_data/python/bauiv1lib/play.py index 97ab6396..c52d27fb 100644 --- a/src/assets/ba_data/python/bauiv1lib/play.py +++ b/src/assets/ba_data/python/bauiv1lib/play.py @@ -44,7 +44,8 @@ class PlayWindow(bui.MainWindow): uiscale = bui.app.ui_v1.uiscale width = 1100 if uiscale is bui.UIScale.SMALL else 800 x_offs = 150 if uiscale is bui.UIScale.SMALL else 0 - height = 550 + y_offs = -60 if uiscale is bui.UIScale.SMALL else 0 + height = 650 if uiscale is bui.UIScale.SMALL else 550 button_width = 400 if origin_widget is not None: @@ -77,21 +78,34 @@ class PlayWindow(bui.MainWindow): transition=transition, origin_widget=origin_widget, ) - self._back_button = back_button = btn = bui.buttonwidget( - parent=self._root_widget, - position=(55 + x_offs, height - 132), - size=(120, 60), - scale=1.1, - text_res_scale=1.5, - text_scale=1.2, - autoselect=True, - label=bui.Lstr(resource='backText'), - button_type='back', - ) + + self._back_button: bui.Widget | None + if uiscale is bui.UIScale.SMALL: + self._back_button = None + bui.containerwidget( + edit=self._root_widget, + on_cancel_call=self.main_window_back, + ) + else: + self._back_button = bui.buttonwidget( + parent=self._root_widget, + position=(55 + x_offs, height - 132 + y_offs), + size=(60, 60), + scale=1.1, + text_res_scale=1.5, + text_scale=1.2, + autoselect=True, + 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 + ) txt = bui.textwidget( parent=self._root_widget, - position=(width * 0.5, height - 101), + position=(width * 0.5, height - 101 + y_offs), # position=(width * 0.5, height - # (101 if main_menu else 61)), size=(0, 0), @@ -110,16 +124,14 @@ class PlayWindow(bui.MainWindow): v_align='center', ) - bui.buttonwidget( - edit=btn, - button_type='backSmall', - size=(60, 60), - label=bui.charstr(bui.SpecialChar.BACK), - ) if uiscale is bui.UIScale.SMALL: bui.textwidget(edit=txt, text='') - v = height - (110 if self._playlist_select_context is None else 90) + 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 -= 280 if self._playlist_select_context is None else 180 @@ -510,11 +522,8 @@ class PlayWindow(bui.MainWindow): ) if uiscale is bui.UIScale.SMALL: - back_button.delete() bui.containerwidget( edit=self._root_widget, - on_cancel_call=self.main_window_back, - # cancel_button=bui.get_special_widget('back_button'), selected_child=( self._coop_button if self._playlist_select_context is None @@ -522,12 +531,8 @@ class PlayWindow(bui.MainWindow): ), ) else: - bui.buttonwidget( - edit=back_button, on_activate_call=self.main_window_back - ) bui.containerwidget( edit=self._root_widget, - cancel_button=back_button, selected_child=( self._coop_button if self._playlist_select_context is None @@ -763,7 +768,7 @@ class PlayWindow(bui.MainWindow): sel = self._coop_button elif sel_name == 'Free-for-All Games': sel = self._free_for_all_button - elif sel_name == 'Back': + elif sel_name == 'Back' and self._back_button is not None: sel = self._back_button else: sel = ( diff --git a/src/ballistica/base/ui/ui.cc b/src/ballistica/base/ui/ui.cc index 72fb417d..68773492 100644 --- a/src/ballistica/base/ui/ui.cc +++ b/src/ballistica/base/ui/ui.cc @@ -7,7 +7,7 @@ #include "ballistica/base/app_adapter/app_adapter.h" #include "ballistica/base/audio/audio.h" #include "ballistica/base/graphics/component/simple_component.h" -#include "ballistica/base/input/device/keyboard_input.h" +#include "ballistica/base/input/device/keyboard_input.h" // IWYU pragma: keep #include "ballistica/base/input/input.h" #include "ballistica/base/logic/logic.h" #include "ballistica/base/support/app_config.h" @@ -54,11 +54,11 @@ UI::OperationContext::~OperationContext() { assert(runnables_.empty()); } - // Complain if our Finish() call was never run (unless we're being torn - // down due to an exception). - if (!ran_finish_ && !std::current_exception()) { + // Complain if our Finish() call was never run (unless it seems we're being + // torn down as part of stack-unwinding due to an exception). + if (!ran_finish_ && !std::uncaught_exceptions()) { BA_LOG_ERROR_NATIVE_TRACE_ONCE( - "UI::InteractionContext_ being torn down without Complete called."); + "UI::InteractionContext_ being torn down without Finish() called."); } // Our runnables are raw unmanaged pointers; need to explicitly kill them. diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index 37e00f3a..3baecf9f 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 = 21999; +const int kEngineBuildNumber = 22004; const char* kEngineVersion = "1.7.37"; const int kEngineApiVersion = 9; diff --git a/src/ballistica/ui_v1/python/methods/python_methods_ui_v1.cc b/src/ballistica/ui_v1/python/methods/python_methods_ui_v1.cc index a3a397bd..bcaa0a5e 100644 --- a/src/ballistica/ui_v1/python/methods/python_methods_ui_v1.cc +++ b/src/ballistica/ui_v1/python/methods/python_methods_ui_v1.cc @@ -1355,6 +1355,7 @@ static auto PyContainerWidget(PyObject* self, PyObject* args, ui_op_context.Finish(); return widget->NewPyRef(); + BA_PYTHON_CATCH; } @@ -2633,13 +2634,15 @@ static PyMethodDef PyOnScreenChangeDef = { // ----------------------------------------------------------------------------- auto PythonMethodsUIV1::GetMethods() -> std::vector { - return {PyRootUIBackPressDef, PyGetSpecialWidgetDef, PySetPartyWindowOpenDef, - PyButtonWidgetDef, PyCheckBoxWidgetDef, PyImageWidgetDef, - PyColumnWidgetDef, PyContainerWidgetDef, PyRowWidgetDef, - PyScrollWidgetDef, PyHScrollWidgetDef, PyTextWidgetDef, - PyWidgetDef, PyUIBoundsDef, PyGetSoundDef, - PyGetTextureDef, PyGetQRCodeTextureDef, PyGetMeshDef, - PyIsAvailableDef, PyOnScreenChangeDef}; + return { + PyRootUIBackPressDef, PyGetSpecialWidgetDef, PySetPartyWindowOpenDef, + PyButtonWidgetDef, PyCheckBoxWidgetDef, PyImageWidgetDef, + PyColumnWidgetDef, PyContainerWidgetDef, PyRowWidgetDef, + PyScrollWidgetDef, PyHScrollWidgetDef, PyTextWidgetDef, + PyWidgetDef, PyUIBoundsDef, PyGetSoundDef, + PyGetTextureDef, PyGetQRCodeTextureDef, PyGetMeshDef, + PyIsAvailableDef, PyOnScreenChangeDef, + }; } #pragma clang diagnostic pop diff --git a/src/ballistica/ui_v1/widget/container_widget.cc b/src/ballistica/ui_v1/widget/container_widget.cc index 7be644ca..baa3f225 100644 --- a/src/ballistica/ui_v1/widget/container_widget.cc +++ b/src/ballistica/ui_v1/widget/container_widget.cc @@ -1406,7 +1406,7 @@ void ContainerWidget::SelectWidget(Widget* w, SelectionCause c) { } for (auto& widget : widgets_) { if (&(*widget) == w) { - Widget* prevSelectedWidget = selected_widget_; + Widget* prev_selected_widget = selected_widget_; // Deactivate old selected widget. if (selected_widget_) { @@ -1420,8 +1420,8 @@ void ContainerWidget::SelectWidget(Widget* w, SelectionCause c) { // Store the old one as prev-selected if its not the one we're // selecting now. (otherwise re-selecting repeatedly kills our prev // mechanism). - if (prevSelectedWidget != selected_widget_) { - prev_selected_widget_ = prevSelectedWidget; + if (prev_selected_widget != selected_widget_) { + prev_selected_widget_ = prev_selected_widget; } } else { static bool printed = false; diff --git a/src/ballistica/ui_v1/widget/container_widget.h b/src/ballistica/ui_v1/widget/container_widget.h index 88511df4..db30a439 100644 --- a/src/ballistica/ui_v1/widget/container_widget.h +++ b/src/ballistica/ui_v1/widget/container_widget.h @@ -36,8 +36,8 @@ class ContainerWidget : public Widget { void SetStartButton(ButtonWidget* button); void SetOnCancelCall(PyObject* call_tuple); - // Set a widget to selected (must already have been added to dialog) - // Pass nullptr to deselect widgets. + // Set a widget to selected (must already have been added to dialog). Pass + // nullptr to deselect widgets. void SelectWidget(Widget* w, SelectionCause s = SelectionCause::NONE); void ReselectLastSelectedWidget(); void ShowWidget(Widget* w);