From d1603831ae15784b58d4207b5d79e36866b7ebca Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 23 Sep 2024 19:14:47 -0700 Subject: [PATCH 1/7] updates for latest pylint and lang updates --- .efrocachemap | 98 +++++++++---------- CHANGELOG.md | 10 +- config/requirements.txt | 2 +- .../ba_data/python/babase/_devconsole.py | 2 + .../ba_data/python/baclassic/_achievement.py | 2 + .../ba_data/python/baclassic/_appsubsystem.py | 2 + src/assets/ba_data/python/baclassic/_net.py | 7 +- src/assets/ba_data/python/baenv.py | 3 +- .../ba_data/python/baplus/_appsubsystem.py | 1 + .../ba_data/python/bascenev1/_gameactivity.py | 1 + .../ba_data/python/bascenev1/_gameutils.py | 1 + src/assets/ba_data/python/bascenev1/_level.py | 1 + .../ba_data/python/bascenev1/_messages.py | 1 + .../ba_data/python/bascenev1/_playlist.py | 1 + .../ba_data/python/bascenev1/_session.py | 1 + src/assets/ba_data/python/bascenev1/_stats.py | 2 + .../bascenev1lib/activity/dualteamscore.py | 1 + .../activity/freeforallvictory.py | 1 + .../bascenev1lib/activity/multiteamscore.py | 2 + .../ba_data/python/bascenev1lib/actor/bomb.py | 2 + .../bascenev1lib/actor/controlsguide.py | 1 + .../ba_data/python/bascenev1lib/actor/flag.py | 1 + .../python/bascenev1lib/actor/image.py | 1 + .../python/bascenev1lib/actor/playerspaz.py | 2 + .../python/bascenev1lib/actor/popuptext.py | 1 + .../python/bascenev1lib/actor/scoreboard.py | 3 + .../python/bascenev1lib/actor/spawner.py | 1 + .../ba_data/python/bascenev1lib/actor/spaz.py | 1 + .../python/bascenev1lib/actor/spazbot.py | 4 +- .../ba_data/python/bascenev1lib/actor/text.py | 1 + .../python/bascenev1lib/actor/zoomtext.py | 1 + .../bascenev1lib/game/capturetheflag.py | 1 + .../python/bascenev1lib/game/elimination.py | 1 + .../python/bascenev1lib/game/onslaught.py | 1 + .../ba_data/python/bascenev1lib/mainmenu.py | 2 + .../ba_data/python/bascenev1lib/tutorial.py | 2 + .../ba_data/python/bauiv1/_appsubsystem.py | 1 + .../python/bauiv1lib/account/viewer.py | 1 + .../ba_data/python/bauiv1lib/benchmarks.py | 2 +- .../python/bauiv1lib/characterpicker.py | 1 + .../ba_data/python/bauiv1lib/colorpicker.py | 2 + src/assets/ba_data/python/bauiv1lib/config.py | 2 + .../ba_data/python/bauiv1lib/confirm.py | 1 + .../python/bauiv1lib/coop/gamebutton.py | 1 + .../python/bauiv1lib/coop/tournamentbutton.py | 1 + .../ba_data/python/bauiv1lib/fileselector.py | 1 + .../python/bauiv1lib/gather/__init__.py | 1 + .../python/bauiv1lib/gather/abouttab.py | 1 + .../python/bauiv1lib/gather/manualtab.py | 1 + .../python/bauiv1lib/gather/nearbytab.py | 1 + .../python/bauiv1lib/gather/privatetab.py | 1 + .../python/bauiv1lib/gather/publictab.py | 2 + .../ba_data/python/bauiv1lib/iconpicker.py | 1 + .../python/bauiv1lib/league/rankbutton.py | 1 + .../python/bauiv1lib/league/rankwindow.py | 4 +- .../ba_data/python/bauiv1lib/partyqueue.py | 5 +- src/assets/ba_data/python/bauiv1lib/play.py | 1 + .../bauiv1lib/playlist/editcontroller.py | 1 + .../python/bauiv1lib/playlist/editgame.py | 6 +- .../python/bauiv1lib/playlist/mapselect.py | 1 + .../ba_data/python/bauiv1lib/playoptions.py | 1 + src/assets/ba_data/python/bauiv1lib/popup.py | 3 + .../python/bauiv1lib/settings/gamepad.py | 3 + .../bauiv1lib/settings/gamepadadvanced.py | 1 + .../python/bauiv1lib/settings/keyboard.py | 1 + .../bauiv1lib/soundtrack/entrytypeselect.py | 1 + .../bauiv1lib/soundtrack/macmusicapp.py | 1 + .../ba_data/python/bauiv1lib/store/button.py | 1 + .../ba_data/python/bauiv1lib/store/item.py | 2 + src/assets/ba_data/python/bauiv1lib/tabs.py | 1 + .../python/bauiv1lib/tournamententry.py | 2 +- .../python/bauiv1lib/tournamentscores.py | 1 + .../ba_data/python/bauiv1lib/trophies.py | 1 + src/ballistica/base/assets/assets.cc | 8 +- src/ballistica/base/assets/assets.h | 8 +- src/ballistica/base/assets/sound_asset.cc | 6 +- src/ballistica/base/audio/audio.cc | 8 +- src/ballistica/base/audio/ogg_stream.cc | 4 +- .../base/graphics/gl/renderer_gl.cc | 14 +-- src/ballistica/base/graphics/gl/renderer_gl.h | 13 +-- src/ballistica/base/graphics/graphics.cc | 9 +- src/ballistica/base/graphics/graphics.h | 5 +- src/ballistica/base/graphics/graphics_vr.cc | 13 +-- .../base/graphics/renderer/renderer.cc | 6 +- .../base/graphics/renderer/renderer.h | 14 +-- .../base/input/device/joystick_input.cc | 4 +- src/ballistica/base/input/input.h | 4 +- src/ballistica/base/logic/logic.cc | 8 +- src/ballistica/base/logic/logic.h | 4 +- .../base/networking/network_reader.cc | 12 +-- src/ballistica/base/platform/base_platform.cc | 4 +- src/ballistica/base/python/base_python.cc | 16 +-- src/ballistica/base/python/base_python.h | 4 +- .../python/class/python_class_app_timer.h | 4 +- .../python/class/python_class_context_call.cc | 4 +- .../python/class/python_class_context_call.h | 4 +- .../python/class/python_class_context_ref.cc | 4 +- .../python/class/python_class_context_ref.h | 8 +- .../python/class/python_class_display_timer.h | 4 +- .../base/python/class/python_class_env.cc | 4 +- .../base/python/class/python_class_env.h | 4 +- .../class/python_class_feature_set_data.h | 4 +- .../python/class/python_class_simple_sound.h | 4 +- .../base/python/class/python_class_vec3.cc | 24 ++--- .../base/python/class/python_class_vec3.h | 16 +-- .../python/methods/python_methods_base_1.cc | 68 ++++++------- .../python/methods/python_methods_base_2.cc | 52 +++++----- .../python/methods/python_methods_base_3.cc | 96 +++++++++--------- src/ballistica/base/support/classic_soft.h | 5 +- src/ballistica/base/ui/ui.cc | 4 +- src/ballistica/classic/classic.cc | 10 +- .../classic/python/classic_python.cc | 5 +- .../python/methods/python_methods_classic.cc | 4 +- .../classic/support/classic_app_mode.cc | 2 +- .../core/platform/apple/core_platform_apple.h | 8 +- src/ballistica/core/platform/core_platform.cc | 24 ++--- src/ballistica/core/platform/core_platform.h | 4 +- .../platform/windows/core_platform_windows.cc | 8 +- .../platform/windows/core_platform_windows.h | 4 +- .../scene_v1/connection/connection_set.cc | 4 +- src/ballistica/scene_v1/dynamics/dynamics.cc | 4 +- .../dynamics/material/material_component.cc | 4 +- .../dynamics/material/material_component.h | 4 +- src/ballistica/scene_v1/node/spaz_node.cc | 4 +- src/ballistica/scene_v1/node/spaz_node.h | 8 +- .../python/class/python_class_activity_data.h | 4 +- .../python/class/python_class_base_timer.h | 4 +- .../python/class/python_class_input_device.cc | 12 +-- .../python/class/python_class_input_device.h | 8 +- .../python/class/python_class_material.cc | 4 +- .../python/class/python_class_material.h | 8 +- .../python/class/python_class_node.cc | 16 +-- .../scene_v1/python/class/python_class_node.h | 16 +-- .../class/python_class_scene_collision_mesh.h | 4 +- .../class/python_class_scene_data_asset.h | 4 +- .../python/class/python_class_scene_mesh.h | 4 +- .../python/class/python_class_scene_sound.h | 4 +- .../python/class/python_class_scene_texture.h | 4 +- .../python/class/python_class_scene_timer.h | 4 +- .../python/class/python_class_session_data.h | 4 +- .../class/python_class_session_player.cc | 32 +++--- .../class/python_class_session_player.h | 8 +- .../python/methods/python_methods_assets.cc | 32 +++--- .../python/methods/python_methods_input.cc | 28 +++--- .../methods/python_methods_networking.cc | 32 +++--- .../python/methods/python_methods_scene.cc | 92 ++++++++--------- .../scene_v1/python/scene_v1_python.cc | 18 ++-- .../scene_v1/python/scene_v1_python.h | 9 +- .../scene_v1/support/host_session.h | 8 +- .../scene_v1/support/session_stream.h | 4 +- src/ballistica/shared/ballistica.cc | 2 +- .../shared/foundation/event_loop.cc | 4 +- src/ballistica/shared/foundation/macros.cc | 4 +- src/ballistica/shared/foundation/macros.h | 4 +- src/ballistica/shared/generic/base64.cc | 4 +- src/ballistica/shared/generic/base64.h | 4 +- src/ballistica/shared/generic/timer_list.h | 4 +- src/ballistica/shared/generic/utils.cc | 4 +- src/ballistica/shared/generic/utils.h | 4 +- src/ballistica/shared/math/matrix44f.cc | 8 +- src/ballistica/shared/math/matrix44f.h | 12 +-- src/ballistica/shared/networking/sockaddr.cc | 4 +- src/ballistica/shared/python/python_class.cc | 8 +- src/ballistica/shared/python/python_class.h | 8 +- .../shared/python/python_command.cc | 8 +- src/ballistica/shared/python/python_command.h | 4 +- src/ballistica/shared/python/python_ref.cc | 12 +-- .../python/class/python_class_hello.h | 4 +- .../methods/python_methods_template_fs.cc | 4 +- .../ui_v1/python/class/python_class_ui_mesh.h | 4 +- .../python/class/python_class_ui_sound.h | 12 +-- .../python/class/python_class_ui_texture.h | 4 +- .../ui_v1/python/class/python_class_widget.cc | 8 +- .../ui_v1/python/class/python_class_widget.h | 8 +- .../python/methods/python_methods_ui_v1.cc | 27 +++-- .../ui_v1/widget/container_widget.cc | 4 +- tools/batools/assetsmakefile.py | 3 + tools/batools/docker.py | 1 + tools/batools/project/_updater.py | 1 + tools/batools/spinoff/_context.py | 22 +++-- tools/batools/xcodeproject.py | 4 +- tools/efro/dataclassio/_api.py | 1 + tools/efro/dataclassio/_base.py | 1 + tools/efro/dataclassio/_inputter.py | 5 + tools/efro/dataclassio/_outputter.py | 3 + tools/efro/dataclassio/_prep.py | 1 + tools/efro/debug.py | 1 + tools/efro/log.py | 5 +- tools/efro/message/_module.py | 2 + tools/efro/message/_protocol.py | 3 + tools/efro/rpc.py | 2 + tools/efro/util.py | 1 + tools/efrotools/code.py | 2 + tools/efrotools/emacs.py | 1 + tools/efrotools/genwrapper.py | 8 ++ tools/efrotools/lazybuild.py | 1 + tools/efrotools/message.py | 2 + tools/efrotools/util.py | 1 + tools/efrotools/xcodebuild.py | 1 + 199 files changed, 787 insertions(+), 615 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index fc5c4413..12c0bce9 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -421,13 +421,13 @@ "build/assets/ba_data/audio/zoeOw.ogg": "74befe45a8417e95b6a2233c51992a26", "build/assets/ba_data/audio/zoePickup01.ogg": "48ab8cddfcde36a750856f3f81dd20c8", "build/assets/ba_data/audio/zoeScream01.ogg": "2b468aedfa8741090247f04eb9e6df55", - "build/assets/ba_data/data/langdata.json": "fa2cb506dd6628e30b775ca44604e4f8", + "build/assets/ba_data/data/langdata.json": "a3d27b587a1b206a3338ef820a802313", "build/assets/ba_data/data/languages/arabic.json": "609f5d698a488e40e61787b62ee8ea5e", "build/assets/ba_data/data/languages/belarussian.json": "3d5523d0004293aa2df02f3f6f3b84f8", - "build/assets/ba_data/data/languages/chinese.json": "d03ed49486d41cfbdf770e5a54f974a1", + "build/assets/ba_data/data/languages/chinese.json": "57d199cfd2a5cf493e777dd96cc12f7c", "build/assets/ba_data/data/languages/chinesetraditional.json": "d85c58cc1e0e4bd0b09b2bc768cb1971", "build/assets/ba_data/data/languages/croatian.json": "b23619cb396ac16640c47458f884b16a", - "build/assets/ba_data/data/languages/czech.json": "61bcfce75c0d53d2f2af709cee42187a", + "build/assets/ba_data/data/languages/czech.json": "be5d536a1160607dfa158e59ecc1c324", "build/assets/ba_data/data/languages/danish.json": "8e57db30c5250df2abff14a822f83ea7", "build/assets/ba_data/data/languages/dutch.json": "b0900d572c9141897d53d6574c471343", "build/assets/ba_data/data/languages/english.json": "5a73dea22df1117d58a79459def62ff5", @@ -443,7 +443,7 @@ "build/assets/ba_data/data/languages/italian.json": "d9eb41f6eafb19040f8d5c0608790b62", "build/assets/ba_data/data/languages/korean.json": "4e3524327a0174250aff5e1ef4c0c597", "build/assets/ba_data/data/languages/malay.json": "f6ce0426d03a62612e3e436ed5d1be1f", - "build/assets/ba_data/data/languages/persian.json": "ededb9c015afb58b1324a096ea740f72", + "build/assets/ba_data/data/languages/persian.json": "fc25780341e0dfebc393e4c1c846b7a9", "build/assets/ba_data/data/languages/polish.json": "89333fb207f9eb2f22fff5a95b022c35", "build/assets/ba_data/data/languages/portuguese.json": "eb2563e245e1ea00b870264dced3ebd7", "build/assets/ba_data/data/languages/romanian.json": "55a8744e466801013ea131266a856924", @@ -455,7 +455,7 @@ "build/assets/ba_data/data/languages/tamil.json": "ead39b864228696a9b0d19344bc4b5ec", "build/assets/ba_data/data/languages/thai.json": "1d665629361f302693dead39de8fa945", "build/assets/ba_data/data/languages/turkish.json": "6153ca5248b8e4743e9501ac72378493", - "build/assets/ba_data/data/languages/ukrainian.json": "23a98e5722d3e71e809a8a0063daa603", + "build/assets/ba_data/data/languages/ukrainian.json": "3a5b8132690fcd583d280879876c85b7", "build/assets/ba_data/data/languages/venetian.json": "a1315f5233ebbee1464683ac55d5d9d5", "build/assets/ba_data/data/languages/vietnamese.json": "5ae84265600b6cfda45c9bed18724e1d", "build/assets/ba_data/data/maps/big_g.json": "1dd301d490643088a435ce75df971054", @@ -4096,50 +4096,50 @@ "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": "fad0592c63dbf5623fd085b1f94dc5b5", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "b18b7d1073b180dd2b0ed563e3befda7", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "2ea095b28288927982060509174ed625", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "bdd91ad1d25228813e6123adecc16031", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "354635e2cdb27b523c229ee3c723e136", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "6a3ecdf84a34549f451cfa43e87bae28", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "5e01a1b583a53c3d475013363b6e0372", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "179905fc0b716c99c57b56179f84166e", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "be15731bcd223a8723f146d8e3153b53", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "dfc1d123a5517302f5869b151a436a7f", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "b1ef6725fdcf9071aba0f0f5e038727d", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "24ac52a8b44b2b815cce76a150f38629", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "488119eac17785da1bf534702e8ed51f", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "cb59173e8b176b98206b7f69b9a08972", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "60700ee6b7ed262215fca2c02ec5561b", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "972c6e59e59ca24c7d1739b1d7530a30", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "b04c87e6dec8916aaf3666fe0aa4d158", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "04ddbccf8268c1199d196b3dc4559e1b", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "02c9824a5e1951e8298c75196ae154e2", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "da0705f8cc9e9eece02592fd1295ea40", - "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", - "build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "fa659b5d6119acba6570c92ce4d35ae2", - "build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "ab8467107ed371eb542e0317a7e7395d", - "build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "4a4c19120f810ff5b4c7afbf11c23cf6", - "build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "ab8467107ed371eb542e0317a7e7395d", - "build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "4a4c19120f810ff5b4c7afbf11c23cf6", - "build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "f4c36e72fa8d9d06f8a00684a3fc4679", - "build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "3168e8377498df85a4adacede63d126a", - "build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "f4c36e72fa8d9d06f8a00684a3fc4679", - "build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "3168e8377498df85a4adacede63d126a", - "build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "427a392c291aa9562e93c570c9f1b92c", - "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "3f50101eed1a5178d5630064dbafb3ee", - "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "78cf6a2069ab46f5f0be3f5b57a6ee70", - "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "3f50101eed1a5178d5630064dbafb3ee", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "4769b8b8a99ef0e08aa968af3072fa38", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "f999d258cb8c7645c5b462ff81012289", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "aee027b5a96a835583d07ea95ac6d608", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "3f7d65bf17deb2714862df46c6772e06", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "d332af0eee1178cc7c00b6e3ed5ca8a2", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "2c8f29b6b26f657c776fee12f81bd28e", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "26a02edb690a0f9e5baaf0923cc1e57d", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "62d7688c402895869b794541366a3e20", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "aa72881174380859e777358af1da8d1f", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "bb5c1ca60d9683f2d24d4d8d35af9121", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "89a73b9312c48ed182d54263707a0982", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "f8e25d00480757c6fef0d125fbabe7d3", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "116a9fff16cc5cefd91d24415e9b09e7", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "01a542f1515ee659f99550c34ca2f749", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "16aa91530f2abea70f8c648db20872b9", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "5c19c58e3163c2b4c21eb1cde8f2712a", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "f3e54e879fe538a6f0e52c1833e03739", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "36b20cfad166d7229684cd0b88be0ca0", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "64bdc98a71e9bcb63999e7fb1c57722f", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "583086e11d495f3439bdd6029bde0466", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "701f03b8ba74493d935f795a84c13455", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "3e9f1feaf14d30f740d84280432cb236", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "31da2a14cc69755f3a8f68b17482832f", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "8ef21c1df9040fb8e2d38258dc80a4d5", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "74a0b75b877954015798a6289d26c26c", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "ed2b2f673f2ed41fc24613a937a954d9", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "16824b0155479f54293cb2230553d174", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "379f72d2ce79111490ba9c87087488f3", + "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", + "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "086a2ce72497e44079ad6b747fc5439f", + "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", + "build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "086a2ce72497e44079ad6b747fc5439f", + "build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "d562f21a435b7a888028689ffdf06d02", + "build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "226df279a267c72853b7242fd1507dd1", + "build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "d562f21a435b7a888028689ffdf06d02", + "build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "226df279a267c72853b7242fd1507dd1", + "build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "5a17ee891f9113060a2f462cd9d04dc7", + "build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "46f23c6890b06fa29f97604b42113c5e", + "build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "5a17ee891f9113060a2f462cd9d04dc7", + "build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "46f23c6890b06fa29f97604b42113c5e", + "build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "ecb7fec32ddd75652e657c2076ff2b69", + "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", + "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "4c11b81a574aa9af593f54db4d998e61", + "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "c6a3ce3f5dbfa705ef6d7e4b94bca8ed", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "61a4f8795d6cd96f90bc2bed25087bfe", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "0af969c789949825652e6b09020867b5", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "839ebfcfcbc87f4470b96f986485a4f6", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "b161b991f68d7fc5a23e1bbf3041693f", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "48add2ca39f42cf1129fd56deac471e1", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "bd7faaa40c5b448554d524d2d5fddeb1", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "d18d44e3e100240220523f4bc54f9d85", "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 ddad06aa..245eaa46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,17 @@ -### 1.7.37 (build 22007, api 9, 2024-09-19) +### 1.7.37 (build 22009, api 9, 2024-09-23) - 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. I'm hopeful that api version won't need to be bumped again for along time (if ever). +- The newest Pylint update (3.3) added a check for + 'too-many-positional-arguments'. This seems like a good idea, so I updated + various functions to conform to it and set some others to ignore it. Basically + if you see a function like `def dothing(a, b, *, c, d)` then everything after + the `*` needs to be passed as a keyword. So you can't do `dothing(val1, val2, + val3, val4)`; you need to do `dothing(val1, val2, c=val3, d=val4)`. Requiring + keywords for complex functions generally leads to more readable code and less + breakage if arguments are added or removed from the function. - Playlist customization no longer requires pro. - Soundtrack customization no longer requires pro. - Campaign hard mode no longer requires pro. diff --git a/config/requirements.txt b/config/requirements.txt index 0f456306..75a8e8ab 100644 --- a/config/requirements.txt +++ b/config/requirements.txt @@ -6,7 +6,7 @@ mypy==1.11.2 pbxproj==4.2.1 pdoc==14.7.0 pur==7.3.2 -pylint==3.2.7 +pylint==3.3.0 pylsp-mypy==0.6.9 pytest==8.3.3 python-daemon==3.0.1 diff --git a/src/assets/ba_data/python/babase/_devconsole.py b/src/assets/ba_data/python/babase/_devconsole.py index fbae9fa2..d7e4eb00 100644 --- a/src/assets/ba_data/python/babase/_devconsole.py +++ b/src/assets/ba_data/python/babase/_devconsole.py @@ -33,6 +33,7 @@ class DevConsoleTab: pos: tuple[float, float], size: tuple[float, float], call: Callable[[], Any] | None = None, + *, h_anchor: Literal['left', 'center', 'right'] = 'center', label_scale: float = 1.0, corner_radius: float = 8.0, @@ -57,6 +58,7 @@ class DevConsoleTab: self, text: str, pos: tuple[float, float], + *, h_anchor: Literal['left', 'center', 'right'] = 'center', h_align: Literal['left', 'center', 'right'] = 'center', v_align: Literal['top', 'center', 'bottom', 'none'] = 'center', diff --git a/src/assets/ba_data/python/baclassic/_achievement.py b/src/assets/ba_data/python/baclassic/_achievement.py index 3ef3bed8..908ef6ad 100644 --- a/src/assets/ba_data/python/baclassic/_achievement.py +++ b/src/assets/ba_data/python/baclassic/_achievement.py @@ -657,6 +657,7 @@ class Achievement: award: int, hard_mode_only: bool = False, ): + # pylint: disable=too-many-positional-arguments self._name = name self._icon_name = icon_name self._icon_color: Sequence[float] = list(icon_color) + [1] @@ -870,6 +871,7 @@ class Achievement: x: float, y: float, delay: float, + *, outdelay: float | None = None, color: Sequence[float] | None = None, style: str = 'post_game', diff --git a/src/assets/ba_data/python/baclassic/_appsubsystem.py b/src/assets/ba_data/python/baclassic/_appsubsystem.py index c09889cc..f68b0bd4 100644 --- a/src/assets/ba_data/python/baclassic/_appsubsystem.py +++ b/src/assets/ba_data/python/baclassic/_appsubsystem.py @@ -543,6 +543,7 @@ class ClassicAppSubsystem(babase.AppSubsystem): def run_stress_test( self, + *, playlist_type: str = 'Random', playlist_name: str = '__default__', player_count: int = 8, @@ -694,6 +695,7 @@ class ClassicAppSubsystem(babase.AppSubsystem): def tournament_entry_window( self, tournament_id: str, + *, tournament_activity: bascenev1.Activity | None = None, position: tuple[float, float] = (0.0, 0.0), delegate: Any = None, diff --git a/src/assets/ba_data/python/baclassic/_net.py b/src/assets/ba_data/python/baclassic/_net.py index 359c4425..185f24b6 100644 --- a/src/assets/ba_data/python/baclassic/_net.py +++ b/src/assets/ba_data/python/baclassic/_net.py @@ -35,6 +35,8 @@ class MasterServerV1CallThread(threading.Thread): callback: MasterServerCallback | None, response_type: MasterServerResponseType, ): + # pylint: disable=too-many-positional-arguments + # Set daemon=True so long-running requests don't keep us from # quitting the app. super().__init__(daemon=True) @@ -52,8 +54,9 @@ class MasterServerV1CallThread(threading.Thread): self._activity = weakref.ref(activity) if activity is not None else None def _run_callback(self, arg: None | dict[str, Any]) -> None: - # If we were created in an activity context and that activity has - # since died, do nothing. + # If we were created in an activity context and that activity + # has since died, do nothing. + # FIXME: Should we just be using a ContextCall instead of doing # this check manually? if self._activity is not None: diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 77a13c89..45f47bb0 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 = 22007 +TARGET_BALLISTICA_BUILD = 22009 TARGET_BALLISTICA_VERSION = '1.7.37' @@ -156,6 +156,7 @@ def get_config() -> EnvConfig: def configure( + *, config_dir: str | None = None, data_dir: str | None = None, user_python_dir: str | None = None, diff --git a/src/assets/ba_data/python/baplus/_appsubsystem.py b/src/assets/ba_data/python/baplus/_appsubsystem.py index 6733699c..0036a114 100644 --- a/src/assets/ba_data/python/baplus/_appsubsystem.py +++ b/src/assets/ba_data/python/baplus/_appsubsystem.py @@ -221,6 +221,7 @@ class PlusAppSubsystem(AppSubsystem): name: Any, score: int | None, callback: Callable, + *, order: str = 'increasing', tournament_id: str | None = None, score_type: str = 'points', diff --git a/src/assets/ba_data/python/bascenev1/_gameactivity.py b/src/assets/ba_data/python/bascenev1/_gameactivity.py index fc9f0b83..14f3c2db 100644 --- a/src/assets/ba_data/python/bascenev1/_gameactivity.py +++ b/src/assets/ba_data/python/bascenev1/_gameactivity.py @@ -1247,6 +1247,7 @@ class GameActivity(Activity[PlayerT, TeamT]): def show_zoom_message( self, message: babase.Lstr, + *, color: Sequence[float] = (0.9, 0.4, 0.0), scale: float = 0.8, duration: float = 2.0, diff --git a/src/assets/ba_data/python/bascenev1/_gameutils.py b/src/assets/ba_data/python/bascenev1/_gameutils.py index 36a1f31d..c67f0667 100644 --- a/src/assets/ba_data/python/bascenev1/_gameutils.py +++ b/src/assets/ba_data/python/bascenev1/_gameutils.py @@ -112,6 +112,7 @@ def animate_array( attr: str, size: int, keys: dict[float, Sequence[float]], + *, loop: bool = False, offset: float = 0, ) -> None: diff --git a/src/assets/ba_data/python/bascenev1/_level.py b/src/assets/ba_data/python/bascenev1/_level.py index 6da0a7ec..ce8ddf58 100644 --- a/src/assets/ba_data/python/bascenev1/_level.py +++ b/src/assets/ba_data/python/bascenev1/_level.py @@ -27,6 +27,7 @@ class Level: gametype: type[bascenev1.GameActivity], settings: dict, preview_texture_name: str, + *, displayname: str | None = None, ): self._name = name diff --git a/src/assets/ba_data/python/bascenev1/_messages.py b/src/assets/ba_data/python/bascenev1/_messages.py index cecf8db2..45f83c88 100644 --- a/src/assets/ba_data/python/bascenev1/_messages.py +++ b/src/assets/ba_data/python/bascenev1/_messages.py @@ -241,6 +241,7 @@ class HitMessage: def __init__( self, + *, srcnode: bascenev1.Node | None = None, pos: Sequence[float] | None = None, velocity: Sequence[float] | None = None, diff --git a/src/assets/ba_data/python/bascenev1/_playlist.py b/src/assets/ba_data/python/bascenev1/_playlist.py index 013f6e56..c06199dc 100644 --- a/src/assets/ba_data/python/bascenev1/_playlist.py +++ b/src/assets/ba_data/python/bascenev1/_playlist.py @@ -21,6 +21,7 @@ PlaylistType = list[dict[str, Any]] def filter_playlist( playlist: PlaylistType, sessiontype: type[Session], + *, add_resolved_type: bool = False, remove_unowned: bool = True, mark_unowned: bool = False, diff --git a/src/assets/ba_data/python/bascenev1/_session.py b/src/assets/ba_data/python/bascenev1/_session.py index dd757346..85c341f6 100644 --- a/src/assets/ba_data/python/bascenev1/_session.py +++ b/src/assets/ba_data/python/bascenev1/_session.py @@ -96,6 +96,7 @@ class Session: def __init__( self, depsets: Sequence[bascenev1.DependencySet], + *, team_names: Sequence[str] | None = None, team_colors: Sequence[Sequence[float]] | None = None, min_players: int = 1, diff --git a/src/assets/ba_data/python/bascenev1/_stats.py b/src/assets/ba_data/python/bascenev1/_stats.py index 4f3a0dbe..59e02bf2 100644 --- a/src/assets/ba_data/python/bascenev1/_stats.py +++ b/src/assets/ba_data/python/bascenev1/_stats.py @@ -196,6 +196,7 @@ class PlayerRecord: scale2: float, sound2: bascenev1.Sound | None, ) -> None: + # pylint: disable=too-many-positional-arguments from bascenev1lib.actor.popuptext import PopupText # Only award this if they're still alive and we can get @@ -341,6 +342,7 @@ class Stats: self, player: bascenev1.Player, base_points: int = 1, + *, target: Sequence[float] | None = None, kill: bool = False, victim_player: bascenev1.Player | None = None, diff --git a/src/assets/ba_data/python/bascenev1lib/activity/dualteamscore.py b/src/assets/ba_data/python/bascenev1lib/activity/dualteamscore.py index dc01ac58..6929a102 100644 --- a/src/assets/ba_data/python/bascenev1lib/activity/dualteamscore.py +++ b/src/assets/ba_data/python/bascenev1lib/activity/dualteamscore.py @@ -145,6 +145,7 @@ class TeamVictoryScoreScreenActivity(MultiTeamScoreScreenActivity): kill_delay: float, shiftdelay: float, ) -> None: + # pylint: disable=too-many-positional-arguments del kill_delay # Unused arg. ZoomText( str(sessionteam.customdata['score']), diff --git a/src/assets/ba_data/python/bascenev1lib/activity/freeforallvictory.py b/src/assets/ba_data/python/bascenev1lib/activity/freeforallvictory.py index 5f2189fa..3f88e3b6 100644 --- a/src/assets/ba_data/python/bascenev1lib/activity/freeforallvictory.py +++ b/src/assets/ba_data/python/bascenev1lib/activity/freeforallvictory.py @@ -87,6 +87,7 @@ class FreeForAllVictoryScoreScreenActivity(MultiTeamScoreScreenActivity): extrascale: float, flash: bool = False, ) -> Text: + # pylint: disable=too-many-positional-arguments return Text( text, position=( diff --git a/src/assets/ba_data/python/bascenev1lib/activity/multiteamscore.py b/src/assets/ba_data/python/bascenev1lib/activity/multiteamscore.py index 9feb385d..b398f7d4 100644 --- a/src/assets/ba_data/python/bascenev1lib/activity/multiteamscore.py +++ b/src/assets/ba_data/python/bascenev1lib/activity/multiteamscore.py @@ -57,6 +57,7 @@ class MultiTeamScoreScreenActivity(bs.ScoreScreenActivity): def show_player_scores( self, + *, delay: float = 2.5, results: bs.GameResults | None = None, scale: float = 1.0, @@ -134,6 +135,7 @@ class MultiTeamScoreScreenActivity(bs.ScoreScreenActivity): xoffs: float, yoffs: float, text: bs.Lstr, + *, h_align: Text.HAlign = Text.HAlign.RIGHT, extrascale: float = 1.0, maxwidth: float | None = 120.0, diff --git a/src/assets/ba_data/python/bascenev1lib/actor/bomb.py b/src/assets/ba_data/python/bascenev1lib/actor/bomb.py index c73eceba..126f0f2d 100644 --- a/src/assets/ba_data/python/bascenev1lib/actor/bomb.py +++ b/src/assets/ba_data/python/bascenev1lib/actor/bomb.py @@ -333,6 +333,7 @@ class Blast(bs.Actor): def __init__( self, + *, position: Sequence[float] = (0.0, 1.0, 0.0), velocity: Sequence[float] = (0.0, 0.0, 0.0), blast_radius: float = 2.0, @@ -715,6 +716,7 @@ class Bomb(bs.Actor): def __init__( self, + *, position: Sequence[float] = (0.0, 1.0, 0.0), velocity: Sequence[float] = (0.0, 0.0, 0.0), bomb_type: str = 'normal', diff --git a/src/assets/ba_data/python/bascenev1lib/actor/controlsguide.py b/src/assets/ba_data/python/bascenev1lib/actor/controlsguide.py index a750dfdc..40b3f189 100644 --- a/src/assets/ba_data/python/bascenev1lib/actor/controlsguide.py +++ b/src/assets/ba_data/python/bascenev1lib/actor/controlsguide.py @@ -24,6 +24,7 @@ class ControlsGuide(bs.Actor): def __init__( self, + *, position: tuple[float, float] = (390.0, 120.0), scale: float = 1.0, delay: float = 0.0, diff --git a/src/assets/ba_data/python/bascenev1lib/actor/flag.py b/src/assets/ba_data/python/bascenev1lib/actor/flag.py index 03472039..79ac4486 100644 --- a/src/assets/ba_data/python/bascenev1lib/actor/flag.py +++ b/src/assets/ba_data/python/bascenev1lib/actor/flag.py @@ -169,6 +169,7 @@ class Flag(bs.Actor): def __init__( self, + *, position: Sequence[float] = (0.0, 1.0, 0.0), color: Sequence[float] = (1.0, 1.0, 1.0), materials: Sequence[bs.Material] | None = None, diff --git a/src/assets/ba_data/python/bascenev1lib/actor/image.py b/src/assets/ba_data/python/bascenev1lib/actor/image.py index daa648be..2a71c878 100644 --- a/src/assets/ba_data/python/bascenev1lib/actor/image.py +++ b/src/assets/ba_data/python/bascenev1lib/actor/image.py @@ -37,6 +37,7 @@ class Image(bs.Actor): def __init__( self, texture: bs.Texture | dict[str, Any], + *, position: tuple[float, float] = (0, 0), transition: Transition | None = None, transition_delay: float = 0.0, diff --git a/src/assets/ba_data/python/bascenev1lib/actor/playerspaz.py b/src/assets/ba_data/python/bascenev1lib/actor/playerspaz.py index 07caae58..1aa7ed5a 100644 --- a/src/assets/ba_data/python/bascenev1lib/actor/playerspaz.py +++ b/src/assets/ba_data/python/bascenev1lib/actor/playerspaz.py @@ -46,6 +46,7 @@ class PlayerSpaz(Spaz): def __init__( self, player: bs.Player, + *, color: Sequence[float] = (1.0, 1.0, 1.0), highlight: Sequence[float] = (0.5, 0.5, 0.5), character: str = 'Spaz', @@ -102,6 +103,7 @@ class PlayerSpaz(Spaz): def connect_controls_to_player( self, + *, enable_jump: bool = True, enable_punch: bool = True, enable_pickup: bool = True, diff --git a/src/assets/ba_data/python/bascenev1lib/actor/popuptext.py b/src/assets/ba_data/python/bascenev1lib/actor/popuptext.py index ca375fce..9c0d09c2 100644 --- a/src/assets/ba_data/python/bascenev1lib/actor/popuptext.py +++ b/src/assets/ba_data/python/bascenev1lib/actor/popuptext.py @@ -22,6 +22,7 @@ class PopupText(bs.Actor): def __init__( self, text: str | bs.Lstr, + *, position: Sequence[float] = (0.0, 0.0, 0.0), color: Sequence[float] = (1.0, 1.0, 1.0, 1.0), random_offset: float = 0.5, diff --git a/src/assets/ba_data/python/bascenev1lib/actor/scoreboard.py b/src/assets/ba_data/python/bascenev1lib/actor/scoreboard.py index 05a1ba50..f5e30583 100644 --- a/src/assets/ba_data/python/bascenev1lib/actor/scoreboard.py +++ b/src/assets/ba_data/python/bascenev1lib/actor/scoreboard.py @@ -24,6 +24,7 @@ class _Entry: flash_length: float, ): # pylint: disable=too-many-statements + # pylint: disable=too-many-positional-arguments self._scoreboard = weakref.ref(scoreboard) self._do_cover = do_cover self._scale = scale @@ -277,6 +278,7 @@ class _Entry: def set_value( self, score: float, + *, max_score: float | None = None, countdown: bool = False, flash: bool = True, @@ -399,6 +401,7 @@ class Scoreboard: team: bs.Team, score: float, max_score: float | None = None, + *, countdown: bool = False, flash: bool = True, show_value: bool = True, diff --git a/src/assets/ba_data/python/bascenev1lib/actor/spawner.py b/src/assets/ba_data/python/bascenev1lib/actor/spawner.py index 78fa56cf..95cc2838 100644 --- a/src/assets/ba_data/python/bascenev1lib/actor/spawner.py +++ b/src/assets/ba_data/python/bascenev1lib/actor/spawner.py @@ -50,6 +50,7 @@ class Spawner: def __init__( self, + *, data: Any = None, pt: Sequence[float] = (0, 0, 0), spawn_time: float = 1.0, diff --git a/src/assets/ba_data/python/bascenev1lib/actor/spaz.py b/src/assets/ba_data/python/bascenev1lib/actor/spaz.py index f70383f0..a35bea08 100644 --- a/src/assets/ba_data/python/bascenev1lib/actor/spaz.py +++ b/src/assets/ba_data/python/bascenev1lib/actor/spaz.py @@ -71,6 +71,7 @@ class Spaz(bs.Actor): def __init__( self, + *, color: Sequence[float] = (1.0, 1.0, 1.0), highlight: Sequence[float] = (0.5, 0.5, 0.5), character: str = 'Spaz', diff --git a/src/assets/ba_data/python/bascenev1lib/actor/spazbot.py b/src/assets/ba_data/python/bascenev1lib/actor/spazbot.py index 56118af8..86d1620b 100644 --- a/src/assets/ba_data/python/bascenev1lib/actor/spazbot.py +++ b/src/assets/ba_data/python/bascenev1lib/actor/spazbot.py @@ -947,9 +947,9 @@ class SpazBotSet: on_spawn_call: Callable[[SpazBot], Any] | None = None, ) -> None: """Spawn a bot from this set.""" - from bascenev1lib.actor import spawner + from bascenev1lib.actor.spawner import Spawner - spawner.Spawner( + Spawner( pt=pos, spawn_time=spawn_time, send_spawn_message=False, diff --git a/src/assets/ba_data/python/bascenev1lib/actor/text.py b/src/assets/ba_data/python/bascenev1lib/actor/text.py index cdea37d2..42611e85 100644 --- a/src/assets/ba_data/python/bascenev1lib/actor/text.py +++ b/src/assets/ba_data/python/bascenev1lib/actor/text.py @@ -56,6 +56,7 @@ class Text(bs.Actor): def __init__( self, text: str | bs.Lstr, + *, position: tuple[float, float] = (0.0, 0.0), h_align: HAlign = HAlign.LEFT, v_align: VAlign = VAlign.NONE, diff --git a/src/assets/ba_data/python/bascenev1lib/actor/zoomtext.py b/src/assets/ba_data/python/bascenev1lib/actor/zoomtext.py index 46525aaf..573c6001 100644 --- a/src/assets/ba_data/python/bascenev1lib/actor/zoomtext.py +++ b/src/assets/ba_data/python/bascenev1lib/actor/zoomtext.py @@ -26,6 +26,7 @@ class ZoomText(bs.Actor): self, text: str | bs.Lstr, position: tuple[float, float] = (0.0, 0.0), + *, shiftposition: tuple[float, float] | None = None, shiftdelay: float | None = None, lifespan: float | None = None, diff --git a/src/assets/ba_data/python/bascenev1lib/game/capturetheflag.py b/src/assets/ba_data/python/bascenev1lib/game/capturetheflag.py index b97c6aa4..e86af03e 100644 --- a/src/assets/ba_data/python/bascenev1lib/game/capturetheflag.py +++ b/src/assets/ba_data/python/bascenev1lib/game/capturetheflag.py @@ -73,6 +73,7 @@ class Team(bs.Team[Player]): def __init__( self, + *, base_pos: Sequence[float], base_region_material: bs.Material, base_region: bs.Node, diff --git a/src/assets/ba_data/python/bascenev1lib/game/elimination.py b/src/assets/ba_data/python/bascenev1lib/game/elimination.py index 7df1d7da..693d36ba 100644 --- a/src/assets/ba_data/python/bascenev1lib/game/elimination.py +++ b/src/assets/ba_data/python/bascenev1lib/game/elimination.py @@ -27,6 +27,7 @@ class Icon(bs.Actor): player: Player, position: tuple[float, float], scale: float, + *, show_lives: bool = True, show_death: bool = True, name_scale: float = 1.0, diff --git a/src/assets/ba_data/python/bascenev1lib/game/onslaught.py b/src/assets/ba_data/python/bascenev1lib/game/onslaught.py index 8635d31e..604d2d82 100644 --- a/src/assets/ba_data/python/bascenev1lib/game/onslaught.py +++ b/src/assets/ba_data/python/bascenev1lib/game/onslaught.py @@ -805,6 +805,7 @@ class OnslaughtGame(bs.CoopGameActivity[Player, Team]): max_level: int, ) -> list[list[tuple[int, int]]]: """Calculate a distribution of bad guys given some params.""" + # pylint: disable=too-many-positional-arguments max_iterations = 10 + max_dudes * 2 groups: list[list[tuple[int, int]]] = [] diff --git a/src/assets/ba_data/python/bascenev1lib/mainmenu.py b/src/assets/ba_data/python/bascenev1lib/mainmenu.py index a395abbf..bbb89834 100644 --- a/src/assets/ba_data/python/bascenev1lib/mainmenu.py +++ b/src/assets/ba_data/python/bascenev1lib/mainmenu.py @@ -433,6 +433,7 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]): word: str, x: float, y: float, + *, scale: float = 1.0, delay: float = 0.0, vr_depth_offset: float = 0.0, @@ -561,6 +562,7 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]): y: float, scale: float, delay: float, + *, custom_texture: str | None = None, jitter_scale: float = 1.0, rotate: float = 0.0, diff --git a/src/assets/ba_data/python/bascenev1lib/tutorial.py b/src/assets/ba_data/python/bascenev1lib/tutorial.py index 541e6119..d9b6e291 100644 --- a/src/assets/ba_data/python/bascenev1lib/tutorial.py +++ b/src/assets/ba_data/python/bascenev1lib/tutorial.py @@ -515,6 +515,7 @@ class TutorialActivity(bs.Activity[Player, Team]): self, num: int, position: Sequence[float], + *, color: Sequence[float] = (1.0, 1.0, 1.0), make_current: bool = False, relative_to: int | None = None, @@ -577,6 +578,7 @@ class TutorialActivity(bs.Activity[Player, Team]): self, num: int, position: Sequence[float], + *, color: Sequence[float] = (1.0, 1.0, 1.0), make_current: bool = False, relative_to: int | None = None, diff --git a/src/assets/ba_data/python/bauiv1/_appsubsystem.py b/src/assets/ba_data/python/bauiv1/_appsubsystem.py index e425f7fd..9eeb6755 100644 --- a/src/assets/ba_data/python/bauiv1/_appsubsystem.py +++ b/src/assets/ba_data/python/bauiv1/_appsubsystem.py @@ -201,6 +201,7 @@ class UIV1AppSubsystem(babase.AppSubsystem): def set_main_window( self, window: bauiv1.MainWindow, + *, from_window: bauiv1.MainWindow | None | bool = True, is_back: bool = False, is_top_level: bool = False, diff --git a/src/assets/ba_data/python/bauiv1lib/account/viewer.py b/src/assets/ba_data/python/bauiv1lib/account/viewer.py index 2dbb1dea..9f0d606a 100644 --- a/src/assets/ba_data/python/bauiv1lib/account/viewer.py +++ b/src/assets/ba_data/python/bauiv1lib/account/viewer.py @@ -23,6 +23,7 @@ class AccountViewerWindow(PopupWindow): def __init__( self, account_id: str, + *, profile_id: str | None = None, position: tuple[float, float] = (0.0, 0.0), scale: float | None = None, diff --git a/src/assets/ba_data/python/bauiv1lib/benchmarks.py b/src/assets/ba_data/python/bauiv1lib/benchmarks.py index 357be9ee..d9bba76a 100644 --- a/src/assets/ba_data/python/bauiv1lib/benchmarks.py +++ b/src/assets/ba_data/python/bauiv1lib/benchmarks.py @@ -316,7 +316,7 @@ class BenchmarksAndStressTestsWindow(bui.MainWindow): label=bui.Lstr(resource=f'{self._r}.runStressTestText'), on_activate_call=self._stress_test_pressed, ) - bui.widget(btn, show_buffer_bottom=50) + bui.widget(edit=btn, show_buffer_bottom=50) @override def get_main_window_state(self) -> bui.MainWindowState: diff --git a/src/assets/ba_data/python/bauiv1lib/characterpicker.py b/src/assets/ba_data/python/bauiv1lib/characterpicker.py index 1e16f45f..2d5e413a 100644 --- a/src/assets/ba_data/python/bauiv1lib/characterpicker.py +++ b/src/assets/ba_data/python/bauiv1lib/characterpicker.py @@ -41,6 +41,7 @@ class CharacterPicker(PopupWindow): selected_character: str | None = None, ): # pylint: disable=too-many-locals + # pylint: disable=too-many-positional-arguments from bascenev1lib.actor import spazappearance assert bui.app.classic is not None diff --git a/src/assets/ba_data/python/bauiv1lib/colorpicker.py b/src/assets/ba_data/python/bauiv1lib/colorpicker.py index 0067f684..fcc93bf4 100644 --- a/src/assets/ba_data/python/bauiv1lib/colorpicker.py +++ b/src/assets/ba_data/python/bauiv1lib/colorpicker.py @@ -25,6 +25,7 @@ class ColorPicker(PopupWindow): self, parent: bui.Widget, position: tuple[float, float], + *, initial_color: Sequence[float] = (1.0, 1.0, 1.0), delegate: Any = None, scale: float | None = None, @@ -184,6 +185,7 @@ class ColorPickerExact(PopupWindow): self, parent: bui.Widget, position: tuple[float, float], + *, initial_color: Sequence[float] = (1.0, 1.0, 1.0), delegate: Any = None, scale: float | None = None, diff --git a/src/assets/ba_data/python/bauiv1lib/config.py b/src/assets/ba_data/python/bauiv1lib/config.py index 337a25f9..fd46303c 100644 --- a/src/assets/ba_data/python/bauiv1lib/config.py +++ b/src/assets/ba_data/python/bauiv1lib/config.py @@ -28,6 +28,7 @@ class ConfigCheckBox: configkey: str, position: tuple[float, float], size: tuple[float, float], + *, displayname: str | bui.Lstr | None = None, scale: float | None = None, maxwidth: float | None = None, @@ -85,6 +86,7 @@ class ConfigNumberEdit: parent: bui.Widget, configkey: str, position: tuple[float, float], + *, minval: float = 0.0, maxval: float = 100.0, increment: float = 1.0, diff --git a/src/assets/ba_data/python/bauiv1lib/confirm.py b/src/assets/ba_data/python/bauiv1lib/confirm.py index d0e848ad..3aff09d2 100644 --- a/src/assets/ba_data/python/bauiv1lib/confirm.py +++ b/src/assets/ba_data/python/bauiv1lib/confirm.py @@ -22,6 +22,7 @@ class ConfirmWindow: action: Callable[[], Any] | None = None, width: float = 360.0, height: float = 100.0, + *, cancel_button: bool = True, cancel_is_selected: bool = False, color: tuple[float, float, float] = (1, 1, 1), diff --git a/src/assets/ba_data/python/bauiv1lib/coop/gamebutton.py b/src/assets/ba_data/python/bauiv1lib/coop/gamebutton.py index 5172e3a6..fee0a388 100644 --- a/src/assets/ba_data/python/bauiv1lib/coop/gamebutton.py +++ b/src/assets/ba_data/python/bauiv1lib/coop/gamebutton.py @@ -26,6 +26,7 @@ class GameButton: select: bool, row: str, ): + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-statements # pylint: disable=too-many-locals diff --git a/src/assets/ba_data/python/bauiv1lib/coop/tournamentbutton.py b/src/assets/ba_data/python/bauiv1lib/coop/tournamentbutton.py index 1c5a9267..549f5b90 100644 --- a/src/assets/ba_data/python/bauiv1lib/coop/tournamentbutton.py +++ b/src/assets/ba_data/python/bauiv1lib/coop/tournamentbutton.py @@ -24,6 +24,7 @@ class TournamentButton: select: bool, on_pressed: Callable[[TournamentButton], None], ) -> None: + # pylint: disable=too-many-positional-arguments self._r = 'coopSelectWindow' sclx = 300 scly = 195.0 diff --git a/src/assets/ba_data/python/bauiv1lib/fileselector.py b/src/assets/ba_data/python/bauiv1lib/fileselector.py index de92e6fb..9bafedc9 100644 --- a/src/assets/ba_data/python/bauiv1lib/fileselector.py +++ b/src/assets/ba_data/python/bauiv1lib/fileselector.py @@ -23,6 +23,7 @@ class FileSelectorWindow(bui.MainWindow): self, path: str, callback: Callable[[str | None], Any] | None = None, + *, show_base_path: bool = True, valid_file_extensions: Sequence[str] | None = None, allow_folders: bool = False, diff --git a/src/assets/ba_data/python/bauiv1lib/gather/__init__.py b/src/assets/ba_data/python/bauiv1lib/gather/__init__.py index 8d3c18f6..f3f01e32 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/__init__.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/__init__.py @@ -44,6 +44,7 @@ class GatherTab: The tab should create and return a container widget covering the specified region. """ + # pylint: disable=too-many-positional-arguments raise RuntimeError('Should not get here.') def on_deactivate(self) -> None: diff --git a/src/assets/ba_data/python/bauiv1lib/gather/abouttab.py b/src/assets/ba_data/python/bauiv1lib/gather/abouttab.py index dacf2c6c..7b1bdac6 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/abouttab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/abouttab.py @@ -27,6 +27,7 @@ class AboutGatherTab(GatherTab): region_bottom: float, ) -> bui.Widget: # pylint: disable=too-many-locals + # pylint: disable=too-many-positional-arguments plus = bui.app.plus assert plus is not None diff --git a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py index 4dcc9c79..e59ad3bd 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py @@ -114,6 +114,7 @@ class ManualGatherTab(GatherTab): region_left: float, region_bottom: float, ) -> bui.Widget: + # pylint: disable=too-many-positional-arguments c_width = region_width c_height = region_height - 20 diff --git a/src/assets/ba_data/python/bauiv1lib/gather/nearbytab.py b/src/assets/ba_data/python/bauiv1lib/gather/nearbytab.py index 3301204a..551b74d7 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/nearbytab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/nearbytab.py @@ -115,6 +115,7 @@ class NearbyGatherTab(GatherTab): region_left: float, region_bottom: float, ) -> bui.Widget: + # pylint: disable=too-many-positional-arguments c_width = region_width c_height = region_height - 20 sub_scroll_height = c_height - 85 diff --git a/src/assets/ba_data/python/bauiv1lib/gather/privatetab.py b/src/assets/ba_data/python/bauiv1lib/gather/privatetab.py index 65854a1a..fa5a2e86 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/privatetab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/privatetab.py @@ -99,6 +99,7 @@ class PrivateGatherTab(GatherTab): region_left: float, region_bottom: float, ) -> bui.Widget: + # pylint: disable=too-many-positional-arguments self._c_width = region_width self._c_height = region_height - 20 self._container = bui.containerwidget( diff --git a/src/assets/ba_data/python/bauiv1lib/gather/publictab.py b/src/assets/ba_data/python/bauiv1lib/gather/publictab.py index ca799188..66104345 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/publictab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/publictab.py @@ -96,6 +96,7 @@ class UIRow: ) -> None: """Update for the given data.""" # pylint: disable=too-many-locals + # pylint: disable=too-many-positional-arguments plus = bui.app.plus assert plus is not None @@ -404,6 +405,7 @@ class PublicGatherTab(GatherTab): region_left: float, region_bottom: float, ) -> bui.Widget: + # pylint: disable=too-many-positional-arguments c_width = region_width c_height = region_height - 20 self._container = bui.containerwidget( diff --git a/src/assets/ba_data/python/bauiv1lib/iconpicker.py b/src/assets/ba_data/python/bauiv1lib/iconpicker.py index 20ebdb0c..779100cd 100644 --- a/src/assets/ba_data/python/bauiv1lib/iconpicker.py +++ b/src/assets/ba_data/python/bauiv1lib/iconpicker.py @@ -23,6 +23,7 @@ class IconPicker(PopupWindow): position: tuple[float, float] = (0.0, 0.0), delegate: Any = None, scale: float | None = None, + *, offset: tuple[float, float] = (0.0, 0.0), tint_color: Sequence[float] = (1.0, 1.0, 1.0), tint2_color: Sequence[float] = (1.0, 1.0, 1.0), diff --git a/src/assets/ba_data/python/bauiv1lib/league/rankbutton.py b/src/assets/ba_data/python/bauiv1lib/league/rankbutton.py index d9528273..6aeee08f 100644 --- a/src/assets/ba_data/python/bauiv1lib/league/rankbutton.py +++ b/src/assets/ba_data/python/bauiv1lib/league/rankbutton.py @@ -22,6 +22,7 @@ class LeagueRankButton: position: tuple[float, float], size: tuple[float, float], scale: float, + *, on_activate_call: Callable[[], Any] | None = None, transition_delay: float | None = None, color: tuple[float, float, float] | None = None, diff --git a/src/assets/ba_data/python/bauiv1lib/league/rankwindow.py b/src/assets/ba_data/python/bauiv1lib/league/rankwindow.py index b4e235e6..97078465 100644 --- a/src/assets/ba_data/python/bauiv1lib/league/rankwindow.py +++ b/src/assets/ba_data/python/bauiv1lib/league/rankwindow.py @@ -1151,10 +1151,10 @@ class LeagueRankWindow(bui.MainWindow): def _show_account_info( self, account_id: str, textwidget: bui.Widget ) -> None: - from bauiv1lib.account import viewer + from bauiv1lib.account.viewer import AccountViewerWindow bui.getsound('swish').play() - viewer.AccountViewerWindow( + AccountViewerWindow( account_id=account_id, position=textwidget.get_screen_space_center() ) diff --git a/src/assets/ba_data/python/bauiv1lib/partyqueue.py b/src/assets/ba_data/python/bauiv1lib/partyqueue.py index 8435562d..7554568f 100644 --- a/src/assets/ba_data/python/bauiv1lib/partyqueue.py +++ b/src/assets/ba_data/python/bauiv1lib/partyqueue.py @@ -33,6 +33,7 @@ class PartyQueueWindow(bui.Window): account_id: str, name: str, ): + # pylint: disable=too-many-positional-arguments self.claimed = False self._line_left = parent.get_line_left() self._line_width = parent.get_line_width() @@ -351,12 +352,12 @@ class PartyQueueWindow(bui.Window): self, account_id: str | None, origin_widget: bui.Widget ) -> None: """A dude was clicked so we should show his account info.""" - from bauiv1lib.account import viewer + from bauiv1lib.account.viewer import AccountViewerWindow if account_id is None: bui.getsound('error').play() return - viewer.AccountViewerWindow( + AccountViewerWindow( account_id=account_id, position=origin_widget.get_screen_space_center(), ) diff --git a/src/assets/ba_data/python/bauiv1lib/play.py b/src/assets/ba_data/python/bauiv1lib/play.py index c52d27fb..2276f0cd 100644 --- a/src/assets/ba_data/python/bauiv1lib/play.py +++ b/src/assets/ba_data/python/bauiv1lib/play.py @@ -632,6 +632,7 @@ class PlayWindow(bui.MainWindow): position: tuple[float, float], color: tuple[float, float, float], ) -> None: + # pylint: disable=too-many-positional-arguments h_extra = -100 v_extra = 130 eye_color = ( diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/editcontroller.py b/src/assets/ba_data/python/bauiv1lib/playlist/editcontroller.py index f398e5b0..71260224 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/editcontroller.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/editcontroller.py @@ -21,6 +21,7 @@ class PlaylistEditController: self, sessiontype: type[bs.Session], from_window: bui.MainWindow, + *, existing_playlist_name: str | None = None, playlist: list[dict[str, Any]] | None = None, playlist_name: str | None = None, diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/editgame.py b/src/assets/ba_data/python/bauiv1lib/playlist/editgame.py index 22a10fda..fa18b1e9 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/editgame.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/editgame.py @@ -31,6 +31,7 @@ class PlaylistEditGameWindow(bui.MainWindow): edit_info: dict[str, Any] | None = None, ): # pylint: disable=too-many-branches + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-statements # pylint: disable=too-many-locals from bascenev1 import ( @@ -485,11 +486,11 @@ class PlaylistEditGameWindow(bui.MainWindow): if prev_widgets is not None: # Wire our rightmost to their rightmost. bui.widget(edit=prev_widgets[-1], down_widget=cwdg[-1]) - bui.widget(cwdg[-1], up_widget=prev_widgets[-1]) + bui.widget(edit=cwdg[-1], up_widget=prev_widgets[-1]) # Wire our leftmost to their leftmost. bui.widget(edit=prev_widgets[0], down_widget=cwdg[0]) - bui.widget(cwdg[0], up_widget=prev_widgets[0]) + bui.widget(edit=cwdg[0], up_widget=prev_widgets[0]) prev_widgets = cwdg except Exception: logging.exception( @@ -617,6 +618,7 @@ class PlaylistEditGameWindow(bui.MainWindow): setting_type: type, setting_name: str, ) -> None: + # pylint: disable=too-many-positional-arguments if setting_type == float: val = float(cast(str, bui.textwidget(query=ctrl))) else: diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/mapselect.py b/src/assets/ba_data/python/bauiv1lib/playlist/mapselect.py index c58128dc..65690a0f 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/mapselect.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/mapselect.py @@ -30,6 +30,7 @@ class PlaylistMapSelectWindow(bui.MainWindow): select_get_more_maps_button: bool = False, ): # pylint: disable=too-many-locals + # pylint: disable=too-many-positional-arguments from bascenev1 import get_filtered_map_name diff --git a/src/assets/ba_data/python/bauiv1lib/playoptions.py b/src/assets/ba_data/python/bauiv1lib/playoptions.py index 0c772183..17f9c410 100644 --- a/src/assets/ba_data/python/bauiv1lib/playoptions.py +++ b/src/assets/ba_data/python/bauiv1lib/playoptions.py @@ -23,6 +23,7 @@ class PlayOptionsWindow(PopupWindow): def __init__( self, + *, sessiontype: type[bs.Session], playlist: str, scale_origin: tuple[float, float], diff --git a/src/assets/ba_data/python/bauiv1lib/popup.py b/src/assets/ba_data/python/bauiv1lib/popup.py index df9d111c..a4acf696 100644 --- a/src/assets/ba_data/python/bauiv1lib/popup.py +++ b/src/assets/ba_data/python/bauiv1lib/popup.py @@ -23,6 +23,7 @@ class PopupWindow: position: tuple[float, float], size: tuple[float, float], scale: float = 1.0, + *, offset: tuple[float, float] = (0, 0), bg_color: tuple[float, float, float] = (0.35, 0.55, 0.15), focus_position: tuple[float, float] = (0, 0), @@ -116,6 +117,7 @@ class PopupMenuWindow(PopupWindow): position: tuple[float, float], choices: Sequence[str], current_choice: str, + *, delegate: Any = None, width: float = 230.0, maxwidth: float | None = None, @@ -301,6 +303,7 @@ class PopupMenu: parent: bui.Widget, position: tuple[float, float], choices: Sequence[str], + *, current_choice: str | None = None, on_value_change_call: Callable[[str], Any] | None = None, opening_call: Callable[[], Any] | None = None, diff --git a/src/assets/ba_data/python/bauiv1lib/settings/gamepad.py b/src/assets/ba_data/python/bauiv1lib/settings/gamepad.py index 94b266d1..c79c210a 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/gamepad.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/gamepad.py @@ -25,6 +25,7 @@ class GamepadSettingsWindow(bui.MainWindow): def __init__( self, inputdevice: bs.InputDevice, + *, modal: bool = False, transition: str = 'in_right', transition_out: str = 'out_right', @@ -744,6 +745,7 @@ class GamepadSettingsWindow(bui.MainWindow): color: tuple[float, float, float], texture: bui.Texture, button: str, + *, scale: float = 1.0, message: bui.Lstr | None = None, message2: bui.Lstr | None = None, @@ -955,6 +957,7 @@ class AwaitGamepadInputWindow(bui.Window): message: bui.Lstr | None = None, message2: bui.Lstr | None = None, ): + # pylint: disable=too-many-positional-arguments if message is None: print('AwaitGamepadInputWindow message is None!') # Shouldn't get here. diff --git a/src/assets/ba_data/python/bauiv1lib/settings/gamepadadvanced.py b/src/assets/ba_data/python/bauiv1lib/settings/gamepadadvanced.py index 7db6b2e7..53b1eafe 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/gamepadadvanced.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/gamepadadvanced.py @@ -473,6 +473,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): name: bui.Lstr, control: str, position: tuple[float, float], + *, min_val: float = 0.0, max_val: float = 100.0, increment: float = 1.0, diff --git a/src/assets/ba_data/python/bauiv1lib/settings/keyboard.py b/src/assets/ba_data/python/bauiv1lib/settings/keyboard.py index 5d2f6f96..0225a6fd 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/keyboard.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/keyboard.py @@ -271,6 +271,7 @@ class ConfigKeyboardWindow(bui.MainWindow): button: str, scale: float = 1.0, ) -> None: + # pylint: disable=too-many-positional-arguments base_size = 79 btn = bui.buttonwidget( parent=self._root_widget, diff --git a/src/assets/ba_data/python/bauiv1lib/soundtrack/entrytypeselect.py b/src/assets/ba_data/python/bauiv1lib/soundtrack/entrytypeselect.py index 64ae95c0..ff47eac4 100644 --- a/src/assets/ba_data/python/bauiv1lib/soundtrack/entrytypeselect.py +++ b/src/assets/ba_data/python/bauiv1lib/soundtrack/entrytypeselect.py @@ -20,6 +20,7 @@ class SoundtrackEntryTypeSelectWindow(bui.MainWindow): callback: Callable[[Any], Any], current_entry: Any, selection_target_name: str, + *, transition: str | None = 'in_right', origin_widget: bui.Widget | None = None, ): diff --git a/src/assets/ba_data/python/bauiv1lib/soundtrack/macmusicapp.py b/src/assets/ba_data/python/bauiv1lib/soundtrack/macmusicapp.py index b4c34ef8..6354fdf4 100644 --- a/src/assets/ba_data/python/bauiv1lib/soundtrack/macmusicapp.py +++ b/src/assets/ba_data/python/bauiv1lib/soundtrack/macmusicapp.py @@ -21,6 +21,7 @@ class MacMusicAppPlaylistSelectWindow(bui.MainWindow): callback: Callable[[Any], Any], existing_playlist: str | None, existing_entry: Any, + *, transition: str | None = 'in_right', origin_widget: bui.Widget | None = None, ): diff --git a/src/assets/ba_data/python/bauiv1lib/store/button.py b/src/assets/ba_data/python/bauiv1lib/store/button.py index 5571fef1..892db29e 100644 --- a/src/assets/ba_data/python/bauiv1lib/store/button.py +++ b/src/assets/ba_data/python/bauiv1lib/store/button.py @@ -23,6 +23,7 @@ class StoreButton: position: Sequence[float], size: Sequence[float], scale: float, + *, on_activate_call: Callable[[], Any] | None = None, transition_delay: float | None = None, color: Sequence[float] | None = None, diff --git a/src/assets/ba_data/python/bauiv1lib/store/item.py b/src/assets/ba_data/python/bauiv1lib/store/item.py index ee779cb4..54a8d0a1 100644 --- a/src/assets/ba_data/python/bauiv1lib/store/item.py +++ b/src/assets/ba_data/python/bauiv1lib/store/item.py @@ -19,6 +19,7 @@ def instantiate_store_item_display( b_pos: tuple[float, float], b_width: float, b_height: float, + *, boffs_h: float = 0.0, boffs_h2: float = 0.0, boffs_v2: float = 0, @@ -26,6 +27,7 @@ def instantiate_store_item_display( button: bool = True, ) -> None: """(internal)""" + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-statements # pylint: disable=too-many-branches # pylint: disable=too-many-locals diff --git a/src/assets/ba_data/python/bauiv1lib/tabs.py b/src/assets/ba_data/python/bauiv1lib/tabs.py index ffb0cff4..be3a1bab 100644 --- a/src/assets/ba_data/python/bauiv1lib/tabs.py +++ b/src/assets/ba_data/python/bauiv1lib/tabs.py @@ -37,6 +37,7 @@ class TabRow(Generic[T]): tabdefs: list[tuple[T, bui.Lstr]], pos: tuple[float, float], size: tuple[float, float], + *, on_select_call: Callable[[T], None] | None = None, ) -> None: if not tabdefs: diff --git a/src/assets/ba_data/python/bauiv1lib/tournamententry.py b/src/assets/ba_data/python/bauiv1lib/tournamententry.py index 025ae53b..ba0a76a4 100644 --- a/src/assets/ba_data/python/bauiv1lib/tournamententry.py +++ b/src/assets/ba_data/python/bauiv1lib/tournamententry.py @@ -28,7 +28,7 @@ class TournamentEntryWindow(PopupWindow): offset: tuple[float, float] = (0.0, 0.0), on_close_call: Callable[[], Any] | None = None, ): - # Needs some tidying. + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-locals # pylint: disable=too-many-branches # pylint: disable=too-many-statements diff --git a/src/assets/ba_data/python/bauiv1lib/tournamentscores.py b/src/assets/ba_data/python/bauiv1lib/tournamentscores.py index e4be2db0..7cff3db1 100644 --- a/src/assets/ba_data/python/bauiv1lib/tournamentscores.py +++ b/src/assets/ba_data/python/bauiv1lib/tournamentscores.py @@ -21,6 +21,7 @@ class TournamentScoresWindow(PopupWindow): def __init__( self, tournament_id: str, + *, tournament_activity: bs.GameActivity | None = None, position: tuple[float, float] = (0.0, 0.0), scale: float | None = None, diff --git a/src/assets/ba_data/python/bauiv1lib/trophies.py b/src/assets/ba_data/python/bauiv1lib/trophies.py index a7982f6c..c4419c5e 100644 --- a/src/assets/ba_data/python/bauiv1lib/trophies.py +++ b/src/assets/ba_data/python/bauiv1lib/trophies.py @@ -134,6 +134,7 @@ class TrophiesWindow(popup.PopupWindow): sub_width: int, trophy_types: list[list[str]], ) -> int: + # pylint: disable=too-many-positional-arguments from bascenev1 import get_trophy_string total_pts = 0 diff --git a/src/ballistica/base/assets/assets.cc b/src/ballistica/base/assets/assets.cc index 2f135ecd..7a0ecc90 100644 --- a/src/ballistica/base/assets/assets.cc +++ b/src/ballistica/base/assets/assets.cc @@ -699,8 +699,8 @@ auto Assets::GetPendingLoadCount() -> int { template auto Assets::GetAssetPendingLoadCount( - std::unordered_map >* t_list, - AssetType type) -> int { + std::unordered_map >* t_list, AssetType type) + -> int { assert(g_base->InLogicThread()); assert(asset_lists_locked_); @@ -1056,8 +1056,8 @@ void Assets::Prune(int level) { } } -auto Assets::FindAssetFile(FileType type, - const std::string& name) -> std::string { +auto Assets::FindAssetFile(FileType type, const std::string& name) + -> std::string { std::string file_out; // We don't protect package-path access so make sure its always from here. diff --git a/src/ballistica/base/assets/assets.h b/src/ballistica/base/assets/assets.h index f9cbbe94..aa396371 100644 --- a/src/ballistica/base/assets/assets.h +++ b/src/ballistica/base/assets/assets.h @@ -38,8 +38,8 @@ class Assets { /// is deleted once the load is completed. void AddPendingLoad(Object::Ref* c); enum class FileType { kMesh, kCollisionMesh, kTexture, kSound, kData }; - auto FindAssetFile(FileType fileType, - const std::string& file_in) -> std::string; + auto FindAssetFile(FileType fileType, const std::string& file_in) + -> std::string; /// Unload renderer-specific bits only (gl display lists, etc) - used when /// recreating/adjusting the renderer. @@ -131,8 +131,8 @@ class Assets { template auto GetAssetPendingLoadCount( - std::unordered_map >* t_list, - AssetType type) -> int; + std::unordered_map >* t_list, AssetType type) + -> int; template auto GetAsset(const std::string& file_name, diff --git a/src/ballistica/base/assets/sound_asset.cc b/src/ballistica/base/assets/sound_asset.cc index c6e64dcb..34acd22a 100644 --- a/src/ballistica/base/assets/sound_asset.cc +++ b/src/ballistica/base/assets/sound_asset.cc @@ -33,8 +33,8 @@ static auto CallbackRead(void* ptr, size_t size, size_t nmemb, void* data_source) -> size_t { return fread(ptr, size, nmemb, static_cast(data_source)); } -static auto CallbackSeek(void* data_source, ogg_int64_t offset, - int whence) -> int { +static auto CallbackSeek(void* data_source, ogg_int64_t offset, int whence) + -> int { return fseek(static_cast(data_source), static_cast_check_fit(offset), whence); // NOLINT } @@ -175,7 +175,7 @@ static void LoadCachedOgg(const char* file_name, std::vector* buffer, // If we have a cache file and it matches the mod time on the ogg, attempt to // load it. - struct BA_STAT stat_ogg {}; + struct BA_STAT stat_ogg{}; time_t ogg_mod_time = 0; if (g_core->platform->Stat(file_name, &stat_ogg) == 0) { ogg_mod_time = stat_ogg.st_mtime; diff --git a/src/ballistica/base/audio/audio.cc b/src/ballistica/base/audio/audio.cc index 7638f032..f37f4632 100644 --- a/src/ballistica/base/audio/audio.cc +++ b/src/ballistica/base/audio/audio.cc @@ -124,8 +124,8 @@ auto Audio::IsSoundPlaying(uint32_t play_id) -> bool { return result; } -auto Audio::SourceBeginExisting(uint32_t play_id, - int debug_id) -> AudioSource* { +auto Audio::SourceBeginExisting(uint32_t play_id, int debug_id) + -> AudioSource* { BA_DEBUG_FUNCTION_TIMER_BEGIN(); uint32_t source_id = AudioServer::SourceIdFromPlayId(play_id); @@ -186,8 +186,8 @@ auto Audio::SafePlaySysSound(SysSoundID sound_id) -> std::optional { return PlaySound(g_base->assets->SysSound(sound_id)); } -auto Audio::PlaySound(SoundAsset* sound, - float volume) -> std::optional { +auto Audio::PlaySound(SoundAsset* sound, float volume) + -> std::optional { assert(g_core); assert(g_base->InLogicThread()); BA_DEBUG_FUNCTION_TIMER_BEGIN(); diff --git a/src/ballistica/base/audio/ogg_stream.cc b/src/ballistica/base/audio/ogg_stream.cc index c62c4799..5b51d427 100644 --- a/src/ballistica/base/audio/ogg_stream.cc +++ b/src/ballistica/base/audio/ogg_stream.cc @@ -15,8 +15,8 @@ static auto CallbackRead(void* ptr, size_t size, size_t nmemb, return fread(ptr, size, nmemb, static_cast(data_source)); } -static auto CallbackSeek(void* data_source, ogg_int64_t offset, - int whence) -> int { +static auto CallbackSeek(void* data_source, ogg_int64_t offset, int whence) + -> int { return fseek(static_cast(data_source), static_cast_check_fit(offset), whence); // NOLINT } diff --git a/src/ballistica/base/graphics/gl/renderer_gl.cc b/src/ballistica/base/graphics/gl/renderer_gl.cc index bfb5582a..156f8630 100644 --- a/src/ballistica/base/graphics/gl/renderer_gl.cc +++ b/src/ballistica/base/graphics/gl/renderer_gl.cc @@ -2824,17 +2824,19 @@ auto RendererGL::NewScreenRenderTarget() -> RenderTarget* { return Object::NewDeferred(this); } -auto RendererGL::NewFramebufferRenderTarget( - int width, int height, bool linear_interp, bool depth, bool texture, - bool depth_texture, bool high_quality, bool msaa, - bool alpha) -> Object::Ref { +auto RendererGL::NewFramebufferRenderTarget(int width, int height, + bool linear_interp, bool depth, + bool texture, bool depth_texture, + bool high_quality, bool msaa, + bool alpha) + -> Object::Ref { return Object::New( this, width, height, linear_interp, depth, texture, depth_texture, high_quality, msaa, alpha); } -auto RendererGL::NewMeshData(MeshDataType mesh_type, - MeshDrawType draw_type) -> MeshRendererData* { +auto RendererGL::NewMeshData(MeshDataType mesh_type, MeshDrawType draw_type) + -> MeshRendererData* { switch (mesh_type) { case MeshDataType::kIndexedSimpleSplit: { MeshDataSimpleSplitGL* data; diff --git a/src/ballistica/base/graphics/gl/renderer_gl.h b/src/ballistica/base/graphics/gl/renderer_gl.h index c747f9d1..4beceec6 100644 --- a/src/ballistica/base/graphics/gl/renderer_gl.h +++ b/src/ballistica/base/graphics/gl/renderer_gl.h @@ -141,17 +141,18 @@ class RendererGL : public Renderer { void SetDepthTesting(bool enable) override; void SetDrawAtEqualDepth(bool enable) override; auto NewScreenRenderTarget() -> RenderTarget* override; - auto NewFramebufferRenderTarget( - int width, int height, bool linear_interp, bool depth, bool texture, - bool depth_is_texture, bool high_quality, bool msaa, - bool alpha) -> Object::Ref override; + auto NewFramebufferRenderTarget(int width, int height, bool linear_interp, + bool depth, bool texture, + bool depth_is_texture, bool high_quality, + bool msaa, bool alpha) + -> Object::Ref override; auto NewMeshAssetData(const MeshAsset& mesh) -> Object::Ref override; auto NewTextureData(const TextureAsset& texture) -> Object::Ref override; - auto NewMeshData(MeshDataType type, - MeshDrawType drawType) -> MeshRendererData* override; + auto NewMeshData(MeshDataType type, MeshDrawType drawType) + -> MeshRendererData* override; void DeleteMeshData(MeshRendererData* data, MeshDataType type) override; void ProcessRenderCommandBuffer(RenderCommandBuffer* buffer, diff --git a/src/ballistica/base/graphics/graphics.cc b/src/ballistica/base/graphics/graphics.cc index 0ca9a658..bbf66a55 100644 --- a/src/ballistica/base/graphics/graphics.cc +++ b/src/ballistica/base/graphics/graphics.cc @@ -484,8 +484,8 @@ void Graphics::DrawMiscOverlays(FrameDef* frame_def) { screenmessages->DrawMiscOverlays(frame_def); } -auto Graphics::GetDebugGraph(const std::string& name, - bool smoothed) -> NetGraph* { +auto Graphics::GetDebugGraph(const std::string& name, bool smoothed) + -> NetGraph* { auto out = debug_graphs_.find(name); if (out == debug_graphs_.end()) { debug_graphs_[name] = Object::New(); @@ -1681,8 +1681,9 @@ auto Graphics::GraphicsQualityFromRequest(GraphicsQualityRequest request, } } -auto Graphics::TextureQualityFromRequest( - TextureQualityRequest request, TextureQuality auto_val) -> TextureQuality { +auto Graphics::TextureQualityFromRequest(TextureQualityRequest request, + TextureQuality auto_val) + -> TextureQuality { switch (request) { case TextureQualityRequest::kLow: return TextureQuality::kLow; diff --git a/src/ballistica/base/graphics/graphics.h b/src/ballistica/base/graphics/graphics.h index 73072734..a8e8e116 100644 --- a/src/ballistica/base/graphics/graphics.h +++ b/src/ballistica/base/graphics/graphics.h @@ -339,8 +339,9 @@ class Graphics { static auto GraphicsQualityFromRequest(GraphicsQualityRequest request, GraphicsQuality auto_val) -> GraphicsQuality; - static auto TextureQualityFromRequest( - TextureQualityRequest request, TextureQuality auto_val) -> TextureQuality; + static auto TextureQualityFromRequest(TextureQualityRequest request, + TextureQuality auto_val) + -> TextureQuality; /// For temporary use from arbitrary threads. This should be removed when /// possible and replaced with proper safe thread-specific access patterns diff --git a/src/ballistica/base/graphics/graphics_vr.cc b/src/ballistica/base/graphics/graphics_vr.cc index f4717fab..60c5484c 100644 --- a/src/ballistica/base/graphics/graphics_vr.cc +++ b/src/ballistica/base/graphics/graphics_vr.cc @@ -16,8 +16,8 @@ namespace ballistica::base { -static auto ValueTestFloat(float* storage, double* absval, - double* deltaval) -> double { +static auto ValueTestFloat(float* storage, double* absval, double* deltaval) + -> double { if (absval) { *storage = static_cast(*absval); } @@ -27,8 +27,8 @@ static auto ValueTestFloat(float* storage, double* absval, return *storage; } -static auto ValueTestBool(bool* storage, double* absval, - double* deltaval) -> double { +static auto ValueTestBool(bool* storage, double* absval, double* deltaval) + -> double { if (absval) { *storage = static_cast(*absval); } @@ -241,8 +241,9 @@ void GraphicsVR::CalcVROverlayMatrices(FrameDef* frame_def) { } } -auto GraphicsVR::CalcVROverlayMatrix( - const Vector3f& cam_pt, const Vector3f& cam_target_pt) const -> Matrix44f { +auto GraphicsVR::CalcVROverlayMatrix(const Vector3f& cam_pt, + const Vector3f& cam_target_pt) const + -> Matrix44f { Matrix44f m = Matrix44fTranslate(cam_target_pt); Vector3f diff = cam_pt - cam_target_pt; diff.Normalize(); diff --git a/src/ballistica/base/graphics/renderer/renderer.cc b/src/ballistica/base/graphics/renderer/renderer.cc index 813b45e4..c3cc98db 100644 --- a/src/ballistica/base/graphics/renderer/renderer.cc +++ b/src/ballistica/base/graphics/renderer/renderer.cc @@ -99,9 +99,9 @@ void Renderer::RenderFrameDef(FrameDef* frame_def) { // If preprocess decided not to render this. if (!frame_def->rendering()) return; - // Set camera/hand/etc positioning with latest VR data if applicable. - // (we do this here at render time as opposed to frame construction time - // so we have the most up-to-date data possible). + // Set camera/hand/etc positioning with latest VR data if applicable. + // (we do this here at render time as opposed to frame construction time + // so we have the most up-to-date data possible). #if BA_VR_BUILD VRUpdateForEyeRender(frame_def); #endif // BA_VR_BUILD diff --git a/src/ballistica/base/graphics/renderer/renderer.h b/src/ballistica/base/graphics/renderer/renderer.h index 4a4a0466..3bc6ccc2 100644 --- a/src/ballistica/base/graphics/renderer/renderer.h +++ b/src/ballistica/base/graphics/renderer/renderer.h @@ -152,8 +152,8 @@ class Renderer { -> Object::Ref = 0; virtual auto NewTextureData(const TextureAsset& texture) -> Object::Ref = 0; - virtual auto NewMeshData(MeshDataType t, - MeshDrawType drawType) -> MeshRendererData* = 0; + virtual auto NewMeshData(MeshDataType t, MeshDrawType drawType) + -> MeshRendererData* = 0; virtual void DeleteMeshData(MeshRendererData* data, MeshDataType t) = 0; virtual void ProcessRenderCommandBuffer(RenderCommandBuffer* buffer, const RenderPass& pass, @@ -176,10 +176,12 @@ class Renderer { virtual void InvalidateFramebuffer(bool color, bool depth, bool target_read_framebuffer) = 0; virtual auto NewScreenRenderTarget() -> RenderTarget* = 0; - virtual auto NewFramebufferRenderTarget( - int width, int height, bool linear_interp, bool depth, bool texture, - bool depth_texture, bool high_quality, bool msaa, - bool alpha) -> Object::Ref = 0; + virtual auto NewFramebufferRenderTarget(int width, int height, + bool linear_interp, bool depth, + bool texture, bool depth_texture, + bool high_quality, bool msaa, + bool alpha) + -> Object::Ref = 0; virtual void PushGroupMarker(const char* label) = 0; virtual void PopGroupMarker() = 0; virtual void BlitBuffer(RenderTarget* src, RenderTarget* dst, bool depth, diff --git a/src/ballistica/base/input/device/joystick_input.cc b/src/ballistica/base/input/device/joystick_input.cc index 4e333224..08f7386c 100644 --- a/src/ballistica/base/input/device/joystick_input.cc +++ b/src/ballistica/base/input/device/joystick_input.cc @@ -331,8 +331,8 @@ auto JoystickInput::ShouldBeHiddenFromUser() -> bool { } } -auto JoystickInput::GetCalibratedValue(float raw, - float neutral) const -> int32_t { +auto JoystickInput::GetCalibratedValue(float raw, float neutral) const + -> int32_t { int32_t val; float dead_zone = 0.5f; float mag, target; diff --git a/src/ballistica/base/input/input.h b/src/ballistica/base/input/input.h index 5d7b0b12..5c23bf33 100644 --- a/src/ballistica/base/input/input.h +++ b/src/ballistica/base/input/input.h @@ -43,8 +43,8 @@ class Input { // Given a device name and persistent identifier for it, returns a device or // nullptr. Note that this can return hidden devices (ones the user has // flagged as totally-ignored, etc). - auto GetInputDevice(const std::string& name, - const std::string& persistent_id) -> InputDevice*; + auto GetInputDevice(const std::string& name, const std::string& persistent_id) + -> InputDevice*; // Return a device by id, or nullptr for an invalid id. Note that this can // return hidden devices (ones the user has flagged as totally-ignored, etc). diff --git a/src/ballistica/base/logic/logic.cc b/src/ballistica/base/logic/logic.cc index 2a2bbc79..3acc82fa 100644 --- a/src/ballistica/base/logic/logic.cc +++ b/src/ballistica/base/logic/logic.cc @@ -636,8 +636,8 @@ void Logic::NotifyOfPendingAssetLoads() { UpdatePendingWorkTimer_(); } -auto Logic::NewAppTimer(microsecs_t length, bool repeat, - Runnable* runnable) -> int { +auto Logic::NewAppTimer(microsecs_t length, bool repeat, Runnable* runnable) + -> int { // App-Timers simply get injected into our loop and run alongside our own // stuff. assert(g_base->InLogicThread()); @@ -661,8 +661,8 @@ void Logic::SetAppTimerLength(int timer_id, microsecs_t length) { } } -auto Logic::NewDisplayTimer(microsecs_t length, bool repeat, - Runnable* runnable) -> int { +auto Logic::NewDisplayTimer(microsecs_t length, bool repeat, Runnable* runnable) + -> int { // Display-Timers go into a timer-list that we exec explicitly when we // step display-time. assert(g_base->InLogicThread()); diff --git a/src/ballistica/base/logic/logic.h b/src/ballistica/base/logic/logic.h index 58cf8d0c..d74e7de4 100644 --- a/src/ballistica/base/logic/logic.h +++ b/src/ballistica/base/logic/logic.h @@ -94,8 +94,8 @@ class Logic { void DeleteAppTimer(int timer_id); void SetAppTimerLength(int timer_id, microsecs_t length); - auto NewDisplayTimer(microsecs_t length, bool repeat, - Runnable* runnable) -> int; + auto NewDisplayTimer(microsecs_t length, bool repeat, Runnable* runnable) + -> int; void DeleteDisplayTimer(int timer_id); void SetDisplayTimerLength(int timer_id, microsecs_t length); diff --git a/src/ballistica/base/networking/network_reader.cc b/src/ballistica/base/networking/network_reader.cc index 40f64c25..44b48089 100644 --- a/src/ballistica/base/networking/network_reader.cc +++ b/src/ballistica/base/networking/network_reader.cc @@ -59,7 +59,7 @@ void NetworkReader::PokeSelf_() { Log(LogLevel::kError, "Unable to create sleep ping socket; errno " + g_core->platform->GetSocketErrorString()); } else { - struct sockaddr_in serv_addr {}; + struct sockaddr_in serv_addr{}; memset(&serv_addr, 0, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); // NOLINT @@ -69,7 +69,7 @@ void NetworkReader::PokeSelf_() { Log(LogLevel::kError, "Unable to bind sleep socket: " + g_core->platform->GetSocketErrorString()); } else { - struct sockaddr_in t_addr {}; + struct sockaddr_in t_addr{}; memset(&t_addr, 0, sizeof(t_addr)); t_addr.sin_family = AF_INET; t_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); // NOLINT @@ -414,7 +414,7 @@ void NetworkReader::OpenSockets_() { g_core->platform->SetSocketNonBlocking(sd4_); // Bind to local server port. - struct sockaddr_in serv_addr {}; + struct sockaddr_in serv_addr{}; serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); // NOLINT @@ -443,7 +443,7 @@ void NetworkReader::OpenSockets_() { // See what v4 port we actually wound up with. if (sd4_ != -1) { - struct sockaddr_in sa {}; + struct sockaddr_in sa{}; socklen_t sa_len = sizeof(sa); if (getsockname(sd4_, reinterpret_cast(&sa), &sa_len) == 0) { port4_ = ntohs(sa.sin_port); // NOLINT @@ -474,7 +474,7 @@ void NetworkReader::OpenSockets_() { } g_core->platform->SetSocketNonBlocking(sd6_); - struct sockaddr_in6 serv_addr {}; + struct sockaddr_in6 serv_addr{}; memset(&serv_addr, 0, sizeof(serv_addr)); serv_addr.sin6_family = AF_INET6; serv_addr.sin6_port = htons(port6_); // NOLINT @@ -505,7 +505,7 @@ void NetworkReader::OpenSockets_() { // See what v6 port we actually wound up with. if (sd6_ != -1) { - struct sockaddr_in sa {}; + struct sockaddr_in sa{}; socklen_t sa_len = sizeof(sa); if (getsockname(sd6_, reinterpret_cast(&sa), &sa_len) == 0) { port6_ = ntohs(sa.sin_port); // NOLINT diff --git a/src/ballistica/base/platform/base_platform.cc b/src/ballistica/base/platform/base_platform.cc index 7c226efb..dcaf72c2 100644 --- a/src/ballistica/base/platform/base_platform.cc +++ b/src/ballistica/base/platform/base_platform.cc @@ -207,14 +207,14 @@ void BasePlatform::SetupInterruptHandling() { throw Exception(); #else { - struct sigaction handler {}; + struct sigaction handler{}; handler.sa_handler = HandleSIGINT; sigemptyset(&handler.sa_mask); handler.sa_flags = 0; sigaction(SIGINT, &handler, nullptr); } { - struct sigaction handler {}; + struct sigaction handler{}; handler.sa_handler = HandleSIGTERM; sigemptyset(&handler.sa_mask); handler.sa_flags = 0; diff --git a/src/ballistica/base/python/base_python.cc b/src/ballistica/base/python/base_python.cc index 251544eb..cec3b878 100644 --- a/src/ballistica/base/python/base_python.cc +++ b/src/ballistica/base/python/base_python.cc @@ -333,8 +333,8 @@ auto BasePython::GetRawConfigValue(const char* name) -> PyObject* { return PyDict_GetItemString(objs().Get(ObjID::kConfig).Get(), name); } -auto BasePython::GetRawConfigValue(const char* name, - const char* default_value) -> std::string { +auto BasePython::GetRawConfigValue(const char* name, const char* default_value) + -> std::string { assert(g_base->InLogicThread()); assert(objs().Exists(ObjID::kConfig)); PyObject* value = @@ -345,8 +345,8 @@ auto BasePython::GetRawConfigValue(const char* name, return PyUnicode_AsUTF8(value); } -auto BasePython::GetRawConfigValue(const char* name, - float default_value) -> float { +auto BasePython::GetRawConfigValue(const char* name, float default_value) + -> float { assert(g_base->InLogicThread()); assert(objs().Exists(ObjID::kConfig)); PyObject* value = @@ -402,8 +402,8 @@ auto BasePython::GetRawConfigValue(const char* name, int default_value) -> int { } } -auto BasePython::GetRawConfigValue(const char* name, - bool default_value) -> bool { +auto BasePython::GetRawConfigValue(const char* name, bool default_value) + -> bool { assert(g_base->InLogicThread()); assert(objs().Exists(ObjID::kConfig)); PyObject* value = @@ -537,8 +537,8 @@ auto BasePython::GetResource(const char* key, const char* fallback_resource, return std::string(""; } -auto BasePython::GetTranslation(const char* category, - const char* s) -> std::string { +auto BasePython::GetTranslation(const char* category, const char* s) + -> std::string { assert(Python::HaveGIL()); PythonRef results; PythonRef args(Py_BuildValue("(ss)", category, s), PythonRef::kSteal); diff --git a/src/ballistica/base/python/base_python.h b/src/ballistica/base/python/base_python.h index 176db71b..479cde21 100644 --- a/src/ballistica/base/python/base_python.h +++ b/src/ballistica/base/python/base_python.h @@ -145,8 +145,8 @@ class BasePython { // functions (which themselves call these functions) auto GetRawConfigValue(const char* name) -> PyObject*; // (returns a borrowed ref) - auto GetRawConfigValue(const char* name, - const char* default_value) -> std::string; + auto GetRawConfigValue(const char* name, const char* default_value) + -> std::string; auto GetRawConfigValue(const char* name, float default_value) -> float; auto GetRawConfigValue(const char* name, std::optional default_value) -> std::optional; diff --git a/src/ballistica/base/python/class/python_class_app_timer.h b/src/ballistica/base/python/class/python_class_app_timer.h index 0c086a2e..7295988a 100644 --- a/src/ballistica/base/python/class/python_class_app_timer.h +++ b/src/ballistica/base/python/class/python_class_app_timer.h @@ -18,8 +18,8 @@ class PythonClassAppTimer : public PythonClass { static PyTypeObject type_obj; private: - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassAppTimer* self); int timer_id_{}; bool have_timer_{}; diff --git a/src/ballistica/base/python/class/python_class_context_call.cc b/src/ballistica/base/python/class/python_class_context_call.cc index e50b227e..3dad799a 100644 --- a/src/ballistica/base/python/class/python_class_context_call.cc +++ b/src/ballistica/base/python/class/python_class_context_call.cc @@ -92,8 +92,8 @@ auto PythonClassContextCall::tp_new(PyTypeObject* type, PyObject* args, } auto PythonClassContextCall::tp_call(PythonClassContextCall* self, - PyObject* args, - PyObject* keywds) -> PyObject* { + PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", diff --git a/src/ballistica/base/python/class/python_class_context_call.h b/src/ballistica/base/python/class/python_class_context_call.h index 349cc289..8d0c3020 100644 --- a/src/ballistica/base/python/class/python_class_context_call.h +++ b/src/ballistica/base/python/class/python_class_context_call.h @@ -23,8 +23,8 @@ class PythonClassContextCall : public PythonClass { static auto tp_call(PythonClassContextCall* self, PyObject* args, PyObject* keywds) -> PyObject*; static auto tp_repr(PythonClassContextCall* self) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassContextCall* self); Object::Ref* context_call_{}; }; diff --git a/src/ballistica/base/python/class/python_class_context_ref.cc b/src/ballistica/base/python/class/python_class_context_ref.cc index 90fef920..e32fb729 100644 --- a/src/ballistica/base/python/class/python_class_context_ref.cc +++ b/src/ballistica/base/python/class/python_class_context_ref.cc @@ -151,8 +151,8 @@ auto PythonClassContextRef::Enter(PythonClassContextRef* self) -> PyObject* { BA_PYTHON_CATCH; } -auto PythonClassContextRef::Exit(PythonClassContextRef* self, - PyObject* args) -> PyObject* { +auto PythonClassContextRef::Exit(PythonClassContextRef* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; g_base->SetCurrentContext(*self->context_ref_prev_); Py_RETURN_NONE; diff --git a/src/ballistica/base/python/class/python_class_context_ref.h b/src/ballistica/base/python/class/python_class_context_ref.h index 9c3c5edd..b325dfca 100644 --- a/src/ballistica/base/python/class/python_class_context_ref.h +++ b/src/ballistica/base/python/class/python_class_context_ref.h @@ -22,10 +22,10 @@ class PythonClassContextRef : public PythonClass { private: static PyMethodDef tp_methods[]; static auto tp_repr(PythonClassContextRef* self) -> PyObject*; - static auto tp_richcompare(PythonClassContextRef* c1, PyObject* c2, - int op) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_richcompare(PythonClassContextRef* c1, PyObject* c2, int op) + -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassContextRef* self); static auto Enter(PythonClassContextRef* self) -> PyObject*; static auto Exit(PythonClassContextRef* self, PyObject* args) -> PyObject*; diff --git a/src/ballistica/base/python/class/python_class_display_timer.h b/src/ballistica/base/python/class/python_class_display_timer.h index 35b10d3b..61c25888 100644 --- a/src/ballistica/base/python/class/python_class_display_timer.h +++ b/src/ballistica/base/python/class/python_class_display_timer.h @@ -18,8 +18,8 @@ class PythonClassDisplayTimer : public PythonClass { static PyTypeObject type_obj; private: - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassDisplayTimer* self); int timer_id_; bool have_timer_; diff --git a/src/ballistica/base/python/class/python_class_env.cc b/src/ballistica/base/python/class/python_class_env.cc index b5970b0b..c84055c5 100644 --- a/src/ballistica/base/python/class/python_class_env.cc +++ b/src/ballistica/base/python/class/python_class_env.cc @@ -214,8 +214,8 @@ void PythonClassEnv::tp_dealloc(PythonClassEnv* self) { Py_TYPE(self)->tp_free(reinterpret_cast(self)); } -auto PythonClassEnv::tp_getattro(PythonClassEnv* self, - PyObject* attr) -> PyObject* { +auto PythonClassEnv::tp_getattro(PythonClassEnv* self, PyObject* attr) + -> PyObject* { BA_PYTHON_TRY; // Do we need to support other attr types? diff --git a/src/ballistica/base/python/class/python_class_env.h b/src/ballistica/base/python/class/python_class_env.h index dd28f68b..dcca64c5 100644 --- a/src/ballistica/base/python/class/python_class_env.h +++ b/src/ballistica/base/python/class/python_class_env.h @@ -34,8 +34,8 @@ class PythonClassEnv : public PythonClass { PythonClassEnv(); ~PythonClassEnv(); static PyMethodDef tp_methods[]; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassEnv* self); static auto Dir(PythonClassEnv* self) -> PyObject*; }; diff --git a/src/ballistica/base/python/class/python_class_feature_set_data.h b/src/ballistica/base/python/class/python_class_feature_set_data.h index 5df100e4..f9283d4d 100644 --- a/src/ballistica/base/python/class/python_class_feature_set_data.h +++ b/src/ballistica/base/python/class/python_class_feature_set_data.h @@ -40,8 +40,8 @@ class PythonClassFeatureSetData : public PythonClass { private: static PyMethodDef tp_methods[]; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassFeatureSetData* self); FeatureSetNativeComponent* feature_set_{}; static auto Play(PythonClassFeatureSetData* self, PyObject* args, diff --git a/src/ballistica/base/python/class/python_class_simple_sound.h b/src/ballistica/base/python/class/python_class_simple_sound.h index a0cd3244..6f4e3e69 100644 --- a/src/ballistica/base/python/class/python_class_simple_sound.h +++ b/src/ballistica/base/python/class/python_class_simple_sound.h @@ -42,8 +42,8 @@ class PythonClassSimpleSound : public PythonClass { private: static PyMethodDef tp_methods[]; static auto tp_repr(PythonClassSimpleSound* self) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassSimpleSound* self); Object::Ref* sound_; static auto Play(PythonClassSimpleSound* self, PyObject* args, diff --git a/src/ballistica/base/python/class/python_class_vec3.cc b/src/ballistica/base/python/class/python_class_vec3.cc index 31602fc2..cbf96e4d 100644 --- a/src/ballistica/base/python/class/python_class_vec3.cc +++ b/src/ballistica/base/python/class/python_class_vec3.cc @@ -138,8 +138,8 @@ auto PythonClassVec3::sq_length(PythonClassVec3* self) -> Py_ssize_t { return kMemberCount; } -auto PythonClassVec3::sq_item(PythonClassVec3* self, - Py_ssize_t i) -> PyObject* { +auto PythonClassVec3::sq_item(PythonClassVec3* self, Py_ssize_t i) + -> PyObject* { if (i < 0 || i >= kMemberCount) { PyErr_SetString(PyExc_IndexError, "Vec3 index out of range"); return nullptr; @@ -159,8 +159,8 @@ auto PythonClassVec3::sq_ass_item(PythonClassVec3* self, Py_ssize_t i, BA_PYTHON_INT_CATCH; } -auto PythonClassVec3::nb_add(PythonClassVec3* l, - PythonClassVec3* r) -> PyObject* { +auto PythonClassVec3::nb_add(PythonClassVec3* l, PythonClassVec3* r) + -> PyObject* { BA_PYTHON_TRY; // We can add if both sides are Vec3. @@ -175,8 +175,8 @@ auto PythonClassVec3::nb_add(PythonClassVec3* l, BA_PYTHON_CATCH; } -auto PythonClassVec3::nb_subtract(PythonClassVec3* l, - PythonClassVec3* r) -> PyObject* { +auto PythonClassVec3::nb_subtract(PythonClassVec3* l, PythonClassVec3* r) + -> PyObject* { BA_PYTHON_TRY; // We can subtract if both sides are Vec3. @@ -240,8 +240,8 @@ auto PythonClassVec3::nb_multiply(PyObject* l, PyObject* r) -> PyObject* { BA_PYTHON_CATCH; } -auto PythonClassVec3::tp_richcompare(PythonClassVec3* c1, PyObject* c2, - int op) -> PyObject* { +auto PythonClassVec3::tp_richcompare(PythonClassVec3* c1, PyObject* c2, int op) + -> PyObject* { // Always return false against other types. if (!Check(c2)) { Py_RETURN_FALSE; @@ -283,8 +283,8 @@ auto PythonClassVec3::Dot(PythonClassVec3* self, PyObject* other) -> PyObject* { BA_PYTHON_CATCH; } -auto PythonClassVec3::Cross(PythonClassVec3* self, - PyObject* other) -> PyObject* { +auto PythonClassVec3::Cross(PythonClassVec3* self, PyObject* other) + -> PyObject* { BA_PYTHON_TRY; return Create(Vector3f::Cross(self->value, BasePython::GetPyVector3f(other))); BA_PYTHON_CATCH; @@ -309,8 +309,8 @@ PyMethodDef PythonClassVec3::tp_methods[] = { "Returns the cross product of this vector and another."}, {nullptr}}; -auto PythonClassVec3::tp_getattro(PythonClassVec3* self, - PyObject* attr) -> PyObject* { +auto PythonClassVec3::tp_getattro(PythonClassVec3* self, PyObject* attr) + -> PyObject* { BA_PYTHON_TRY; assert(PyUnicode_Check(attr)); diff --git a/src/ballistica/base/python/class/python_class_vec3.h b/src/ballistica/base/python/class/python_class_vec3.h index 3290b420..1855a4cd 100644 --- a/src/ballistica/base/python/class/python_class_vec3.h +++ b/src/ballistica/base/python/class/python_class_vec3.h @@ -30,19 +30,19 @@ class PythonClassVec3 : public PythonClass { static auto tp_repr(PythonClassVec3* self) -> PyObject*; static auto sq_length(PythonClassVec3* self) -> Py_ssize_t; static auto sq_item(PythonClassVec3* self, Py_ssize_t i) -> PyObject*; - static auto sq_ass_item(PythonClassVec3* self, Py_ssize_t i, - PyObject* val) -> int; + static auto sq_ass_item(PythonClassVec3* self, Py_ssize_t i, PyObject* val) + -> int; static auto nb_add(PythonClassVec3* l, PythonClassVec3* r) -> PyObject*; static auto nb_subtract(PythonClassVec3* l, PythonClassVec3* r) -> PyObject*; static auto nb_multiply(PyObject* l, PyObject* r) -> PyObject*; static auto nb_negative(PythonClassVec3* self) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static auto tp_getattro(PythonClassVec3* self, PyObject* attr) -> PyObject*; - static auto tp_richcompare(PythonClassVec3* c1, PyObject* c2, - int op) -> PyObject*; - static auto tp_setattro(PythonClassVec3* self, PyObject* attr, - PyObject* val) -> int; + static auto tp_richcompare(PythonClassVec3* c1, PyObject* c2, int op) + -> PyObject*; + static auto tp_setattro(PythonClassVec3* self, PyObject* attr, PyObject* val) + -> int; }; } // namespace ballistica::base diff --git a/src/ballistica/base/python/methods/python_methods_base_1.cc b/src/ballistica/base/python/methods/python_methods_base_1.cc index 6ae95dd7..0b63f144 100644 --- a/src/ballistica/base/python/methods/python_methods_base_1.cc +++ b/src/ballistica/base/python/methods/python_methods_base_1.cc @@ -184,8 +184,8 @@ static PyMethodDef PyCanDisplayFullUnicodeDef = { // -------------------------- app_instance_uuid -------------------------------- -static auto PyAppInstanceUUID(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyAppInstanceUUID(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -208,8 +208,8 @@ static PyMethodDef PyAppInstanceUUIDDef = { // --------------------------- user_ran_commands ------------------------------- -static auto PyUserRanCommands(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyUserRanCommands(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -233,8 +233,8 @@ static PyMethodDef PyUserRanCommandsDef = { // -------------------------------- pushcall ---------------------------------- -static auto PyPushCall(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyPushCall(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; PyObject* call_obj; int from_other_thread{}; @@ -337,8 +337,8 @@ static PyMethodDef PyPushCallDef = { // ------------------------------ apptime -------------------------------------- -static auto PyAppTime(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyAppTime(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -373,8 +373,8 @@ static PyMethodDef PyAppTimeDef = { // ------------------------------ apptimer ------------------------------------- -static auto PyAppTimer(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyAppTimer(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); double length; @@ -431,8 +431,8 @@ static PyMethodDef PyAppTimerDef = { // --------------------------- displaytime ------------------------------------- -static auto PyDisplayTime(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyDisplayTime(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -466,8 +466,8 @@ static PyMethodDef PyDisplayTimeDef = { // ---------------------------- displaytimer ----------------------------------- -static auto PyDisplayTimer(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyDisplayTimer(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); double length; @@ -529,8 +529,8 @@ static PyMethodDef PyDisplayTimerDef = { // ----------------------------------- quit ------------------------------------ -static auto PyQuit(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyQuit(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->IsAppStarted()); @@ -594,8 +594,8 @@ static PyMethodDef PyDoApplyAppConfigDef = { // ----------------------------- commit_config --------------------------------- -static auto PyCommitConfig(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyCommitConfig(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; PyObject* config_obj; static const char* kwlist[] = {"config", nullptr}; @@ -794,8 +794,8 @@ static PyMethodDef PyEnvDef = { // -------------------------------- emit_log ----------------------------------- -static auto PyEmitLog(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyEmitLog(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {"name", "level", "message", nullptr}; const char* name; @@ -846,8 +846,8 @@ static PyMethodDef PyEmitLogDef = { // ------------------------------ lifecyclelog --------------------------------- -static auto PyLifecycleLog(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyLifecycleLog(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {"message", nullptr}; const char* message; @@ -874,8 +874,8 @@ static PyMethodDef PyLifecycleLogDef = { // ----------------------------- v1_cloud_log ---------------------------------- -static auto PyV1CloudLog(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyV1CloudLog(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* message; static const char* kwlist[] = {"message", nullptr}; @@ -903,8 +903,8 @@ static PyMethodDef PyV1CloudLogDef = { // --------------------------- music_player_stop ------------------------------- -static auto PyMusicPlayerStop(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyMusicPlayerStop(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -929,8 +929,8 @@ static PyMethodDef PyMusicPlayerStopDef = { // ---------------------------- music_player_play ------------------------------ -static auto PyMusicPlayerPlay(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyMusicPlayerPlay(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; PyObject* files_obj; static const char* kwlist[] = {"files", nullptr}; @@ -1035,8 +1035,8 @@ static PyMethodDef PyReloadMediaDef = { // --------------------------- mac_music_app_init ------------------------------ -static auto PyMacMusicAppInit(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyMacMusicAppInit(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; g_core->platform->MacMusicAppInit(); Py_RETURN_NONE; @@ -1099,8 +1099,8 @@ static PyMethodDef PyMacMusicAppSetVolumeDef = { // --------------------------- mac_music_app_stop ------------------------------ -static auto PyMacMusicAppStop(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyMacMusicAppStop(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; g_core->platform->MacMusicAppStop(); Py_RETURN_NONE; @@ -1177,8 +1177,8 @@ static PyMethodDef PyMacMusicAppGetPlaylistsDef = { // -------------------------- is_os_playing_music ------------------------------ -static auto PyIsOSPlayingMusic(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyIsOSPlayingMusic(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; if (g_core->platform->IsOSPlayingMusic()) { Py_RETURN_TRUE; diff --git a/src/ballistica/base/python/methods/python_methods_base_2.cc b/src/ballistica/base/python/methods/python_methods_base_2.cc index 64ea4617..508724ec 100644 --- a/src/ballistica/base/python/methods/python_methods_base_2.cc +++ b/src/ballistica/base/python/methods/python_methods_base_2.cc @@ -28,8 +28,8 @@ namespace ballistica::base { // ------------------------------- open_url ------------------------------------ -static auto PyOpenURL(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyOpenURL(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* address{}; int force_fallback{}; @@ -169,8 +169,8 @@ static PyMethodDef PyOverlayWebBrowserCloseDef = { "Category: **General Utility Functions**\n"}; // ---------------------------- screenmessage ---------------------------------- -static auto PyScreenMessage(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyScreenMessage(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; PyObject* color_obj = Py_None; PyObject* message_obj; @@ -247,8 +247,8 @@ static PyMethodDef PyGetCameraPositionDef = { // --------------------------- get_camera_target ------------------------------- -static auto PyGetCameraTarget(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetCameraTarget(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; float x = 0.0f; float y = 0.0f; @@ -308,8 +308,8 @@ static PyMethodDef PySetCameraPositionDef = { // ---------------------------- set_camera_target ------------------------------ -static auto PySetCameraTarget(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PySetCameraTarget(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; float x = 0.0f; float y = 0.0f; @@ -341,8 +341,8 @@ static PyMethodDef PySetCameraTargetDef = { // ---------------------------- set_camera_manual ------------------------------ -static auto PySetCameraManual(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PySetCameraManual(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; bool value = false; static const char* kwlist[] = {"value", nullptr}; @@ -372,8 +372,8 @@ static PyMethodDef PySetCameraManualDef = { // -------------------------------- charstr ------------------------------------ -static auto PyCharStr(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyCharStr(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; PyObject* name_obj; static const char* kwlist[] = {"name", nullptr}; @@ -408,8 +408,8 @@ static PyMethodDef PyCharStrDef = { // ------------------------------- safecolor ----------------------------------- -static auto PySafeColor(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PySafeColor(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; PyObject* color_obj; float red, green, blue; @@ -485,8 +485,8 @@ static PyMethodDef PyGetMaxGraphicsQualityDef = { // ------------------------------ evaluate_lstr -------------------------------- -static auto PyEvaluateLstr(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyEvaluateLstr(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* value; static const char* kwlist[] = {"value", nullptr}; @@ -511,8 +511,8 @@ static PyMethodDef PyEvaluateLstrDef = { // --------------------------- get_string_height ------------------------------- -static auto PyGetStringHeight(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetStringHeight(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; std::string s; int suppress_warning = 0; @@ -557,8 +557,8 @@ static PyMethodDef PyGetStringHeightDef = { // ---------------------------- get_string_width ------------------------------- -static auto PyGetStringWidth(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetStringWidth(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; std::string s; PyObject* s_obj; @@ -604,8 +604,8 @@ static PyMethodDef PyGetStringWidthDef = { // ------------------------------ have_chars ----------------------------------- -static auto PyHaveChars(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyHaveChars(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; std::string text; PyObject* text_obj; @@ -635,8 +635,8 @@ static PyMethodDef PyHaveCharsDef = { // ----------------------------- fade_screen ----------------------------------- -static auto PyFadeScreen(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyFadeScreen(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; int fade{}; @@ -905,8 +905,8 @@ static PyMethodDef PySupportsMaxFPSDef = { // --------------------------- show_progress_bar ------------------------------- -static auto PyShowProgressBar(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyShowProgressBar(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; g_base->graphics->EnableProgressBar(false); diff --git a/src/ballistica/base/python/methods/python_methods_base_3.cc b/src/ballistica/base/python/methods/python_methods_base_3.cc index e3ff2dbe..de15d716 100644 --- a/src/ballistica/base/python/methods/python_methods_base_3.cc +++ b/src/ballistica/base/python/methods/python_methods_base_3.cc @@ -28,8 +28,8 @@ namespace ballistica::base { // ---------------------------- getsimplesound -------------------------------- -static auto PyGetSimpleSound(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetSimpleSound(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* name; static const char* kwlist[] = {"name", nullptr}; @@ -59,8 +59,8 @@ static PyMethodDef PyGetSimpleSoundDef = { // -------------------------- set_ui_input_device ------------------------------ -static auto PySetUIInputDevice(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PySetUIInputDevice(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); static const char* kwlist[] = {"input_device_id", nullptr}; @@ -99,8 +99,8 @@ static PyMethodDef PySetUIInputDeviceDef = { // ------------------------------ set_ui_scale --------------------------------- -static auto PySetUIScale(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PySetUIScale(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); @@ -182,8 +182,8 @@ static PyMethodDef PyGetUIScaleDef = { // ----------------------------- hastouchscreen -------------------------------- -static auto PyHasTouchScreen(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyHasTouchScreen(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); static const char* kwlist[] = {nullptr}; @@ -265,8 +265,8 @@ static PyMethodDef PyClipboardHasTextDef = { // --------------------------- clipboard_set_text ------------------------------ -static auto PyClipboardSetText(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyClipboardSetText(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* value; static const char* kwlist[] = {"value", nullptr}; @@ -343,8 +343,8 @@ static PyMethodDef PySetUpSigIntDef = { // ---------------------------- have_permission -------------------------------- -static auto PyHavePermission(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyHavePermission(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); Permission permission; @@ -407,8 +407,8 @@ static PyMethodDef PyRequestPermissionDef = { // ----------------------------- in_logic_thread ------------------------------- -static auto PyInLogicThread(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyInLogicThread(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -436,8 +436,8 @@ static PyMethodDef PyInLogicThreadDef = { // ------------------------------ in_main_menu --------------------------------- -static auto PyInMainMenu(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyInMainMenu(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -467,8 +467,8 @@ static PyMethodDef PyInMainMenuDef = { // ----------------------------- set_thread_name ------------------------------- -static auto PySetThreadName(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PySetThreadName(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* name; static const char* kwlist[] = {"name", nullptr}; @@ -497,8 +497,8 @@ static PyMethodDef PySetThreadNameDef = { // ------------------------------ get_thread_name ------------------------------ -static auto PyGetThreadName(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetThreadName(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -528,8 +528,8 @@ static PyMethodDef PyGetThreadNameDef = { // Returns an extra hash value that can be incorporated into security // checks; this contains things like whether console commands have been run, // etc. -auto PyExtraHashValue(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +auto PyExtraHashValue(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -663,8 +663,8 @@ static PyMethodDef PyDebugPrintPyErrDef = { // ----------------------------- print_context --------------------------------- -static auto PyPrintContext(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyPrintContext(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -690,8 +690,8 @@ static PyMethodDef PyPrintContextDef = { // --------------------------- print_load_info --------------------------------- -static auto PyPrintLoadInfo(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyPrintLoadInfo(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; g_base->assets->PrintLoadInfo(); Py_RETURN_NONE; @@ -712,8 +712,8 @@ static PyMethodDef PyPrintLoadInfoDef = { // -------------------------- get_replays_dir ---------------------------------- -static auto PyGetReplaysDir(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetReplaysDir(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -956,8 +956,8 @@ static PyMethodDef PyGetLogFilePathDef = { // --------------------- get_volatile_data_directory --------------------------- -static auto PyGetVolatileDataDirectory(PyObject* self, - PyObject* args) -> PyObject* { +static auto PyGetVolatileDataDirectory(PyObject* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; return PyUnicode_FromString( g_core->platform->GetVolatileDataDirectory().c_str()); @@ -1000,8 +1000,8 @@ static PyMethodDef PyIsLogFullDef = { // -------------------------- get_v1_cloud_log --------------------------------- -static auto PyGetV1CloudLog(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetV1CloudLog(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; std::string log_fin; { @@ -1027,8 +1027,8 @@ static PyMethodDef PyGetV1CloudLogDef = { // ---------------------------- mark_log_sent ---------------------------------- -static auto PyMarkLogSent(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyMarkLogSent(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; // This way we won't try to send it at shutdown time and whatnot g_core->did_put_v1_cloud_log = true; @@ -1048,8 +1048,8 @@ static PyMethodDef PyMarkLogSentDef = { // --------------------- increment_analytics_count ----------------------------- -auto PyIncrementAnalyticsCount(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +auto PyIncrementAnalyticsCount(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* name; int increment = 1; @@ -1240,8 +1240,8 @@ static PyMethodDef PyLoginAdapterBackEndActiveChangeDef = { // ---------------------- set_internal_language_keys --------------------------- -static auto PySetInternalLanguageKeys(PyObject* self, - PyObject* args) -> PyObject* { +static auto PySetInternalLanguageKeys(PyObject* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; PyObject* list_obj; PyObject* random_names_list_obj; @@ -1338,8 +1338,8 @@ static PyMethodDef PyAndroidGetExternalFilesDirDef = { // ------------------------------- do_once ------------------------------------- -static auto PyDoOnce(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyDoOnce(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; if (g_base->python->DoOnce()) { Py_RETURN_TRUE; @@ -1373,8 +1373,8 @@ static PyMethodDef PyDoOnceDef = { // ------------------------------- getapp -------------------------------------- -static auto PyGetApp(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetApp(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; if (!PyArg_ParseTupleAndKeywords(args, keywds, "", @@ -1529,8 +1529,8 @@ static PyMethodDef PyOpenDirExternallyDef = { // ----------------------------- fatal_error ----------------------------------- -static auto PyFatalError(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyFatalError(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* message; static const char* kwlist[] = {"message", nullptr}; @@ -1651,8 +1651,8 @@ static PyMethodDef PyDevConsoleAddTextDef = { // -------------------- dev_console_add_python_terminal ------------------------ -static auto PyDevConsoleAddPythonTerminal(PyObject* self, - PyObject* args) -> PyObject* { +static auto PyDevConsoleAddPythonTerminal(PyObject* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); auto* dev_console = g_base->ui->dev_console(); @@ -1969,8 +1969,8 @@ static PyMethodDef PyGetDrawUIBoundsDef = { // --------------------------- set_draw_ui_bounds ----------------------------- -static auto PySetDrawUIBounds(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PySetDrawUIBounds(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); diff --git a/src/ballistica/base/support/classic_soft.h b/src/ballistica/base/support/classic_soft.h index 445205b9..5e388e93 100644 --- a/src/ballistica/base/support/classic_soft.h +++ b/src/ballistica/base/support/classic_soft.h @@ -18,8 +18,9 @@ class ClassicSoftInterface { public: virtual auto GetControllerValue(base::InputDevice* device, const std::string& value_name) -> int = 0; - virtual auto GetControllerFloatValue( - base::InputDevice* device, const std::string& value_name) -> float = 0; + virtual auto GetControllerFloatValue(base::InputDevice* device, + const std::string& value_name) + -> float = 0; virtual auto IsV1AccountSignedIn() -> bool = 0; virtual auto HandleSignOutV1() -> bool = 0; virtual void V2SetV1AccountState(const char* statestr, const char* loginid, diff --git a/src/ballistica/base/ui/ui.cc b/src/ballistica/base/ui/ui.cc index 68773492..eeec38f9 100644 --- a/src/ballistica/base/ui/ui.cc +++ b/src/ballistica/base/ui/ui.cc @@ -221,8 +221,8 @@ auto UI::PartyWindowOpen() -> bool { return false; } -auto UI::HandleMouseDown(int button, float x, float y, - bool double_click) -> bool { +auto UI::HandleMouseDown(int button, float x, float y, bool double_click) + -> bool { assert(g_base->InLogicThread()); bool handled{}; diff --git a/src/ballistica/classic/classic.cc b/src/ballistica/classic/classic.cc index f78d6acd..56a42e41 100644 --- a/src/ballistica/classic/classic.cc +++ b/src/ballistica/classic/classic.cc @@ -70,13 +70,15 @@ auto ClassicFeatureSet::Import() -> ClassicFeatureSet* { return ImportThroughPythonModule("_baclassic"); } -auto ClassicFeatureSet::GetControllerValue( - base::InputDevice* device, const std::string& value_name) -> int { +auto ClassicFeatureSet::GetControllerValue(base::InputDevice* device, + const std::string& value_name) + -> int { return python->GetControllerValue(device, value_name); } -auto ClassicFeatureSet::GetControllerFloatValue( - base::InputDevice* device, const std::string& value_name) -> float { +auto ClassicFeatureSet::GetControllerFloatValue(base::InputDevice* device, + const std::string& value_name) + -> float { return python->GetControllerFloatValue(device, value_name); } diff --git a/src/ballistica/classic/python/classic_python.cc b/src/ballistica/classic/python/classic_python.cc index 41d52348..1c1219c7 100644 --- a/src/ballistica/classic/python/classic_python.cc +++ b/src/ballistica/classic/python/classic_python.cc @@ -66,8 +66,9 @@ auto ClassicPython::GetControllerValue(base::InputDevice* device, return static_cast(PyLong_AsLong(ret_val.Get())); } -auto ClassicPython::GetControllerFloatValue( - base::InputDevice* device, const std::string& value_name) -> float { +auto ClassicPython::GetControllerFloatValue(base::InputDevice* device, + const std::string& value_name) + -> float { assert(device); assert(objs().Exists(ObjID::kGetInputDeviceMappedValueCall)); diff --git a/src/ballistica/classic/python/methods/python_methods_classic.cc b/src/ballistica/classic/python/methods/python_methods_classic.cc index eab05e73..eb442393 100644 --- a/src/ballistica/classic/python/methods/python_methods_classic.cc +++ b/src/ballistica/classic/python/methods/python_methods_classic.cc @@ -22,8 +22,8 @@ namespace ballistica::classic { // -------------------------------- value_test --------------------------------- -static auto PyValueTest(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyValueTest(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* arg; double change = 0.0f; diff --git a/src/ballistica/classic/support/classic_app_mode.cc b/src/ballistica/classic/support/classic_app_mode.cc index 17c4e31d..1549e91c 100644 --- a/src/ballistica/classic/support/classic_app_mode.cc +++ b/src/ballistica/classic/support/classic_app_mode.cc @@ -167,7 +167,7 @@ void ClassicAppMode::HostScanCycle() { } // Bind to whatever. - struct sockaddr_in serv_addr {}; + struct sockaddr_in serv_addr{}; memset(&serv_addr, 0, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); // NOLINT diff --git a/src/ballistica/core/platform/apple/core_platform_apple.h b/src/ballistica/core/platform/apple/core_platform_apple.h index 1d3851a7..982fb8f9 100644 --- a/src/ballistica/core/platform/apple/core_platform_apple.h +++ b/src/ballistica/core/platform/apple/core_platform_apple.h @@ -33,14 +33,14 @@ class CorePlatformApple : public CorePlatform { auto CreateTextTexture(int width, int height, const std::vector& strings, const std::vector& positions, - const std::vector& widths, - float scale) -> void* override; + const std::vector& widths, float scale) + -> void* override; auto GetTextTextureData(void* tex) -> uint8_t* override; void SubmitScore(const std::string& game, const std::string& version, int64_t score) override; void ReportAchievement(const std::string& achievement) override; - auto HaveLeaderboard(const std::string& game, - const std::string& config) -> bool override; + auto HaveLeaderboard(const std::string& game, const std::string& config) + -> bool override; void ShowGameServiceUI(const std::string& show, const std::string& game, const std::string& game_version) override; void ResetAchievements() override; diff --git a/src/ballistica/core/platform/core_platform.cc b/src/ballistica/core/platform/core_platform.cc index a30e03f2..d03596a6 100644 --- a/src/ballistica/core/platform/core_platform.cc +++ b/src/ballistica/core/platform/core_platform.cc @@ -219,8 +219,8 @@ auto CorePlatform::GetConfigFilePath() -> std::string { } // FIXME: should make this unnecessary. -auto CorePlatform::GetLowLevelConfigValue(const char* key, - int default_value) -> int { +auto CorePlatform::GetLowLevelConfigValue(const char* key, int default_value) + -> int { std::string path = g_core->GetConfigDirectory() + BA_DIRSLASH + ".cvar_" + key; int val = default_value; @@ -318,7 +318,7 @@ auto CorePlatform::FOpen(const char* path, const char* mode) -> FILE* { } auto CorePlatform::FilePathExists(const std::string& name) -> bool { - struct BA_STAT buffer {}; + struct BA_STAT buffer{}; return (Stat(name.c_str(), &buffer) == 0); } @@ -512,14 +512,16 @@ void CorePlatform::EmitPlatformLog(const std::string& name, LogLevel level, // Do nothing by default. } -auto CorePlatform::ReportFatalError( - const std::string& message, bool in_top_level_exception_handler) -> bool { +auto CorePlatform::ReportFatalError(const std::string& message, + bool in_top_level_exception_handler) + -> bool { // Don't override handling by default. return false; } -auto CorePlatform::HandleFatalError( - bool exit_cleanly, bool in_top_level_exception_handler) -> bool { +auto CorePlatform::HandleFatalError(bool exit_cleanly, + bool in_top_level_exception_handler) + -> bool { // Don't override handling by default. return false; } @@ -851,8 +853,8 @@ void CorePlatform::Unlink(const char* path) { #endif } -auto CorePlatform::AbsPath(const std::string& path, - std::string* outpath) -> bool { +auto CorePlatform::AbsPath(const std::string& path, std::string* outpath) + -> bool { // Ensure all implementations fail if the file does not exist. if (!FilePathExists(path)) { return false; @@ -860,8 +862,8 @@ auto CorePlatform::AbsPath(const std::string& path, return DoAbsPath(path, outpath); } -auto CorePlatform::DoAbsPath(const std::string& path, - std::string* outpath) -> bool { +auto CorePlatform::DoAbsPath(const std::string& path, std::string* outpath) + -> bool { // This covers all but windows. #if BA_OSTYPE_WINDOWS throw Exception(); diff --git a/src/ballistica/core/platform/core_platform.h b/src/ballistica/core/platform/core_platform.h index 978b5e1a..7be064b3 100644 --- a/src/ballistica/core/platform/core_platform.h +++ b/src/ballistica/core/platform/core_platform.h @@ -229,8 +229,8 @@ class CorePlatform { virtual auto CreateTextTexture(int width, int height, const std::vector& strings, const std::vector& positions, - const std::vector& widths, - float scale) -> void*; + const std::vector& widths, float scale) + -> void*; virtual auto GetTextTextureData(void* tex) -> uint8_t*; #pragma mark ACCOUNTS ---------------------------------------------------------- diff --git a/src/ballistica/core/platform/windows/core_platform_windows.cc b/src/ballistica/core/platform/windows/core_platform_windows.cc index 5951440b..7e0d8442 100644 --- a/src/ballistica/core/platform/windows/core_platform_windows.cc +++ b/src/ballistica/core/platform/windows/core_platform_windows.cc @@ -342,13 +342,13 @@ auto CorePlatformWindows::Remove(const char* path) -> int { return _wremove(UTF8Decode(path).c_str()); } -auto CorePlatformWindows::Stat(const char* path, - struct BA_STAT* buffer) -> int { +auto CorePlatformWindows::Stat(const char* path, struct BA_STAT* buffer) + -> int { return _wstat(UTF8Decode(path).c_str(), buffer); } -auto CorePlatformWindows::Rename(const char* oldname, - const char* newname) -> int { +auto CorePlatformWindows::Rename(const char* oldname, const char* newname) + -> int { // Unlike other platforms, windows will error if the target file already // exists instead of simply overwriting it. So let's attempt to blow away // anything there first. diff --git a/src/ballistica/core/platform/windows/core_platform_windows.h b/src/ballistica/core/platform/windows/core_platform_windows.h index 27820814..4943e85e 100644 --- a/src/ballistica/core/platform/windows/core_platform_windows.h +++ b/src/ballistica/core/platform/windows/core_platform_windows.h @@ -31,8 +31,8 @@ class CorePlatformWindows : public CorePlatform { auto Remove(const char* path) -> int; auto Stat(const char* path, struct BA_STAT* buffer) -> int; auto Rename(const char* oldname, const char* newname) -> int; - auto DoAbsPath(const std::string& path, - std::string* outpath) -> bool override; + auto DoAbsPath(const std::string& path, std::string* outpath) + -> bool override; auto FOpen(const char* path, const char* mode) -> FILE* override; auto GetErrnoString() -> std::string override; auto GetSocketErrorString() -> std::string override; diff --git a/src/ballistica/scene_v1/connection/connection_set.cc b/src/ballistica/scene_v1/connection/connection_set.cc index a6336fd8..78dafb0c 100644 --- a/src/ballistica/scene_v1/connection/connection_set.cc +++ b/src/ballistica/scene_v1/connection/connection_set.cc @@ -700,8 +700,8 @@ void ConnectionSet::HandleIncomingUDPPacket(const std::vector& data_in, } } -auto ConnectionSet::VerifyClientAddr(uint8_t client_id, - const SockAddr& addr) -> bool { +auto ConnectionSet::VerifyClientAddr(uint8_t client_id, const SockAddr& addr) + -> bool { auto connection_to_client = connections_to_clients_.find(client_id); if (connection_to_client != connections_to_clients_.end()) { diff --git a/src/ballistica/scene_v1/dynamics/dynamics.cc b/src/ballistica/scene_v1/dynamics/dynamics.cc index e46543e1..ba6e5564 100644 --- a/src/ballistica/scene_v1/dynamics/dynamics.cc +++ b/src/ballistica/scene_v1/dynamics/dynamics.cc @@ -25,8 +25,8 @@ namespace ballistica::scene_v1 { // Given two parts, returns true if part1 is major in // the storage order. -static auto IsInStoreOrder(int64_t node1, int part1, int64_t node2, - int part2) -> bool { +static auto IsInStoreOrder(int64_t node1, int part1, int64_t node2, int part2) + -> bool { assert(node1 >= 0 && part1 >= 0 && node2 >= 0 && part2 >= 0); // Node with smaller id is primary search node. diff --git a/src/ballistica/scene_v1/dynamics/material/material_component.cc b/src/ballistica/scene_v1/dynamics/material/material_component.cc index 80eaf88f..55b9963d 100644 --- a/src/ballistica/scene_v1/dynamics/material/material_component.cc +++ b/src/ballistica/scene_v1/dynamics/material/material_component.cc @@ -28,8 +28,8 @@ MaterialComponent::~MaterialComponent() {} auto MaterialComponent::eval_conditions( const Object::Ref& condition, const Material& c, - const Part* part, const Part* opposing_part, - const MaterialContext& s) -> bool { + const Part* part, const Part* opposing_part, const MaterialContext& s) + -> bool { // If there's no condition, succeed. if (!condition.Exists()) { return true; diff --git a/src/ballistica/scene_v1/dynamics/material/material_component.h b/src/ballistica/scene_v1/dynamics/material/material_component.h index 53e7cde4..bbd06761 100644 --- a/src/ballistica/scene_v1/dynamics/material/material_component.h +++ b/src/ballistica/scene_v1/dynamics/material/material_component.h @@ -29,8 +29,8 @@ class MaterialComponent : public Object { Object::Ref conditions; auto eval_conditions(const Object::Ref& condition, const Material& c, const Part* part, - const Part* opposing_part, - const MaterialContext& s) -> bool; + const Part* opposing_part, const MaterialContext& s) + -> bool; // Apply the component to a context. void Apply(MaterialContext* c, const Part* src_part, const Part* dst_part); diff --git a/src/ballistica/scene_v1/node/spaz_node.cc b/src/ballistica/scene_v1/node/spaz_node.cc index cfc36364..8efa91ea 100644 --- a/src/ballistica/scene_v1/node/spaz_node.cc +++ b/src/ballistica/scene_v1/node/spaz_node.cc @@ -146,8 +146,8 @@ enum SpazBodyType { kHairPonyTailBottomBodyID }; -static auto AngleBetween2DVectors(dReal x1, dReal y1, dReal x2, - dReal y2) -> dReal { +static auto AngleBetween2DVectors(dReal x1, dReal y1, dReal x2, dReal y2) + -> dReal { dReal x1_norm, y1_norm, x2_norm, y2_norm; dReal len1, len2; len1 = sqrtf(x1 * x1 + y1 * y1); diff --git a/src/ballistica/scene_v1/node/spaz_node.h b/src/ballistica/scene_v1/node/spaz_node.h index dd660902..3440ef59 100644 --- a/src/ballistica/scene_v1/node/spaz_node.h +++ b/src/ballistica/scene_v1/node/spaz_node.h @@ -271,8 +271,8 @@ class SpazNode : public Node { // points line up. auto CreateFixedJoint(RigidBody* b1, RigidBody* b2, float ls, float ld, float as, float ad, float a1x, float a1y, float a1z, - float a2x, float a2y, float a2z, - bool reposition = true) -> JointFixedEF*; + float a2x, float a2y, float a2z, bool reposition = true) + -> JointFixedEF*; void Throw(bool withBombButton); // Reset to a standing, non-moving state at the given point. @@ -285,8 +285,8 @@ class SpazNode : public Node { auto IsBrokenBodyPart(int id) -> bool; static auto StaticCollideCallback(dContact* c, int count, RigidBody* colliding_body, - RigidBody* opposingbody, - void* data) -> bool { + RigidBody* opposingbody, void* data) + -> bool { auto* a = static_cast(data); return a->CollideCallback(c, count, colliding_body, opposingbody); } diff --git a/src/ballistica/scene_v1/python/class/python_class_activity_data.h b/src/ballistica/scene_v1/python/class/python_class_activity_data.h index f2d8323a..bb7a7122 100644 --- a/src/ballistica/scene_v1/python/class/python_class_activity_data.h +++ b/src/ballistica/scene_v1/python/class/python_class_activity_data.h @@ -24,8 +24,8 @@ class PythonClassActivityData : public PythonClass { static PyMethodDef tp_methods[]; static PyNumberMethods as_number_; static auto tp_repr(PythonClassActivityData* self) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassActivityData* self); static auto nb_bool(PythonClassActivityData* self) -> int; diff --git a/src/ballistica/scene_v1/python/class/python_class_base_timer.h b/src/ballistica/scene_v1/python/class/python_class_base_timer.h index c061226d..bcd1179e 100644 --- a/src/ballistica/scene_v1/python/class/python_class_base_timer.h +++ b/src/ballistica/scene_v1/python/class/python_class_base_timer.h @@ -18,8 +18,8 @@ class PythonClassBaseTimer : public PythonClass { static PyTypeObject type_obj; private: - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassBaseTimer* self); int timer_id_; ContextRefSceneV1* context_ref_; diff --git a/src/ballistica/scene_v1/python/class/python_class_input_device.cc b/src/ballistica/scene_v1/python/class/python_class_input_device.cc index b4115a04..4d54399b 100644 --- a/src/ballistica/scene_v1/python/class/python_class_input_device.cc +++ b/src/ballistica/scene_v1/python/class/python_class_input_device.cc @@ -344,8 +344,8 @@ auto PythonClassInputDevice::GetPlayerProfiles(PythonClassInputDevice* self) } auto PythonClassInputDevice::GetV1AccountName(PythonClassInputDevice* self, - PyObject* args, - PyObject* keywds) -> PyObject* { + PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; int full; static const char* kwlist[] = {"full", nullptr}; @@ -388,8 +388,8 @@ auto PythonClassInputDevice::Exists(PythonClassInputDevice* self) -> PyObject* { } auto PythonClassInputDevice::GetAxisName(PythonClassInputDevice* self, - PyObject* args, - PyObject* keywds) -> PyObject* { + PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); int id; @@ -409,8 +409,8 @@ auto PythonClassInputDevice::GetAxisName(PythonClassInputDevice* self, } auto PythonClassInputDevice::GetButtonName(PythonClassInputDevice* self, - PyObject* args, - PyObject* keywds) -> PyObject* { + PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); int id{}; diff --git a/src/ballistica/scene_v1/python/class/python_class_input_device.h b/src/ballistica/scene_v1/python/class/python_class_input_device.h index ab1ab209..987b2ece 100644 --- a/src/ballistica/scene_v1/python/class/python_class_input_device.h +++ b/src/ballistica/scene_v1/python/class/python_class_input_device.h @@ -23,12 +23,12 @@ class PythonClassInputDevice : public PythonClass { private: static PyMethodDef tp_methods[]; static auto tp_repr(PythonClassInputDevice* self) -> PyObject*; - static auto tp_getattro(PythonClassInputDevice* self, - PyObject* attr) -> PyObject*; + static auto tp_getattro(PythonClassInputDevice* self, PyObject* attr) + -> PyObject*; static auto tp_setattro(PythonClassInputDevice* self, PyObject* attr, PyObject* val) -> int; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassInputDevice* self); static auto nb_bool(PythonClassInputDevice* self) -> int; static auto DetachFromPlayer(PythonClassInputDevice* self) -> PyObject*; diff --git a/src/ballistica/scene_v1/python/class/python_class_material.cc b/src/ballistica/scene_v1/python/class/python_class_material.cc index 02d7f08a..3ea51b8d 100644 --- a/src/ballistica/scene_v1/python/class/python_class_material.cc +++ b/src/ballistica/scene_v1/python/class/python_class_material.cc @@ -174,8 +174,8 @@ auto PythonClassMaterial::tp_repr(PythonClassMaterial* self) -> PyObject* { BA_PYTHON_CATCH; } -auto PythonClassMaterial::tp_getattro(PythonClassMaterial* self, - PyObject* attr) -> PyObject* { +auto PythonClassMaterial::tp_getattro(PythonClassMaterial* self, PyObject* attr) + -> PyObject* { BA_PYTHON_TRY; // Assuming this will always be a str? diff --git a/src/ballistica/scene_v1/python/class/python_class_material.h b/src/ballistica/scene_v1/python/class/python_class_material.h index c61855ac..fc452860 100644 --- a/src/ballistica/scene_v1/python/class/python_class_material.h +++ b/src/ballistica/scene_v1/python/class/python_class_material.h @@ -27,12 +27,12 @@ class PythonClassMaterial : public PythonClass { private: static bool s_create_empty_; static PyMethodDef tp_methods[]; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void Delete(Object::Ref* m); static void tp_dealloc(PythonClassMaterial* self); - static auto tp_getattro(PythonClassMaterial* self, - PyObject* attr) -> PyObject*; + static auto tp_getattro(PythonClassMaterial* self, PyObject* attr) + -> PyObject*; static auto tp_setattro(PythonClassMaterial* self, PyObject* attr, PyObject* val) -> int; static auto tp_repr(PythonClassMaterial* self) -> PyObject*; diff --git a/src/ballistica/scene_v1/python/class/python_class_node.cc b/src/ballistica/scene_v1/python/class/python_class_node.cc index 1636863f..fad31158 100644 --- a/src/ballistica/scene_v1/python/class/python_class_node.cc +++ b/src/ballistica/scene_v1/python/class/python_class_node.cc @@ -141,8 +141,8 @@ auto PythonClassNode::tp_repr(PythonClassNode* self) -> PyObject* { BA_PYTHON_CATCH; } -auto PythonClassNode::tp_getattro(PythonClassNode* self, - PyObject* attr) -> PyObject* { +auto PythonClassNode::tp_getattro(PythonClassNode* self, PyObject* attr) + -> PyObject* { BA_PYTHON_TRY; // Do we need to support other attr types? @@ -259,8 +259,8 @@ auto PythonClassNode::Delete(PythonClassNode* self, PyObject* args, BA_PYTHON_CATCH; } -auto PythonClassNode::HandleMessage(PythonClassNode* self, - PyObject* args) -> PyObject* { +auto PythonClassNode::HandleMessage(PythonClassNode* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; Py_ssize_t tuple_size = PyTuple_GET_SIZE(args); if (tuple_size < 1) { @@ -294,8 +294,8 @@ auto PythonClassNode::HandleMessage(PythonClassNode* self, BA_PYTHON_CATCH; } -auto PythonClassNode::AddDeathAction(PythonClassNode* self, - PyObject* args) -> PyObject* { +auto PythonClassNode::AddDeathAction(PythonClassNode* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; PyObject* call_obj; if (!PyArg_ParseTuple(args, "O", &call_obj)) { @@ -317,8 +317,8 @@ auto PythonClassNode::AddDeathAction(PythonClassNode* self, BA_PYTHON_CATCH; } -auto PythonClassNode::ConnectAttr(PythonClassNode* self, - PyObject* args) -> PyObject* { +auto PythonClassNode::ConnectAttr(PythonClassNode* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; PyObject* dst_node_obj; Node* node = self->node_->Get(); diff --git a/src/ballistica/scene_v1/python/class/python_class_node.h b/src/ballistica/scene_v1/python/class/python_class_node.h index c3c118ef..0765b87e 100644 --- a/src/ballistica/scene_v1/python/class/python_class_node.h +++ b/src/ballistica/scene_v1/python/class/python_class_node.h @@ -21,23 +21,23 @@ class PythonClassNode : public PythonClass { auto GetNode(bool doraise = true) const -> Node*; private: - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassNode* self); static auto tp_repr(PythonClassNode* self) -> PyObject*; static auto tp_getattro(PythonClassNode* self, PyObject* attr) -> PyObject*; - static auto tp_setattro(PythonClassNode* self, PyObject* attr, - PyObject* val) -> int; + static auto tp_setattro(PythonClassNode* self, PyObject* attr, PyObject* val) + -> int; static auto Exists(PythonClassNode* self) -> PyObject*; static auto GetNodeType(PythonClassNode* self) -> PyObject*; static auto GetName(PythonClassNode* self) -> PyObject*; static auto GetDelegate(PythonClassNode* self, PyObject* args, PyObject* keywds) -> PyObject*; - static auto Delete(PythonClassNode* self, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto Delete(PythonClassNode* self, PyObject* args, PyObject* keywds) + -> PyObject*; static auto HandleMessage(PythonClassNode* self, PyObject* args) -> PyObject*; - static auto AddDeathAction(PythonClassNode* self, - PyObject* args) -> PyObject*; + static auto AddDeathAction(PythonClassNode* self, PyObject* args) + -> PyObject*; static auto ConnectAttr(PythonClassNode* self, PyObject* args) -> PyObject*; static auto Dir(PythonClassNode* self) -> PyObject*; static auto nb_bool(PythonClassNode* self) -> int; diff --git a/src/ballistica/scene_v1/python/class/python_class_scene_collision_mesh.h b/src/ballistica/scene_v1/python/class/python_class_scene_collision_mesh.h index 89e0a9a6..c6ec83a8 100644 --- a/src/ballistica/scene_v1/python/class/python_class_scene_collision_mesh.h +++ b/src/ballistica/scene_v1/python/class/python_class_scene_collision_mesh.h @@ -22,8 +22,8 @@ class PythonClassSceneCollisionMesh : public PythonClass { auto GetCollisionMesh(bool doraise = true) const -> SceneCollisionMesh*; private: - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* kwds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* kwds) + -> PyObject*; static void tp_dealloc(PythonClassSceneCollisionMesh* self); static bool s_create_empty_; Object::Ref* collision_mesh_; diff --git a/src/ballistica/scene_v1/python/class/python_class_scene_data_asset.h b/src/ballistica/scene_v1/python/class/python_class_scene_data_asset.h index da164792..58df60e2 100644 --- a/src/ballistica/scene_v1/python/class/python_class_scene_data_asset.h +++ b/src/ballistica/scene_v1/python/class/python_class_scene_data_asset.h @@ -24,8 +24,8 @@ class PythonClassSceneDataAsset : public PythonClass { private: static PyMethodDef tp_methods[]; static auto GetValue(PythonClassSceneDataAsset* self) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* kwds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* kwds) + -> PyObject*; static void tp_dealloc(PythonClassSceneDataAsset* self); static bool s_create_empty_; Object::Ref* data_; diff --git a/src/ballistica/scene_v1/python/class/python_class_scene_mesh.h b/src/ballistica/scene_v1/python/class/python_class_scene_mesh.h index dc55f6b3..b703b5d1 100644 --- a/src/ballistica/scene_v1/python/class/python_class_scene_mesh.h +++ b/src/ballistica/scene_v1/python/class/python_class_scene_mesh.h @@ -23,8 +23,8 @@ class PythonClassSceneMesh : public PythonClass { private: static bool s_create_empty_; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* kwds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* kwds) + -> PyObject*; static void tp_dealloc(PythonClassSceneMesh* self); Object::Ref* mesh_; }; diff --git a/src/ballistica/scene_v1/python/class/python_class_scene_sound.h b/src/ballistica/scene_v1/python/class/python_class_scene_sound.h index b71c2b77..9be96fed 100644 --- a/src/ballistica/scene_v1/python/class/python_class_scene_sound.h +++ b/src/ballistica/scene_v1/python/class/python_class_scene_sound.h @@ -24,8 +24,8 @@ class PythonClassSceneSound : public PythonClass { private: static auto Play(PythonClassSceneSound* self, PyObject* args, PyObject* keywds) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* kwds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* kwds) + -> PyObject*; static void tp_dealloc(PythonClassSceneSound* self); static PyMethodDef tp_methods[]; static bool s_create_empty_; diff --git a/src/ballistica/scene_v1/python/class/python_class_scene_texture.h b/src/ballistica/scene_v1/python/class/python_class_scene_texture.h index e198e7cf..2f78a1da 100644 --- a/src/ballistica/scene_v1/python/class/python_class_scene_texture.h +++ b/src/ballistica/scene_v1/python/class/python_class_scene_texture.h @@ -23,8 +23,8 @@ class PythonClassSceneTexture : public PythonClass { private: static bool s_create_empty_; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassSceneTexture* self); Object::Ref* texture_; }; diff --git a/src/ballistica/scene_v1/python/class/python_class_scene_timer.h b/src/ballistica/scene_v1/python/class/python_class_scene_timer.h index d87a475a..51005bae 100644 --- a/src/ballistica/scene_v1/python/class/python_class_scene_timer.h +++ b/src/ballistica/scene_v1/python/class/python_class_scene_timer.h @@ -18,8 +18,8 @@ class PythonClassSceneTimer : public PythonClass { static PyTypeObject type_obj; private: - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassSceneTimer* self); int timer_id_; ContextRefSceneV1* context_ref_; diff --git a/src/ballistica/scene_v1/python/class/python_class_session_data.h b/src/ballistica/scene_v1/python/class/python_class_session_data.h index 4a75654b..a4de57bc 100644 --- a/src/ballistica/scene_v1/python/class/python_class_session_data.h +++ b/src/ballistica/scene_v1/python/class/python_class_session_data.h @@ -24,8 +24,8 @@ class PythonClassSessionData : public PythonClass { static PyMethodDef tp_methods[]; static PyNumberMethods as_number_; static auto tp_repr(PythonClassSessionData* self) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassSessionData* self); static auto Exists(PythonClassSessionData* self) -> PyObject*; diff --git a/src/ballistica/scene_v1/python/class/python_class_session_player.cc b/src/ballistica/scene_v1/python/class/python_class_session_player.cc index 833e4aab..5431aff9 100644 --- a/src/ballistica/scene_v1/python/class/python_class_session_player.cc +++ b/src/ballistica/scene_v1/python/class/python_class_session_player.cc @@ -324,8 +324,8 @@ auto PythonClassSessionPlayer::tp_getattro(PythonClassSessionPlayer* self, } auto PythonClassSessionPlayer::tp_setattro(PythonClassSessionPlayer* self, - PyObject* attr, - PyObject* val) -> int { + PyObject* attr, PyObject* val) + -> int { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); @@ -351,8 +351,8 @@ auto PythonClassSessionPlayer::tp_setattro(PythonClassSessionPlayer* self, } auto PythonClassSessionPlayer::GetName(PythonClassSessionPlayer* self, - PyObject* args, - PyObject* keywds) -> PyObject* { + PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); int full = false; @@ -383,8 +383,8 @@ auto PythonClassSessionPlayer::Exists(PythonClassSessionPlayer* self) } auto PythonClassSessionPlayer::SetName(PythonClassSessionPlayer* self, - PyObject* args, - PyObject* keywds) -> PyObject* { + PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); PyObject* name_obj; @@ -425,8 +425,8 @@ auto PythonClassSessionPlayer::ResetInput(PythonClassSessionPlayer* self) } auto PythonClassSessionPlayer::AssignInputCall(PythonClassSessionPlayer* self, - PyObject* args, - PyObject* keywds) -> PyObject* { + PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); PyObject* input_type_obj; @@ -518,8 +518,8 @@ auto PythonClassSessionPlayer::GetV1AccountID(PythonClassSessionPlayer* self) } auto PythonClassSessionPlayer::SetData(PythonClassSessionPlayer* self, - PyObject* args, - PyObject* keywds) -> PyObject* { + PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); PyObject* team_obj; @@ -564,8 +564,8 @@ auto PythonClassSessionPlayer::GetIconInfo(PythonClassSessionPlayer* self) } auto PythonClassSessionPlayer::SetIconInfo(PythonClassSessionPlayer* self, - PyObject* args, - PyObject* keywds) -> PyObject* { + PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); PyObject* texture_name_obj; @@ -599,8 +599,8 @@ auto PythonClassSessionPlayer::SetIconInfo(PythonClassSessionPlayer* self, } auto PythonClassSessionPlayer::SetActivity(PythonClassSessionPlayer* self, - PyObject* args, - PyObject* keywds) -> PyObject* { + PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); PyObject* activity_obj; @@ -625,8 +625,8 @@ auto PythonClassSessionPlayer::SetActivity(PythonClassSessionPlayer* self, } auto PythonClassSessionPlayer::SetNode(PythonClassSessionPlayer* self, - PyObject* args, - PyObject* keywds) -> PyObject* { + PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); PyObject* node_obj; diff --git a/src/ballistica/scene_v1/python/class/python_class_session_player.h b/src/ballistica/scene_v1/python/class/python_class_session_player.h index 64475655..dbe92676 100644 --- a/src/ballistica/scene_v1/python/class/python_class_session_player.h +++ b/src/ballistica/scene_v1/python/class/python_class_session_player.h @@ -24,11 +24,11 @@ class PythonClassSessionPlayer : public PythonClass { static bool s_create_empty_; static PyMethodDef tp_methods[]; static auto tp_repr(PythonClassSessionPlayer* self) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassSessionPlayer* self); - static auto tp_getattro(PythonClassSessionPlayer* self, - PyObject* attr) -> PyObject*; + static auto tp_getattro(PythonClassSessionPlayer* self, PyObject* attr) + -> PyObject*; static auto tp_setattro(PythonClassSessionPlayer* self, PyObject* attr, PyObject* val) -> int; static auto GetName(PythonClassSessionPlayer* self, PyObject* args, diff --git a/src/ballistica/scene_v1/python/methods/python_methods_assets.cc b/src/ballistica/scene_v1/python/methods/python_methods_assets.cc index a99bc200..58f63c19 100644 --- a/src/ballistica/scene_v1/python/methods/python_methods_assets.cc +++ b/src/ballistica/scene_v1/python/methods/python_methods_assets.cc @@ -22,8 +22,8 @@ namespace ballistica::scene_v1 { // ------------------------------- gettexture ---------------------------------- -static auto PyGetTexture(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetTexture(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* name; static const char* kwlist[] = {"name", nullptr}; @@ -82,8 +82,8 @@ static PyMethodDef PyGetPackageTextureDef = { // ------------------------------- getsound ------------------------------------ -static auto PyGetSound(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetSound(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* name; static const char* kwlist[] = {"name", nullptr}; @@ -113,8 +113,8 @@ static PyMethodDef PyGetSoundDef = { // --------------------------- get_package_sound ------------------------------- -static auto PyGetPackageSound(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetPackageSound(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* name; PyObject* package_obj; @@ -142,8 +142,8 @@ static PyMethodDef PyGetPackageSoundDef = { // ------------------------------- getdata ------------------------------------- -static auto PyGetData(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetData(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* name; static const char* kwlist[] = {"name", nullptr}; @@ -173,8 +173,8 @@ static PyMethodDef PyGetDataDef = { // --------------------------- get_package_data -------------------------------- -static auto PyGetPackageData(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetPackageData(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* name; PyObject* package_obj; @@ -202,8 +202,8 @@ static PyMethodDef PyGetPackageDataDef = { // -------------------------------- getmesh ------------------------------------ -static auto PyGetMesh(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetMesh(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* name; static const char* kwlist[] = {"name", nullptr}; @@ -233,8 +233,8 @@ static PyMethodDef PyGetMeshDef = { // ---------------------------- get_package_mesh ------------------------------- -static auto PyGetPackageMesh(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetPackageMesh(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* name; PyObject* package_obj; @@ -263,8 +263,8 @@ static PyMethodDef PyGetPackageMeshDef = { // ----------------------------- getcollisionmesh ------------------------------ -static auto PyGetCollisionMesh(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetCollisionMesh(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* name; static const char* kwlist[] = {"name", nullptr}; diff --git a/src/ballistica/scene_v1/python/methods/python_methods_input.cc b/src/ballistica/scene_v1/python/methods/python_methods_input.cc index a41556be..55700a64 100644 --- a/src/ballistica/scene_v1/python/methods/python_methods_input.cc +++ b/src/ballistica/scene_v1/python/methods/python_methods_input.cc @@ -17,8 +17,8 @@ namespace ballistica::scene_v1 { // ----------------------- get_configurable_game_pads -------------------------- -static auto PyGetConfigurableGamePads(PyObject* self, - PyObject* args) -> PyObject* { +static auto PyGetConfigurableGamePads(PyObject* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; std::vector gamepads = g_base->input->GetConfigurableGamePads(); @@ -52,8 +52,8 @@ static PyMethodDef PyGetConfigurableGamePadsDef = { // ------------------------ have_touchscreen_input ----------------------------- -static auto PyHaveTouchScreenInput(PyObject* self, - PyObject* args) -> PyObject* { +static auto PyHaveTouchScreenInput(PyObject* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; if (g_base->touch_input) { Py_RETURN_TRUE; @@ -77,8 +77,8 @@ static PyMethodDef PyHaveTouchScreenInputDef = { // ------------------------- set_touchscreen_editing --------------------------- -static auto PySetTouchscreenEditing(PyObject* self, - PyObject* args) -> PyObject* { +static auto PySetTouchscreenEditing(PyObject* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; int editing; if (!PyArg_ParseTuple(args, "p", &editing)) { @@ -152,8 +152,8 @@ static PyMethodDef PyReleaseGamePadInputDef = { // ------------------------ capture_keyboard_input ----------------------------- -static auto PyCaptureKeyboardInput(PyObject* self, - PyObject* args) -> PyObject* { +static auto PyCaptureKeyboardInput(PyObject* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); assert(g_scene_v1); @@ -181,8 +181,8 @@ static PyMethodDef PyCaptureKeyboardInputDef = { // ------------------------- release_keyboard_input ---------------------------- -static auto PyReleaseKeyboardInput(PyObject* self, - PyObject* args) -> PyObject* { +static auto PyReleaseKeyboardInput(PyObject* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); assert(g_scene_v1); @@ -205,8 +205,8 @@ static PyMethodDef PyReleaseKeyboardInputDef = { // --------------------------- get_ui_input_device ----------------------------- -static auto PyGetUIInputDevice(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetUIInputDevice(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); static const char* kwlist[] = {nullptr}; @@ -252,8 +252,8 @@ static PyMethodDef PyGetUIInputDeviceDef = { // ---------------------------- getinputdevice --------------------------------- -static auto PyGetInputDevice(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetInputDevice(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); const char* name; diff --git a/src/ballistica/scene_v1/python/methods/python_methods_networking.cc b/src/ballistica/scene_v1/python/methods/python_methods_networking.cc index eb2a95b5..8cca87e5 100644 --- a/src/ballistica/scene_v1/python/methods/python_methods_networking.cc +++ b/src/ballistica/scene_v1/python/methods/python_methods_networking.cc @@ -313,8 +313,8 @@ static PyMethodDef PySetAuthenticateClientsDef = { // ------------------------------- set_admins ---------------------------------- -static auto PySetAdmins(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PySetAdmins(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; PyObject* admins_obj; static const char* kwlist[] = {"admins", nullptr}; @@ -378,8 +378,8 @@ static PyMethodDef PySetEnableDefaultKickVotingDef = { // --------------------------- connect_to_party -------------------------------- -static auto PyConnectToParty(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyConnectToParty(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; std::string address; PyObject* address_obj; @@ -590,8 +590,8 @@ static PyMethodDef PyDisconnectFromHostDef = { // --------------------------- disconnect_client ------------------------------- -static auto PyDisconnectClient(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyDisconnectClient(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; int client_id; int ban_time = 300; // Old default before we exposed this. @@ -701,8 +701,8 @@ static PyMethodDef PyGetGamePortDef = { // ------------------------ set_master_server_source --------------------------- -static auto PySetMasterServerSource(PyObject* self, - PyObject* args) -> PyObject* { +static auto PySetMasterServerSource(PyObject* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; int source; if (!PyArg_ParseTuple(args, "i", &source)) return nullptr; @@ -728,8 +728,8 @@ static PyMethodDef PySetMasterServerSourceDef = { // ----------------------------- host_scan_cycle ------------------------------- -static auto PyHostScanCycle(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyHostScanCycle(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; auto* appmode = classic::ClassicAppMode::GetActiveOrThrow(); appmode->HostScanCycle(); @@ -757,8 +757,8 @@ static PyMethodDef PyHostScanCycleDef = { // ---------------------------- end_host_scanning ------------------------------ -static auto PyEndHostScanning(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyEndHostScanning(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; auto* appmode = classic::ClassicAppMode::GetActiveOrThrow(); appmode->EndHostScanning(); @@ -805,8 +805,8 @@ static PyMethodDef PyHaveConnectedClientsDef = { // ------------------------------ chatmessage ---------------------------------- -static auto PyChatMessage(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyChatMessage(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; std::string message; PyObject* message_obj; @@ -857,8 +857,8 @@ static PyMethodDef PyChatMessageDef = { // --------------------------- get_chat_messages ------------------------------- -static auto PyGetChatMessages(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetChatMessages(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); diff --git a/src/ballistica/scene_v1/python/methods/python_methods_scene.cc b/src/ballistica/scene_v1/python/methods/python_methods_scene.cc index bbcf8f21..aa862616 100644 --- a/src/ballistica/scene_v1/python/methods/python_methods_scene.cc +++ b/src/ballistica/scene_v1/python/methods/python_methods_scene.cc @@ -41,8 +41,8 @@ namespace ballistica::scene_v1 { // --------------------------------- time -------------------------------------- -static auto PyTime(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyTime(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; @@ -79,8 +79,8 @@ static PyMethodDef PyTimeDef = { // --------------------------------- timer ------------------------------------- -static auto PyTimer(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyTimer(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); @@ -152,8 +152,8 @@ static PyMethodDef PyTimerDef = { // ----------------------------- basetime ----------------------------------- -static auto PyBaseTime(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyBaseTime(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {nullptr}; @@ -190,8 +190,8 @@ static PyMethodDef PyBaseTimeDef = { // --------------------------------- timer ------------------------------------- -static auto PyBaseTimer(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyBaseTimer(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); @@ -261,8 +261,8 @@ static PyMethodDef PyBaseTimerDef = { // ------------------------------- getsession ---------------------------------- -static auto PyGetSession(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetSession(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; int raise = true; static const char* kwlist[] = {"doraise", nullptr}; @@ -305,8 +305,8 @@ static PyMethodDef PyGetSessionDef = { // --------------------------- new_host_session -------------------------------- -static auto PyNewHostSession(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyNewHostSession(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* benchmark_type_str = nullptr; static const char* kwlist[] = {"sessiontype", "benchmark_type", nullptr}; @@ -347,8 +347,8 @@ static PyMethodDef PyNewHostSessionDef = { // -------------------------- new_replay_session ------------------------------- -static auto PyNewReplaySession(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyNewReplaySession(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; std::string file_name; PyObject* file_name_obj; @@ -377,8 +377,8 @@ static PyMethodDef PyNewReplaySessionDef = { // ------------------------------ is_in_replay --------------------------------- -static auto PyIsInReplay(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyIsInReplay(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); static const char* kwlist[] = {nullptr}; @@ -408,8 +408,8 @@ static PyMethodDef PyIsInReplayDef = { // -------------------------- register_session-------- ------------------------- -static auto PyRegisterSession(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyRegisterSession(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); PyObject* session_obj; @@ -443,8 +443,8 @@ static PyMethodDef PyRegisterSessionDef = { // --------------------------- register_activity ------------------------------- -static auto PyRegisterActivity(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyRegisterActivity(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); PyObject* activity_obj; @@ -516,8 +516,8 @@ static PyMethodDef PyGetForegroundHostSessionDef = { // ----------------------------- newactivity ----------------------------------- -static auto PyNewActivity(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyNewActivity(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {"activity_type", "settings", nullptr}; @@ -575,8 +575,8 @@ static PyMethodDef PyNewActivityDef = { // ----------------------------- getactivity ----------------------------------- -static auto PyGetActivity(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetActivity(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; int raise = true; static const char* kwlist[] = {"doraise", nullptr}; @@ -624,8 +624,8 @@ static PyMethodDef PyGetActivityDef = { // -------------------------- broadcastmessage --------------------------------- -static auto PyBroadcastMessage(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyBroadcastMessage(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* message = nullptr; PyObject* color_obj = Py_None; @@ -800,8 +800,8 @@ static PyMethodDef PyBroadcastMessageDef = { // ------------------------------- newnode ------------------------------------- -static auto PyNewNode(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyNewNode(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; Node* n = SceneV1Python::DoNewNode(args, keywds); if (!n) { @@ -1037,8 +1037,8 @@ static PyMethodDef PyGetCollisionInfoDef = { // ------------------------------ camerashake ---------------------------------- -static auto PyCameraShake(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyCameraShake(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; assert(g_base->InLogicThread()); float intensity = 1.0f; @@ -1088,8 +1088,8 @@ static PyMethodDef PyCameraShakeDef = { // -------------------------------- emitfx ------------------------------------- -static auto PyEmitFx(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyEmitFx(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; static const char* kwlist[] = {"position", "velocity", "count", "scale", "spread", "chunk_type", @@ -1304,8 +1304,8 @@ static PyMethodDef PyGetForegroundHostActivityDef = { // --------------------------- get_game_roster --------------------------------- -static auto PyGetGameRoster(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyGetGameRoster(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); static const char* kwlist[] = {nullptr}; @@ -1414,8 +1414,8 @@ static PyMethodDef PyGetGameRosterDef = { // ----------------------- set_debug_speed_exponent ---------------------------- -static auto PySetDebugSpeedExponent(PyObject* self, - PyObject* args) -> PyObject* { +static auto PySetDebugSpeedExponent(PyObject* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; int speed; if (!PyArg_ParseTuple(args, "i", &speed)) { @@ -1453,8 +1453,8 @@ static PyMethodDef PySetDebugSpeedExponentDef = { // ----------------------- get_replay_speed_exponent --------------------------- -static auto PyGetReplaySpeedExponent(PyObject* self, - PyObject* args) -> PyObject* { +static auto PyGetReplaySpeedExponent(PyObject* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; auto* appmode = classic::ClassicAppMode::GetActiveOrThrow(); return PyLong_FromLong(appmode->replay_speed_exponent()); @@ -1476,8 +1476,8 @@ static PyMethodDef PyGetReplaySpeedExponentDef = { // ------------------------ set_replay_speed_exponent -------------------------- -static auto PySetReplaySpeedExponent(PyObject* self, - PyObject* args) -> PyObject* { +static auto PySetReplaySpeedExponent(PyObject* self, PyObject* args) + -> PyObject* { BA_PYTHON_TRY; int speed; if (!PyArg_ParseTuple(args, "i", &speed)) { @@ -1652,8 +1652,8 @@ static PyMethodDef PyGetRandomNamesDef = { // -------------------------------- ls_objects --------------------------------- -static auto PyLsObjects(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyLsObjects(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; Object::LsObjects(); Py_RETURN_NONE; @@ -1677,8 +1677,8 @@ static PyMethodDef PyLsObjectsDef = { // --------------------------- ls_input_devices -------------------------------- -static auto PyLsInputDevices(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyLsInputDevices(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; g_base->input->LsInputDevices(); Py_RETURN_NONE; @@ -1702,8 +1702,8 @@ static PyMethodDef PyLsInputDevicesDef = { // -------------------------- set_internal_music ------------------------------- -static auto PySetInternalMusic(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PySetInternalMusic(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); PyObject* music_obj; diff --git a/src/ballistica/scene_v1/python/scene_v1_python.cc b/src/ballistica/scene_v1/python/scene_v1_python.cc index f99c9611..1c7ed978 100644 --- a/src/ballistica/scene_v1/python/scene_v1_python.cc +++ b/src/ballistica/scene_v1/python/scene_v1_python.cc @@ -422,8 +422,8 @@ auto SceneV1Python::DoNewNode(PyObject* args, PyObject* keywds) -> Node* { // Return the node attr as a PyObject, or nullptr if the node doesn't have that // attr. -auto SceneV1Python::GetNodeAttr(Node* node, - const char* attr_name) -> PyObject* { +auto SceneV1Python::GetNodeAttr(Node* node, const char* attr_name) + -> PyObject* { assert(node); NodeAttribute attr = node->GetAttribute(attr_name); switch (attr.type()) { @@ -972,8 +972,9 @@ auto SceneV1Python::GetPySceneSounds(PyObject* o) -> std::vector { return vals; } -auto SceneV1Python::GetPySceneCollisionMesh( - PyObject* o, bool allow_empty_ref, bool allow_none) -> SceneCollisionMesh* { +auto SceneV1Python::GetPySceneCollisionMesh(PyObject* o, bool allow_empty_ref, + bool allow_none) + -> SceneCollisionMesh* { assert(Python::HaveGIL()); BA_PRECONDITION_FATAL(o != nullptr); @@ -1101,8 +1102,8 @@ auto SceneV1Python::GetPySceneDataAsset(PyObject* o, bool allow_empty_ref, PyExcType::kType); } -auto SceneV1Python::FilterChatMessage(std::string* message, - int client_id) -> bool { +auto SceneV1Python::FilterChatMessage(std::string* message, int client_id) + -> bool { assert(message); base::ScopedSetContext ssc(nullptr); @@ -1423,8 +1424,9 @@ auto SceneV1Python::HandleCapturedKeyRelease(const SDL_Keysym& keysym) -> bool { return true; } -auto SceneV1Python::HandleCapturedJoystickEvent( - const SDL_Event& event, base::InputDevice* input_device) -> bool { +auto SceneV1Python::HandleCapturedJoystickEvent(const SDL_Event& event, + base::InputDevice* input_device) + -> bool { assert(g_base->InLogicThread()); assert(input_device != nullptr); if (!joystick_capture_call_.Exists()) { diff --git a/src/ballistica/scene_v1/python/scene_v1_python.h b/src/ballistica/scene_v1/python/scene_v1_python.h index c711ea45..afa67832 100644 --- a/src/ballistica/scene_v1/python/scene_v1_python.h +++ b/src/ballistica/scene_v1/python/scene_v1_python.h @@ -70,8 +70,8 @@ class SceneV1Python { /// Given an asset-package python object and a media name, verify /// that the asset-package is valid in the current context_ref and return /// its fully qualified name if so. Throw an Exception if not. - auto ValidatedPackageAssetName(PyObject* package, - const char* name) -> std::string; + auto ValidatedPackageAssetName(PyObject* package, const char* name) + -> std::string; /// Specific Python objects we hold in objs_. enum class ObjID { @@ -101,8 +101,9 @@ class SceneV1Python { const auto& objs() { return objs_; } private: - static auto HandleCapturedJoystickEventCall( - const SDL_Event& event, base::InputDevice* input_device) -> bool; + static auto HandleCapturedJoystickEventCall(const SDL_Event& event, + base::InputDevice* input_device) + -> bool; static auto HandleCapturedKeyPressCall(const SDL_Keysym& keysym) -> bool; static auto HandleCapturedKeyReleaseCall(const SDL_Keysym& keysym) -> bool; auto HandleCapturedJoystickEvent(const SDL_Event& event, diff --git a/src/ballistica/scene_v1/support/host_session.h b/src/ballistica/scene_v1/support/host_session.h index 5515a48f..cf53cccf 100644 --- a/src/ballistica/scene_v1/support/host_session.h +++ b/src/ballistica/scene_v1/support/host_session.h @@ -58,8 +58,8 @@ class HostSession : public Session { } // Given an activity python type, instantiate a new activity // and return a new reference. - auto NewHostActivity(PyObject* activity_type_obj, - PyObject* settings_obj) -> PyObject*; + auto NewHostActivity(PyObject* activity_type_obj, PyObject* settings_obj) + -> PyObject*; void DestroyHostActivity(HostActivity* a); void RemovePlayer(Player* player); void RequestPlayer(SceneV1InputDeviceDelegate* device); @@ -99,8 +99,8 @@ class HostSession : public Session { // New HostActivities should call this in their constructors. void AddHostActivity(HostActivity* sgc); - auto GetUnusedPlayerName(Player* p, - const std::string& base_name) -> std::string; + auto GetUnusedPlayerName(Player* p, const std::string& base_name) + -> std::string; auto ContextAllowsDefaultTimerTypes() -> bool override; auto TimeToNextEvent() -> std::optional override; diff --git a/src/ballistica/scene_v1/support/session_stream.h b/src/ballistica/scene_v1/support/session_stream.h index 4d97fe4f..ae15b633 100644 --- a/src/ballistica/scene_v1/support/session_stream.h +++ b/src/ballistica/scene_v1/support/session_stream.h @@ -122,8 +122,8 @@ class SessionStream : public Object, public ClientControllerInterface { template auto GetPointerCount(const std::vector& vec) -> size_t; template - auto GetFreeIndex(std::vector* vec, - std::vector* free_indices) -> size_t; + auto GetFreeIndex(std::vector* vec, std::vector* free_indices) + -> size_t; template void Add(T* val, std::vector* vec, std::vector* free_indices); template diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index 2bc62d95..dd8de96d 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 = 22007; +const int kEngineBuildNumber = 22009; const char* kEngineVersion = "1.7.37"; const int kEngineApiVersion = 9; diff --git a/src/ballistica/shared/foundation/event_loop.cc b/src/ballistica/shared/foundation/event_loop.cc index d390defa..eb36357f 100644 --- a/src/ballistica/shared/foundation/event_loop.cc +++ b/src/ballistica/shared/foundation/event_loop.cc @@ -575,8 +575,8 @@ auto EventLoop::AreEventLoopsSuspended() -> bool { return g_core->event_loops_suspended(); } -auto EventLoop::NewTimer(microsecs_t length, bool repeat, - Runnable* runnable) -> Timer* { +auto EventLoop::NewTimer(microsecs_t length, bool repeat, Runnable* runnable) + -> Timer* { assert(g_core); assert(ThreadIsCurrent()); assert(Object::IsValidManagedObject(runnable)); diff --git a/src/ballistica/shared/foundation/macros.cc b/src/ballistica/shared/foundation/macros.cc index e1e1791b..c2ae788d 100644 --- a/src/ballistica/shared/foundation/macros.cc +++ b/src/ballistica/shared/foundation/macros.cc @@ -138,8 +138,8 @@ void MacroLogPythonTrace(core::CoreFeatureSet* corefs, const std::string& msg) { Log(LogLevel::kError, msg); } -auto MacroPathFilter(core::CoreFeatureSet* corefs, - const char* filename) -> const char* { +auto MacroPathFilter(core::CoreFeatureSet* corefs, const char* filename) + -> const char* { // If we've got a build_src_dir set and filename starts with it, skip past // it. assert(corefs); diff --git a/src/ballistica/shared/foundation/macros.h b/src/ballistica/shared/foundation/macros.h index 946ffe26..60ad3b07 100644 --- a/src/ballistica/shared/foundation/macros.h +++ b/src/ballistica/shared/foundation/macros.h @@ -172,8 +172,8 @@ namespace ballistica { // Support functions used by some of our macros; not intended to be used // directly. -auto MacroPathFilter(core::CoreFeatureSet* corefs, - const char* filename) -> const char*; +auto MacroPathFilter(core::CoreFeatureSet* corefs, const char* filename) + -> const char*; void MacroFunctionTimerEnd(core::CoreFeatureSet* corefs, millisecs_t starttime, millisecs_t time, const char* funcname); void MacroFunctionTimerEndThread(core::CoreFeatureSet* corefs, diff --git a/src/ballistica/shared/generic/base64.cc b/src/ballistica/shared/generic/base64.cc index cada6c25..77df7e20 100644 --- a/src/ballistica/shared/generic/base64.cc +++ b/src/ballistica/shared/generic/base64.cc @@ -102,8 +102,8 @@ auto base64_encode(const unsigned char* bytes_to_encode, unsigned int in_len, return ret; } -auto base64_decode(const std::string& encoded_string, - bool urlsafe) -> std::string { +auto base64_decode(const std::string& encoded_string, bool urlsafe) + -> std::string { int in_len = static_cast(encoded_string.size()); int i = 0; // int j = 0; diff --git a/src/ballistica/shared/generic/base64.h b/src/ballistica/shared/generic/base64.h index 2faab459..0df02824 100644 --- a/src/ballistica/shared/generic/base64.h +++ b/src/ballistica/shared/generic/base64.h @@ -7,8 +7,8 @@ namespace ballistica { -auto base64_encode(const unsigned char*, unsigned int len, - bool urlsafe = false) -> std::string; +auto base64_encode(const unsigned char*, unsigned int len, bool urlsafe = false) + -> std::string; auto base64_decode(const std::string& s, bool urlsafe = false) -> std::string; } // namespace ballistica diff --git a/src/ballistica/shared/generic/timer_list.h b/src/ballistica/shared/generic/timer_list.h index f2ad5408..a954b759 100644 --- a/src/ballistica/shared/generic/timer_list.h +++ b/src/ballistica/shared/generic/timer_list.h @@ -22,8 +22,8 @@ class TimerList { // Create a timer with provided runnable. auto NewTimer(TimerMedium current_time, TimerMedium length, - TimerMedium offset, int repeat_count, - Runnable* runnable) -> Timer*; + TimerMedium offset, int repeat_count, Runnable* runnable) + -> Timer*; // Return a timer by its id, or nullptr if the timer no longer exists. auto GetTimer(int id) -> Timer*; diff --git a/src/ballistica/shared/generic/utils.cc b/src/ballistica/shared/generic/utils.cc index d87a10df..10025b03 100644 --- a/src/ballistica/shared/generic/utils.cc +++ b/src/ballistica/shared/generic/utils.cc @@ -332,8 +332,8 @@ auto Utils::UTF8FromUnicode(std::vector unichars) -> std::string { return buffer.data(); } -auto Utils::UnicodeFromUTF8(const std::string& s_in, - const char* loc) -> std::vector { +auto Utils::UnicodeFromUTF8(const std::string& s_in, const char* loc) + -> std::vector { std::string s = GetValidUTF8(s_in.c_str(), loc); // worst case every char is a character (plus trailing 0) std::vector vals(s.size() + 1); diff --git a/src/ballistica/shared/generic/utils.h b/src/ballistica/shared/generic/utils.h index 1d969586..db5088ae 100644 --- a/src/ballistica/shared/generic/utils.h +++ b/src/ballistica/shared/generic/utils.h @@ -48,8 +48,8 @@ class Utils { /// control characters). static auto StripNonAsciiFromUTF8(const std::string& s) -> std::string; - static auto UnicodeFromUTF8(const std::string& s, - const char* loc) -> std::vector; + static auto UnicodeFromUTF8(const std::string& s, const char* loc) + -> std::vector; static auto UTF8FromUnicode(std::vector unichars) -> std::string; static auto UTF8FromUnicodeChar(uint32_t c) -> std::string; static auto UTF8StringLength(const char* val) -> int; diff --git a/src/ballistica/shared/math/matrix44f.cc b/src/ballistica/shared/math/matrix44f.cc index f2e093a4..46d08c3e 100644 --- a/src/ballistica/shared/math/matrix44f.cc +++ b/src/ballistica/shared/math/matrix44f.cc @@ -57,8 +57,8 @@ auto Matrix44fRotate(float azimuth, float elevation) -> Matrix44f { return rotate; } -auto Matrix44fOrient(const Vector3f& x, const Vector3f& y, - const Vector3f& z) -> Matrix44f { +auto Matrix44fOrient(const Vector3f& x, const Vector3f& y, const Vector3f& z) + -> Matrix44f { Matrix44f orient{kMatrix44fIdentity}; orient.set(0, 0, x.x); @@ -76,8 +76,8 @@ auto Matrix44fOrient(const Vector3f& x, const Vector3f& y, return orient; } -auto Matrix44fOrient(const Vector3f& direction, - const Vector3f& up) -> Matrix44f { +auto Matrix44fOrient(const Vector3f& direction, const Vector3f& up) + -> Matrix44f { assert(direction.LengthSquared() > 0.0f); assert(up.LengthSquared() > 0.0f); diff --git a/src/ballistica/shared/math/matrix44f.h b/src/ballistica/shared/math/matrix44f.h index 20b321b0..e8bcd52c 100644 --- a/src/ballistica/shared/math/matrix44f.h +++ b/src/ballistica/shared/math/matrix44f.h @@ -161,8 +161,8 @@ inline auto Matrix44fTranslate(const Vector3f& trans) -> Matrix44f { return translate; } -inline auto Matrix44fTranslate(const float x, const float y, - const float z) -> Matrix44f { +inline auto Matrix44fTranslate(const float x, const float y, const float z) + -> Matrix44f { Matrix44f translate{kMatrix44fIdentity}; translate.set(3, 0, x); translate.set(3, 1, y); @@ -188,12 +188,12 @@ inline auto Matrix44fScale(const Vector3f& sf) -> Matrix44f { auto Matrix44fRotate(const Vector3f& axis, float angle) -> Matrix44f; auto Matrix44fRotate(float azimuth, float elevation) -> Matrix44f; -auto Matrix44fOrient(const Vector3f& x, const Vector3f& y, - const Vector3f& z) -> Matrix44f; +auto Matrix44fOrient(const Vector3f& x, const Vector3f& y, const Vector3f& z) + -> Matrix44f; // Note: direction and up need to be perpendicular and normalized here. -auto Matrix44fOrient(const Vector3f& direction, - const Vector3f& up) -> Matrix44f; +auto Matrix44fOrient(const Vector3f& direction, const Vector3f& up) + -> Matrix44f; auto Matrix44fFrustum(float left, float right, float bottom, float top, float near, float far) -> Matrix44f; diff --git a/src/ballistica/shared/networking/sockaddr.cc b/src/ballistica/shared/networking/sockaddr.cc index 6dd5b190..af4c5dab 100644 --- a/src/ballistica/shared/networking/sockaddr.cc +++ b/src/ballistica/shared/networking/sockaddr.cc @@ -9,7 +9,7 @@ SockAddr::SockAddr(const std::string& addr, int port) { // Try ipv4 and then ipv6. { - struct in_addr addr_out {}; + struct in_addr addr_out{}; int result = inet_pton(AF_INET, addr.c_str(), &addr_out); if (result == 1) { auto* a = reinterpret_cast(&addr_); @@ -18,7 +18,7 @@ SockAddr::SockAddr(const std::string& addr, int port) { a->sin_addr = addr_out; return; } else { - struct in6_addr addr6_out {}; + struct in6_addr addr6_out{}; result = inet_pton(AF_INET6, addr.c_str(), &addr6_out); if (result == 1) { auto* a = reinterpret_cast(&addr_); diff --git a/src/ballistica/shared/python/python_class.cc b/src/ballistica/shared/python/python_class.cc index 1e652df3..b6530162 100644 --- a/src/ballistica/shared/python/python_class.cc +++ b/src/ballistica/shared/python/python_class.cc @@ -35,8 +35,8 @@ auto PythonClass::TypeIsSetUp(PyTypeObject* cls) -> bool { return Py_REFCNT(cls) > 0; } -auto PythonClass::tp_new(PyTypeObject* type, PyObject* args, - PyObject* kwds) -> PyObject* { +auto PythonClass::tp_new(PyTypeObject* type, PyObject* args, PyObject* kwds) + -> PyObject* { // Simply allocating and returning a zeroed instance of our class here. // If subclasses need to construct/destruct any other values in the object // they can either do it manually here and in tp_dealloc *or* they can get @@ -57,8 +57,8 @@ auto PythonClass::tp_getattro(PythonClass* node, PyObject* attr) -> PyObject* { BA_PYTHON_CATCH; } -auto PythonClass::tp_setattro(PythonClass* node, PyObject* attr, - PyObject* val) -> int { +auto PythonClass::tp_setattro(PythonClass* node, PyObject* attr, PyObject* val) + -> int { BA_PYTHON_TRY; return PyObject_GenericSetAttr(reinterpret_cast(node), attr, val); BA_PYTHON_INT_CATCH; diff --git a/src/ballistica/shared/python/python_class.h b/src/ballistica/shared/python/python_class.h index 5036a08e..572fea36 100644 --- a/src/ballistica/shared/python/python_class.h +++ b/src/ballistica/shared/python/python_class.h @@ -35,12 +35,12 @@ class PythonClass { private: static auto tp_repr(PythonClass* self) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* kwds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* kwds) + -> PyObject*; static void tp_dealloc(PythonClass* self); static auto tp_getattro(PythonClass* node, PyObject* attr) -> PyObject*; - static auto tp_setattro(PythonClass* node, PyObject* attr, - PyObject* val) -> int; + static auto tp_setattro(PythonClass* node, PyObject* attr, PyObject* val) + -> int; }; } // namespace ballistica diff --git a/src/ballistica/shared/python/python_command.cc b/src/ballistica/shared/python/python_command.cc index 68cf3275..ab04999f 100644 --- a/src/ballistica/shared/python/python_command.cc +++ b/src/ballistica/shared/python/python_command.cc @@ -97,8 +97,8 @@ auto PythonCommand::CanEval() -> bool { return true; } -auto PythonCommand::Exec(bool print_errors, PyObject* globals, - PyObject* locals) -> bool { +auto PythonCommand::Exec(bool print_errors, PyObject* globals, PyObject* locals) + -> bool { assert(Python::HaveGIL()); // If we're being used before core is up, we need both global and @@ -163,8 +163,8 @@ auto PythonCommand::Exec(bool print_errors, PyObject* globals, return false; } -auto PythonCommand::Eval(bool print_errors, PyObject* globals, - PyObject* locals) -> PythonRef { +auto PythonCommand::Eval(bool print_errors, PyObject* globals, PyObject* locals) + -> PythonRef { assert(Python::HaveGIL()); assert(!dead_); diff --git a/src/ballistica/shared/python/python_command.h b/src/ballistica/shared/python/python_command.h index bf712080..a0a34704 100644 --- a/src/ballistica/shared/python/python_command.h +++ b/src/ballistica/shared/python/python_command.h @@ -46,8 +46,8 @@ class PythonCommand { /// Run the command and return the result as a new Python reference. /// Only works for eval-able commands. /// Returns nullptr on errors, but Python error state will be cleared. - auto Eval(bool print_errors, PyObject* globals, - PyObject* locals) -> PythonRef; + auto Eval(bool print_errors, PyObject* globals, PyObject* locals) + -> PythonRef; void PrintContext(); diff --git a/src/ballistica/shared/python/python_ref.cc b/src/ballistica/shared/python/python_ref.cc index b209a561..eb74d121 100644 --- a/src/ballistica/shared/python/python_ref.cc +++ b/src/ballistica/shared/python/python_ref.cc @@ -277,8 +277,8 @@ auto PythonRef::UnicodeCheck() const -> bool { return static_cast(PyUnicode_Check(obj_)); } -static inline auto _HandleCallResults(PyObject* out, - bool print_errors) -> PyObject* { +static inline auto _HandleCallResults(PyObject* out, bool print_errors) + -> PyObject* { if (!out) { if (print_errors) { // Save/restore error or it can mess with context print calls. @@ -297,8 +297,8 @@ static inline auto _HandleCallResults(PyObject* out, return out; } -auto PythonRef::Call(PyObject* args, PyObject* keywds, - bool print_errors) const -> PythonRef { +auto PythonRef::Call(PyObject* args, PyObject* keywds, bool print_errors) const + -> PythonRef { assert(obj_); assert(Python::HaveGIL()); assert(CallableCheck()); @@ -319,8 +319,8 @@ auto PythonRef::Call(bool print_errors) const -> PythonRef { return out ? PythonRef(out, PythonRef::kSteal) : PythonRef(); } -auto PythonRef::Call(const Vector2f& val, - bool print_errors) const -> PythonRef { +auto PythonRef::Call(const Vector2f& val, bool print_errors) const + -> PythonRef { assert(Python::HaveGIL()); PythonRef args(Py_BuildValue("((ff))", val.x, val.y), PythonRef::kSteal); return Call(args.Get(), nullptr, print_errors); diff --git a/src/ballistica/template_fs/python/class/python_class_hello.h b/src/ballistica/template_fs/python/class/python_class_hello.h index d717da9b..e2e3f28d 100644 --- a/src/ballistica/template_fs/python/class/python_class_hello.h +++ b/src/ballistica/template_fs/python/class/python_class_hello.h @@ -33,8 +33,8 @@ class PythonClassHello : public PythonClass { PythonClassHello(); ~PythonClassHello(); static PyMethodDef tp_methods[]; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassHello* self); static auto TestMethod(PythonClassHello* self, PyObject* args, PyObject* keywds) -> PyObject*; diff --git a/src/ballistica/template_fs/python/methods/python_methods_template_fs.cc b/src/ballistica/template_fs/python/methods/python_methods_template_fs.cc index a644e4e9..2e0015ad 100644 --- a/src/ballistica/template_fs/python/methods/python_methods_template_fs.cc +++ b/src/ballistica/template_fs/python/methods/python_methods_template_fs.cc @@ -9,8 +9,8 @@ namespace ballistica::template_fs { // -------------------------- hello_again_world -------------------------------- -static auto PyHelloAgainWorld(PyObject* self, PyObject* args, - PyObject* keywds) -> PyObject* { +static auto PyHelloAgainWorld(PyObject* self, PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; const char* name; static const char* kwlist[] = {nullptr}; diff --git a/src/ballistica/ui_v1/python/class/python_class_ui_mesh.h b/src/ballistica/ui_v1/python/class/python_class_ui_mesh.h index 49ce22a0..09edebc9 100644 --- a/src/ballistica/ui_v1/python/class/python_class_ui_mesh.h +++ b/src/ballistica/ui_v1/python/class/python_class_ui_mesh.h @@ -39,8 +39,8 @@ class PythonClassUIMesh : public PythonClass { private: static PyMethodDef tp_methods[]; static auto tp_repr(PythonClassUIMesh* self) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassUIMesh* self); Object::Ref* mesh_; }; diff --git a/src/ballistica/ui_v1/python/class/python_class_ui_sound.h b/src/ballistica/ui_v1/python/class/python_class_ui_sound.h index 1dfcb57e..50aefb51 100644 --- a/src/ballistica/ui_v1/python/class/python_class_ui_sound.h +++ b/src/ballistica/ui_v1/python/class/python_class_ui_sound.h @@ -39,13 +39,13 @@ class PythonClassUISound : public PythonClass { private: static PyMethodDef tp_methods[]; static auto tp_repr(PythonClassUISound* self) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassUISound* self); - static auto Play(PythonClassUISound* self, PyObject* args, - PyObject* keywds) -> PyObject*; - static auto Stop(PythonClassUISound* self, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto Play(PythonClassUISound* self, PyObject* args, PyObject* keywds) + -> PyObject*; + static auto Stop(PythonClassUISound* self, PyObject* args, PyObject* keywds) + -> PyObject*; Object::Ref* sound_; bool playing_; diff --git a/src/ballistica/ui_v1/python/class/python_class_ui_texture.h b/src/ballistica/ui_v1/python/class/python_class_ui_texture.h index b50815c9..56e720b6 100644 --- a/src/ballistica/ui_v1/python/class/python_class_ui_texture.h +++ b/src/ballistica/ui_v1/python/class/python_class_ui_texture.h @@ -40,8 +40,8 @@ class PythonClassUITexture : public PythonClass { private: static PyMethodDef tp_methods[]; static auto tp_repr(PythonClassUITexture* self) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassUITexture* self); Object::Ref* texture_; }; diff --git a/src/ballistica/ui_v1/python/class/python_class_widget.cc b/src/ballistica/ui_v1/python/class/python_class_widget.cc index 57978903..62b879be 100644 --- a/src/ballistica/ui_v1/python/class/python_class_widget.cc +++ b/src/ballistica/ui_v1/python/class/python_class_widget.cc @@ -90,8 +90,8 @@ auto PythonClassWidget::GetWidget() const -> Widget* { return w; } -auto PythonClassWidget::tp_getattro(PythonClassWidget* self, - PyObject* attr) -> PyObject* { +auto PythonClassWidget::tp_getattro(PythonClassWidget* self, PyObject* attr) + -> PyObject* { BA_PYTHON_TRY; BA_PRECONDITION(g_base->InLogicThread()); @@ -312,8 +312,8 @@ auto PythonClassWidget::Delete(PythonClassWidget* self, PyObject* args, } auto PythonClassWidget::AddDeleteCallback(PythonClassWidget* self, - PyObject* args, - PyObject* keywds) -> PyObject* { + PyObject* args, PyObject* keywds) + -> PyObject* { BA_PYTHON_TRY; PyObject* call_obj; static const char* kwlist[] = {"call", nullptr}; diff --git a/src/ballistica/ui_v1/python/class/python_class_widget.h b/src/ballistica/ui_v1/python/class/python_class_widget.h index e38fd152..b4e98409 100644 --- a/src/ballistica/ui_v1/python/class/python_class_widget.h +++ b/src/ballistica/ui_v1/python/class/python_class_widget.h @@ -23,8 +23,8 @@ class PythonClassWidget : public PythonClass { private: static PyMethodDef tp_methods[]; static auto tp_repr(PythonClassWidget* self) -> PyObject*; - static auto tp_new(PyTypeObject* type, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto tp_new(PyTypeObject* type, PyObject* args, PyObject* keywds) + -> PyObject*; static void tp_dealloc(PythonClassWidget* self); static auto tp_getattro(PythonClassWidget* self, PyObject* attr) -> PyObject*; static auto tp_setattro(PythonClassWidget* self, PyObject* attr, @@ -35,8 +35,8 @@ class PythonClassWidget : public PythonClass { static auto GetChildren(PythonClassWidget* self) -> PyObject*; static auto GetSelectedChild(PythonClassWidget* self) -> PyObject*; static auto GetScreenSpaceCenter(PythonClassWidget* self) -> PyObject*; - static auto Delete(PythonClassWidget* self, PyObject* args, - PyObject* keywds) -> PyObject*; + static auto Delete(PythonClassWidget* self, PyObject* args, PyObject* keywds) + -> PyObject*; static auto AddDeleteCallback(PythonClassWidget* self, PyObject* args, PyObject* keywds) -> PyObject*; Object::WeakRef* widget_; 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 b594da2c..0edfcf5b 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 @@ -457,7 +457,8 @@ static PyMethodDef PyButtonWidgetDef = { (PyCFunction)PyButtonWidget, // method METH_VARARGS | METH_KEYWORDS, // flags - "buttonwidget(edit: bauiv1.Widget | None = None,\n" + "buttonwidget(*,\n" + " edit: bauiv1.Widget | None = None,\n" " parent: bauiv1.Widget | None = None,\n" " size: Sequence[float] | None = None,\n" " position: Sequence[float] | None = None,\n" @@ -653,7 +654,8 @@ static PyMethodDef PyCheckBoxWidgetDef = { (PyCFunction)PyCheckBoxWidget, // method METH_VARARGS | METH_KEYWORDS, // flags - "checkboxwidget(edit: bauiv1.Widget | None = None,\n" + "checkboxwidget(*,\n" + " edit: bauiv1.Widget | None = None,\n" " parent: bauiv1.Widget | None = None,\n" " size: Sequence[float] | None = None,\n" " position: Sequence[float] | None = None,\n" @@ -853,7 +855,8 @@ static PyMethodDef PyImageWidgetDef = { (PyCFunction)PyImageWidget, // method METH_VARARGS | METH_KEYWORDS, // flags - "imagewidget(edit: bauiv1.Widget | None = None,\n" + "imagewidget(*,\n" + " edit: bauiv1.Widget | None = None,\n" " parent: bauiv1.Widget | None = None,\n" " size: Sequence[float] | None = None,\n" " position: Sequence[float] | None = None,\n" @@ -1038,7 +1041,8 @@ static PyMethodDef PyColumnWidgetDef = { (PyCFunction)PyColumnWidget, // method METH_VARARGS | METH_KEYWORDS, // flags - "columnwidget(edit: bauiv1.Widget | None = None,\n" + "columnwidget(*,\n" + " edit: bauiv1.Widget | None = None,\n" " parent: bauiv1.Widget | None = None,\n" " size: Sequence[float] | None = None,\n" " position: Sequence[float] | None = None,\n" @@ -1364,7 +1368,8 @@ static PyMethodDef PyContainerWidgetDef = { (PyCFunction)PyContainerWidget, // method METH_VARARGS | METH_KEYWORDS, // flags - "containerwidget(edit: bauiv1.Widget | None = None,\n" + "containerwidget(*,\n" + " edit: bauiv1.Widget | None = None,\n" " parent: bauiv1.Widget | None = None,\n" " size: Sequence[float] | None = None,\n" " position: Sequence[float] | None = None,\n" @@ -1704,7 +1709,8 @@ static PyMethodDef PyScrollWidgetDef = { (PyCFunction)PyScrollWidget, // method METH_VARARGS | METH_KEYWORDS, // flags - "scrollwidget(edit: bauiv1.Widget | None = None,\n" + "scrollwidget(*,\n" + " edit: bauiv1.Widget | None = None,\n" " parent: bauiv1.Widget | None = None,\n" " size: Sequence[float] | None = None,\n" " position: Sequence[float] | None = None,\n" @@ -1885,7 +1891,8 @@ static PyMethodDef PyHScrollWidgetDef = { (PyCFunction)PyHScrollWidget, // method METH_VARARGS | METH_KEYWORDS, // flags - "hscrollwidget(edit: bauiv1.Widget | None = None,\n" + "hscrollwidget(*,\n" + " edit: bauiv1.Widget | None = None,\n" " parent: bauiv1.Widget | None = None,\n" " size: Sequence[float] | None = None,\n" " position: Sequence[float] | None = None,\n" @@ -2258,7 +2265,8 @@ static PyMethodDef PyTextWidgetDef = { (PyCFunction)PyTextWidget, // method METH_VARARGS | METH_KEYWORDS, // flags - "textwidget(edit: bauiv1.Widget | None = None,\n" + "textwidget(*,\n" + " edit: bauiv1.Widget | None = None,\n" " parent: bauiv1.Widget | None = None,\n" " size: Sequence[float] | None = None,\n" " position: Sequence[float] | None = None,\n" @@ -2417,7 +2425,8 @@ static PyMethodDef PyWidgetDef = { (PyCFunction)PyWidgetCall, // method METH_VARARGS | METH_KEYWORDS, // flags - "widget(edit: bauiv1.Widget,\n" + "widget(*,\n" + " edit: bauiv1.Widget,\n" " up_widget: bauiv1.Widget | None = None,\n" " down_widget: bauiv1.Widget | None = None,\n" " left_widget: bauiv1.Widget | None = None,\n" diff --git a/src/ballistica/ui_v1/widget/container_widget.cc b/src/ballistica/ui_v1/widget/container_widget.cc index baa3f225..63873e1a 100644 --- a/src/ballistica/ui_v1/widget/container_widget.cc +++ b/src/ballistica/ui_v1/widget/container_widget.cc @@ -697,8 +697,8 @@ auto ContainerWidget::HandleMessage(const base::WidgetMessage& m) -> bool { return claimed; } -auto ContainerWidget::GetMult(millisecs_t current_time, - bool for_glow) const -> float { +auto ContainerWidget::GetMult(millisecs_t current_time, bool for_glow) const + -> float { if (root_selectable_ && selected()) { float m; diff --git a/tools/batools/assetsmakefile.py b/tools/batools/assetsmakefile.py index 75f993a9..0092873c 100755 --- a/tools/batools/assetsmakefile.py +++ b/tools/batools/assetsmakefile.py @@ -29,6 +29,7 @@ def _get_targets( ) -> str: """Generic function to map source extension to dst files.""" # pylint: disable=too-many-locals + # pylint: disable=too-many-positional-arguments src = ASSETS_SRC dst = BUILD_DIR @@ -66,6 +67,7 @@ def _get_py_targets( all_targets: set[str], subset: str, ) -> None: + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-branches # pylint: disable=too-many-locals # pylint: disable=too-many-statements @@ -213,6 +215,7 @@ def _get_py_targets_subset( suffix: str, ) -> str: # pylint: disable=too-many-locals + # pylint: disable=too-many-positional-arguments if subset == 'public_tools': src = 'tools' dst = f'{BUILD_DIR}/ba_data/python' diff --git a/tools/batools/docker.py b/tools/batools/docker.py index 68d6c5d6..70526764 100644 --- a/tools/batools/docker.py +++ b/tools/batools/docker.py @@ -8,6 +8,7 @@ import subprocess def _docker_build( image_name: str, dockerfile_dir: str, + *, cmake_build_type: str | None = None, labels: dict[str, str] | None = None, platform: str | None = None, diff --git a/tools/batools/project/_updater.py b/tools/batools/project/_updater.py index 31959b55..23d058a0 100755 --- a/tools/batools/project/_updater.py +++ b/tools/batools/project/_updater.py @@ -45,6 +45,7 @@ class ProjectUpdater: def __init__( self, projroot: str, + *, check: bool, fix: bool, empty: bool = False, diff --git a/tools/batools/spinoff/_context.py b/tools/batools/spinoff/_context.py index e6f7313c..53faef2d 100644 --- a/tools/batools/spinoff/_context.py +++ b/tools/batools/spinoff/_context.py @@ -62,6 +62,7 @@ class SpinoffContext: src_root: str, dst_root: str, mode: Mode, + *, force: bool = False, verbose: bool = False, print_full_lists: bool = False, @@ -1210,6 +1211,8 @@ class SpinoffContext: dst_path_full: str, key: str, ) -> None: + # pylint: disable=too-many-positional-arguments + # Ick; dst changed. Now the only way we allow # the delete is if we can re-filter its src # and come up with the same dst again @@ -1526,11 +1529,13 @@ class SpinoffContext: dst_path_full: str, display_diff_cmd: str, ) -> None: + # pylint: disable=too-many-positional-arguments + if os.path.isfile(src_path_full) and os.path.isfile(dst_path_full): - # We want to show how this update would change the dst - # file, so we need to compare a filtered version of src - # to the existing dst. For non-filtered src files we - # can just do a direct compare + # We want to show how this update would change the dst file, + # so we need to compare a filtered version of src to the + # existing dst. For non-filtered src files we can just do a + # direct compare delete_file_name: str | None if self._should_filter_src_file(src_path): with tempfile.NamedTemporaryFile('wb', delete=False) as tmpf: @@ -1612,9 +1617,9 @@ class SpinoffContext: # For project-updater to do its thing, we need to provide # filtered source versions of *all* project files which - # might be changing. (Some project files may implicitly generate - # others as part of their own generation so we need all sources - # in place before any generation happens). + # might be changing. (Some project files may implicitly + # generate others as part of their own generation so we need + # all sources in place before any generation happens). for src_path in project_src_paths: self._handle_src_copy_project_updater_register(src_path) @@ -1758,7 +1763,7 @@ class SpinoffContext: src_entity: SrcEntity, is_project_file: bool, ) -> DstEntity: - # del dst_path # Unused. + # pylint: disable=too-many-positional-arguments # If this is a project file, we already fed the filtered # src into our ProjectUpdater instance, so all we do here is @@ -2041,6 +2046,7 @@ class SpinoffContext: dst_entity: DstEntity, dst_exists: bool, ) -> None: + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-branches # pylint: disable=too-many-statements # pylint: disable=too-many-locals diff --git a/tools/batools/xcodeproject.py b/tools/batools/xcodeproject.py index c26042f8..8c6132c7 100644 --- a/tools/batools/xcodeproject.py +++ b/tools/batools/xcodeproject.py @@ -35,6 +35,7 @@ def update_xcode_project( force: bool = False, ) -> str: """Given an xcode project, update it for the current set of files.""" + # pylint: disable=too-many-positional-arguments suffixes = ['.cc', '.h', '.m', '.mm', '.swift'] updater = Updater( @@ -63,8 +64,8 @@ class Updater: existing_data: str, sources: list[str], projname: str, - # has_app_delegate_mm: bool = False, ) -> None: + # pylint: disable=too-many-positional-arguments if not path.endswith('.xcodeproj'): raise RuntimeError(f"Path does not end in .xcodeproj: '{path}'.") @@ -73,7 +74,6 @@ class Updater: self.existing_data = existing_data self.sources = sources self.project = None - # self.has_app_delegate_mm = has_app_delegate_mm # Project name variations. self.pnameu = projname diff --git a/tools/efro/dataclassio/_api.py b/tools/efro/dataclassio/_api.py index 7475cbab..5e7aee34 100644 --- a/tools/efro/dataclassio/_api.py +++ b/tools/efro/dataclassio/_api.py @@ -99,6 +99,7 @@ def dataclass_to_json( def dataclass_from_dict( cls: type[T], values: dict, + *, codec: Codec = Codec.JSON, coerce_to_float: bool = True, allow_unknown_attrs: bool = True, diff --git a/tools/efro/dataclassio/_base.py b/tools/efro/dataclassio/_base.py index 246b04e7..d0743ab4 100644 --- a/tools/efro/dataclassio/_base.py +++ b/tools/efro/dataclassio/_base.py @@ -180,6 +180,7 @@ class IOAttrs: def __init__( self, storagename: str | None = storagename, + *, store_default: bool = store_default, whole_days: bool = whole_days, whole_hours: bool = whole_hours, diff --git a/tools/efro/dataclassio/_inputter.py b/tools/efro/dataclassio/_inputter.py index a9c2f1bb..1fb6ee72 100644 --- a/tools/efro/dataclassio/_inputter.py +++ b/tools/efro/dataclassio/_inputter.py @@ -41,6 +41,7 @@ class _Inputter: def __init__( self, cls: type[Any], + *, codec: Codec, coerce_to_float: bool, allow_unknown_attrs: bool = True, @@ -110,6 +111,7 @@ class _Inputter: ioattrs: IOAttrs | None, ) -> Any: """Convert an assigned value to what a dataclass field expects.""" + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-return-statements # pylint: disable=too-many-branches @@ -413,6 +415,7 @@ class _Inputter: value: Any, ioattrs: IOAttrs | None, ) -> Any: + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-branches # pylint: disable=too-many-locals @@ -533,6 +536,7 @@ class _Inputter: seqtype: type, ioattrs: IOAttrs | None, ) -> Any: + # pylint: disable=too-many-positional-arguments # Because we are json-centric, we expect a list for all sequences. if type(value) is not list: raise TypeError( @@ -582,6 +586,7 @@ class _Inputter: value: Any, ioattrs: IOAttrs | None, ) -> Any: + # pylint: disable=too-many-positional-arguments out: list = [] # Because we are json-centric, we expect a list for all sequences. diff --git a/tools/efro/dataclassio/_outputter.py b/tools/efro/dataclassio/_outputter.py index 5442efae..df6b72ab 100644 --- a/tools/efro/dataclassio/_outputter.py +++ b/tools/efro/dataclassio/_outputter.py @@ -40,6 +40,7 @@ class _Outputter: def __init__( self, obj: Any, + *, create: bool, codec: Codec, coerce_to_float: bool, @@ -192,6 +193,7 @@ class _Outputter: value: Any, ioattrs: IOAttrs | None, ) -> Any: + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-return-statements # pylint: disable=too-many-branches # pylint: disable=too-many-statements @@ -512,6 +514,7 @@ class _Outputter: value: dict, ioattrs: IOAttrs | None, ) -> Any: + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-branches if not isinstance(value, dict): raise TypeError( diff --git a/tools/efro/dataclassio/_prep.py b/tools/efro/dataclassio/_prep.py index 8321dbdc..68bcaa37 100644 --- a/tools/efro/dataclassio/_prep.py +++ b/tools/efro/dataclassio/_prep.py @@ -261,6 +261,7 @@ class PrepSession: recursion_level: int, ) -> None: """Run prep on a dataclass.""" + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-return-statements # pylint: disable=too-many-branches # pylint: disable=too-many-statements diff --git a/tools/efro/debug.py b/tools/efro/debug.py index 01a3f778..6afeb65b 100644 --- a/tools/efro/debug.py +++ b/tools/efro/debug.py @@ -312,6 +312,7 @@ def _desc(obj: Any) -> str: def _printrefs( obj: Any, + *, level: int, max_level: int, exclude_objs: list, diff --git a/tools/efro/log.py b/tools/efro/log.py index 3e1326ca..f681fab9 100644 --- a/tools/efro/log.py +++ b/tools/efro/log.py @@ -126,6 +126,7 @@ class LogHandler(logging.Handler): def __init__( self, + *, path: str | Path | None, echofile: TextIO | None, suppress_non_root_debug: bool, @@ -447,6 +448,7 @@ class LogHandler(logging.Handler): message: str | logging.LogRecord, labels: dict[str, str], ) -> None: + # pylint: disable=too-many-positional-arguments try: # If they passed a raw record here, bake it down to a string. if isinstance(message, logging.LogRecord): @@ -678,6 +680,7 @@ class FileLogEcho: def setup_logging( log_path: str | Path | None, level: LogLevel, + *, suppress_non_root_debug: bool = False, log_stdout_stderr: bool = False, echo_to_stderr: bool = True, @@ -710,7 +713,7 @@ def setup_logging( # won't themselves be intercepted and sent to the logger # which would create an infinite loop. loghandler = LogHandler( - log_path, + path=log_path, echofile=sys.stderr if echo_to_stderr else None, suppress_non_root_debug=suppress_non_root_debug, cache_size_limit=cache_size_limit, diff --git a/tools/efro/message/_module.py b/tools/efro/message/_module.py index 2fa91fa2..db96f3b7 100644 --- a/tools/efro/message/_module.py +++ b/tools/efro/message/_module.py @@ -19,6 +19,7 @@ def create_sender_module( protocol_create_code: str, enable_sync_sends: bool, enable_async_sends: bool, + *, private: bool = False, protocol_module_level_import_code: str | None = None, build_time_protocol_create_code: str | None = None, @@ -61,6 +62,7 @@ def create_receiver_module( basename: str, protocol_create_code: str, is_async: bool, + *, private: bool = False, protocol_module_level_import_code: str | None = None, build_time_protocol_create_code: str | None = None, diff --git a/tools/efro/message/_protocol.py b/tools/efro/message/_protocol.py index 928d1fa7..4e3e1ccd 100644 --- a/tools/efro/message/_protocol.py +++ b/tools/efro/message/_protocol.py @@ -42,6 +42,7 @@ class MessageProtocol: self, message_types: dict[int, type[Message]], response_types: dict[int, type[Response]], + *, forward_communication_errors: bool = False, forward_clean_errors: bool = False, remote_errors_include_stack_traces: bool = False, @@ -414,6 +415,7 @@ class MessageProtocol: protocol_module_level_import_code: str | None = None, ) -> str: """Used by create_sender_module(); do not call directly.""" + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-locals # pylint: disable=too-many-branches import textwrap @@ -531,6 +533,7 @@ class MessageProtocol: ) -> str: """Used by create_receiver_module(); do not call directly.""" # pylint: disable=too-many-locals + # pylint: disable=too-many-positional-arguments import textwrap desc = 'asynchronous' if is_async else 'synchronous' diff --git a/tools/efro/rpc.py b/tools/efro/rpc.py index 9acfab04..e4477cb3 100644 --- a/tools/efro/rpc.py +++ b/tools/efro/rpc.py @@ -180,6 +180,7 @@ class RPCEndpoint: reader: asyncio.StreamReader, writer: asyncio.StreamWriter, label: str, + *, debug_print: bool = False, debug_print_io: bool = False, debug_print_call: Callable[[str], None] | None = None, @@ -426,6 +427,7 @@ class RPCEndpoint: bytes_awaitable: asyncio.Task[bytes], message_id: int, ) -> bytes: + # pylint: disable=too-many-positional-arguments # We need to know their protocol, so if we haven't gotten a handshake # from them yet, just wait. while self._peer_info is None: diff --git a/tools/efro/util.py b/tools/efro/util.py index b01576b8..3c8a7851 100644 --- a/tools/efro/util.py +++ b/tools/efro/util.py @@ -190,6 +190,7 @@ class DirtyBit: self, dirty: bool = False, retry_interval: float = 5.0, + *, use_lock: bool = False, auto_dirty_seconds: float | None = None, min_update_interval: float | None = None, diff --git a/tools/efrotools/code.py b/tools/efrotools/code.py index 57e83275..4449a28d 100644 --- a/tools/efrotools/code.py +++ b/tools/efrotools/code.py @@ -882,6 +882,7 @@ def _run_idea_inspections( Throw an Exception if anything is found or goes wrong. """ + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-locals # pylint: disable=consider-using-with @@ -957,6 +958,7 @@ def _run_idea_inspections_cached( inspectdir: Path | None = None, ) -> None: # pylint: disable=too-many-locals + # pylint: disable=too-many-positional-arguments import hashlib import json diff --git a/tools/efrotools/emacs.py b/tools/efrotools/emacs.py index ffbc7b81..9ee995f0 100644 --- a/tools/efrotools/emacs.py +++ b/tools/efrotools/emacs.py @@ -31,6 +31,7 @@ def py_examine( operation: str, ) -> None: """Given file position info, performs some code inspection.""" + # pylint: disable=too-many-positional-arguments # pylint: disable=too-many-locals # pylint: disable=cyclic-import import astroid diff --git a/tools/efrotools/genwrapper.py b/tools/efrotools/genwrapper.py index 9d1d8bea..6c0cdd09 100644 --- a/tools/efrotools/genwrapper.py +++ b/tools/efrotools/genwrapper.py @@ -42,6 +42,14 @@ if __name__ == '__main__': if public else get_non_public_legal_notice() ) + + # For some reason 'contents' is triggering Constant-name-not-uppercase + # errors only in spinoff projects. + + # pylint: disable=useless-suppression + # pylint: disable=invalid-name + # pylint: enable=useless-suppression + contents = ( f'#!{pybinpath}\n' f'# {legalnotice}\n' diff --git a/tools/efrotools/lazybuild.py b/tools/efrotools/lazybuild.py index f61581dc..e9e29cfe 100644 --- a/tools/efrotools/lazybuild.py +++ b/tools/efrotools/lazybuild.py @@ -48,6 +48,7 @@ class LazyBuildContext: target: str, srcpaths: list[str], command: str, + *, buildlockname: str | None = None, dirfilter: Callable[[str, str], bool] | None = None, filefilter: Callable[[str, str], bool] | None = None, diff --git a/tools/efrotools/message.py b/tools/efrotools/message.py index 113375cf..c5251d9d 100644 --- a/tools/efrotools/message.py +++ b/tools/efrotools/message.py @@ -15,6 +15,7 @@ if TYPE_CHECKING: def standard_message_sender_gen_pcommand( + *, projroot: Path, basename: str, source_module: str, @@ -84,6 +85,7 @@ def standard_message_sender_gen_pcommand( def standard_message_receiver_gen_pcommand( + *, projroot: Path, basename: str, source_module: str, diff --git a/tools/efrotools/util.py b/tools/efrotools/util.py index 72b7bc18..54de68bd 100644 --- a/tools/efrotools/util.py +++ b/tools/efrotools/util.py @@ -25,6 +25,7 @@ def replace_section( begin_marker: str, end_marker: str, replace_text: str = '', + *, keep_markers: bool = False, error_if_missing: bool = True, ) -> str: diff --git a/tools/efrotools/xcodebuild.py b/tools/efrotools/xcodebuild.py index e717076d..48d51973 100644 --- a/tools/efrotools/xcodebuild.py +++ b/tools/efrotools/xcodebuild.py @@ -970,6 +970,7 @@ class XCodeBuild: prefix_unexpected: bool = True, ) -> None: # pylint: disable=too-many-branches + # pylint: disable=too-many-positional-arguments if ignore_line_starts is None: ignore_line_starts = [] if ignore_line_start_tails is None: From f6973bac7cff656d749093e6407331f6f9fc928c Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 24 Sep 2024 11:33:09 -0700 Subject: [PATCH 2/7] UI is now properly saved/restored after games or appmode switches --- .efrocachemap | 56 ++++----- CHANGELOG.md | 5 +- .../ba_data/python/baclassic/_appmode.py | 7 +- .../ba_data/python/baclassic/_appsubsystem.py | 113 +++++------------- .../ba_data/python/baclassic/_benchmark.py | 27 +++-- src/assets/ba_data/python/baenv.py | 2 +- .../ba_data/python/bascenev1lib/mainmenu.py | 10 +- .../ba_data/python/bauiv1lib/benchmarks.py | 16 --- .../python/bauiv1lib/gather/manualtab.py | 5 + .../python/bauiv1lib/gather/nearbytab.py | 5 + .../python/bauiv1lib/gather/privatetab.py | 5 + .../python/bauiv1lib/gather/publictab.py | 4 + .../ba_data/python/bauiv1lib/partyqueue.py | 5 + .../ba_data/python/bauiv1lib/playoptions.py | 5 + src/assets/ba_data/python/bauiv1lib/watch.py | 4 + src/ballistica/shared/ballistica.cc | 2 +- 16 files changed, 123 insertions(+), 148 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index 12c0bce9..51c316f7 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": "aa72881174380859e777358af1da8d1f", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "bb5c1ca60d9683f2d24d4d8d35af9121", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "89a73b9312c48ed182d54263707a0982", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "f8e25d00480757c6fef0d125fbabe7d3", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "116a9fff16cc5cefd91d24415e9b09e7", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "01a542f1515ee659f99550c34ca2f749", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "16aa91530f2abea70f8c648db20872b9", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "5c19c58e3163c2b4c21eb1cde8f2712a", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "f3e54e879fe538a6f0e52c1833e03739", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "36b20cfad166d7229684cd0b88be0ca0", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "64bdc98a71e9bcb63999e7fb1c57722f", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "583086e11d495f3439bdd6029bde0466", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "701f03b8ba74493d935f795a84c13455", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "3e9f1feaf14d30f740d84280432cb236", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "31da2a14cc69755f3a8f68b17482832f", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "8ef21c1df9040fb8e2d38258dc80a4d5", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "74a0b75b877954015798a6289d26c26c", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "ed2b2f673f2ed41fc24613a937a954d9", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "16824b0155479f54293cb2230553d174", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "379f72d2ce79111490ba9c87087488f3", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "21a16533b62c491d0581609132c22dd5", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "fd60f24823b5fd2951acf06ad92d124b", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "87bba2b52609ee3ae31c2b1255218d93", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "bb123af5ef4bdede5248e4d0e086d623", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "78e44932b961f079ddf15fae69fed639", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "49210bd0982bf5eda8dd1074b0b26152", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "85fcee6b23abbf1c5a8e64fd95567b6e", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "6c881b22460cb58f93249bc9f7a95724", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "625390166d0eac624f14fc1688c638e7", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "66cfb48fb1975ca32a750754d16055eb", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "b459b77672b95838742903e0afd1d9ae", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "f17dd55c15904f515e53fc676658194f", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "b1a493c944b9e60a80482e0097699695", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "018ca530ee4e8eaf78c2ea50059f2da4", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "83ef6001e1ef561a33207c396a7dc8b0", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "a00d2cff684ae4df75e52159ead85824", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "775c7f67370eff8d333eda82a626531f", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "1fa9c1e758e790c263b45315b016fe11", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "8b9e532091efbf224cb410ebf66cfbcf", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "7fbbd61ecdcbb4a8e162b6045d2dcf53", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "086a2ce72497e44079ad6b747fc5439f", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", @@ -4132,14 +4132,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "4c11b81a574aa9af593f54db4d998e61", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "c6a3ce3f5dbfa705ef6d7e4b94bca8ed", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "61a4f8795d6cd96f90bc2bed25087bfe", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "0af969c789949825652e6b09020867b5", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "839ebfcfcbc87f4470b96f986485a4f6", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "b161b991f68d7fc5a23e1bbf3041693f", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "48add2ca39f42cf1129fd56deac471e1", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "bd7faaa40c5b448554d524d2d5fddeb1", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "d18d44e3e100240220523f4bc54f9d85", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "564675e2f00a311387a6e621f3b67332", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "93395e2263f9ed10160dd8e80811be77", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "24445c70a851b691690803c87af33c81", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "cf286af8eb7762893ee935e08975eb60", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "33b5f0f70ad2d8775dee1fd810f319e5", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "74a2c3fa9e709ca034a106d56c3b3e36", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "8d97d249be1218c6277dc1de54e5c6b8", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "892e10ddcf3b8f1dd83e5d0303594273", "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 245eaa46..f2adaa5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.37 (build 22009, api 9, 2024-09-23) +### 1.7.37 (build 22010, api 9, 2024-09-24) - 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. @@ -98,6 +98,9 @@ test UIScales are by using the UI panel in the dev-console or by setting the `BA_UI_SCALE` env var. If we can get UIScale switches to feel seamless enough at some point, it may be worth adding to display settings. +- There is now a `ba*.app.classic.save_ui_state()` method that should be called + right before jumping into a game/replay/etc. This will save a state that will + automatically be restored the next time the main menu activity is entered. ### 1.7.36 (build 21944, api 8, 2024-07-26) - Wired up Tokens, BombSquad's new purchasable currency. The first thing these diff --git a/src/assets/ba_data/python/baclassic/_appmode.py b/src/assets/ba_data/python/baclassic/_appmode.py index 10f2fc65..07bc250b 100644 --- a/src/assets/ba_data/python/baclassic/_appmode.py +++ b/src/assets/ba_data/python/baclassic/_appmode.py @@ -49,7 +49,6 @@ class ClassicAppMode(AppMode): @override def on_activate(self) -> None: - print('CLASSIC ACTIVATING') # Let the native layer do its thing. _baclassic.classic_app_mode_activate() @@ -110,7 +109,11 @@ class ClassicAppMode(AppMode): @override def on_deactivate(self) -> None: - print('CLASSIC DEACTIVATING') + + # Save where we were in the UI so we return there next time. + if app.classic is not None: + app.classic.save_ui_state() + # Let the native layer do its thing. _baclassic.classic_app_mode_deactivate() diff --git a/src/assets/ba_data/python/baclassic/_appsubsystem.py b/src/assets/ba_data/python/baclassic/_appsubsystem.py index f68b0bd4..6ac7bfb3 100644 --- a/src/assets/ba_data/python/baclassic/_appsubsystem.py +++ b/src/assets/ba_data/python/baclassic/_appsubsystem.py @@ -112,6 +112,7 @@ class ClassicAppSubsystem(babase.AppSubsystem): self.invite_confirm_windows: list[Any] = [] # FIXME: Don't use Any. self.party_window: weakref.ref[PartyWindow] | None = None self.main_menu_resume_callbacks: list = [] + self.saved_ui_state: bauiv1.MainWindowState | None = None # Store. self.store_layout: dict[str, list[dict[str, Any]]] | None = None @@ -327,6 +328,9 @@ class ClassicAppSubsystem(babase.AppSubsystem): ) return False + # Save where we are in the UI to come back to when done. + babase.app.classic.save_ui_state() + # Ok, we're good to go. self.coop_session_args = { 'campaign': campaignname, @@ -523,23 +527,17 @@ class ClassicAppSubsystem(babase.AppSubsystem): tip = self.tips.pop() return tip - def run_gpu_benchmark(self) -> None: - """Kick off a benchmark to test gpu speeds.""" - from baclassic._benchmark import run_gpu_benchmark as run - - run() - def run_cpu_benchmark(self) -> None: """Kick off a benchmark to test cpu speeds.""" - from baclassic._benchmark import run_cpu_benchmark as run + from baclassic._benchmark import run_cpu_benchmark - run() + run_cpu_benchmark() def run_media_reload_benchmark(self) -> None: """Kick off a benchmark to test media reloading speeds.""" - from baclassic._benchmark import run_media_reload_benchmark as run + from baclassic._benchmark import run_media_reload_benchmark - run() + run_media_reload_benchmark() def run_stress_test( self, @@ -551,9 +549,9 @@ class ClassicAppSubsystem(babase.AppSubsystem): attract_mode: bool = False, ) -> None: """Run a stress test.""" - from baclassic._benchmark import run_stress_test as run + from baclassic._benchmark import run_stress_test - run( + run_stress_test( playlist_type=playlist_type, playlist_name=playlist_name, player_count=player_count, @@ -819,11 +817,20 @@ class ClassicAppSubsystem(babase.AppSubsystem): InGameMenuWindow(), is_top_level=True, suppress_warning=True ) + def save_ui_state(self) -> None: + """Store our current place in the UI.""" + ui = babase.app.ui_v1 + mainwindow = ui.get_main_window() + if mainwindow is not None: + self.saved_ui_state = ui.save_main_window_state(mainwindow) + else: + self.saved_ui_state = None + def invoke_main_menu_ui(self) -> None: """Bring up main menu ui.""" - print('INVOKING MAIN MENU UI') - # Bring up the last place we were, or start at the main menu otherwise. + # Bring up the last place we were, or start at the main menu + # otherwise. app = bauiv1.app env = app.env with bascenev1.ContextRef.empty(): @@ -844,72 +851,16 @@ class ClassicAppSubsystem(babase.AppSubsystem): app.ui_v1.set_main_window( KioskWindow(), is_top_level=True, suppress_warning=True ) - # ..or in normal cases go back to the main menu else: - # if main_menu_location == 'Gather': - # # pylint: disable=cyclic-import - # from bauiv1lib.gather import GatherWindow + # If there's a saved ui state, restore that. + if self.saved_ui_state is not None: + app.ui_v1.restore_main_window_state(self.saved_ui_state) + else: + # Otherwise start fresh at the main menu. + from bauiv1lib.mainmenu import MainMenuWindow - # app.ui_v1.set_main_window( - # GatherWindow(transition=None), - # from_window=False, # Disable check here. - # ) - # elif main_menu_location == 'Watch': - # # pylint: disable=cyclic-import - # from bauiv1lib.watch import WatchWindow - - # app.ui_v1.set_main_window( - # WatchWindow(transition=None), - # from_window=False, # Disable check here. - # ) - # elif main_menu_location == 'Team Game Select': - # # pylint: disable=cyclic-import - # from bauiv1lib.playlist.browser import ( - # PlaylistBrowserWindow, - # ) - - # app.ui_v1.set_main_window( - # PlaylistBrowserWindow( - # sessiontype=bascenev1.DualTeamSession, - # transition=None, - # ), - # from_window=False, # Disable check here. - # ) - # elif main_menu_location == 'Free-for-All Game Select': - # # pylint: disable=cyclic-import - # from bauiv1lib.playlist.browser import ( - # PlaylistBrowserWindow, - # ) - - # app.ui_v1.set_main_window( - # PlaylistBrowserWindow( - # sessiontype=bascenev1.FreeForAllSession, - # transition=None, - # ), - # from_window=False, # Disable check here. - # ) - # elif main_menu_location == 'Coop Select': - # # pylint: disable=cyclic-import - # from bauiv1lib.coop.browser import CoopBrowserWindow - - # app.ui_v1.set_main_window( - # CoopBrowserWindow(transition=None), - # from_window=False, # Disable check here. - # ) - # elif main_menu_location == 'Benchmarks & Stress Tests': - # # pylint: disable=cyclic-import - # from bauiv1lib.debug import DebugWindow - - # app.ui_v1.set_main_window( - # DebugWindow(transition=None), - # from_window=False, # Disable check here. - # ) - # else: - # pylint: disable=cyclic-import - from bauiv1lib.mainmenu import MainMenuWindow - - app.ui_v1.set_main_window( - MainMenuWindow(transition=None), - is_top_level=True, - suppress_warning=True, - ) + app.ui_v1.set_main_window( + MainMenuWindow(transition=None), + is_top_level=True, + suppress_warning=True, + ) diff --git a/src/assets/ba_data/python/baclassic/_benchmark.py b/src/assets/ba_data/python/baclassic/_benchmark.py index 0c25f593..b110e25b 100644 --- a/src/assets/ba_data/python/baclassic/_benchmark.py +++ b/src/assets/ba_data/python/baclassic/_benchmark.py @@ -20,11 +20,14 @@ def run_cpu_benchmark() -> None: # pylint: disable=cyclic-import from bascenev1lib import tutorial + # Save our UI state that we'll return to when done. + if babase.app.classic is not None: + babase.app.classic.save_ui_state() + class BenchmarkSession(bascenev1.Session): """Session type for cpu benchmark.""" def __init__(self) -> None: - # print('FIXME: BENCHMARK SESSION WOULD CALC DEPS.') depsets: Sequence[bascenev1.DependencySet] = [] super().__init__(depsets) @@ -99,7 +102,9 @@ def _start_stress_test(args: _StressTestArgs) -> None: """(internal)""" from bascenev1 import DualTeamSession, FreeForAllSession - assert babase.app.classic is not None + classic = babase.app.classic + + assert classic is not None appconfig = babase.app.config playlist_type = args.playlist_type @@ -116,6 +121,10 @@ def _start_stress_test(args: _StressTestArgs) -> None: + args.playlist_name + '")...' ) + + # Save where we are in the UI so we'll return there when done. + classic.save_ui_state() + if playlist_type == 'Teams': appconfig['Team Tournament Playlist Selection'] = args.playlist_name appconfig['Team Tournament Playlist Randomize'] = 1 @@ -137,11 +146,11 @@ def _start_stress_test(args: _StressTestArgs) -> None: ), ) _baclassic.set_stress_testing(True, args.player_count, args.attract_mode) - babase.app.classic.stress_test_update_timer = babase.AppTimer( + classic.stress_test_update_timer = babase.AppTimer( args.round_duration, babase.Call(_reset_stress_test, args) ) if args.attract_mode: - babase.app.classic.stress_test_update_timer_2 = babase.AppTimer( + classic.stress_test_update_timer_2 = babase.AppTimer( 0.48, babase.Call(_update_attract_mode_test, args), repeat=True ) @@ -170,12 +179,6 @@ def _reset_stress_test(args: _StressTestArgs) -> None: babase.apptimer(1.0, babase.Call(_start_stress_test, args)) -def run_gpu_benchmark() -> None: - """Kick off a benchmark to test gpu speeds.""" - # FIXME: Not wired up yet. - babase.screenmessage('Not wired up yet.', color=(1, 0, 0)) - - def run_media_reload_benchmark() -> None: """Kick off a benchmark to test media reloading speeds.""" babase.reload_media() @@ -199,6 +202,6 @@ def run_media_reload_benchmark() -> None: babase.add_clean_frame_callback(babase.Call(doit, start_time)) - # The reload starts (should add a completion callback to the - # reload func to fix this). + # The reload starts (should add a completion callback to the reload + # func to fix this). babase.apptimer(0.05, babase.Call(delay_add, babase.apptime())) diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 45f47bb0..4886940b 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 = 22009 +TARGET_BALLISTICA_BUILD = 22010 TARGET_BALLISTICA_VERSION = '1.7.37' diff --git a/src/assets/ba_data/python/bascenev1lib/mainmenu.py b/src/assets/ba_data/python/bascenev1lib/mainmenu.py index bbb89834..3ca5ed98 100644 --- a/src/assets/ba_data/python/bascenev1lib/mainmenu.py +++ b/src/assets/ba_data/python/bascenev1lib/mainmenu.py @@ -57,8 +57,8 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]): plus = bs.app.plus assert plus is not None - # Throw up some text that only clients can see so they know that the - # host is navigating menus while they're just staring at an + # Throw up some text that only clients can see so they know that + # the host is navigating menus while they're just staring at an # empty-ish screen. tval = bs.Lstr( resource='hostIsNavigatingMenusText', @@ -569,7 +569,6 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]): vr_depth_offset: float = 0.0, ) -> None: # pylint: disable=too-many-locals - # Temp easter goodness. if custom_texture is None: custom_texture = self._get_custom_logo_tex_name() self._custom_logo_tex_name = custom_texture @@ -604,9 +603,8 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]): self._logo_node = logo.node self._word_actors.append(logo) - # Add a bit of stop-motion-y jitter to the logo - # (unless we're in VR mode in which case its best to - # leave things still). + # Add a bit of stop-motion-y jitter to the logo (unless we're in + # VR mode in which case its best to leave things still). assert logo.node def jitter() -> None: diff --git a/src/assets/ba_data/python/bauiv1lib/benchmarks.py b/src/assets/ba_data/python/bauiv1lib/benchmarks.py index d9bba76a..927300ba 100644 --- a/src/assets/ba_data/python/bauiv1lib/benchmarks.py +++ b/src/assets/ba_data/python/bauiv1lib/benchmarks.py @@ -121,16 +121,6 @@ class BenchmarksAndStressTestsWindow(bui.MainWindow): ) v -= 60 - bui.buttonwidget( - parent=self._subcontainer, - position=((self._sub_width - button_width) * 0.5, v), - size=(button_width, 60), - autoselect=True, - label=bui.Lstr(resource=f'{self._r}.runGPUBenchmarkText'), - on_activate_call=self._run_gpu_benchmark_pressed, - ) - v -= 60 - bui.buttonwidget( parent=self._subcontainer, position=((self._sub_width - button_width) * 0.5, v), @@ -369,12 +359,6 @@ class BenchmarksAndStressTestsWindow(bui.MainWindow): return bui.app.classic.run_cpu_benchmark() - def _run_gpu_benchmark_pressed(self) -> None: - if bui.app.classic is None: - logging.warning('run-gpu-benchmark requires classic') - return - bui.app.classic.run_gpu_benchmark() - def _run_media_reload_benchmark_pressed(self) -> None: if bui.app.classic is None: logging.warning('run-media-reload-benchmark requires classic') diff --git a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py index e59ad3bd..05924f8f 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py @@ -871,6 +871,11 @@ class ManualGatherTab(GatherTab): config['Last Manual Party Connect Address'] = resolved_address config['Last Manual Party Connect Port'] = port config.commit() + + # Store UI location to return to when done. + if bs.app.classic is not None: + bs.app.classic.save_ui_state() + bs.connect_to_party(resolved_address, port=port) def _run_addr_fetch(self) -> None: diff --git a/src/assets/ba_data/python/bauiv1lib/gather/nearbytab.py b/src/assets/ba_data/python/bauiv1lib/gather/nearbytab.py index 551b74d7..5a6b5a98 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/nearbytab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/nearbytab.py @@ -53,6 +53,11 @@ class NetScanner: self._last_selected_host = host def _on_activate(self, host: dict[str, Any]) -> None: + + # Store UI location to return to when done. + if bs.app.classic is not None: + bs.app.classic.save_ui_state() + bs.connect_to_party(host['address']) def update(self) -> None: diff --git a/src/assets/ba_data/python/bauiv1lib/gather/privatetab.py b/src/assets/ba_data/python/bauiv1lib/gather/privatetab.py index fa5a2e86..d4492bf9 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/privatetab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/privatetab.py @@ -1081,6 +1081,11 @@ class PrivateGatherTab(GatherTab): return self._debug_server_comm('got valid connect response') assert cresult.address4 is not None and cresult.port is not None + + # Store UI location to return to when done. + if bs.app.classic is not None: + bs.app.classic.save_ui_state() + bs.connect_to_party(cresult.address4, port=cresult.port) except Exception: self._debug_server_comm('got connect response error') diff --git a/src/assets/ba_data/python/bauiv1lib/gather/publictab.py b/src/assets/ba_data/python/bauiv1lib/gather/publictab.py index 66104345..5111405d 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/publictab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/publictab.py @@ -1450,6 +1450,10 @@ class PublicGatherTab(GatherTab): address = party.address port = party.port + # Store UI location to return to when done. + if bs.app.classic is not None: + bs.app.classic.save_ui_state() + # Rate limit this a bit. now = time.time() last_connect_time = self._last_connect_attempt_time diff --git a/src/assets/ba_data/python/bauiv1lib/partyqueue.py b/src/assets/ba_data/python/bauiv1lib/partyqueue.py index 7554568f..3b826331 100644 --- a/src/assets/ba_data/python/bauiv1lib/partyqueue.py +++ b/src/assets/ba_data/python/bauiv1lib/partyqueue.py @@ -552,6 +552,11 @@ class PartyQueueWindow(bui.Window): self._last_connect_attempt_time is None or now - self._last_connect_attempt_time > 10.0 ): + + # Store UI location to return to when done. + if bs.app.classic is not None: + bs.app.classic.save_ui_state() + bs.connect_to_party( address=self._address, port=self._port, diff --git a/src/assets/ba_data/python/bauiv1lib/playoptions.py b/src/assets/ba_data/python/bauiv1lib/playoptions.py index 17f9c410..2d206135 100644 --- a/src/assets/ba_data/python/bauiv1lib/playoptions.py +++ b/src/assets/ba_data/python/bauiv1lib/playoptions.py @@ -529,6 +529,11 @@ class PlayOptionsWindow(PopupWindow): def _run_selected_playlist(self) -> None: bui.unlock_all_input() + + # Save our place in the UI that we'll return to when done. + if bs.app.classic is not None: + bs.app.classic.save_ui_state() + try: bs.new_host_session(self._sessiontype) except Exception: diff --git a/src/assets/ba_data/python/bauiv1lib/watch.py b/src/assets/ba_data/python/bauiv1lib/watch.py index 2db96a78..c697e4b3 100644 --- a/src/assets/ba_data/python/bauiv1lib/watch.py +++ b/src/assets/ba_data/python/bauiv1lib/watch.py @@ -355,6 +355,10 @@ class WatchWindow(bui.MainWindow): return bui.increment_analytics_count('Replay watch') + # Save our place in the UI so we return there when done. + if bui.app.classic is not None: + bui.app.classic.save_ui_state() + def do_it() -> None: try: # Reset to normal speed. diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index dd8de96d..7500892e 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 = 22009; +const int kEngineBuildNumber = 22010; const char* kEngineVersion = "1.7.37"; const int kEngineApiVersion = 9; From 4dc322f956d089a43720ba2d204c0e4fc3ae9bfa Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 24 Sep 2024 16:05:55 -0700 Subject: [PATCH 3/7] window navigation improvements --- .efrocachemap | 56 ++--- CHANGELOG.md | 7 +- .../ba_data/python/baclassic/_appmode.py | 204 ++++++++++-------- src/assets/ba_data/python/baenv.py | 2 +- .../ba_data/python/bauiv1/_appsubsystem.py | 29 ++- src/assets/ba_data/python/bauiv1/_uitypes.py | 15 +- src/ballistica/shared/ballistica.cc | 2 +- 7 files changed, 194 insertions(+), 121 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index 51c316f7..b800ac8b 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": "21a16533b62c491d0581609132c22dd5", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "fd60f24823b5fd2951acf06ad92d124b", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "87bba2b52609ee3ae31c2b1255218d93", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "bb123af5ef4bdede5248e4d0e086d623", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "78e44932b961f079ddf15fae69fed639", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "49210bd0982bf5eda8dd1074b0b26152", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "85fcee6b23abbf1c5a8e64fd95567b6e", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "6c881b22460cb58f93249bc9f7a95724", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "625390166d0eac624f14fc1688c638e7", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "66cfb48fb1975ca32a750754d16055eb", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "b459b77672b95838742903e0afd1d9ae", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "f17dd55c15904f515e53fc676658194f", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "b1a493c944b9e60a80482e0097699695", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "018ca530ee4e8eaf78c2ea50059f2da4", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "83ef6001e1ef561a33207c396a7dc8b0", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "a00d2cff684ae4df75e52159ead85824", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "775c7f67370eff8d333eda82a626531f", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "1fa9c1e758e790c263b45315b016fe11", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "8b9e532091efbf224cb410ebf66cfbcf", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "7fbbd61ecdcbb4a8e162b6045d2dcf53", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "4c5719f4c7ab007be49e25f7d1c2ebc3", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "f94530fb06665cc65da84a0998a8c34f", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "4565fe7bf5497a1e6f26791d370cbf36", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "861bb4628d6e98833f34cd7fe188ccb4", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "ef45f0ea1f16016366069670869a105b", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "ecb70cb07e1f2a971faa6932278e623e", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "80cad1c9c9d7e95bba8fca46a7ad71cb", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "a62d9dcfec465b4e8e9e7b516ce20d6c", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "53ea2045ee7324176fc41f2c92e34c83", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "a48f988081b53a8cef28978e2779ad53", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "ca6f9f14f49e9578c79d4e192bae2a23", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "b3189be75ff31435fbd0deebf4d05d86", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "37457582e66d96fd63583e64d3392521", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "1505da6f4c3b5a5b5987c485271f567f", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "540e2954f30c48148e1c4824f484ba42", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "bd41f4930a3c1b0dfe1eb992bd1bd2c4", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "d226791f74aa398fd07909ba69eb2a19", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "59f65a8cbcdf13fcb30aec30d053fa85", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "cefcdb5c49a4a3f848119a9159d832f7", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "ea787281130d9e3565dd49b7776fb3f0", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "086a2ce72497e44079ad6b747fc5439f", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", @@ -4132,14 +4132,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "4c11b81a574aa9af593f54db4d998e61", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "564675e2f00a311387a6e621f3b67332", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "93395e2263f9ed10160dd8e80811be77", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "24445c70a851b691690803c87af33c81", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "cf286af8eb7762893ee935e08975eb60", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "33b5f0f70ad2d8775dee1fd810f319e5", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "74a2c3fa9e709ca034a106d56c3b3e36", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "8d97d249be1218c6277dc1de54e5c6b8", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "892e10ddcf3b8f1dd83e5d0303594273", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "d52d476f324fd3c0c1f99add058aa405", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "059bd84629b72597c692b3a6b6cf6aa9", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "8428089ffce127d5eedf8d9cbafa2ffa", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "0d267d44801387189b44896d4b6027b3", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "114f954bc27541998dce635b25e3ec01", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "eb84b5585f44e853604fa059ac57f388", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "579d3f0ad1d0f79522408d6197413a88", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "85b61a46caa9ada867f0c643ff28b6cd", "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 f2adaa5b..229ce86c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.37 (build 22010, api 9, 2024-09-24) +### 1.7.37 (build 22011, api 9, 2024-09-24) - 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. @@ -101,6 +101,11 @@ - There is now a `ba*.app.classic.save_ui_state()` method that should be called right before jumping into a game/replay/etc. This will save a state that will automatically be restored the next time the main menu activity is entered. +- (build 22010) Added the concept of 'auxiliary' windows and used them to make + various window navigation more intuitive. Example: previously, if you were on + the co-op screen and pressed the trophy toolbar icon to see your league rank + and then pressed back, you would be taken back to the top level main menu. Now + it will take you back to the co-op screen. ### 1.7.36 (build 21944, api 8, 2024-07-26) - Wired up Tokens, BombSquad's new purchasable currency. The first thing these diff --git a/src/assets/ba_data/python/baclassic/_appmode.py b/src/assets/ba_data/python/baclassic/_appmode.py index 07bc250b..85e5a6d2 100644 --- a/src/assets/ba_data/python/baclassic/_appmode.py +++ b/src/assets/ba_data/python/baclassic/_appmode.py @@ -15,14 +15,16 @@ from babase import ( AppIntentDefault, invoke_main_menu, screenmessage, - in_main_menu, + # in_main_menu, ) import _baclassic if TYPE_CHECKING: + from typing import Callable + from babase import AppIntent - from bauiv1 import UIV1AppSubsystem, MainWindow + from bauiv1 import UIV1AppSubsystem, MainWindow, MainWindowState class ClassicAppMode(AppMode): @@ -124,38 +126,6 @@ class ClassicAppMode(AppMode): if not app.active: invoke_main_menu() - def _jump_to_main_window(self, window: MainWindow) -> None: - """Jump to a window with the main menu as its parent.""" - from bauiv1lib.mainmenu import MainMenuWindow - from bauiv1lib.ingamemenu import InGameMenuWindow - - ui = app.ui_v1 - - old_window = ui.get_main_window() - - if isinstance(old_window, (MainMenuWindow, InGameMenuWindow)): - # If we're currently in the top level menu window, just push - # our mainwindow on to the end. - old_window.main_window_replace(window) - else: - # Blow away the window stack and build a fresh one. - ui.clear_main_window() - - back_state = ( - MainMenuWindow.do_get_main_window_state() - if in_main_menu() - else InGameMenuWindow.do_get_main_window_state() - ) - # set_main_window() needs this to be set. - back_state.is_top_level = True - - ui.set_main_window( - window, - from_window=False, # Disable from-check. - back_state=back_state, - suppress_warning=True, - ) - def _root_ui_menu_press(self) -> None: from babase import push_back_press @@ -173,18 +143,11 @@ class ClassicAppMode(AppMode): import bauiv1 from bauiv1lib.account.settings import AccountSettingsWindow - ui = app.ui_v1 - - # If the window is already showing, back out of it. - current_main_window = ui.get_main_window() - if isinstance(current_main_window, AccountSettingsWindow): - current_main_window.main_window_back() - return - - self._jump_to_main_window( - AccountSettingsWindow( + self._auxiliary_window_nav( + win_type=AccountSettingsWindow, + win_create_call=lambda: AccountSettingsWindow( origin_widget=bauiv1.get_special_widget('account_button') - ) + ), ) def _root_ui_squad_press(self) -> None: @@ -201,18 +164,100 @@ class ClassicAppMode(AppMode): import bauiv1 from bauiv1lib.settings.allsettings import AllSettingsWindow + self._auxiliary_window_nav( + win_type=AllSettingsWindow, + win_create_call=lambda: AllSettingsWindow( + origin_widget=bauiv1.get_special_widget('settings_button') + ), + ) + + def _auxiliary_window_nav( + self, + win_type: type[MainWindow], + win_create_call: Callable[[], MainWindow], + ) -> None: + """Navigate to or away from a particular type of Auxiliary window.""" + # pylint: disable=unidiomatic-typecheck + ui = app.ui_v1 - # If the window is already showing, back out of it. current_main_window = ui.get_main_window() - if isinstance(current_main_window, AllSettingsWindow): + + # Scan our ancestors for auxiliary states matching our type as + # well as auxiliary states in general. + aux_matching_state: MainWindowState | None = None + aux_state: MainWindowState | None = None + + if current_main_window is None: + raise RuntimeError( + 'Not currently handling no-top-level-window case.' + ) + + state = current_main_window.main_window_back_state + while state is not None: + assert state.window_type is not None + if state.is_auxiliary: + if state.window_type is win_type: + aux_matching_state = state + else: + aux_state = state + + state = state.parent + + # If there's an ancestor auxiliary window-state matching our + # type, back out past it (example: poking settings, navigating + # down a level or two, and then poking settings again should + # back out of settings). + if aux_matching_state is not None: + current_main_window.main_window_back_state = ( + aux_matching_state.parent + ) current_main_window.main_window_back() return - self._jump_to_main_window( - AllSettingsWindow( - origin_widget=bauiv1.get_special_widget('settings_button') + # If there's an ancestory auxiliary state *not* matching our + # type, crop the state and swap in our new auxiliary UI + # (example: poking settings, then poking account, then poking + # back should end up where things were before the settings + # poke). + if aux_state is not None: + # Blow away the window stack and build a fresh one. + ui.clear_main_window() + ui.set_main_window( + win_create_call(), + from_window=False, # Disable from-check. + back_state=aux_state.parent, + suppress_warning=True, + is_auxiliary=True, ) + return + + # Ok, no auxiliary states found. Now if current window is auxiliary + # and the type matches, simply do a back. + if ( + current_main_window.main_window_is_auxiliary + and type(current_main_window) is win_type + ): + current_main_window.main_window_back() + return + + # If current window is auxiliary but type doesn't match, + # swap it out for our new auxiliary UI. + if current_main_window.main_window_is_auxiliary: + ui.clear_main_window() + ui.set_main_window( + win_create_call(), + from_window=False, # Disable from-check. + back_state=current_main_window.main_window_back_state, + suppress_warning=True, + is_auxiliary=True, + ) + return + + # Ok, no existing auxiliary stuff was found period. Just + # navigate forward to this UI. + current_main_window.main_window_replace( + win_create_call(), is_auxiliary=True ) def _root_ui_achievements_press(self) -> None: @@ -235,18 +280,11 @@ class ClassicAppMode(AppMode): import bauiv1 from bauiv1lib.store.browser import StoreBrowserWindow - ui = app.ui_v1 - - # If the window is already showing, back out of it. - current_main_window = ui.get_main_window() - if isinstance(current_main_window, StoreBrowserWindow): - current_main_window.main_window_back() - return - - self._jump_to_main_window( - StoreBrowserWindow( + self._auxiliary_window_nav( + win_type=StoreBrowserWindow, + win_create_call=lambda: StoreBrowserWindow( origin_widget=bauiv1.get_special_widget('store_button') - ) + ), ) def _root_ui_tickets_meter_press(self) -> None: @@ -270,25 +308,17 @@ class ClassicAppMode(AppMode): from bauiv1lib.account import show_sign_in_prompt from bauiv1lib.league.rankwindow import LeagueRankWindow - ui = app.ui_v1 - - # If the window is already showing, back out of it. - current_main_window = ui.get_main_window() - if isinstance(current_main_window, LeagueRankWindow): - current_main_window.main_window_back() - return - plus = bauiv1.app.plus assert plus is not None - if plus.get_v1_account_state() != 'signed_in': show_sign_in_prompt() return - self._jump_to_main_window( - LeagueRankWindow( + self._auxiliary_window_nav( + win_type=LeagueRankWindow, + win_create_call=lambda: LeagueRankWindow( origin_widget=bauiv1.get_special_widget('trophy_meter') - ) + ), ) def _root_ui_level_meter_press(self) -> None: @@ -303,19 +333,25 @@ class ClassicAppMode(AppMode): import bauiv1 from bauiv1lib.inventory import InventoryWindow - ui = app.ui_v1 - - # If the window is already showing, back out of it. - current_main_window = ui.get_main_window() - if isinstance(current_main_window, InventoryWindow): - current_main_window.main_window_back() - return - - self._jump_to_main_window( - InventoryWindow( + self._auxiliary_window_nav( + win_type=InventoryWindow, + win_create_call=lambda: InventoryWindow( origin_widget=bauiv1.get_special_widget('inventory_button') - ) + ), ) + # ui = app.ui_v1 + + # # If the window is already showing, back out of it. + # current_main_window = ui.get_main_window() + # if isinstance(current_main_window, InventoryWindow): + # current_main_window.main_window_back() + # return + + # self._jump_to_auxiliary_window( + # InventoryWindow( + # origin_widget=bauiv1.get_special_widget('inventory_button') + # ) + # ) def _root_ui_get_tokens_press(self) -> None: import bauiv1 diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 4886940b..00a3d142 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 = 22010 +TARGET_BALLISTICA_BUILD = 22011 TARGET_BALLISTICA_VERSION = '1.7.37' diff --git a/src/assets/ba_data/python/bauiv1/_appsubsystem.py b/src/assets/ba_data/python/bauiv1/_appsubsystem.py index 9eeb6755..9711c51b 100644 --- a/src/assets/ba_data/python/bauiv1/_appsubsystem.py +++ b/src/assets/ba_data/python/bauiv1/_appsubsystem.py @@ -181,8 +181,10 @@ class UIV1AppSubsystem(babase.AppSubsystem): f' cannot use auto-back.' ) - # Valid states should have a value here. + # Valid states should have values here. assert back_state.is_top_level is not None + assert back_state.is_auxiliary is not None + assert back_state.window_type is not None backwin = back_state.create_window(transition='in_left') @@ -205,6 +207,7 @@ class UIV1AppSubsystem(babase.AppSubsystem): from_window: bauiv1.MainWindow | None | bool = True, is_back: bool = False, is_top_level: bool = False, + is_auxiliary: bool = False, back_state: MainWindowState | None = None, suppress_warning: bool = False, ) -> None: @@ -214,6 +217,7 @@ class UIV1AppSubsystem(babase.AppSubsystem): MainWindow methods main_window_replace() and main_window_back() should be used when possible for navigation. """ + # pylint: disable=too-many-locals # pylint: disable=too-many-branches # pylint: disable=too-many-statements from bauiv1._uitypes import MainWindow @@ -254,9 +258,13 @@ class UIV1AppSubsystem(babase.AppSubsystem): # If they passed a back-state, make sure it is fully filled out. if back_state is not None: - if back_state.is_top_level is None: + if ( + back_state.is_top_level is None + or back_state.is_auxiliary is None + or back_state.window_type is None + ): raise RuntimeError( - 'back_state.is_top_level has not been set.' + 'Provided back_state is incomplete.' ' Make sure to only pass fully-filled-out MainWindowStates.' ) # If a top-level main-window is being set, complain if there already @@ -309,18 +317,24 @@ class UIV1AppSubsystem(babase.AppSubsystem): logging.exception('Error checking from_window') if is_back: - # is_top_level should never be True here (only applies forward). + # These values should only be passed for forward navigation. assert not is_top_level - # Always should have back_state in this case. + assert not is_auxiliary + # Make sure back state is complete. assert back_state is not None assert back_state.is_top_level is not None + assert back_state.is_auxiliary is not None + assert back_state.window_type is type(window) window.main_window_back_state = back_state.parent window.main_window_is_top_level = back_state.is_top_level + window.main_window_is_auxiliary = back_state.is_auxiliary else: # Store if the window is top-level so we won't complain later if # we go back from it and there's nowhere to go to. window.main_window_is_top_level = is_top_level + window.main_window_is_auxiliary = is_auxiliary + # When navigating forward, generate a back-window-state from # the outgoing window. if is_top_level: @@ -386,6 +400,8 @@ class UIV1AppSubsystem(babase.AppSubsystem): # Store some common window stuff on its state. winstate.parent = window.main_window_back_state winstate.is_top_level = window.main_window_is_top_level + winstate.is_auxiliary = window.main_window_is_auxiliary + winstate.window_type = type(window) return winstate @@ -397,12 +413,15 @@ class UIV1AppSubsystem(babase.AppSubsystem): # Valid states should have a value here. assert state.is_top_level is not None + assert state.is_auxiliary is not None + assert state.window_type is not None win = state.create_window(transition=None) self.set_main_window( win, from_window=False, # disable check is_top_level=state.is_top_level, + is_auxiliary=state.is_auxiliary, back_state=state.parent, suppress_warning=True, ) diff --git a/src/assets/ba_data/python/bauiv1/_uitypes.py b/src/assets/ba_data/python/bauiv1/_uitypes.py index 00edc4cb..16815e04 100644 --- a/src/assets/ba_data/python/bauiv1/_uitypes.py +++ b/src/assets/ba_data/python/bauiv1/_uitypes.py @@ -65,6 +65,13 @@ class MainWindow(Window): self.main_window_is_top_level: bool = False + # Windows can be flagged as auxiliary when not related to the + # main UI task at hand. UI code may choose to handle auxiliary + # windows in special ways, such as by implicitly replacing + # existing auxiliary windows with new ones instead of keeping + # old ones as back targets. + self.main_window_is_auxiliary: bool = False + self._main_window_transition = transition self._main_window_origin_widget = origin_widget super().__init__(root_widget, cleanupcheck) @@ -147,7 +154,10 @@ class MainWindow(Window): self.main_window_close() def main_window_replace( - self, new_window: MainWindow, back_state: MainWindowState | None = None + self, + new_window: MainWindow, + back_state: MainWindowState | None = None, + is_auxiliary: bool = False, ) -> None: """Replace ourself with a new MainWindow.""" @@ -177,6 +187,7 @@ class MainWindow(Window): new_window, from_window=self, back_state=back_state, + is_auxiliary=is_auxiliary, suppress_warning=True, ) @@ -203,6 +214,8 @@ class MainWindowState: # The window that back/cancel navigation should take us to. self.parent: MainWindowState | None = None self.is_top_level: bool | None = None + self.is_auxiliary: bool | None = None + self.window_type: type[MainWindow] | None = None def create_window( self, diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index 7500892e..15c6dc5b 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 = 22010; +const int kEngineBuildNumber = 22011; const char* kEngineVersion = "1.7.37"; const int kEngineApiVersion = 9; From 3f419c3233da394ac23563bdabb31200064130cf Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 24 Sep 2024 21:57:36 -0700 Subject: [PATCH 4/7] converted achievements and inbox to MainWindows and other ui polishing --- .efrocachemap | 56 +++--- CHANGELOG.md | 2 +- .../ba_data/python/baclassic/_appmode.py | 38 ++--- src/assets/ba_data/python/baenv.py | 2 +- .../python/bauiv1lib/account/settings.py | 70 +------- .../ba_data/python/bauiv1lib/achievements.py | 109 +++++++----- .../python/bauiv1lib/gather/privatetab.py | 14 +- .../ba_data/python/bauiv1lib/gettokens.py | 96 ++++++----- src/assets/ba_data/python/bauiv1lib/inbox.py | 153 ++++++++++++----- .../python/bauiv1lib/league/rankwindow.py | 6 +- src/ballistica/shared/ballistica.cc | 2 +- src/ballistica/ui_v1/widget/root_widget.cc | 159 +++++++++--------- 12 files changed, 373 insertions(+), 334 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index b800ac8b..3012707e 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": "4c5719f4c7ab007be49e25f7d1c2ebc3", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "f94530fb06665cc65da84a0998a8c34f", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "4565fe7bf5497a1e6f26791d370cbf36", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "861bb4628d6e98833f34cd7fe188ccb4", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "ef45f0ea1f16016366069670869a105b", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "ecb70cb07e1f2a971faa6932278e623e", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "80cad1c9c9d7e95bba8fca46a7ad71cb", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "a62d9dcfec465b4e8e9e7b516ce20d6c", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "53ea2045ee7324176fc41f2c92e34c83", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "a48f988081b53a8cef28978e2779ad53", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "ca6f9f14f49e9578c79d4e192bae2a23", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "b3189be75ff31435fbd0deebf4d05d86", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "37457582e66d96fd63583e64d3392521", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "1505da6f4c3b5a5b5987c485271f567f", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "540e2954f30c48148e1c4824f484ba42", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "bd41f4930a3c1b0dfe1eb992bd1bd2c4", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "d226791f74aa398fd07909ba69eb2a19", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "59f65a8cbcdf13fcb30aec30d053fa85", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "cefcdb5c49a4a3f848119a9159d832f7", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "ea787281130d9e3565dd49b7776fb3f0", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "009e9834589fdca68dad7af91b56a9ae", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "5f307993914ffd163b31824495103533", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "eb06b4b7905a67fb2b7e65d543872b8d", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "4fce2d86cf75558f089f8bc67476cd8e", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "954288b391c83f0c124d0ab9b2f3ef5b", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "1883286f80c4f53723f3d0338a3c3c31", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "ad63b8d21e6ae4fd0274875c4e66f6bf", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "f5c69292fa9b046ac86b9c938b139dbe", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "9e53108985b005b5c5403d992a8eb5bd", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "f5e9323ce05bdde512c4a853e0a46d71", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "1a572a5722992601bfc510499083d980", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "b26537fa8323d1fb159f4f07c035d0d3", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "a70a22456f7d6d3cc2826f27627f302d", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "868d55c194a4834d8a373c8d9300f4a1", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "1a35b2a949f8d900a1fb640592a6d5f9", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "f2465aed23f9dc56fe1ba17a8e528563", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "d32b49718718560b44ef3b4e99a1dd96", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "6ff6d0b91e51c4d3a8bb134be2bff23b", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "64c03fe1e1bc86b49079bf5dec74d484", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "b905501fa611121ae9e34db5fb841921", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "086a2ce72497e44079ad6b747fc5439f", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", @@ -4132,14 +4132,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "4c11b81a574aa9af593f54db4d998e61", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "d52d476f324fd3c0c1f99add058aa405", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "059bd84629b72597c692b3a6b6cf6aa9", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "8428089ffce127d5eedf8d9cbafa2ffa", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "0d267d44801387189b44896d4b6027b3", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "114f954bc27541998dce635b25e3ec01", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "eb84b5585f44e853604fa059ac57f388", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "579d3f0ad1d0f79522408d6197413a88", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "85b61a46caa9ada867f0c643ff28b6cd", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "e900c88682cb4e25a3f36e798aa167db", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "d74de72b01b831df93e14a77f8351a75", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "44a8676feda50e8b831f707041b6053e", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "c7b6d06e55a914e94cf7ab84dd7ed617", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "cd7aab8432d4ba5eefd1d36261bc1928", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "1058ad3d671eb62dc52a971cf231f5e3", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "96908e3c333c66c2010136c11ac4fde6", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "d962d4f91a10bfae22e96c9e74466c4a", "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 229ce86c..caf97a4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.37 (build 22011, api 9, 2024-09-24) +### 1.7.37 (build 22012, api 9, 2024-09-24) - 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/baclassic/_appmode.py b/src/assets/ba_data/python/baclassic/_appmode.py index 85e5a6d2..7d130394 100644 --- a/src/assets/ba_data/python/baclassic/_appmode.py +++ b/src/assets/ba_data/python/baclassic/_appmode.py @@ -264,17 +264,23 @@ class ClassicAppMode(AppMode): import bauiv1 from bauiv1lib.achievements import AchievementsWindow - btn = bauiv1.get_special_widget('achievements_button') - - AchievementsWindow(position=btn.get_screen_space_center()) + self._auxiliary_window_nav( + win_type=AchievementsWindow, + win_create_call=lambda: AchievementsWindow( + origin_widget=bauiv1.get_special_widget('achievements_button') + ), + ) def _root_ui_inbox_press(self) -> None: import bauiv1 from bauiv1lib.inbox import InboxWindow - btn = bauiv1.get_special_widget('inbox_button') - - InboxWindow(position=btn.get_screen_space_center()) + self._auxiliary_window_nav( + win_type=InboxWindow, + win_create_call=lambda: InboxWindow( + origin_widget=bauiv1.get_special_widget('inbox_button') + ), + ) def _root_ui_store_press(self) -> None: import bauiv1 @@ -339,26 +345,16 @@ class ClassicAppMode(AppMode): origin_widget=bauiv1.get_special_widget('inventory_button') ), ) - # ui = app.ui_v1 - - # # If the window is already showing, back out of it. - # current_main_window = ui.get_main_window() - # if isinstance(current_main_window, InventoryWindow): - # current_main_window.main_window_back() - # return - - # self._jump_to_auxiliary_window( - # InventoryWindow( - # origin_widget=bauiv1.get_special_widget('inventory_button') - # ) - # ) def _root_ui_get_tokens_press(self) -> None: import bauiv1 from bauiv1lib.gettokens import GetTokensWindow - GetTokensWindow( - origin_widget=bauiv1.get_special_widget('get_tokens_button') + self._auxiliary_window_nav( + win_type=GetTokensWindow, + win_create_call=lambda: GetTokensWindow( + origin_widget=bauiv1.get_special_widget('get_tokens_button') + ), ) def _root_ui_chest_slot_pressed(self, index: int) -> None: diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 00a3d142..ef617cf6 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 = 22011 +TARGET_BALLISTICA_BUILD = 22012 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 0a16d8c4..eb4bdc4f 100644 --- a/src/assets/ba_data/python/bauiv1lib/account/settings.py +++ b/src/assets/ba_data/python/bauiv1lib/account/settings.py @@ -334,20 +334,6 @@ class AccountSettingsWindow(bui.MainWindow): ) linked_accounts_text_space = 60.0 - # Always show achievements except in the game-center case where - # its unified UI covers them. - # show_achievements_button = - # self._v1_signed_in and not game_center_active - - # Update: No longer showing this since its visible on main - # toolbar. - show_achievements_button = False - achievements_button_space = 60.0 - - # show_achievements_text = ( - # self._v1_signed_in and not show_achievements_button - # ) - # Update: No longer showing this since its visible on main # toolbar. show_achievements_text = False @@ -422,8 +408,6 @@ class AccountSettingsWindow(bui.MainWindow): self._sub_height += linked_accounts_text_space if show_achievements_text: self._sub_height += achievements_text_space - if show_achievements_button: - self._sub_height += achievements_button_space if show_leaderboards_button: self._sub_height += leaderboards_button_space if show_campaign_progress: @@ -876,43 +860,7 @@ class AccountSettingsWindow(bui.MainWindow): else: self._achievements_text = None - self._achievements_button: bui.Widget | None - if show_achievements_button: - button_width = 300 - v -= achievements_button_space * 0.85 - self._achievements_button = btn = bui.buttonwidget( - parent=self._subcontainer, - position=((self._sub_width - button_width) * 0.5, v), - color=(0.55, 0.5, 0.6), - textcolor=(0.75, 0.7, 0.8), - autoselect=True, - icon=bui.gettexture( - 'googlePlayAchievementsIcon' - if gpgs_active - else 'achievementsIcon' - ), - icon_color=( - (0.8, 0.95, 0.7) if gpgs_active else (0.85, 0.8, 0.9) - ), - on_activate_call=( - self._on_custom_achievements_press - if gpgs_active - else self._on_achievements_press - ), - size=(button_width, 50), - label='', - ) - if first_selectable is None: - first_selectable = btn - bui.widget( - edit=btn, right_widget=bui.get_special_widget('squad_button') - ) - bui.widget(edit=btn, left_widget=bbtn) - v -= achievements_button_space * 0.15 - else: - self._achievements_button = None - - if show_achievements_text or show_achievements_button: + if show_achievements_text: self._refresh_achievements() self._leaderboards_button: bui.Widget | None @@ -1212,15 +1160,6 @@ class AccountSettingsWindow(bui.MainWindow): else: logging.warning('show_game_service_ui requires plus feature-set.') - def _on_achievements_press(self) -> None: - # pylint: disable=cyclic-import - from bauiv1lib import achievements - - assert self._achievements_button is not None - achievements.AchievementsWindow( - position=self._achievements_button.get_screen_space_center() - ) - def _on_manage_account_press(self) -> None: self._do_manage_account_press(WebLocation.ACCOUNT_EDITOR) @@ -1401,10 +1340,7 @@ class AccountSettingsWindow(bui.MainWindow): def _refresh_achievements(self) -> None: assert bui.app.classic is not None - if ( - self._achievements_text is None - and self._achievements_button is None - ): + if self._achievements_text is None: return complete = sum( 1 if a.complete else 0 for a in bui.app.classic.ach.achievements @@ -1417,8 +1353,6 @@ class AccountSettingsWindow(bui.MainWindow): if self._achievements_text is not None: bui.textwidget(edit=self._achievements_text, text=txt_final) - if self._achievements_button is not None: - bui.buttonwidget(edit=self._achievements_button, label=txt_final) def _link_accounts_press(self) -> None: # pylint: disable=cyclic-import diff --git a/src/assets/ba_data/python/bauiv1lib/achievements.py b/src/assets/ba_data/python/bauiv1lib/achievements.py index 00744b3b..36d182ca 100644 --- a/src/assets/ba_data/python/bauiv1lib/achievements.py +++ b/src/assets/ba_data/python/bauiv1lib/achievements.py @@ -6,55 +6,69 @@ from __future__ import annotations from typing import override -from bauiv1lib.popup import PopupWindow import bauiv1 as bui -class AchievementsWindow(PopupWindow): +class AchievementsWindow(bui.MainWindow): """Popup window to view achievements.""" def __init__( - self, position: tuple[float, float], scale: float | None = None + self, + 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 - if scale is None: - scale = ( - 2.3 - if uiscale is bui.UIScale.SMALL - else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23 - ) - self._transitioning_out = False - self._width = 450 + self._width = 600 if uiscale is bui.UIScale.SMALL else 450 self._height = ( 300 if uiscale is bui.UIScale.SMALL else 370 if uiscale is bui.UIScale.MEDIUM else 450 ) - bg_color = (0.5, 0.4, 0.6) - # creates our _root_widget super().__init__( - position=position, - size=(self._width, self._height), - scale=scale, - bg_color=bg_color, - edge_buffer_scale=4.0, # Try to keep button unobscured. + root_widget=bui.containerwidget( + size=(self._width, self._height), + toolbar_visibility=( + 'menu_minimal' + if uiscale is bui.UIScale.SMALL + else 'menu_full' + ), + scale=( + 2.3 + if uiscale is bui.UIScale.SMALL + else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23 + ), + stack_offset=( + (0, -10) + if uiscale is bui.UIScale.SMALL + else (0, 0) if uiscale is bui.UIScale.MEDIUM else (0, 0) + ), + ), + transition=transition, + origin_widget=origin_widget, ) - self._cancel_button = bui.buttonwidget( - parent=self.root_widget, - position=(50, self._height - 30), - size=(50, 50), - scale=0.5, - label='', - color=bg_color, - on_activate_call=self._on_cancel_press, - autoselect=True, - icon=bui.gettexture('crossOut'), - iconscale=1.2, - ) + if uiscale is bui.UIScale.SMALL: + bui.containerwidget( + edit=self._root_widget, on_cancel_call=self.main_window_back + ) + self._back_button = None + else: + self._back_button = bui.buttonwidget( + parent=self._root_widget, + autoselect=True, + position=(50, self._height - 38), + size=(60, 60), + scale=0.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 + ) achievements = bui.app.classic.ach.achievements num_complete = len([a for a in achievements if a.complete]) @@ -67,8 +81,11 @@ class AchievementsWindow(PopupWindow): ], ) self._title_text = bui.textwidget( - parent=self.root_widget, - position=(self._width * 0.5, self._height - 20), + parent=self._root_widget, + position=( + self._width * 0.5, + self._height - (27 if uiscale is bui.UIScale.SMALL else 20), + ), size=(0, 0), h_align='center', v_align='center', @@ -79,16 +96,21 @@ class AchievementsWindow(PopupWindow): ) self._scrollwidget = bui.scrollwidget( - parent=self.root_widget, + parent=self._root_widget, size=(self._width - 60, self._height - 70), position=(30, 30), capture_arrows=True, simple_culling_v=10, ) bui.widget(edit=self._scrollwidget, autoselect=True) + if uiscale is bui.UIScale.SMALL: + bui.widget( + edit=self._scrollwidget, + left_widget=bui.get_special_widget('back_button'), + ) bui.containerwidget( - edit=self.root_widget, cancel_button=self._cancel_button + edit=self._root_widget, cancel_button=self._back_button ) incr = 36 @@ -224,15 +246,12 @@ class AchievementsWindow(PopupWindow): v_align='center', ) - def _on_cancel_press(self) -> None: - self._transition_out() - - def _transition_out(self) -> None: - if not self._transitioning_out: - self._transitioning_out = True - bui.containerwidget(edit=self.root_widget, transition='out_scale') - @override - def on_popup_cancel(self) -> None: - bui.getsound('swish').play() - self._transition_out() + def get_main_window_state(self) -> bui.MainWindowState: + # Support recreating our window for back/refresh purposes. + cls = type(self) + return bui.BasicMainWindowState( + create_call=lambda transition, origin_widget: cls( + transition=transition, origin_widget=origin_widget + ) + ) diff --git a/src/assets/ba_data/python/bauiv1lib/gather/privatetab.py b/src/assets/ba_data/python/bauiv1lib/gather/privatetab.py index d4492bf9..dc185f2d 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/privatetab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/privatetab.py @@ -24,7 +24,7 @@ from bacommon.net import ( from bauiv1lib.gather import GatherTab from bauiv1lib.play import PlaylistSelectContext -from bauiv1lib.gettokens import GetTokensWindow, show_get_tokens_prompt +from bauiv1lib.gettokens import show_get_tokens_prompt import bascenev1 as bs import bauiv1 as bui @@ -551,13 +551,13 @@ class PrivateGatherTab(GatherTab): edit=self._join_party_code_text, on_return_press_call=btn.activate ) - def _on_get_tokens_press(self) -> None: - if self._waiting_for_start_stop_response: - return + # def _on_get_tokens_press(self) -> None: + # if self._waiting_for_start_stop_response: + # return - # Bring up get-tickets window and then kill ourself (we're on - # the overlay layer so we'd show up above it). - GetTokensWindow(origin_widget=self._get_tokens_button) + # # Bring up get-tickets window and then kill ourself (we're on + # # the overlay layer so we'd show up above it). + # GetTokensWindow(origin_widget=self._get_tokens_button) def _build_host_tab(self) -> None: # pylint: disable=too-many-branches diff --git a/src/assets/ba_data/python/bauiv1lib/gettokens.py b/src/assets/ba_data/python/bauiv1lib/gettokens.py index 0c3baeb8..c923ae18 100644 --- a/src/assets/ba_data/python/bauiv1lib/gettokens.py +++ b/src/assets/ba_data/python/bauiv1lib/gettokens.py @@ -8,7 +8,7 @@ import time from enum import Enum from functools import partial from dataclasses import dataclass -from typing import TYPE_CHECKING, assert_never +from typing import TYPE_CHECKING, assert_never, override import bacommon.cloud import bauiv1 as bui @@ -54,7 +54,7 @@ class _TxtDef: rotate: float | None = None -class GetTokensWindow(bui.Window): +class GetTokensWindow(bui.MainWindow): """Window for purchasing/acquiring classic tickets.""" class State(Enum): @@ -67,12 +67,10 @@ class GetTokensWindow(bui.Window): def __init__( self, - transition: str = 'in_right', + transition: str | None = 'in_right', origin_widget: bui.Widget | None = None, - restore_previous_call: Callable[[bui.Widget], None] | None = None, + # restore_previous_call: Callable[[bui.Widget], None] | None = None, ): - # pylint: disable=too-many-locals - bwidthstd = 170 bwidthwide = 300 ycolor = (0, 0, 0.3) @@ -304,7 +302,7 @@ class GetTokensWindow(bui.Window): ] self._transitioning_out = False - self._restore_previous_call = restore_previous_call + # self._restore_previous_call = restore_previous_call self._textcolor = (0.92, 0.92, 2.0) self._query_in_flight = False @@ -314,14 +312,14 @@ class GetTokensWindow(bui.Window): ) # If they provided an origin-widget, scale up from that. - scale_origin: tuple[float, float] | None - if origin_widget is not None: - self._transition_out = 'out_scale' - scale_origin = origin_widget.get_screen_space_center() - transition = 'in_scale' - else: - self._transition_out = 'out_right' - scale_origin = None + # scale_origin: tuple[float, float] | None + # if origin_widget is not None: + # self._transition_out = 'out_scale' + # scale_origin = origin_widget.get_screen_space_center() + # transition = 'in_scale' + # else: + # self._transition_out = 'out_right' + # scale_origin = None uiscale = bui.app.ui_v1.uiscale self._width = 1000.0 if uiscale is bui.UIScale.SMALL else 800.0 @@ -334,8 +332,8 @@ class GetTokensWindow(bui.Window): super().__init__( root_widget=bui.containerwidget( size=(self._width, self._height), - transition=transition, - scale_origin_stack_offset=scale_origin, + # transition=transition, + # scale_origin_stack_offset=scale_origin, color=(0.3, 0.23, 0.36), scale=( 1.5 @@ -346,13 +344,19 @@ class GetTokensWindow(bui.Window): (0, -3) if uiscale is bui.UIScale.SMALL else (0, 0) ), # toolbar_visibility='menu_minimal', - toolbar_visibility='get_tokens', - ) + toolbar_visibility=( + 'get_tokens' + if uiscale is bui.UIScale.SMALL + else 'menu_full' + ), + ), + transition=transition, + origin_widget=origin_widget, ) if uiscale is bui.UIScale.SMALL: bui.containerwidget( - edit=self._root_widget, on_cancel_call=self._back + edit=self._root_widget, on_cancel_call=self.main_window_back ) self._back_button = bui.get_special_widget('back_button') else: @@ -363,23 +367,26 @@ class GetTokensWindow(bui.Window): self._height - 80 + self._y_offset, ), size=( - (140, 60) - if self._restore_previous_call is None - else (60, 60) + # (140, 60) + # if self._restore_previous_call is None + # else + (60, 60) ), scale=1.0, autoselect=True, label=( - bui.Lstr(resource='doneText') - if self._restore_previous_call is None - else bui.charstr(bui.SpecialChar.BACK) + # bui.Lstr(resource='doneText') + # if self._restore_previous_call is None + # else + bui.charstr(bui.SpecialChar.BACK) ), button_type=( - 'regular' - if self._restore_previous_call is None - else 'backSmall' + # 'regular' + # if self._restore_previous_call is None + # else + 'backSmall' ), - on_activate_call=self._back, + on_activate_call=self.main_window_back, ) # if uiscale is bui.UIScale.SMALL: # bui.widget( @@ -446,6 +453,16 @@ class GetTokensWindow(bui.Window): # self._ticking_sound.stop() # self._ticking_sound = None + @override + def get_main_window_state(self) -> bui.MainWindowState: + # Support recreating our window for back/refresh purposes. + cls = type(self) + return bui.BasicMainWindowState( + create_call=lambda transition, origin_widget: cls( + transition=transition, origin_widget=origin_widget + ) + ) + def _update(self) -> None: # No-op if our underlying widget is dead or on its way out. if not self._root_widget or self._root_widget.transitioning_out: @@ -815,17 +832,18 @@ class GetTokensWindow(bui.Window): # self._ticking_sound = None # bui.getsound('cashRegister2').play() - def _back(self) -> None: + # def _back(self) -> None: - # No-op if our underlying widget is dead or on its way out. - if not self._root_widget or self._root_widget.transitioning_out: - return + # self.main_ + # No-op if our underlying widget is dead or on its way out. + # if not self._root_widget or self._root_widget.transitioning_out: + # return - bui.containerwidget( - edit=self._root_widget, transition=self._transition_out - ) - if self._restore_previous_call is not None: - self._restore_previous_call(self._root_widget) + # bui.containerwidget( + # edit=self._root_widget, transition=self._transition_out + # ) + # if self._restore_previous_call is not None: + # self._restore_previous_call(self._root_widget) def _on_learn_more_press(self, url: str) -> None: bui.open_url(url) diff --git a/src/assets/ba_data/python/bauiv1lib/inbox.py b/src/assets/ba_data/python/bauiv1lib/inbox.py index ee4b4108..cb3ad3d5 100644 --- a/src/assets/ba_data/python/bauiv1lib/inbox.py +++ b/src/assets/ba_data/python/bauiv1lib/inbox.py @@ -6,58 +6,107 @@ from __future__ import annotations from typing import override -from bauiv1lib.popup import PopupWindow +# from bauiv1lib.popup import PopupWindow import bauiv1 as bui -class InboxWindow(PopupWindow): +class InboxWindow(bui.MainWindow): """Popup window to show account messages.""" def __init__( - self, position: tuple[float, float], scale: float | None = None + self, + transition: str | None = 'in_right', + origin_widget: bui.Widget | None = None, + # position: tuple[float, float], + # scale: float | None = None, ): assert bui.app.classic is not None uiscale = bui.app.ui_v1.uiscale - if scale is None: - scale = ( - 2.3 - if uiscale is bui.UIScale.SMALL - else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23 - ) - self._transitioning_out = False - self._width = 450 + # if scale is None: + # scale = ( + # 2.3 + # if uiscale is bui.UIScale.SMALL + # else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23 + # ) + # self._transitioning_out = False + self._width = 600 if uiscale is bui.UIScale.SMALL else 450 self._height = ( 300 if uiscale is bui.UIScale.SMALL else 370 if uiscale is bui.UIScale.MEDIUM else 450 ) - bg_color = (0.5, 0.4, 0.6) + # bg_color = (0.5, 0.4, 0.6) # creates our _root_widget + # super().__init__( + # position=position, + # size=(self._width, self._height), + # scale=scale, + # bg_color=bg_color, + # edge_buffer_scale=4.0, # Try to keep button unobscured. + # ) super().__init__( - position=position, - size=(self._width, self._height), - scale=scale, - bg_color=bg_color, - edge_buffer_scale=4.0, # Try to keep button unobscured. + root_widget=bui.containerwidget( + size=(self._width, self._height), + toolbar_visibility=( + 'menu_minimal' + if uiscale is bui.UIScale.SMALL + else 'menu_full' + ), + scale=( + 2.3 + if uiscale is bui.UIScale.SMALL + else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23 + ), + stack_offset=( + (0, -10) + if uiscale is bui.UIScale.SMALL + else (0, 0) if uiscale is bui.UIScale.MEDIUM else (0, 0) + ), + ), + transition=transition, + origin_widget=origin_widget, ) - self._cancel_button = bui.buttonwidget( - parent=self.root_widget, - position=(50, self._height - 30), - size=(50, 50), - scale=0.5, - label='', - color=bg_color, - on_activate_call=self._on_cancel_press, - autoselect=True, - icon=bui.gettexture('crossOut'), - iconscale=1.2, - ) + if uiscale is bui.UIScale.SMALL: + bui.containerwidget( + edit=self._root_widget, on_cancel_call=self.main_window_back + ) + self._back_button = None + else: + self._back_button = bui.buttonwidget( + parent=self._root_widget, + autoselect=True, + position=(50, self._height - 38), + size=(60, 60), + scale=0.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 + ) + + # self._cancel_button = bui.buttonwidget( + # parent=self.root_widget, + # position=(50, self._height - 30), + # size=(50, 50), + # scale=0.5, + # label='', + # color=bg_color, + # on_activate_call=self._on_cancel_press, + # autoselect=True, + # icon=bui.gettexture('crossOut'), + # iconscale=1.2, + # ) self._title_text = bui.textwidget( - parent=self.root_widget, - position=(self._width * 0.5, self._height - 20), + parent=self._root_widget, + position=( + self._width * 0.5, + self._height - (27 if uiscale is bui.UIScale.SMALL else 20), + ), size=(0, 0), h_align='center', v_align='center', @@ -68,16 +117,21 @@ class InboxWindow(PopupWindow): ) self._scrollwidget = bui.scrollwidget( - parent=self.root_widget, + parent=self._root_widget, size=(self._width - 60, self._height - 70), position=(30, 30), capture_arrows=True, simple_culling_v=10, ) bui.widget(edit=self._scrollwidget, autoselect=True) + if uiscale is bui.UIScale.SMALL: + bui.widget( + edit=self._scrollwidget, + left_widget=bui.get_special_widget('back_button'), + ) bui.containerwidget( - edit=self.root_widget, cancel_button=self._cancel_button + edit=self._root_widget, cancel_button=self._back_button ) entries: list[str] = [] @@ -105,15 +159,26 @@ class InboxWindow(PopupWindow): v_align='center', ) - def _on_cancel_press(self) -> None: - self._transition_out() - - def _transition_out(self) -> None: - if not self._transitioning_out: - self._transitioning_out = True - bui.containerwidget(edit=self.root_widget, transition='out_scale') - @override - def on_popup_cancel(self) -> None: - bui.getsound('swish').play() - self._transition_out() + def get_main_window_state(self) -> bui.MainWindowState: + # Support recreating our window for back/refresh purposes. + cls = type(self) + return bui.BasicMainWindowState( + create_call=lambda transition, origin_widget: cls( + transition=transition, origin_widget=origin_widget + ) + ) + + # def _on_cancel_press(self) -> None: + # self._transition_out() + + # def _transition_out(self) -> None: + # if not self._transitioning_out: + # self._transitioning_out = True + # bui.containerwidget( + # edit=self._root_widget, transition='out_scale') + + # @override + # def on_popup_cancel(self) -> None: + # bui.getsound('swish').play() + # self._transition_out() diff --git a/src/assets/ba_data/python/bauiv1lib/league/rankwindow.py b/src/assets/ba_data/python/bauiv1lib/league/rankwindow.py index 97078465..a4a1fb67 100644 --- a/src/assets/ba_data/python/bauiv1lib/league/rankwindow.py +++ b/src/assets/ba_data/python/bauiv1lib/league/rankwindow.py @@ -186,16 +186,14 @@ class LeagueRankWindow(bui.MainWindow): self._update(show=info is None) def _on_achievements_press(self) -> None: - from bauiv1lib import achievements + from bauiv1lib.achievements import AchievementsWindow # only allow this for all-time or the current season # (we currently don't keep specific achievement data for old seasons) if self._season == 'a' or self._is_current_season: prab = self._power_ranking_achievements_button assert prab is not None - achievements.AchievementsWindow( - position=prab.get_screen_space_center() - ) + self.main_window_replace(AchievementsWindow(origin_widget=prab)) else: bui.screenmessage( bui.Lstr( diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index 15c6dc5b..74a5fc0c 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 = 22011; +const int kEngineBuildNumber = 22012; const char* kEngineVersion = "1.7.37"; const int kEngineApiVersion = 9; diff --git a/src/ballistica/ui_v1/widget/root_widget.cc b/src/ballistica/ui_v1/widget/root_widget.cc index bf8132f6..0f37e62c 100644 --- a/src/ballistica/ui_v1/widget/root_widget.cc +++ b/src/ballistica/ui_v1/widget/root_widget.cc @@ -54,6 +54,7 @@ struct RootWidget::ButtonDef { float h_align{}; float x{}; float y{}; + float y_offs_small{}; float width{100.0f}; float height{30.0f}; float scale{1.0f}; @@ -74,12 +75,13 @@ struct RootWidget::Button { Object::Ref widget; float h_align{}; VAlign v_align{VAlign::kTop}; - float x{}; // user provided x - float y{}; // user provided y - float x_target{}; // final target x (accounting for visibility, etc) - float y_target{}; // final target y (accounting for visibility, etc) - float x_smoothed{}; // current x (on way to target) - float y_smoothed{}; // current y (on way to target) + float x{}; // user provided x + float y{}; // user provided y + float y_offs_small{}; // user provided y offset for small uiscale + float x_target{}; // final target x (accounting for visibility, etc) + float y_target{}; // final target y (accounting for visibility, etc) + float x_smoothed{}; // current x (on way to target) + float y_smoothed{}; // current y (on way to target) float width{100.0f}; float height{30.0f}; float scale{1.0f}; @@ -178,10 +180,10 @@ auto RootWidget::AddCover_(float h_align, VAlign v_align, float x, float y, // phone-size; for other sizes we always draw a backing. // // UPDATE: We no longer do backings, so ignore that. - if (g_base->ui->scale() != UIScale::kSmall) { - bd.visibility_mask |= - static_cast(Widget::ToolbarVisibility::kMenuFull); - } + // if (g_base->ui->scale() != UIScale::kSmall) { + // bd.visibility_mask |= + // static_cast(Widget::ToolbarVisibility::kMenuFull); + // } Button* b = AddButton_(bd); return b; @@ -189,7 +191,9 @@ auto RootWidget::AddCover_(float h_align, VAlign v_align, float x, float y, void RootWidget::AddMeter_(MeterType type, float h_align, float r, float g, float b, bool plus, const std::string& s) { - float yoffs = (g_base->ui->scale() == UIScale::kSmall) ? 0.0f : -7.0f; + // float yoffs = (g_base->ui->scale() == UIScale::kSmall) ? 0.0f : -7.0f; + + float y_offs_small{7.0f}; float width = (type == MeterType::kTrophy) ? 80.0f : 110.0f; width = 110.0f; @@ -202,7 +206,8 @@ void RootWidget::AddMeter_(MeterType type, float h_align, float r, float g, bd.width = width; bd.height = 36.0f; // bd.x = x; - bd.y = -36.0f + 10.0f + yoffs; + bd.y = -36.0f + 10.0f - y_offs_small; + bd.y_offs_small = y_offs_small; bd.img = "uiAtlas2"; bd.mesh_transparent = "currencyMeter"; bd.selectable = true; @@ -466,17 +471,18 @@ void RootWidget::AddMeter_(MeterType type, float h_align, float r, float g, bd.v_align = VAlign::kTop; bd.width = bd.height = 45.0f; // bd.x = x - 68; - bd.y = -36.0f + 11.0f + yoffs; + bd.y = -36.0f + 11.0f - y_offs_small; + bd.y_offs_small = y_offs_small; bd.img = "uiAtlas2"; bd.mesh_transparent = "currencyPlusButton"; bd.color_r = 0.35f; bd.color_g = 0.35f; bd.color_b = 0.55f; - if (g_base->ui->scale() != UIScale::kSmall) { - // bd.color_r *= TOOLBAR_COLOR_R; - // bd.color_g *= TOOLBAR_COLOR_G; - // bd.color_b *= TOOLBAR_COLOR_B; - } + // if (g_base->ui->scale() != UIScale::kSmall) { + // bd.color_r *= TOOLBAR_COLOR_R; + // bd.color_g *= TOOLBAR_COLOR_G; + // bd.color_b *= TOOLBAR_COLOR_B; + // } bd.depth_min = 0.3f; switch (type) { case MeterType::kTokens: @@ -615,9 +621,9 @@ void RootWidget::Setup() { bd.h_align = 0.5f; bd.v_align = VAlign::kTop; bd.width = 850.0f; - if (g_base->ui->scale() != UIScale::kSmall) { - bd.width = 850.0f; - } + // if (g_base->ui->scale() != UIScale::kSmall) { + // bd.width = 850.0f; + // } bd.height = 90.0f; bd.x = 0.0f; bd.y = -20.0f; @@ -628,14 +634,14 @@ void RootWidget::Setup() { bd.color_g = 0.41f; bd.color_b = 0.56f; bd.opacity = 1.0f; - if (g_base->ui->scale() != UIScale::kSmall) { - bd.color_r *= TOOLBAR_COLOR_R * TOOLBAR_BACK_COLOR_R; - bd.color_g *= TOOLBAR_COLOR_G * TOOLBAR_BACK_COLOR_G; - bd.color_b *= TOOLBAR_COLOR_B * TOOLBAR_BACK_COLOR_B; - bd.opacity *= TOOLBAR_OPACITY; - } else { - bd.opacity *= TOOLBAR_OPACITY_2; - } + // if (g_base->ui->scale() != UIScale::kSmall) { + // bd.color_r *= TOOLBAR_COLOR_R * TOOLBAR_BACK_COLOR_R; + // bd.color_g *= TOOLBAR_COLOR_G * TOOLBAR_BACK_COLOR_G; + // bd.color_b *= TOOLBAR_COLOR_B * TOOLBAR_BACK_COLOR_B; + // bd.opacity *= TOOLBAR_OPACITY; + // } else { + // bd.opacity *= TOOLBAR_OPACITY_2; + // } bd.depth_min = 0.2f; // bd.call = ""; bd.call = UIV1Python::ObjID::kEmptyCall; @@ -649,7 +655,7 @@ void RootWidget::Setup() { } // float xoffs = (g_base->ui->scale() == UIScale::kSmall) ? 90.0f : 0.0f; - float yoffs = (g_base->ui->scale() == UIScale::kSmall) ? 0.0f : -10.0f; + // float yoffs = (g_base->ui->scale() == UIScale::kSmall) ? 0.0f : -10.0f; // Account Button { @@ -660,16 +666,18 @@ void RootWidget::Setup() { bd.height = 60.0f; bd.depth_min = 0.3f; // bd.x = 110.0f + xoffs; - bd.y = -24.0f + yoffs; + // bd.y = -24.0f + yoffs; + bd.y = -34.0f; + bd.y_offs_small = 10.0f; bd.color_r = 0.56f; bd.color_g = 0.5f; bd.color_b = 0.73f; bd.call = UIV1Python::ObjID::kRootUIAccountButtonPressCall; - if (g_base->ui->scale() != UIScale::kSmall) { - // bd.color_r *= TOOLBAR_COLOR_R; - // bd.color_g *= TOOLBAR_COLOR_G; - // bd.color_b *= TOOLBAR_COLOR_B; - } + // if (g_base->ui->scale() != UIScale::kSmall) { + // bd.color_r *= TOOLBAR_COLOR_R; + // bd.color_g *= TOOLBAR_COLOR_G; + // bd.color_b *= TOOLBAR_COLOR_B; + // } bd.pre_buffer = 10.0f; bd.visibility_mask = (static_cast(Widget::ToolbarVisibility::kMenuFull) @@ -752,7 +760,7 @@ void RootWidget::Setup() { top_right_buttons_.push_back(menu_button_); } - // Party button. + // Squad button. { ButtonDef b; b.h_align = 1.0f; @@ -786,16 +794,16 @@ void RootWidget::Setup() { // Bot-left cover // AddCover(0.0f, VAlign::kBottom, 0.0f, -210.0f, 600.0f, 600.0f, 0.25f); - float bx = 55.0f; + // float bx = 55.0f; // Inbox button. { ButtonDef b; b.h_align = 0.0f; b.v_align = VAlign::kBottom; - b.width = b.height = 55.0f; + b.width = b.height = 60.0f; // b.x = bx; - b.y = b.height * 0.5f + 5; + b.y = b.height * 0.5f + 2.0f; b.color_r = BOT_LEFT_COLOR_R; b.color_g = BOT_LEFT_COLOR_G; b.color_b = BOT_LEFT_COLOR_B; @@ -805,22 +813,22 @@ void RootWidget::Setup() { (static_cast(Widget::ToolbarVisibility::kMenuFull) | static_cast(Widget::ToolbarVisibility::kMenuFullNoBack) | static_cast(Widget::ToolbarVisibility::kMenuFullRoot)); - b.pre_buffer = 20.0f; + b.pre_buffer = 25.0f; b.allow_in_game = false; inbox_button_ = AddButton_(b); bottom_left_buttons_.push_back(inbox_button_); } - bx += 80.0f; + // bx += 80.0f; // Achievements button. if (explicit_bool(true)) { ButtonDef b; b.h_align = 0.0f; b.v_align = VAlign::kBottom; - b.width = b.height = 55.0f; + b.width = b.height = 60.0f; // b.x = bx; - b.y = b.height * 0.5f + 5; + b.y = b.height * 0.5f + 2.0f; b.color_r = BOT_LEFT_COLOR_R; b.color_g = BOT_LEFT_COLOR_G; b.color_b = BOT_LEFT_COLOR_B; @@ -830,11 +838,11 @@ void RootWidget::Setup() { (static_cast(Widget::ToolbarVisibility::kMenuFull) | static_cast(Widget::ToolbarVisibility::kMenuFullNoBack) | static_cast(Widget::ToolbarVisibility::kMenuFullRoot)); - b.pre_buffer = 20.0f; + b.pre_buffer = 25.0f; b.allow_in_game = false; achievements_button_ = AddButton_(b); bottom_left_buttons_.push_back(achievements_button_); - bx += 80.0f; + // bx += 80.0f; // Achievement count. // { @@ -928,9 +936,9 @@ void RootWidget::Setup() { ButtonDef b; b.h_align = 0.0f; b.v_align = VAlign::kBottom; - b.width = b.height = 50.0f; + b.width = b.height = 60.0f; // b.x = bx; - b.y = b.height * 0.5f + 5; + b.y = b.height * 0.5f + 2.0f; b.color_r = BOT_LEFT_COLOR_R; b.color_g = BOT_LEFT_COLOR_G; b.color_b = BOT_LEFT_COLOR_B; @@ -940,7 +948,7 @@ void RootWidget::Setup() { | static_cast(Widget::ToolbarVisibility::kMenuFullNoBack) | static_cast(Widget::ToolbarVisibility::kMenuFullRoot)); AddButton_(b); - bx += 70.0f; + // bx += 70.0f; } // Settings button. @@ -948,9 +956,9 @@ void RootWidget::Setup() { ButtonDef b; b.h_align = 0.0f; b.v_align = VAlign::kBottom; - b.width = b.height = 55.0f; + b.width = b.height = 60.0f; // b.x = bx; - b.y = b.height * 0.58f; + b.y = b.height * 0.58f - 2.0f; b.color_r = BOT_LEFT_COLOR_R; b.color_g = BOT_LEFT_COLOR_G; b.color_b = BOT_LEFT_COLOR_B; @@ -961,7 +969,7 @@ void RootWidget::Setup() { | static_cast(Widget::ToolbarVisibility::kMenuFullNoBack) | static_cast(Widget::ToolbarVisibility::kMenuFullRoot) | static_cast(Widget::ToolbarVisibility::kMenuInGame)); - b.pre_buffer = 20.0f; + b.pre_buffer = 25.0f; settings_button_ = AddButton_(b); bottom_left_buttons_.push_back(settings_button_); } @@ -981,23 +989,23 @@ void RootWidget::Setup() { float backing_cover_g = backing_g; float backing_cover_b = backing_b; float backingA = 1.0f; - if (g_base->ui->scale() != UIScale::kSmall) { - backing_r *= TOOLBAR_COLOR_R * TOOLBAR_BACK_COLOR_R; - backing_g *= TOOLBAR_COLOR_G * TOOLBAR_BACK_COLOR_G; - backing_b *= TOOLBAR_COLOR_B * TOOLBAR_BACK_COLOR_B; - backing_cover_r *= TOOLBAR_COLOR_R; - backing_cover_g *= TOOLBAR_COLOR_G; - backing_cover_b *= TOOLBAR_COLOR_B; - backingA *= TOOLBAR_OPACITY; - } else { - backing_r *= 1.1f; - backing_g *= 1.1f; - backing_b *= 1.1f; - backing_cover_r *= 1.1f; - backing_cover_g *= 1.1f; - backing_cover_b *= 1.1f; - backingA *= TOOLBAR_OPACITY_2; - } + // if (g_base->ui->scale() != UIScale::kSmall) { + // backing_r *= TOOLBAR_COLOR_R * TOOLBAR_BACK_COLOR_R; + // backing_g *= TOOLBAR_COLOR_G * TOOLBAR_BACK_COLOR_G; + // backing_b *= TOOLBAR_COLOR_B * TOOLBAR_BACK_COLOR_B; + // backing_cover_r *= TOOLBAR_COLOR_R; + // backing_cover_g *= TOOLBAR_COLOR_G; + // backing_cover_b *= TOOLBAR_COLOR_B; + // backingA *= TOOLBAR_OPACITY; + // } else { + backing_r *= 1.1f; + backing_g *= 1.1f; + backing_b *= 1.1f; + backing_cover_r *= 1.1f; + backing_cover_g *= 1.1f; + backing_cover_b *= 1.1f; + backingA *= TOOLBAR_OPACITY_2; + // } // Bar backing. { @@ -1161,6 +1169,7 @@ auto RootWidget::AddButton_(const ButtonDef& def) -> RootWidget::Button* { Button& b(buttons_.back()); b.x = b.x_smoothed = b.x_target = def.x; b.y = b.y_smoothed = b.y_target = def.y; + b.y_offs_small = def.y_offs_small; b.visibility_mask = def.visibility_mask; b.disable_offset_scale = def.disable_offset_scale; b.pre_buffer = def.pre_buffer; @@ -1293,6 +1302,8 @@ void RootWidget::StepPositions_(float dt) { return; } + bool is_small{g_base->ui->scale() == UIScale::kSmall}; + // Update enabled-state for all buttons. for (Button& b : buttons_) { bool enable_button = @@ -1319,11 +1330,9 @@ void RootWidget::StepPositions_(float dt) { // enable_button = false; // } } - if (&b == back_button_) { - // Back button is always disabled in medium/large UI. - if (g_base->ui->scale() != UIScale::kSmall) { - enable_button = false; - } + // Back button is always disabled in medium/large UI. + if (&b == back_button_ && !is_small) { + enable_button = false; } b.enabled = enable_button; } @@ -1385,7 +1394,7 @@ void RootWidget::StepPositions_(float dt) { for (Button& b : buttons_) { // Update our target position. b.x_target = b.x; - b.y_target = b.y; + b.y_target = b.y + (is_small ? b.y_offs_small : 0.0f); float disable_offset = b.disable_offset_scale * 110.0f * ((b.v_align == VAlign::kTop) ? 1.0f : -1.0f); // float top_right_offset = 100.0f; From 029dc1520cb903a5a480e73aadb6a8c46da2994f Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 25 Sep 2024 17:03:55 -0700 Subject: [PATCH 5/7] cleaned up UIs to look decent on older less widescreen (16:9) phones --- .efrocachemap | 56 ++++---- CHANGELOG.md | 2 +- src/assets/.asset_manifest_public.json | 8 +- src/assets/Makefile | 8 +- src/assets/ba_data/python/baenv.py | 2 +- .../ba_data/python/bauiv1lib/achievements.py | 21 ++- .../ba_data/python/bauiv1lib/coop/browser.py | 8 +- .../ba_data/python/bauiv1lib/credits.py | 11 +- .../python/bauiv1lib/gather/__init__.py | 27 +++- .../python/bauiv1lib/{helpui.py => help.py} | 25 ++-- src/assets/ba_data/python/bauiv1lib/inbox.py | 52 ++----- .../ba_data/python/bauiv1lib/inventory.py | 13 +- .../ba_data/python/bauiv1lib/mainmenu.py | 4 +- .../python/bauiv1lib/playlist/addgame.py | 23 ++-- .../python/bauiv1lib/playlist/browser.py | 4 +- .../bauiv1lib/playlist/customizebrowser.py | 29 ++-- .../ba_data/python/bauiv1lib/playlist/edit.py | 26 ++-- .../python/bauiv1lib/playlist/editgame.py | 21 ++- .../python/bauiv1lib/playlist/mapselect.py | 18 +-- .../python/bauiv1lib/settings/advanced.py | 12 +- .../python/bauiv1lib/settings/allsettings.py | 9 +- .../bauiv1lib/{ => settings}/benchmarks.py | 16 ++- .../python/bauiv1lib/settings/controls.py | 4 +- .../python/bauiv1lib/settings/devtools.py | 2 +- .../python/bauiv1lib/settings/nettesting.py | 129 +++++++++++------- .../python/bauiv1lib/settings/plugins.py | 28 ++-- .../bauiv1lib/settings/pluginsettings.py | 28 ++-- .../python/bauiv1lib/settings/remoteapp.py | 19 +-- .../python/bauiv1lib/settings/testing.py | 52 +++++-- .../python/bauiv1lib/soundtrack/browser.py | 25 ++-- .../python/bauiv1lib/soundtrack/edit.py | 18 ++- src/ballistica/shared/ballistica.cc | 2 +- 32 files changed, 410 insertions(+), 292 deletions(-) rename src/assets/ba_data/python/bauiv1lib/{helpui.py => help.py} (96%) rename src/assets/ba_data/python/bauiv1lib/{ => settings}/benchmarks.py (96%) diff --git a/.efrocachemap b/.efrocachemap index 3012707e..0641444e 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": "009e9834589fdca68dad7af91b56a9ae", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "5f307993914ffd163b31824495103533", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "eb06b4b7905a67fb2b7e65d543872b8d", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "4fce2d86cf75558f089f8bc67476cd8e", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "954288b391c83f0c124d0ab9b2f3ef5b", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "1883286f80c4f53723f3d0338a3c3c31", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "ad63b8d21e6ae4fd0274875c4e66f6bf", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "f5c69292fa9b046ac86b9c938b139dbe", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "9e53108985b005b5c5403d992a8eb5bd", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "f5e9323ce05bdde512c4a853e0a46d71", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "1a572a5722992601bfc510499083d980", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "b26537fa8323d1fb159f4f07c035d0d3", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "a70a22456f7d6d3cc2826f27627f302d", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "868d55c194a4834d8a373c8d9300f4a1", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "1a35b2a949f8d900a1fb640592a6d5f9", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "f2465aed23f9dc56fe1ba17a8e528563", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "d32b49718718560b44ef3b4e99a1dd96", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "6ff6d0b91e51c4d3a8bb134be2bff23b", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "64c03fe1e1bc86b49079bf5dec74d484", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "b905501fa611121ae9e34db5fb841921", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "7fd769a5fba18ef66df318f3e37e997b", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "d1791e5fb831a8b2c9b57311e5150cfa", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "4ac30721dfa5733629e658b9c9f72c20", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "67efb133f38243baf802f50b675a5012", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "6422858d74bde927974f04650ef1dc42", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "c596fbb576be7d5a4a892423cbc38174", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "c7ca5174ea1aeeac78e6c08ee3d0a6fe", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "ba2405d69ae54d8cf94023c973fe0f9f", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "db91aff1e1646bd2bb0eab4281efe164", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "aab047ea9912fd75194c74ab91351a86", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "8b1a6d52494ec4430ca2431f6492663a", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "d8c3d60b782999942cdacb76c18dc33f", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "19d64c31b8c7e40bf81ca64b574eaf0c", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "7bfea504671ad515e4466fa8d79bc68c", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "92b49993780d368c00960887a96a18e5", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "99c3beebabf9ab885ba06b98131ad8f4", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "033636a6f1c6d4530ead7cb6e126b568", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "64223eac879a1b500564fa3e742dcd7e", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "0cc20eaf538e0cb0b98de0a3a55bba5c", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "a265f0275487fb15d30a050c8db145bf", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "086a2ce72497e44079ad6b747fc5439f", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", @@ -4132,14 +4132,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "4c11b81a574aa9af593f54db4d998e61", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "e900c88682cb4e25a3f36e798aa167db", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "d74de72b01b831df93e14a77f8351a75", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "44a8676feda50e8b831f707041b6053e", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "c7b6d06e55a914e94cf7ab84dd7ed617", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "cd7aab8432d4ba5eefd1d36261bc1928", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "1058ad3d671eb62dc52a971cf231f5e3", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "96908e3c333c66c2010136c11ac4fde6", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "d962d4f91a10bfae22e96c9e74466c4a", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "c454896ceaa45a8b17071e2640b3c05f", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "895bf9f6264abcafad739fd262105d4e", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "a35f999cae9384f769f5b159b4c4f6ae", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "862f051934a0f941800cf26b57aedc0f", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "0158bce6f4270a0e25ccffe8cde23215", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "a9d874c34cab4aa660cf607aca32363a", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "b65364291ce3784dbf5e873eeee0a41e", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "c91dfeeaa90ac17c3160cbe79dd468d5", "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 caf97a4e..7deb32fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.37 (build 22012, api 9, 2024-09-24) +### 1.7.37 (build 22013, api 9, 2024-09-25) - 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/.asset_manifest_public.json b/src/assets/.asset_manifest_public.json index efae5d4a..2e5060b0 100644 --- a/src/assets/.asset_manifest_public.json +++ b/src/assets/.asset_manifest_public.json @@ -367,7 +367,6 @@ "ba_data/python/bauiv1lib/__pycache__/__init__.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/__pycache__/achievements.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/__pycache__/appinvite.cpython-312.opt-1.pyc", - "ba_data/python/bauiv1lib/__pycache__/benchmarks.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/__pycache__/characterpicker.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/__pycache__/colorpicker.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/__pycache__/config.cpython-312.opt-1.pyc", @@ -380,7 +379,7 @@ "ba_data/python/bauiv1lib/__pycache__/fileselector.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/__pycache__/getremote.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/__pycache__/gettokens.cpython-312.opt-1.pyc", - "ba_data/python/bauiv1lib/__pycache__/helpui.cpython-312.opt-1.pyc", + "ba_data/python/bauiv1lib/__pycache__/help.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/__pycache__/iconpicker.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/__pycache__/inbox.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/__pycache__/ingamemenu.cpython-312.opt-1.pyc", @@ -421,7 +420,6 @@ "ba_data/python/bauiv1lib/account/viewer.py", "ba_data/python/bauiv1lib/achievements.py", "ba_data/python/bauiv1lib/appinvite.py", - "ba_data/python/bauiv1lib/benchmarks.py", "ba_data/python/bauiv1lib/characterpicker.py", "ba_data/python/bauiv1lib/colorpicker.py", "ba_data/python/bauiv1lib/config.py", @@ -456,7 +454,7 @@ "ba_data/python/bauiv1lib/gather/publictab.py", "ba_data/python/bauiv1lib/getremote.py", "ba_data/python/bauiv1lib/gettokens.py", - "ba_data/python/bauiv1lib/helpui.py", + "ba_data/python/bauiv1lib/help.py", "ba_data/python/bauiv1lib/iconpicker.py", "ba_data/python/bauiv1lib/inbox.py", "ba_data/python/bauiv1lib/ingamemenu.py", @@ -516,6 +514,7 @@ "ba_data/python/bauiv1lib/settings/__pycache__/advanced.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/settings/__pycache__/allsettings.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/settings/__pycache__/audio.cpython-312.opt-1.pyc", + "ba_data/python/bauiv1lib/settings/__pycache__/benchmarks.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/settings/__pycache__/controls.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/settings/__pycache__/devtools.cpython-312.opt-1.pyc", "ba_data/python/bauiv1lib/settings/__pycache__/gamepad.cpython-312.opt-1.pyc", @@ -533,6 +532,7 @@ "ba_data/python/bauiv1lib/settings/advanced.py", "ba_data/python/bauiv1lib/settings/allsettings.py", "ba_data/python/bauiv1lib/settings/audio.py", + "ba_data/python/bauiv1lib/settings/benchmarks.py", "ba_data/python/bauiv1lib/settings/controls.py", "ba_data/python/bauiv1lib/settings/devtools.py", "ba_data/python/bauiv1lib/settings/gamepad.py", diff --git a/src/assets/Makefile b/src/assets/Makefile index 5440f665..81619ca9 100644 --- a/src/assets/Makefile +++ b/src/assets/Makefile @@ -341,7 +341,6 @@ SCRIPT_TARGETS_PY_PUBLIC = \ $(BUILD_DIR)/ba_data/python/bauiv1lib/account/viewer.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/achievements.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/appinvite.py \ - $(BUILD_DIR)/ba_data/python/bauiv1lib/benchmarks.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/characterpicker.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/colorpicker.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/config.py \ @@ -365,7 +364,7 @@ SCRIPT_TARGETS_PY_PUBLIC = \ $(BUILD_DIR)/ba_data/python/bauiv1lib/gather/publictab.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/getremote.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/gettokens.py \ - $(BUILD_DIR)/ba_data/python/bauiv1lib/helpui.py \ + $(BUILD_DIR)/ba_data/python/bauiv1lib/help.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/iconpicker.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/inbox.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/ingamemenu.py \ @@ -406,6 +405,7 @@ SCRIPT_TARGETS_PY_PUBLIC = \ $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/advanced.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/allsettings.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/audio.py \ + $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/benchmarks.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/controls.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/devtools.py \ $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/gamepad.py \ @@ -619,7 +619,6 @@ SCRIPT_TARGETS_PYC_PUBLIC = \ $(BUILD_DIR)/ba_data/python/bauiv1lib/account/__pycache__/viewer.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/achievements.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/appinvite.cpython-312.opt-1.pyc \ - $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/benchmarks.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/characterpicker.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/colorpicker.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/config.cpython-312.opt-1.pyc \ @@ -643,7 +642,7 @@ SCRIPT_TARGETS_PYC_PUBLIC = \ $(BUILD_DIR)/ba_data/python/bauiv1lib/gather/__pycache__/publictab.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/getremote.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/gettokens.cpython-312.opt-1.pyc \ - $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/helpui.cpython-312.opt-1.pyc \ + $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/help.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/iconpicker.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/inbox.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/ingamemenu.cpython-312.opt-1.pyc \ @@ -684,6 +683,7 @@ SCRIPT_TARGETS_PYC_PUBLIC = \ $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/__pycache__/advanced.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/__pycache__/allsettings.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/__pycache__/audio.cpython-312.opt-1.pyc \ + $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/__pycache__/benchmarks.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/__pycache__/controls.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/__pycache__/devtools.cpython-312.opt-1.pyc \ $(BUILD_DIR)/ba_data/python/bauiv1lib/settings/__pycache__/gamepad.cpython-312.opt-1.pyc \ diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index ef617cf6..79b10d37 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 = 22012 +TARGET_BALLISTICA_BUILD = 22013 TARGET_BALLISTICA_VERSION = '1.7.37' diff --git a/src/assets/ba_data/python/bauiv1lib/achievements.py b/src/assets/ba_data/python/bauiv1lib/achievements.py index 36d182ca..94f17750 100644 --- a/src/assets/ba_data/python/bauiv1lib/achievements.py +++ b/src/assets/ba_data/python/bauiv1lib/achievements.py @@ -22,10 +22,11 @@ class AchievementsWindow(bui.MainWindow): uiscale = bui.app.ui_v1.uiscale self._width = 600 if uiscale is bui.UIScale.SMALL else 450 self._height = ( - 300 + 380 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 super().__init__( root_widget=bui.containerwidget( @@ -41,7 +42,7 @@ class AchievementsWindow(bui.MainWindow): else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23 ), stack_offset=( - (0, -10) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) if uiscale is bui.UIScale.MEDIUM else (0, 0) ), @@ -59,7 +60,7 @@ class AchievementsWindow(bui.MainWindow): self._back_button = bui.buttonwidget( parent=self._root_widget, autoselect=True, - position=(50, self._height - 38), + position=(50, self._height - 38 + yoffs), size=(60, 60), scale=0.6, label=bui.charstr(bui.SpecialChar.BACK), @@ -84,7 +85,9 @@ class AchievementsWindow(bui.MainWindow): parent=self._root_widget, position=( self._width * 0.5, - self._height - (27 if uiscale is bui.UIScale.SMALL else 20), + self._height + - (27 if uiscale is bui.UIScale.SMALL else 20) + + yoffs, ), size=(0, 0), h_align='center', @@ -97,8 +100,14 @@ class AchievementsWindow(bui.MainWindow): self._scrollwidget = bui.scrollwidget( parent=self._root_widget, - size=(self._width - 60, self._height - 70), - position=(30, 30), + size=( + self._width - 60, + self._height - (150 if uiscale is bui.UIScale.SMALL else 70), + ), + position=( + 30, + (110 if uiscale is bui.UIScale.SMALL else 30) + yoffs, + ), capture_arrows=True, simple_culling_v=10, ) diff --git a/src/assets/ba_data/python/bauiv1lib/coop/browser.py b/src/assets/ba_data/python/bauiv1lib/coop/browser.py index 7a04aeb7..533e617b 100644 --- a/src/assets/ba_data/python/bauiv1lib/coop/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/coop/browser.py @@ -77,12 +77,12 @@ class CoopBrowserWindow(bui.MainWindow): 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._height = ( - 565 + 600 if uiscale is bui.UIScale.SMALL else 730 if uiscale is bui.UIScale.MEDIUM else 800 ) self._r = 'coopSelectWindow' - top_extra = 20 if uiscale is bui.UIScale.SMALL else 0 + top_extra = 0 if uiscale is bui.UIScale.SMALL else 0 self._tourney_data_up_to_date = False @@ -109,7 +109,7 @@ class CoopBrowserWindow(bui.MainWindow): size=(self._width, self._height + top_extra), toolbar_visibility='menu_full', stack_offset=( - (0, -17) + (0, -8) if uiscale is bui.UIScale.SMALL else (0, 0) if uiscale is bui.UIScale.MEDIUM else (0, 0) ), @@ -256,7 +256,7 @@ class CoopBrowserWindow(bui.MainWindow): self._scroll_width = self._width - (130 + 2 * x_inset) self._scroll_height = self._height - ( - 185 if uiscale is bui.UIScale.SMALL else 160 + 219 if uiscale is bui.UIScale.SMALL else 160 ) self._subcontainerwidth = 800.0 diff --git a/src/assets/ba_data/python/bauiv1lib/credits.py b/src/assets/ba_data/python/bauiv1lib/credits.py index 5c735e49..a3dc4e08 100644 --- a/src/assets/ba_data/python/bauiv1lib/credits.py +++ b/src/assets/ba_data/python/bauiv1lib/credits.py @@ -32,7 +32,7 @@ class CreditsWindow(bui.MainWindow): uiscale = bui.app.ui_v1.uiscale width = 990 if uiscale is bui.UIScale.SMALL else 670 x_inset = 100 if uiscale is bui.UIScale.SMALL else 0 - height = 398 if uiscale is bui.UIScale.SMALL else 500 + height = 450 if uiscale is bui.UIScale.SMALL else 500 self._r = 'creditsWindow' super().__init__( @@ -86,7 +86,7 @@ class CreditsWindow(bui.MainWindow): bui.textwidget( parent=self._root_widget, - position=(0, height - (65 if uiscale is bui.UIScale.SMALL else 54)), + position=(0, height - (93 if uiscale is bui.UIScale.SMALL else 54)), size=(width, 30), scale=0.8 if uiscale is bui.UIScale.SMALL else 1.0, text=bui.Lstr( @@ -101,8 +101,11 @@ class CreditsWindow(bui.MainWindow): scroll = bui.scrollwidget( parent=self._root_widget, - position=(40 + x_inset, 35), - size=(width - (80 + 2 * x_inset), height - 100), + position=(40 + x_inset, 62 if uiscale is bui.UIScale.SMALL else 35), + size=( + width - (80 + 2 * x_inset), + height - (160 if uiscale is bui.UIScale.SMALL else 100), + ), capture_arrows=True, ) diff --git a/src/assets/ba_data/python/bauiv1lib/gather/__init__.py b/src/assets/ba_data/python/bauiv1lib/gather/__init__.py index f3f01e32..d80218b3 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/__init__.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/__init__.py @@ -90,8 +90,9 @@ class GatherWindow(bui.MainWindow): uiscale = bui.app.ui_v1.uiscale self._width = 1640 if uiscale is bui.UIScale.SMALL else 1040 x_offs = 200 if uiscale is bui.UIScale.SMALL else 0 + y_offs = -65 if uiscale is bui.UIScale.SMALL else 0 self._height = ( - 550 + 650 if uiscale is bui.UIScale.SMALL else 680 if uiscale is bui.UIScale.MEDIUM else 800 ) @@ -113,7 +114,7 @@ class GatherWindow(bui.MainWindow): else 0.95 if uiscale is bui.UIScale.MEDIUM else 0.7 ), stack_offset=( - (0, -20) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) if uiscale is bui.UIScale.MEDIUM else (0, 0) ), @@ -130,7 +131,7 @@ class GatherWindow(bui.MainWindow): else: self._back_button = btn = bui.buttonwidget( parent=self._root_widget, - position=(70 + x_offs, self._height - 74), + position=(70 + x_offs, self._height - 74 + y_offs), size=(140, 60), scale=1.1, autoselect=True, @@ -153,7 +154,7 @@ class GatherWindow(bui.MainWindow): ) bui.textwidget( parent=self._root_widget, - position=(self._width * 0.5, self._height - 42 + t_offs_y), + position=(self._width * 0.5, self._height - 42 + t_offs_y + y_offs), size=(0, 0), color=bui.app.ui_v1.title_color, scale=( @@ -197,7 +198,10 @@ class GatherWindow(bui.MainWindow): self._tab_row = TabRow( self._root_widget, tabdefs, - pos=(tab_buffer_h * 0.5, self._height - 130 + tabs_top_extra), + pos=( + tab_buffer_h * 0.5, + self._height - 130 + tabs_top_extra + y_offs, + ), size=(self._width - tab_buffer_h, 50), on_select_call=bui.WeakCall(self._set_tab), ) @@ -227,11 +231,20 @@ class GatherWindow(bui.MainWindow): ) self._scroll_width = self._width - scroll_buffer_h - self._scroll_height = self._height - 180.0 + tabs_top_extra + self._scroll_height = ( + self._height + - (270.0 if uiscale is bui.UIScale.SMALL else 180.0) + + tabs_top_extra + ) self._scroll_left = (self._width - self._scroll_width) * 0.5 self._scroll_bottom = ( - self._height - self._scroll_height - 79 - 48 + tabs_top_extra + self._height + - self._scroll_height + - 79 + - 48 + + tabs_top_extra + + y_offs ) buffer_h = 10 buffer_v = 4 diff --git a/src/assets/ba_data/python/bauiv1lib/helpui.py b/src/assets/ba_data/python/bauiv1lib/help.py similarity index 96% rename from src/assets/ba_data/python/bauiv1lib/helpui.py rename to src/assets/ba_data/python/bauiv1lib/help.py index ea4e8722..d0652d59 100644 --- a/src/assets/ba_data/python/bauiv1lib/helpui.py +++ b/src/assets/ba_data/python/bauiv1lib/help.py @@ -26,13 +26,14 @@ class HelpWindow(bui.MainWindow): getres = bui.app.lang.get_resource - # self._main_menu = main_menu assert bui.app.classic is not None uiscale = bui.app.ui_v1.uiscale width = 1050 if uiscale is bui.UIScale.SMALL else 750 - x_offs = 70 if uiscale is bui.UIScale.SMALL else 0 + xoffs = 70 if uiscale is bui.UIScale.SMALL else 0 + yoffs = -33 if uiscale is bui.UIScale.SMALL else 0 + height = ( - 460 + 500 if uiscale is bui.UIScale.SMALL else 530 if uiscale is bui.UIScale.MEDIUM else 600 ) @@ -51,7 +52,7 @@ class HelpWindow(bui.MainWindow): else 1.15 if uiscale is bui.UIScale.MEDIUM else 1.0 ), stack_offset=( - (0, -24) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 15) if uiscale is bui.UIScale.MEDIUM else (0, 0) ), @@ -62,7 +63,10 @@ class HelpWindow(bui.MainWindow): bui.textwidget( parent=self._root_widget, - position=(0, height - (50 if uiscale is bui.UIScale.SMALL else 45)), + position=( + 0, + height - (50 if uiscale is bui.UIScale.SMALL else 45) + yoffs, + ), size=(width, 25), text=bui.Lstr( resource=f'{self._r}.titleText', @@ -75,11 +79,14 @@ class HelpWindow(bui.MainWindow): self._scrollwidget = bui.scrollwidget( parent=self._root_widget, - position=(44 + x_offs, 55 if uiscale is bui.UIScale.SMALL else 55), + position=( + 44 + xoffs, + (92 if uiscale is bui.UIScale.SMALL else 55) + yoffs, + ), simple_culling_v=100.0, size=( - width - (88 + 2 * x_offs), - height - 120 + (5 if uiscale is bui.UIScale.SMALL else 0), + width - (88 + 2 * xoffs), + height - (150 if uiscale is bui.UIScale.SMALL else 120), ), capture_arrows=True, ) @@ -105,7 +112,7 @@ class HelpWindow(bui.MainWindow): else: btn = bui.buttonwidget( parent=self._root_widget, - position=(x_offs + 50, height - 55), + position=(xoffs + 50, height - 55), size=(60, 55), scale=0.8, label=bui.charstr(bui.SpecialChar.BACK), diff --git a/src/assets/ba_data/python/bauiv1lib/inbox.py b/src/assets/ba_data/python/bauiv1lib/inbox.py index cb3ad3d5..d5c73000 100644 --- a/src/assets/ba_data/python/bauiv1lib/inbox.py +++ b/src/assets/ba_data/python/bauiv1lib/inbox.py @@ -17,34 +17,17 @@ class InboxWindow(bui.MainWindow): self, transition: str | None = 'in_right', origin_widget: bui.Widget | None = None, - # position: tuple[float, float], - # scale: float | None = None, ): assert bui.app.classic is not None uiscale = bui.app.ui_v1.uiscale - # if scale is None: - # scale = ( - # 2.3 - # if uiscale is bui.UIScale.SMALL - # else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23 - # ) - # self._transitioning_out = False self._width = 600 if uiscale is bui.UIScale.SMALL else 450 self._height = ( - 300 + 380 if uiscale is bui.UIScale.SMALL else 370 if uiscale is bui.UIScale.MEDIUM else 450 ) - # bg_color = (0.5, 0.4, 0.6) + yoffs = -45 if uiscale is bui.UIScale.SMALL else 0 - # creates our _root_widget - # super().__init__( - # position=position, - # size=(self._width, self._height), - # scale=scale, - # bg_color=bg_color, - # edge_buffer_scale=4.0, # Try to keep button unobscured. - # ) super().__init__( root_widget=bui.containerwidget( size=(self._width, self._height), @@ -59,7 +42,7 @@ class InboxWindow(bui.MainWindow): else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23 ), stack_offset=( - (0, -10) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) if uiscale is bui.UIScale.MEDIUM else (0, 0) ), @@ -77,7 +60,7 @@ class InboxWindow(bui.MainWindow): self._back_button = bui.buttonwidget( parent=self._root_widget, autoselect=True, - position=(50, self._height - 38), + position=(50, self._height - 38 + yoffs), size=(60, 60), scale=0.6, label=bui.charstr(bui.SpecialChar.BACK), @@ -88,24 +71,13 @@ class InboxWindow(bui.MainWindow): edit=self._root_widget, cancel_button=self._back_button ) - # self._cancel_button = bui.buttonwidget( - # parent=self.root_widget, - # position=(50, self._height - 30), - # size=(50, 50), - # scale=0.5, - # label='', - # color=bg_color, - # on_activate_call=self._on_cancel_press, - # autoselect=True, - # icon=bui.gettexture('crossOut'), - # iconscale=1.2, - # ) - self._title_text = bui.textwidget( parent=self._root_widget, position=( self._width * 0.5, - self._height - (27 if uiscale is bui.UIScale.SMALL else 20), + self._height + - (27 if uiscale is bui.UIScale.SMALL else 20) + + yoffs, ), size=(0, 0), h_align='center', @@ -118,8 +90,14 @@ class InboxWindow(bui.MainWindow): self._scrollwidget = bui.scrollwidget( parent=self._root_widget, - size=(self._width - 60, self._height - 70), - position=(30, 30), + size=( + self._width - 60, + self._height - (150 if uiscale is bui.UIScale.SMALL else 70), + ), + position=( + 30, + (110 if uiscale is bui.UIScale.SMALL else 30) + yoffs, + ), capture_arrows=True, simple_culling_v=10, ) diff --git a/src/assets/ba_data/python/bauiv1lib/inventory.py b/src/assets/ba_data/python/bauiv1lib/inventory.py index 6297f3aa..508ccfba 100644 --- a/src/assets/ba_data/python/bauiv1lib/inventory.py +++ b/src/assets/ba_data/python/bauiv1lib/inventory.py @@ -24,11 +24,12 @@ class InventoryWindow(bui.MainWindow): uiscale = bui.app.ui_v1.uiscale width = 1050 if uiscale is bui.UIScale.SMALL else 750 height = ( - 460 + 500 if uiscale is bui.UIScale.SMALL else 530 if uiscale is bui.UIScale.MEDIUM else 600 ) x_offs = 70 if uiscale is bui.UIScale.SMALL else 0 + yoffs = -45 if uiscale is bui.UIScale.SMALL else 0 super().__init__( root_widget=bui.containerwidget( @@ -44,7 +45,7 @@ class InventoryWindow(bui.MainWindow): else 1.15 if uiscale is bui.UIScale.MEDIUM else 1.0 ), stack_offset=( - (0, -24) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 15) if uiscale is bui.UIScale.MEDIUM else (0, 0) ), @@ -55,7 +56,7 @@ class InventoryWindow(bui.MainWindow): bui.textwidget( parent=self._root_widget, - position=(0, height - (50 if uiscale is bui.UIScale.SMALL else 45)), + position=(0, height - 45 + yoffs), size=(width, 25), text='INVENTORY', color=bui.app.ui_v1.title_color, @@ -70,7 +71,7 @@ class InventoryWindow(bui.MainWindow): else: btn = bui.buttonwidget( parent=self._root_widget, - position=(x_offs + 50, height - 55), + position=(x_offs + 50, height - 55 + yoffs), size=(60, 55), scale=0.8, label=bui.charstr(bui.SpecialChar.BACK), @@ -83,7 +84,7 @@ class InventoryWindow(bui.MainWindow): bui.textwidget( parent=self._root_widget, - position=(0, height - 120), + position=(0, height - 120 + yoffs), size=(width, 25), text='(under construction)', scale=0.7, @@ -94,7 +95,7 @@ class InventoryWindow(bui.MainWindow): button_width = 300 self._player_profiles_button = btn = bui.buttonwidget( parent=self._root_widget, - position=((width - button_width) * 0.5, height - 200), + position=((width - button_width) * 0.5, height - 200 + yoffs), autoselect=True, size=(button_width, 60), label=bui.Lstr(resource='playerProfilesWindow.titleText'), diff --git a/src/assets/ba_data/python/bauiv1lib/mainmenu.py b/src/assets/ba_data/python/bauiv1lib/mainmenu.py index 496da734..278d5019 100644 --- a/src/assets/ba_data/python/bauiv1lib/mainmenu.py +++ b/src/assets/ba_data/python/bauiv1lib/mainmenu.py @@ -91,7 +91,7 @@ class MainMenuWindow(bui.MainWindow): import bauiv1lib.account.settings as _unused5 import bauiv1lib.store.browser as _unused6 import bauiv1lib.credits as _unused7 - import bauiv1lib.helpui as _unused8 + import bauiv1lib.help as _unused8 import bauiv1lib.settings.allsettings as _unused9 import bauiv1lib.gather as _unused10 import bauiv1lib.watch as _unused11 @@ -524,7 +524,7 @@ class MainMenuWindow(bui.MainWindow): def _howtoplay(self) -> None: # pylint: disable=cyclic-import - from bauiv1lib.helpui import HelpWindow + from bauiv1lib.help import HelpWindow # no-op if we're not currently in control. if not self.main_window_has_control(): diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/addgame.py b/src/assets/ba_data/python/bauiv1lib/playlist/addgame.py index 54b54914..7e064d1f 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/addgame.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/addgame.py @@ -28,17 +28,18 @@ class PlaylistAddGameWindow(bui.MainWindow): uiscale = bui.app.ui_v1.uiscale self._width = 750 if uiscale is bui.UIScale.SMALL else 650 x_inset = 50 if uiscale is bui.UIScale.SMALL else 0 + yoffs = -44 if uiscale is bui.UIScale.SMALL else 0 + self._height = ( - 346 + 400 if uiscale is bui.UIScale.SMALL - else 380 if uiscale is bui.UIScale.MEDIUM else 440 + else 400 if uiscale is bui.UIScale.MEDIUM else 460 ) - top_extra = 30 if uiscale is bui.UIScale.SMALL else 20 self._scroll_width = 210 super().__init__( root_widget=bui.containerwidget( - size=(self._width, self._height + top_extra), + size=(self._width, self._height), scale=( 1.95 if uiscale is bui.UIScale.SMALL @@ -56,7 +57,7 @@ class PlaylistAddGameWindow(bui.MainWindow): else: self._back_button = bui.buttonwidget( parent=self._root_widget, - position=(58 + x_inset, self._height - 53), + position=(58 + x_inset, self._height - 53 + yoffs), size=(60, 48), label=bui.charstr(bui.SpecialChar.BACK), autoselect=True, @@ -65,7 +66,7 @@ class PlaylistAddGameWindow(bui.MainWindow): ) self._select_button = select_button = bui.buttonwidget( parent=self._root_widget, - position=(self._width - (172 + x_inset), self._height - 50), + position=(self._width - (172 + x_inset), self._height - 50 + yoffs), autoselect=True, size=(160, 60), scale=0.75, @@ -81,7 +82,7 @@ class PlaylistAddGameWindow(bui.MainWindow): bui.textwidget( parent=self._root_widget, - position=(self._width * 0.5, self._height - 28), + position=(self._width * 0.5, self._height - 28 + yoffs), size=(0, 0), scale=1.0, text=bui.Lstr(resource=f'{self._r}.titleText'), @@ -90,7 +91,7 @@ class PlaylistAddGameWindow(bui.MainWindow): maxwidth=250, v_align='center', ) - v = self._height - 64 + v = self._height - 64 + yoffs self._selected_title_text = bui.textwidget( parent=self._root_widget, @@ -114,9 +115,11 @@ class PlaylistAddGameWindow(bui.MainWindow): h_align='left', ) - scroll_height = self._height - 100 + scroll_height = self._height - ( + 160 if uiscale is bui.UIScale.SMALL else 100 + ) - v = self._height - 60 + v = self._height - 60 + yoffs self._scrollwidget = bui.scrollwidget( parent=self._root_widget, diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/browser.py b/src/assets/ba_data/python/bauiv1lib/playlist/browser.py index 65721765..0792f59a 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/browser.py @@ -61,7 +61,7 @@ class PlaylistBrowserWindow(bui.MainWindow): else 510 if uiscale is bui.UIScale.MEDIUM else 580 ) - top_extra = 20 if uiscale is bui.UIScale.SMALL else 0 + top_extra = 30 if uiscale is bui.UIScale.SMALL else 0 super().__init__( root_widget=bui.containerwidget( @@ -80,7 +80,7 @@ class PlaylistBrowserWindow(bui.MainWindow): else 1.05 if uiscale is bui.UIScale.MEDIUM else 0.9 ), stack_offset=( - (0, -56) if uiscale is bui.UIScale.SMALL else (0, 0) + (0, -46) if uiscale is bui.UIScale.SMALL else (0, 0) ), ), transition=transition, diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/customizebrowser.py b/src/assets/ba_data/python/bauiv1lib/playlist/customizebrowser.py index f9c777fd..559998cf 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/customizebrowser.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/customizebrowser.py @@ -45,20 +45,20 @@ class PlaylistCustomizeBrowserWindow(bui.MainWindow): uiscale = bui.app.ui_v1.uiscale self._width = 970.0 if uiscale is bui.UIScale.SMALL else 650.0 x_inset = 100.0 if uiscale is bui.UIScale.SMALL else 0.0 + yoffs = -51 if uiscale is bui.UIScale.SMALL else 0.0 self._height = ( - 380.0 + 440.0 if uiscale is bui.UIScale.SMALL else 420.0 if uiscale is bui.UIScale.MEDIUM else 500.0 ) - top_extra = 20.0 if uiscale is bui.UIScale.SMALL else 0.0 super().__init__( root_widget=bui.containerwidget( - size=(self._width, self._height + top_extra), + size=(self._width, self._height), scale=( - 1.83 + 1.8 if uiscale is bui.UIScale.SMALL - else 1.5 if uiscale is bui.UIScale.MEDIUM else 1.0 + else 1.4 if uiscale is bui.UIScale.MEDIUM else 1.0 ), toolbar_visibility=( 'menu_minimal' @@ -66,7 +66,7 @@ class PlaylistCustomizeBrowserWindow(bui.MainWindow): else 'menu_full' ), stack_offset=( - (0, -10) if uiscale is bui.UIScale.SMALL else (0, 0) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) ), ), transition=transition, @@ -82,7 +82,7 @@ class PlaylistCustomizeBrowserWindow(bui.MainWindow): else: self._back_button = bui.buttonwidget( parent=self._root_widget, - position=(43 + x_inset, self._height - 60), + position=(43 + x_inset, self._height - 60 + yoffs), size=(160, 68), scale=0.77, autoselect=True, @@ -99,7 +99,12 @@ class PlaylistCustomizeBrowserWindow(bui.MainWindow): bui.textwidget( parent=self._root_widget, - position=(0, self._height - 47), + position=( + 0, + self._height + - (47 if uiscale is bui.UIScale.SMALL else 47) + + yoffs, + ), size=(self._width, 25), text=bui.Lstr( resource=f'{self._r}.titleText', @@ -111,7 +116,7 @@ class PlaylistCustomizeBrowserWindow(bui.MainWindow): v_align='center', ) - v = self._height - 59.0 + v = self._height - 59.0 + yoffs h = 41 + x_inset b_color = (0.6, 0.53, 0.63) b_textcolor = (0.75, 0.7, 0.8) @@ -260,8 +265,10 @@ class PlaylistCustomizeBrowserWindow(bui.MainWindow): ) ) - v = self._height - 75 - self._scroll_height = self._height - 119 + v = self._height - 75 + yoffs + self._scroll_height = self._height - ( + 180 if uiscale is bui.UIScale.SMALL else 119 + ) scrollwidget = bui.scrollwidget( parent=self._root_widget, position=(140 + x_inset, v - self._scroll_height), diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/edit.py b/src/assets/ba_data/python/bauiv1lib/playlist/edit.py index 0a1b68f4..eb7c1d35 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/edit.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/edit.py @@ -35,22 +35,22 @@ class PlaylistEditWindow(bui.MainWindow): self._width = 870 if uiscale is bui.UIScale.SMALL else 670 x_inset = 100 if uiscale is bui.UIScale.SMALL else 0 self._height = ( - 400 + 500 if uiscale is bui.UIScale.SMALL else 470 if uiscale is bui.UIScale.MEDIUM else 540 ) + yoffs = -68 if uiscale is bui.UIScale.SMALL else 0 - top_extra = 20 if uiscale is bui.UIScale.SMALL else 0 super().__init__( root_widget=bui.containerwidget( - size=(self._width, self._height + top_extra), + size=(self._width, self._height), scale=( - 1.8 + 1.76 if uiscale is bui.UIScale.SMALL else 1.3 if uiscale is bui.UIScale.MEDIUM else 1.0 ), stack_offset=( - (0, -16) if uiscale is bui.UIScale.SMALL else (0, 0) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) ), ), transition=transition, @@ -58,7 +58,7 @@ class PlaylistEditWindow(bui.MainWindow): ) cancel_button = bui.buttonwidget( parent=self._root_widget, - position=(35 + x_inset, self._height - 60), + position=(35 + x_inset, self._height - 60 + yoffs), scale=0.8, size=(175, 60), autoselect=True, @@ -67,7 +67,7 @@ class PlaylistEditWindow(bui.MainWindow): ) save_button = btn = bui.buttonwidget( parent=self._root_widget, - position=(self._width - (195 + x_inset), self._height - 60), + position=(self._width - (195 + x_inset), self._height - 60 + yoffs), scale=0.8, size=(190, 60), autoselect=True, @@ -89,7 +89,7 @@ class PlaylistEditWindow(bui.MainWindow): bui.textwidget( parent=self._root_widget, - position=(-10, self._height - 50), + position=(-10, self._height - 50 + yoffs), size=(self._width, 25), text=bui.Lstr(resource=f'{self._r}.titleText'), color=bui.app.ui_v1.title_color, @@ -99,7 +99,7 @@ class PlaylistEditWindow(bui.MainWindow): maxwidth=270, ) - v = self._height - 115.0 + v = self._height - 115.0 + yoffs self._scroll_width = self._width - (205 + 2 * x_inset) @@ -136,7 +136,7 @@ class PlaylistEditWindow(bui.MainWindow): self._list_widgets: list[bui.Widget] = [] h = 40 + x_inset - v = self._height - 172.0 + v = self._height - 172.0 + yoffs b_color = (0.6, 0.53, 0.63) b_textcolor = (0.75, 0.7, 0.8) @@ -222,8 +222,10 @@ class PlaylistEditWindow(bui.MainWindow): repeat=True, ) - v = self._height - 100 - scroll_height = self._height - 155 + v = self._height - 100 + yoffs + scroll_height = self._height - ( + 250 if uiscale is bui.UIScale.SMALL else 155 + ) scrollwidget = bui.scrollwidget( parent=self._root_widget, position=(160 + x_inset, v - scroll_height), diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/editgame.py b/src/assets/ba_data/python/bauiv1lib/playlist/editgame.py index fa18b1e9..1dd46eda 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/editgame.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/editgame.py @@ -109,13 +109,14 @@ class PlaylistEditGameWindow(bui.MainWindow): width = 820 if uiscale is bui.UIScale.SMALL else 620 x_inset = 100 if uiscale is bui.UIScale.SMALL else 0 height = ( - 365 + 400 if uiscale is bui.UIScale.SMALL else 460 if uiscale is bui.UIScale.MEDIUM else 550 ) spacing = 52 y_extra = 15 y_extra2 = 21 + yoffs = -30 if uiscale is bui.UIScale.SMALL else 0 map_tex_name = get_map_class(self._map).get_preview_texture_name() if map_tex_name is None: @@ -132,7 +133,7 @@ class PlaylistEditGameWindow(bui.MainWindow): else 1.35 if uiscale is bui.UIScale.MEDIUM else 1.0 ), stack_offset=( - (0, -17) if uiscale is bui.UIScale.SMALL else (0, 0) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) ), ), transition=transition, @@ -141,7 +142,7 @@ class PlaylistEditGameWindow(bui.MainWindow): btn = bui.buttonwidget( parent=self._root_widget, - position=(45 + x_inset, height - 82 + y_extra2), + position=(45 + x_inset, height - 82 + y_extra2 + yoffs), size=(60, 48) if is_add else (180, 65), label=( bui.charstr(bui.SpecialChar.BACK) @@ -158,7 +159,7 @@ class PlaylistEditGameWindow(bui.MainWindow): add_button = bui.buttonwidget( parent=self._root_widget, - position=(width - (193 + x_inset), height - 82 + y_extra2), + position=(width - (193 + x_inset), height - 82 + y_extra2 + yoffs), size=(200, 65), scale=0.75, text_scale=1.3, @@ -174,7 +175,7 @@ class PlaylistEditGameWindow(bui.MainWindow): bui.textwidget( parent=self._root_widget, - position=(-8, height - 70 + y_extra2), + position=(-8, height - 70 + y_extra2 + yoffs), size=(width, 25), text=gametype.get_display_string(), color=bui.app.ui_v1.title_color, @@ -194,8 +195,14 @@ class PlaylistEditGameWindow(bui.MainWindow): scroll_width = width - (86 + 2 * x_inset) self._scrollwidget = bui.scrollwidget( parent=self._root_widget, - position=(44 + x_inset, 35 + y_extra), - size=(scroll_width, height - 116), + position=( + 44 + x_inset, + (80 if uiscale is bui.UIScale.SMALL else 35) + y_extra + yoffs, + ), + size=( + scroll_width, + height - (166 if uiscale is bui.UIScale.SMALL else 116), + ), highlight=False, claims_left_right=True, claims_tab=True, diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/mapselect.py b/src/assets/ba_data/python/bauiv1lib/playlist/mapselect.py index 65690a0f..603cd97a 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/mapselect.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/mapselect.py @@ -53,22 +53,22 @@ class PlaylistMapSelectWindow(bui.MainWindow): width = 815 if uiscale is bui.UIScale.SMALL else 615 x_inset = 100 if uiscale is bui.UIScale.SMALL else 0 height = ( - 400 + 420 if uiscale is bui.UIScale.SMALL else 480 if uiscale is bui.UIScale.MEDIUM else 600 ) + yoffs = -37 if uiscale is bui.UIScale.SMALL else 0 - top_extra = 20 if uiscale is bui.UIScale.SMALL else 0 super().__init__( root_widget=bui.containerwidget( - size=(width, height + top_extra), + size=(width, height), scale=( 1.95 if uiscale is bui.UIScale.SMALL else 1.3 if uiscale is bui.UIScale.MEDIUM else 1.0 ), stack_offset=( - (0, -27) if uiscale is bui.UIScale.SMALL else (0, 0) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) ), ), transition=transition, @@ -77,7 +77,7 @@ class PlaylistMapSelectWindow(bui.MainWindow): self._cancel_button = btn = bui.buttonwidget( parent=self._root_widget, - position=(38 + x_inset, height - 67), + position=(38 + x_inset, height - 67 + yoffs), size=(140, 50), scale=0.9, text_scale=1.0, @@ -89,7 +89,7 @@ class PlaylistMapSelectWindow(bui.MainWindow): bui.containerwidget(edit=self._root_widget, cancel_button=btn) bui.textwidget( parent=self._root_widget, - position=(width * 0.5, height - 46), + position=(width * 0.5, height - 46 + yoffs), size=(0, 0), maxwidth=260, scale=1.1, @@ -101,9 +101,11 @@ class PlaylistMapSelectWindow(bui.MainWindow): h_align='center', v_align='center', ) - v = height - 70 + v = height - 70 + yoffs self._scroll_width = width - (80 + 2 * x_inset) - self._scroll_height = height - 140 + self._scroll_height = height - ( + 170 if uiscale is bui.UIScale.SMALL else 140 + ) self._scrollwidget = bui.scrollwidget( parent=self._root_widget, diff --git a/src/assets/ba_data/python/bauiv1lib/settings/advanced.py b/src/assets/ba_data/python/bauiv1lib/settings/advanced.py index d3915c32..245621f7 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/advanced.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/advanced.py @@ -81,7 +81,9 @@ class AdvancedSettingsWindow(bui.MainWindow): self._show_always_use_internal_keyboard = not app.env.vr self._scroll_width = self._width - (100 + 2 * x_inset) - self._scroll_height = self._height - 115.0 + self._scroll_height = self._height - ( + 125.0 if uiscale is bui.UIScale.SMALL else 115.0 + ) self._sub_width = self._scroll_width * 0.95 self._sub_height = 870.0 @@ -129,10 +131,10 @@ class AdvancedSettingsWindow(bui.MainWindow): parent=self._root_widget, position=( self._width * 0.5, - self._height - (57 if uiscale is bui.UIScale.SMALL else 40), + self._height - (61 if uiscale is bui.UIScale.SMALL else 40), ), size=(0, 0), - scale=0.65 if uiscale is bui.UIScale.SMALL else 1.0, + scale=0.85 if uiscale is bui.UIScale.SMALL else 1.0, text=bui.Lstr(resource=f'{self._r}.titleText'), color=app.ui_v1.title_color, h_align='center', @@ -201,7 +203,7 @@ class AdvancedSettingsWindow(bui.MainWindow): from bauiv1lib import appinvite as _unused5 from bauiv1lib import account as _unused6 from bauiv1lib import sendinfo as _unused7 - from bauiv1lib import benchmarks as _unused8 + from bauiv1lib.settings import benchmarks as _unused8 from bauiv1lib.settings import plugins as _unused9 from bauiv1lib.settings import devtools as _unused10 @@ -783,7 +785,7 @@ class AdvancedSettingsWindow(bui.MainWindow): ) def _on_benchmark_press(self) -> None: - from bauiv1lib.benchmarks import BenchmarksAndStressTestsWindow + from bauiv1lib.settings.benchmarks import BenchmarksAndStressTestsWindow # no-op if we're not in control. if not self.main_window_has_control(): diff --git a/src/assets/ba_data/python/bauiv1lib/settings/allsettings.py b/src/assets/ba_data/python/bauiv1lib/settings/allsettings.py index 9c7c81a3..395e9efb 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/allsettings.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/allsettings.py @@ -33,9 +33,10 @@ class AllSettingsWindow(bui.MainWindow): uiscale = bui.app.ui_v1.uiscale width = 1000 if uiscale is bui.UIScale.SMALL else 580 x_inset = 125 if uiscale is bui.UIScale.SMALL else 0 - height = 435 + height = 500 if uiscale is bui.UIScale.SMALL else 435 self._r = 'settingsWindow' top_extra = 20 if uiscale is bui.UIScale.SMALL else 0 + yoffs = -30 if uiscale is bui.UIScale.SMALL else 0 uiscale = bui.app.ui_v1.uiscale super().__init__( @@ -68,7 +69,7 @@ class AllSettingsWindow(bui.MainWindow): self._back_button = btn = bui.buttonwidget( parent=self._root_widget, autoselect=True, - position=(40 + x_inset, height - 55), + position=(40 + x_inset, height - 55 + yoffs), size=(130, 60), scale=0.8, text_scale=1.2, @@ -80,7 +81,7 @@ class AllSettingsWindow(bui.MainWindow): bui.textwidget( parent=self._root_widget, - position=(0, height - 44), + position=(0, height - 44 + yoffs), size=(width, 25), text=bui.Lstr(resource=f'{self._r}.titleText'), color=bui.app.ui_v1.title_color, @@ -97,7 +98,7 @@ class AllSettingsWindow(bui.MainWindow): label=bui.charstr(bui.SpecialChar.BACK), ) - v = height - 80 + v = height - 80 + yoffs v -= 145 basew = 280 if uiscale is bui.UIScale.SMALL else 230 diff --git a/src/assets/ba_data/python/bauiv1lib/benchmarks.py b/src/assets/ba_data/python/bauiv1lib/settings/benchmarks.py similarity index 96% rename from src/assets/ba_data/python/bauiv1lib/benchmarks.py rename to src/assets/ba_data/python/bauiv1lib/settings/benchmarks.py index 927300ba..1f841057 100644 --- a/src/assets/ba_data/python/bauiv1lib/benchmarks.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/benchmarks.py @@ -25,13 +25,16 @@ class BenchmarksAndStressTestsWindow(bui.MainWindow): uiscale = bui.app.ui_v1.uiscale self._width = width = 650 if uiscale is bui.UIScale.SMALL else 580 self._height = height = ( - 330 + 400 if uiscale is bui.UIScale.SMALL else 420 if uiscale is bui.UIScale.MEDIUM else 520 ) + yoffs = -30 if uiscale is bui.UIScale.SMALL else 0 self._scroll_width = self._width - 100 - self._scroll_height = self._height - 120 + self._scroll_height = self._height - ( + 180 if uiscale is bui.UIScale.SMALL else 120 + ) self._sub_width = self._scroll_width * 0.95 self._sub_height = 520 @@ -72,7 +75,7 @@ class BenchmarksAndStressTestsWindow(bui.MainWindow): else: self._done_button = btn = bui.buttonwidget( parent=self._root_widget, - position=(40, height - 67), + position=(40, height - 67 + yoffs), size=(120, 60), scale=0.8, autoselect=True, @@ -83,7 +86,7 @@ class BenchmarksAndStressTestsWindow(bui.MainWindow): bui.textwidget( parent=self._root_widget, - position=(0, height - 60), + position=(0, height - 60 + yoffs), size=(width, 30), text=bui.Lstr(resource=f'{self._r}.titleText'), h_align='center', @@ -96,7 +99,10 @@ class BenchmarksAndStressTestsWindow(bui.MainWindow): parent=self._root_widget, highlight=False, size=(self._scroll_width, self._scroll_height), - position=((self._width - self._scroll_width) * 0.5, 50), + position=( + (self._width - self._scroll_width) * 0.5, + (115 if uiscale is bui.UIScale.SMALL else 50) + yoffs, + ), ) bui.containerwidget(edit=self._scrollwidget, claims_left_right=True) diff --git a/src/assets/ba_data/python/bauiv1lib/settings/controls.py b/src/assets/ba_data/python/bauiv1lib/settings/controls.py index 38678056..562c7e9f 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/controls.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/controls.py @@ -150,7 +150,7 @@ class ControlsSettingsWindow(bui.MainWindow): parent=self._root_widget, position=( 0, - height + yoffs - (75 if uiscale is bui.UIScale.SMALL else 50), + height + yoffs - (53 if uiscale is bui.UIScale.SMALL else 50), ), size=(width, 25), text=bui.Lstr(resource=f'{self._r}.titleText'), @@ -159,7 +159,7 @@ class ControlsSettingsWindow(bui.MainWindow): v_align='top', ) - v = height - 75 + yoffs + v = height - (85 if uiscale is bui.UIScale.SMALL else 75) + yoffs v -= spacing if show_touch: diff --git a/src/assets/ba_data/python/bauiv1lib/settings/devtools.py b/src/assets/ba_data/python/bauiv1lib/settings/devtools.py index 80d924ca..ea817002 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/devtools.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/devtools.py @@ -92,7 +92,7 @@ class DevToolsWindow(bui.MainWindow): self._height - (64 if uiscale is bui.UIScale.SMALL else 48), ), size=(0, 25), - scale=(0.6 if uiscale is bui.UIScale.SMALL else 1.0), + scale=(0.8 if uiscale is bui.UIScale.SMALL else 1.0), maxwidth=self._width - 200, text=bui.Lstr(resource='settingsWindowAdvanced.devToolsText'), color=app.ui_v1.title_color, diff --git a/src/assets/ba_data/python/bauiv1lib/settings/nettesting.py b/src/assets/ba_data/python/bauiv1lib/settings/nettesting.py index 23a6142f..b8e25808 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/nettesting.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/nettesting.py @@ -32,7 +32,9 @@ class NetTestingWindow(bui.MainWindow): ): uiscale = bui.app.ui_v1.uiscale self._width = 820 - self._height = 400 if uiscale is bui.UIScale.SMALL else 500 + self._height = 500 if uiscale is bui.UIScale.SMALL else 500 + yoffs = -50 if uiscale is bui.UIScale.SMALL else 0 + self._printed_lines: list[str] = [] assert bui.app.classic is not None super().__init__( @@ -53,23 +55,33 @@ class NetTestingWindow(bui.MainWindow): transition=transition, origin_widget=origin_widget, ) - self._done_button: bui.Widget | None = bui.buttonwidget( - parent=self._root_widget, - position=(46, self._height - 77), - size=(60, 60), - scale=0.9, - label=bui.charstr(bui.SpecialChar.BACK), - button_type='backSmall', - autoselect=True, - on_activate_call=self.main_window_back, - ) + self._done_button: bui.Widget | None + if uiscale is bui.UIScale.SMALL: + bui.containerwidget( + edit=self._root_widget, on_cancel_call=self.main_window_back + ) + self._done_button = None + else: + self._done_button = bui.buttonwidget( + parent=self._root_widget, + position=(46, self._height - 77 + yoffs), + size=(60, 60), + scale=0.9, + label=bui.charstr(bui.SpecialChar.BACK), + button_type='backSmall', + autoselect=True, + on_activate_call=self.main_window_back, + ) + bui.containerwidget( + edit=self._root_widget, cancel_button=self._done_button + ) # Avoid squads button on small mode. xinset = -50 if uiscale is bui.UIScale.SMALL else 0 self._copy_button = bui.buttonwidget( parent=self._root_widget, - position=(self._width - 200 + xinset, self._height - 77), + position=(self._width - 200 + xinset, self._height - 77 + yoffs), size=(100, 60), scale=0.8, autoselect=True, @@ -79,7 +91,7 @@ class NetTestingWindow(bui.MainWindow): self._settings_button = bui.buttonwidget( parent=self._root_widget, - position=(self._width - 100 + xinset, self._height - 77), + position=(self._width - 100 + xinset, self._height - 77 + yoffs), size=(60, 60), scale=0.8, autoselect=True, @@ -90,7 +102,7 @@ class NetTestingWindow(bui.MainWindow): twidth = self._width - 540 bui.textwidget( parent=self._root_widget, - position=(self._width * 0.5, self._height - 55), + position=(self._width * 0.5, self._height - 55 + yoffs), size=(0, 0), text=bui.Lstr(resource='settingsWindowAdvanced.netTestingText'), color=(0.8, 0.8, 0.8, 1.0), @@ -101,24 +113,19 @@ class NetTestingWindow(bui.MainWindow): self._scroll = bui.scrollwidget( parent=self._root_widget, - position=(50, 50), - size=(self._width - 100, self._height - 140), + position=( + 50, + (140 if uiscale is bui.UIScale.SMALL else 50) + yoffs, + ), + size=( + self._width - 100, + self._height - (220 if uiscale is bui.UIScale.SMALL else 140), + ), capture_arrows=True, autoselect=True, ) self._rows = bui.columnwidget(parent=self._scroll) - if uiscale is bui.UIScale.SMALL: - bui.containerwidget( - edit=self._root_widget, on_cancel_call=self.main_window_back - ) - self._done_button.delete() - self._done_button = None - else: - bui.containerwidget( - edit=self._root_widget, cancel_button=self._done_button - ) - # Now kick off the tests. # Pass a weak-ref to this window so we don't keep it alive # if we back out before it completes. Also set is as daemon @@ -169,7 +176,7 @@ class NetTestingWindow(bui.MainWindow): if not self.main_window_has_control(): return - self.main_window_replace(NetValTestingWindow()) + self.main_window_replace(get_net_val_testing_window()) def _run_diagnostics(weakwin: weakref.ref[NetTestingWindow]) -> None: @@ -461,26 +468,48 @@ def _test_nearby_zone_ping(nearest_zone: tuple[str, float] | None) -> None: raise RuntimeError('Ping too high.') -class NetValTestingWindow(TestingWindow): - """Window to test network related settings.""" +def get_net_val_testing_window() -> TestingWindow: + """Create a window for testing net values.""" + entries = [ + {'name': 'bufferTime', 'label': 'Buffer Time', 'increment': 1.0}, + { + 'name': 'delaySampling', + 'label': 'Delay Sampling', + 'increment': 1.0, + }, + { + 'name': 'dynamicsSyncTime', + 'label': 'Dynamics Sync Time', + 'increment': 10, + }, + {'name': 'showNetInfo', 'label': 'Show Net Info', 'increment': 1}, + ] + return TestingWindow( + title=bui.Lstr(resource='settingsWindowAdvanced.netTestingText'), + entries=entries, + ) - def __init__(self, transition: str = 'in_right'): - entries = [ - {'name': 'bufferTime', 'label': 'Buffer Time', 'increment': 1.0}, - { - 'name': 'delaySampling', - 'label': 'Delay Sampling', - 'increment': 1.0, - }, - { - 'name': 'dynamicsSyncTime', - 'label': 'Dynamics Sync Time', - 'increment': 10, - }, - {'name': 'showNetInfo', 'label': 'Show Net Info', 'increment': 1}, - ] - super().__init__( - title=bui.Lstr(resource='settingsWindowAdvanced.netTestingText'), - entries=entries, - transition=transition, - ) + +# class NetValTestingWindow(TestingWindow): +# """Window to test network related settings.""" + +# def __init__(self, transition: str = 'in_right'): +# entries = [ +# {'name': 'bufferTime', 'label': 'Buffer Time', 'increment': 1.0}, +# { +# 'name': 'delaySampling', +# 'label': 'Delay Sampling', +# 'increment': 1.0, +# }, +# { +# 'name': 'dynamicsSyncTime', +# 'label': 'Dynamics Sync Time', +# 'increment': 10, +# }, +# {'name': 'showNetInfo', 'label': 'Show Net Info', 'increment': 1}, +# ] +# super().__init__( +# title=bui.Lstr(resource='settingsWindowAdvanced.netTestingText'), +# entries=entries, +# transition=transition, +# ) diff --git a/src/assets/ba_data/python/bauiv1lib/settings/plugins.py b/src/assets/ba_data/python/bauiv1lib/settings/plugins.py index 6c12907d..40d2f26c 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/plugins.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/plugins.py @@ -44,12 +44,13 @@ class PluginWindow(bui.MainWindow): uiscale = bui.app.ui_v1.uiscale self._width = 870.0 if uiscale is bui.UIScale.SMALL else 670.0 x_inset = 100 if uiscale is bui.UIScale.SMALL else 0 + yoffs = -55.0 if uiscale is bui.UIScale.SMALL else 0 self._height = ( - 370.0 + 450.0 if uiscale is bui.UIScale.SMALL else 450.0 if uiscale is bui.UIScale.MEDIUM else 520.0 ) - top_extra = 10 if uiscale is bui.UIScale.SMALL else 0 + top_extra = 0 if uiscale is bui.UIScale.SMALL else 0 super().__init__( root_widget=bui.containerwidget( size=(self._width, self._height + top_extra), @@ -64,7 +65,7 @@ class PluginWindow(bui.MainWindow): else 1.4 if uiscale is bui.UIScale.MEDIUM else 1.0 ), stack_offset=( - (0, -25) if uiscale is bui.UIScale.SMALL else (0, 0) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) ), ), transition=transition, @@ -72,7 +73,9 @@ class PluginWindow(bui.MainWindow): ) self._scroll_width = self._width - (100 + 2 * x_inset) - self._scroll_height = self._height - 115.0 + self._scroll_height = self._height - ( + 200.0 if uiscale is bui.UIScale.SMALL else 115.0 + ) self._sub_width = self._scroll_width * 0.95 self._sub_height = 724.0 @@ -85,7 +88,7 @@ class PluginWindow(bui.MainWindow): else: self._back_button = bui.buttonwidget( parent=self._root_widget, - position=(53 + x_inset, self._height - 60), + position=(53 + x_inset, self._height - 60 + yoffs), size=(140, 60), scale=0.8, autoselect=True, @@ -99,7 +102,7 @@ class PluginWindow(bui.MainWindow): self._title_text = bui.textwidget( parent=self._root_widget, - position=(self._width * 0.5, self._height - 41), + position=(self._width * 0.5, self._height - 41 + yoffs), size=(0, 0), text=bui.Lstr(resource='pluginsText'), color=app.ui_v1.title_color, @@ -120,7 +123,7 @@ class PluginWindow(bui.MainWindow): self._num_plugins_text = bui.textwidget( parent=self._root_widget, - position=(settings_button_x - 130, self._height - 41), + position=(settings_button_x - 130, self._height - 41 + yoffs), size=(0, 0), text='', h_align='center', @@ -130,7 +133,7 @@ class PluginWindow(bui.MainWindow): self._category_button = bui.buttonwidget( parent=self._root_widget, scale=0.7, - position=(settings_button_x - 105, self._height - 60), + position=(settings_button_x - 105, self._height - 60 + yoffs), size=(130, 60), label=bui.Lstr(resource='allText'), autoselect=True, @@ -141,7 +144,7 @@ class PluginWindow(bui.MainWindow): self._settings_button = bui.buttonwidget( parent=self._root_widget, - position=(settings_button_x, self._height - 58), + position=(settings_button_x, self._height - 58 + yoffs), size=(40, 40), label='', on_activate_call=self._open_settings, @@ -149,7 +152,7 @@ class PluginWindow(bui.MainWindow): bui.imagewidget( parent=self._root_widget, - position=(settings_button_x + 3, self._height - 57), + position=(settings_button_x + 3, self._height - 57 + yoffs), draw_controller=self._settings_button, size=(35, 35), texture=bui.gettexture('settingsIcon'), @@ -163,7 +166,10 @@ class PluginWindow(bui.MainWindow): self._scrollwidget = bui.scrollwidget( parent=self._root_widget, - position=(50 + x_inset, 50), + position=( + 50 + x_inset, + (135 if uiscale is bui.UIScale.SMALL else 50) + yoffs, + ), simple_culling_v=20.0, highlight=False, size=(self._scroll_width, self._scroll_height), diff --git a/src/assets/ba_data/python/bauiv1lib/settings/pluginsettings.py b/src/assets/ba_data/python/bauiv1lib/settings/pluginsettings.py index 1f3aefda..19024b6b 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/pluginsettings.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/pluginsettings.py @@ -21,17 +21,13 @@ class PluginSettingsWindow(bui.MainWindow): assert bui.app.classic is not None uiscale = bui.app.ui_v1.uiscale - width = 670.0 if uiscale is bui.UIScale.SMALL else 470.0 - height = ( - 365.0 - if uiscale is bui.UIScale.SMALL - else 300.0 if uiscale is bui.UIScale.MEDIUM else 370.0 - ) - top_extra = 10 if uiscale is bui.UIScale.SMALL else 0 + width = 750.0 if uiscale is bui.UIScale.SMALL else 470.0 + height = 400.0 if uiscale is bui.UIScale.SMALL else 300.0 + yoffs = -20 if uiscale is bui.UIScale.SMALL else 0 super().__init__( root_widget=bui.containerwidget( - size=(width, height + top_extra), + size=(width, height), toolbar_visibility=( 'menu_minimal' if uiscale is bui.UIScale.SMALL @@ -43,7 +39,7 @@ class PluginSettingsWindow(bui.MainWindow): else 1.4 if uiscale is bui.UIScale.MEDIUM else 1.0 ), stack_offset=( - (0, -25) if uiscale is bui.UIScale.SMALL else (0, 0) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) ), ), transition=transition, @@ -51,7 +47,7 @@ class PluginSettingsWindow(bui.MainWindow): ) if uiscale is bui.UIScale.SMALL: - xoffs = 90 + xoffs = 135 self._back_button = bui.get_special_widget('back_button') bui.containerwidget( edit=self._root_widget, on_cancel_call=self.main_window_back @@ -60,7 +56,7 @@ class PluginSettingsWindow(bui.MainWindow): xoffs = 0 self._back_button = bui.buttonwidget( parent=self._root_widget, - position=(53, height - 60), + position=(53, height - 60 + yoffs), size=(60, 60), scale=0.8, autoselect=True, @@ -76,7 +72,7 @@ class PluginSettingsWindow(bui.MainWindow): parent=self._root_widget, position=( width * 0.5, - height - (45 if uiscale is bui.UIScale.SMALL else 35), + height - (55 if uiscale is bui.UIScale.SMALL else 35) + yoffs, ), size=(0, 0), text=bui.Lstr(resource='pluginSettingsText'), @@ -85,10 +81,10 @@ class PluginSettingsWindow(bui.MainWindow): v_align='center', ) - self._y_position = 170 if uiscale is bui.UIScale.MEDIUM else 205 + self._y_position = height - 140 + yoffs self._enable_plugins_button = bui.buttonwidget( parent=self._root_widget, - position=(xoffs + 65, self._y_position), + position=(xoffs + 65, self._y_position + yoffs), size=(350, 60), autoselect=True, label=bui.Lstr(resource='pluginsEnableAllText'), @@ -101,7 +97,7 @@ class PluginSettingsWindow(bui.MainWindow): self._y_position -= 70 self._disable_plugins_button = bui.buttonwidget( parent=self._root_widget, - position=(xoffs + 65, self._y_position), + position=(xoffs + 65, self._y_position + yoffs), size=(350, 60), autoselect=True, label=bui.Lstr(resource='pluginsDisableAllText'), @@ -114,7 +110,7 @@ class PluginSettingsWindow(bui.MainWindow): self._y_position -= 70 self._enable_new_plugins_check_box = bui.checkboxwidget( parent=self._root_widget, - position=(xoffs + 65, self._y_position), + position=(xoffs + 65, self._y_position + yoffs), size=(350, 60), value=bui.app.config.get( bui.app.plugins.AUTO_ENABLE_NEW_PLUGINS_CONFIG_KEY, diff --git a/src/assets/ba_data/python/bauiv1lib/settings/remoteapp.py b/src/assets/ba_data/python/bauiv1lib/settings/remoteapp.py index 97af8c44..d9719b3c 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/remoteapp.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/remoteapp.py @@ -21,7 +21,8 @@ class RemoteAppSettingsWindow(bui.MainWindow): app = bui.app uiscale = app.ui_v1.uiscale width = 800 if uiscale is bui.UIScale.SMALL else 700 - height = 390 + height = 480 if uiscale is bui.UIScale.SMALL else 390 + yoffs = -48 if uiscale is bui.UIScale.SMALL else 0 spacing = 40 assert bui.app.classic is not None super().__init__( @@ -33,12 +34,12 @@ class RemoteAppSettingsWindow(bui.MainWindow): else 'menu_full' ), scale=( - 1.76 + 1.75 if uiscale is bui.UIScale.SMALL else 1.3 if uiscale is bui.UIScale.MEDIUM else 1.0 ), stack_offset=( - (-10, 0) if uiscale is bui.UIScale.SMALL else (0, 0) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) ), ), transition=transition, @@ -52,7 +53,7 @@ class RemoteAppSettingsWindow(bui.MainWindow): else: btn = bui.buttonwidget( parent=self._root_widget, - position=(40, height - 67), + position=(40, height - 67 + yoffs), size=(140, 65), scale=0.8, label=bui.Lstr(resource='backText'), @@ -71,7 +72,7 @@ class RemoteAppSettingsWindow(bui.MainWindow): bui.textwidget( parent=self._root_widget, - position=(width * 0.5, height - 42), + position=(width * 0.5, height - 42 + yoffs), size=(0, 0), text=bui.Lstr(resource=f'{self._r}.titleText'), maxwidth=370, @@ -85,7 +86,7 @@ class RemoteAppSettingsWindow(bui.MainWindow): v -= spacing * 1.2 bui.textwidget( parent=self._root_widget, - position=(15, v - 26), + position=(15, v - 26 + yoffs), size=(width - 30, 30), maxwidth=width * 0.95, color=(0.7, 0.9, 0.7, 1.0), @@ -106,7 +107,7 @@ class RemoteAppSettingsWindow(bui.MainWindow): # Update: now we just show link to the remote webpage. bui.textwidget( parent=self._root_widget, - position=(width * 0.5, v + 5), + position=(width * 0.5, v + 5 + yoffs), size=(0, 0), color=(0.7, 0.9, 0.7, 1.0), scale=1.4, @@ -120,7 +121,7 @@ class RemoteAppSettingsWindow(bui.MainWindow): bui.textwidget( parent=self._root_widget, - position=(width * 0.5, v - 35), + position=(width * 0.5, v - 35 + yoffs), size=(0, 0), color=(0.7, 0.9, 0.7, 0.8), scale=0.65, @@ -133,7 +134,7 @@ class RemoteAppSettingsWindow(bui.MainWindow): bui.checkboxwidget( parent=self._root_widget, - position=(width * 0.5 - 150, v - 116), + position=(width * 0.5 - 150, v - 116 + yoffs), size=(300, 30), maxwidth=300, scale=0.8, diff --git a/src/assets/ba_data/python/bauiv1lib/settings/testing.py b/src/assets/ba_data/python/bauiv1lib/settings/testing.py index de396332..00c48124 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/testing.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/testing.py @@ -5,7 +5,7 @@ from __future__ import annotations import copy -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, override import bauiv1 as bui @@ -25,9 +25,12 @@ class TestingWindow(bui.MainWindow): ): assert bui.app.classic is not None uiscale = bui.app.ui_v1.uiscale - self._width = 700 if uiscale is bui.UIScale.SMALL else 600 - self._height = 324 if uiscale is bui.UIScale.SMALL else 400 + self._width = 690 if uiscale is bui.UIScale.SMALL else 600 + self._height = 400 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 + super().__init__( root_widget=bui.containerwidget( size=(self._width, self._height), @@ -37,7 +40,7 @@ class TestingWindow(bui.MainWindow): else 1.2 if uiscale is bui.UIScale.MEDIUM else 1.0 ), stack_offset=( - (0, -20) if uiscale is bui.UIScale.SMALL else (0, 0) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) ), toolbar_visibility=( 'menu_minimal' @@ -58,7 +61,7 @@ class TestingWindow(bui.MainWindow): self._back_button = btn = bui.buttonwidget( parent=self._root_widget, autoselect=True, - position=(65, self._height - 59), + position=(65, self._height - 59 + yoffs), size=(130, 60), scale=0.8, text_scale=1.2, @@ -74,25 +77,30 @@ class TestingWindow(bui.MainWindow): ) bui.containerwidget(edit=self._root_widget, cancel_button=btn) + self.title = title bui.textwidget( parent=self._root_widget, position=( self._width * 0.5, - self._height - (42 if uiscale is bui.UIScale.SMALL else 35), + self._height + - (42 if uiscale is bui.UIScale.SMALL else 35) + + yoffs, ), size=(0, 0), color=bui.app.ui_v1.title_color, h_align='center', v_align='center', maxwidth=245, - text=title, + text=self.title, ) bui.textwidget( parent=self._root_widget, position=( self._width * 0.5, - self._height - (80 if uiscale is bui.UIScale.SMALL else 80), + self._height + - (80 if uiscale is bui.UIScale.SMALL else 80) + + yoffs, ), size=(0, 0), color=bui.app.ui_v1.infotextcolor, @@ -102,12 +110,17 @@ class TestingWindow(bui.MainWindow): text=bui.Lstr(resource='settingsWindowAdvanced.forTestingText'), ) self._scroll_width = self._width - 130 - self._scroll_height = self._height - 140 + 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, 40), + position=( + (self._width - self._scroll_width) * 0.5, + (120 if uiscale is bui.UIScale.SMALL else 40) + yoffs, + ), ) bui.containerwidget(edit=self._scrollwidget, claims_left_right=True) @@ -226,3 +239,22 @@ class TestingWindow(bui.MainWindow): edit=entry['widget'], text='%.4g' % bui.app.classic.value_test(entry['name']), ) + + @override + def get_main_window_state(self) -> bui.MainWindowState: + # 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. + title = self.title + entries = self._entries_orig + + return bui.BasicMainWindowState( + create_call=lambda transition, origin_widget: cls( + title=title, + entries=entries, + transition=transition, + origin_widget=origin_widget, + ) + ) diff --git a/src/assets/ba_data/python/bauiv1lib/soundtrack/browser.py b/src/assets/ba_data/python/bauiv1lib/soundtrack/browser.py index 315ee998..371662b8 100644 --- a/src/assets/ba_data/python/bauiv1lib/soundtrack/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/soundtrack/browser.py @@ -25,19 +25,21 @@ class SoundtrackBrowserWindow(bui.MainWindow): origin_widget: bui.Widget | None = None, ): # pylint: disable=too-many-statements + # pylint: disable=too-many-locals self._r = 'editSoundtrackWindow' assert bui.app.classic is not None uiscale = bui.app.ui_v1.uiscale self._width = 800 if uiscale is bui.UIScale.SMALL else 600 x_inset = 100 if uiscale is bui.UIScale.SMALL else 0 + yoffs = -30 if uiscale is bui.UIScale.SMALL else 0 self._height = ( - 340 + 400 if uiscale is bui.UIScale.SMALL else 370 if uiscale is bui.UIScale.MEDIUM else 440 ) spacing = 40.0 - v = self._height - 40.0 + v = self._height - 40.0 + yoffs v -= spacing * 1.0 super().__init__( @@ -54,7 +56,7 @@ class SoundtrackBrowserWindow(bui.MainWindow): else 1.6 if uiscale is bui.UIScale.MEDIUM else 1.0 ), stack_offset=( - (0, -18) if uiscale is bui.UIScale.SMALL else (0, 0) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) ), ), transition=transition, @@ -67,7 +69,7 @@ class SoundtrackBrowserWindow(bui.MainWindow): else: self._back_button = bui.buttonwidget( parent=self._root_widget, - position=(45 + x_inset, self._height - 60), + position=(45 + x_inset, self._height - 60 + yoffs), size=(120, 60), scale=0.8, label=bui.Lstr(resource='backText'), @@ -82,7 +84,12 @@ class SoundtrackBrowserWindow(bui.MainWindow): ) bui.textwidget( parent=self._root_widget, - position=(self._width * 0.5, self._height - 35), + position=( + self._width * 0.5, + self._height + - (46 if uiscale is bui.UIScale.SMALL else 35) + + yoffs, + ), size=(0, 0), maxwidth=300, text=bui.Lstr(resource=f'{self._r}.titleText'), @@ -92,7 +99,7 @@ class SoundtrackBrowserWindow(bui.MainWindow): ) h = 43 + x_inset - v = self._height - 60 + v = self._height - 60 + yoffs b_color = (0.6, 0.53, 0.63) b_textcolor = (0.75, 0.7, 0.8) lock_tex = bui.gettexture('lock') @@ -222,8 +229,10 @@ class SoundtrackBrowserWindow(bui.MainWindow): ) self._update() - v = self._height - 65 - scroll_height = self._height - 105 + v = self._height - 65 + yoffs + scroll_height = self._height - ( + 160 if uiscale is bui.UIScale.SMALL else 105 + ) v -= scroll_height self._scrollwidget = scrollwidget = bui.scrollwidget( parent=self._root_widget, diff --git a/src/assets/ba_data/python/bauiv1lib/soundtrack/edit.py b/src/assets/ba_data/python/bauiv1lib/soundtrack/edit.py index 27fb5c1b..1edbe8fe 100644 --- a/src/assets/ba_data/python/bauiv1lib/soundtrack/edit.py +++ b/src/assets/ba_data/python/bauiv1lib/soundtrack/edit.py @@ -35,10 +35,12 @@ class SoundtrackEditWindow(bui.MainWindow): self._width = 900 if uiscale is bui.UIScale.SMALL else 648 x_inset = 100 if uiscale is bui.UIScale.SMALL else 0 self._height = ( - 395 + 450 if uiscale is bui.UIScale.SMALL else 450 if uiscale is bui.UIScale.MEDIUM else 560 ) + yoffs = -48 if uiscale is bui.UIScale.SMALL else 0 + super().__init__( root_widget=bui.containerwidget( size=(self._width, self._height), @@ -48,7 +50,7 @@ class SoundtrackEditWindow(bui.MainWindow): else 1.5 if uiscale is bui.UIScale.MEDIUM else 1.0 ), stack_offset=( - (0, -37) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 15) if uiscale is bui.UIScale.MEDIUM else (0, 0) ), @@ -58,7 +60,7 @@ class SoundtrackEditWindow(bui.MainWindow): ) cancel_button = bui.buttonwidget( parent=self._root_widget, - position=(38 + x_inset, self._height - 60), + position=(38 + x_inset, self._height - 60 + yoffs), size=(160, 60), autoselect=True, label=bui.Lstr(resource='cancelText'), @@ -66,7 +68,7 @@ class SoundtrackEditWindow(bui.MainWindow): ) save_button = bui.buttonwidget( parent=self._root_widget, - position=(self._width - (168 + x_inset), self._height - 60), + position=(self._width - (168 + x_inset), self._height - 60 + yoffs), autoselect=True, size=(160, 60), label=bui.Lstr(resource='saveText'), @@ -76,7 +78,7 @@ class SoundtrackEditWindow(bui.MainWindow): bui.widget(edit=cancel_button, right_widget=save_button) bui.textwidget( parent=self._root_widget, - position=(0, self._height - 50), + position=(0, self._height - 50 + yoffs), size=(self._width, 25), text=bui.Lstr( resource=self._r @@ -91,7 +93,7 @@ class SoundtrackEditWindow(bui.MainWindow): v_align='center', maxwidth=280, ) - v = self._height - 110 + v = self._height - 110 + yoffs if 'Soundtracks' not in appconfig: appconfig['Soundtracks'] = {} @@ -165,7 +167,9 @@ class SoundtrackEditWindow(bui.MainWindow): on_return_press_call=self._do_it_with_sound, ) - scroll_height = self._height - 180 + scroll_height = self._height - ( + 230 if uiscale is bui.UIScale.SMALL else 180 + ) self._scrollwidget = scrollwidget = bui.scrollwidget( parent=self._root_widget, highlight=False, diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index 74a5fc0c..63cf9d24 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 = 22012; +const int kEngineBuildNumber = 22013; const char* kEngineVersion = "1.7.37"; const int kEngineApiVersion = 9; From 86d2a7897459732383e53dc1638e97709648b57a Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 25 Sep 2024 19:08:39 -0700 Subject: [PATCH 6/7] a few more UI fixes for 16:9 phones --- .efrocachemap | 56 ++++++++--------- CHANGELOG.md | 2 +- config/requirements.txt | 2 +- src/assets/ba_data/python/baenv.py | 2 +- .../python/bauiv1lib/characterpicker.py | 11 ---- .../ba_data/python/bauiv1lib/coop/browser.py | 2 +- .../ba_data/python/bauiv1lib/profile/edit.py | 13 ++-- .../python/bauiv1lib/profile/upgrade.py | 62 ++++++------------- src/ballistica/shared/ballistica.cc | 2 +- 9 files changed, 60 insertions(+), 92 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index 0641444e..0849c084 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": "7fd769a5fba18ef66df318f3e37e997b", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "d1791e5fb831a8b2c9b57311e5150cfa", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "4ac30721dfa5733629e658b9c9f72c20", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "67efb133f38243baf802f50b675a5012", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "6422858d74bde927974f04650ef1dc42", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "c596fbb576be7d5a4a892423cbc38174", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "c7ca5174ea1aeeac78e6c08ee3d0a6fe", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "ba2405d69ae54d8cf94023c973fe0f9f", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "db91aff1e1646bd2bb0eab4281efe164", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "aab047ea9912fd75194c74ab91351a86", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "8b1a6d52494ec4430ca2431f6492663a", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "d8c3d60b782999942cdacb76c18dc33f", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "19d64c31b8c7e40bf81ca64b574eaf0c", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "7bfea504671ad515e4466fa8d79bc68c", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "92b49993780d368c00960887a96a18e5", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "99c3beebabf9ab885ba06b98131ad8f4", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "033636a6f1c6d4530ead7cb6e126b568", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "64223eac879a1b500564fa3e742dcd7e", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "0cc20eaf538e0cb0b98de0a3a55bba5c", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "a265f0275487fb15d30a050c8db145bf", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "65b928385abc5fb852a9bfca74e25515", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "949ec63b1c4049ca8b53177e3a1b4125", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "3e8a83e2a34261d99879c6be7a035f76", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "b23e959d29accbcacbb2e07983a4585b", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "293bb35597a0f9b39b4a940094b25c80", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "1c79a0db39022e7341c1f4228bbf1bfe", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "3dfaacb9b36d61081d39493ac5e95ae9", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "61a7153508cc55bad48bd9102a672b58", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "daf24f76db0462c10219c0422bef7651", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "4ad78818230f71946ecd45dddad495d3", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "1c22dcc8b478a5673e81eec9484b4c95", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "3ea63c2c531c1201511bd65cc84328c0", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "d1dda1bcd25be89d924f59daeb76deb4", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "461dd43017d4b9ddd66f07b663ea073a", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "8b5f76faeb062bf526f4de2e36756e86", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "b11df699748ceaeabb9d7b1d575d574b", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "0273dbc73771533d13d88636c0a0d920", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "c95d98be2122ffb63ea7ba2ea00bdc94", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "5945a64fbd6a70d3fed7e6cfe042515c", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "dfc3f3e2501435163035e43b2996624f", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "086a2ce72497e44079ad6b747fc5439f", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", @@ -4132,14 +4132,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "4c11b81a574aa9af593f54db4d998e61", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "c454896ceaa45a8b17071e2640b3c05f", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "895bf9f6264abcafad739fd262105d4e", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "a35f999cae9384f769f5b159b4c4f6ae", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "862f051934a0f941800cf26b57aedc0f", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "0158bce6f4270a0e25ccffe8cde23215", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "a9d874c34cab4aa660cf607aca32363a", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "b65364291ce3784dbf5e873eeee0a41e", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "c91dfeeaa90ac17c3160cbe79dd468d5", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "07ac2d15d5fdcaaf8505439b07b5f2aa", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "c55f3ea6d1e8d3f951e0ca08460e853f", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "c93e65e95335b64a5a7de102094bfe75", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "a276c3209acad4d12cdce69936044160", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "464fdc0293df656486ec70358b0bf9e8", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "f827037308d6d4a9b4fc978a362d166f", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "14f7fe0fa80210300c86ba65a5c70b75", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "75a7444330624357cb388077eccd9e69", "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 7deb32fa..b4721d99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.37 (build 22013, api 9, 2024-09-25) +### 1.7.37 (build 22014, api 9, 2024-09-25) - 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/config/requirements.txt b/config/requirements.txt index 75a8e8ab..816a0d45 100644 --- a/config/requirements.txt +++ b/config/requirements.txt @@ -6,7 +6,7 @@ mypy==1.11.2 pbxproj==4.2.1 pdoc==14.7.0 pur==7.3.2 -pylint==3.3.0 +pylint==3.3.1 pylsp-mypy==0.6.9 pytest==8.3.3 python-daemon==3.0.1 diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 79b10d37..551ac5b0 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 = 22013 +TARGET_BALLISTICA_BUILD = 22014 TARGET_BALLISTICA_VERSION = '1.7.37' diff --git a/src/assets/ba_data/python/bauiv1lib/characterpicker.py b/src/assets/ba_data/python/bauiv1lib/characterpicker.py index 2d5e413a..cd8286b4 100644 --- a/src/assets/ba_data/python/bauiv1lib/characterpicker.py +++ b/src/assets/ba_data/python/bauiv1lib/characterpicker.py @@ -195,8 +195,6 @@ class CharacterPicker(PopupWindow): def _on_store_press(self) -> None: from bauiv1lib.account import show_sign_in_prompt - # from bauiv1lib.store.browser import StoreBrowserWindow - plus = bui.app.plus assert plus is not None @@ -209,15 +207,6 @@ class CharacterPicker(PopupWindow): self._transition_out() - # bui.screenmessage('UNDER CONSTRUCTION') - # return - - # StoreBrowserWindow( - # modal=True, - # show_tab=StoreBrowserWindow.TabID.CHARACTERS, - # origin_widget=self._get_more_characters_button, - # ) - def _select_character(self, character: str) -> None: if self._delegate is not None: self._delegate.on_character_picker_pick(character) diff --git a/src/assets/ba_data/python/bauiv1lib/coop/browser.py b/src/assets/ba_data/python/bauiv1lib/coop/browser.py index 533e617b..b3571047 100644 --- a/src/assets/ba_data/python/bauiv1lib/coop/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/coop/browser.py @@ -47,7 +47,7 @@ class CoopBrowserWindow(bui.MainWindow): # Quick note to players that tourneys won't work in ballistica # core builds. (need to split the word so it won't get subbed # out) - if 'ballistica' + 'kit' == bui.appname(): + if 'ballistica' + 'kit' == bui.appname() and bui.do_once(): bui.apptimer( 1.0, lambda: bui.screenmessage( diff --git a/src/assets/ba_data/python/bauiv1lib/profile/edit.py b/src/assets/ba_data/python/bauiv1lib/profile/edit.py index 4bf5be4d..d34c5c8c 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/edit.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/edit.py @@ -62,10 +62,11 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): self._width = width = 880.0 if uiscale is bui.UIScale.SMALL else 680.0 self._x_inset = x_inset = 100.0 if uiscale is bui.UIScale.SMALL else 0.0 self._height = height = ( - 450.0 + 500.0 if uiscale is bui.UIScale.SMALL else 400.0 if uiscale is bui.UIScale.MEDIUM else 450.0 ) + yoffs = -42 if uiscale is bui.UIScale.SMALL else 0 spacing = 40 self._base_scale = ( 1.6 @@ -78,7 +79,7 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): size=(width, height + top_extra), scale=self._base_scale, stack_offset=( - (0, -40) if uiscale is bui.UIScale.SMALL else (0, 0) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) ), toolbar_visibility=( # 'menu_minimal' @@ -92,7 +93,7 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): ) cancel_button = btn = bui.buttonwidget( parent=self._root_widget, - position=(52 + x_inset, height - 60), + position=(52 + x_inset, height - 60 + yoffs), size=(155, 60), scale=0.8, autoselect=True, @@ -102,7 +103,7 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): bui.containerwidget(edit=self._root_widget, cancel_button=btn) save_button = btn = bui.buttonwidget( parent=self._root_widget, - position=(width - (177 + x_inset), height - 60), + position=(width - (177 + x_inset), height - 60 + yoffs), size=(155, 60), autoselect=True, scale=0.8, @@ -113,7 +114,7 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): bui.containerwidget(edit=self._root_widget, start_button=btn) bui.textwidget( parent=self._root_widget, - position=(self._width * 0.5, height - 38), + position=(self._width * 0.5, height - 38 + yoffs), size=(0, 0), text=( bui.Lstr(resource=f'{self._r}.titleNewText') @@ -163,7 +164,7 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): self._icon_index = icon_index bui.buttonwidget(edit=save_button, on_activate_call=self.save) - v = height - 115.0 + v = height - 115.0 + yoffs self._name = ( '' if self._existing_profile is None else self._existing_profile ) diff --git a/src/assets/ba_data/python/bauiv1lib/profile/upgrade.py b/src/assets/ba_data/python/bauiv1lib/profile/upgrade.py index eadc9903..3d762184 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/upgrade.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/upgrade.py @@ -34,13 +34,14 @@ class ProfileUpgradeWindow(bui.Window): uiscale = bui.app.ui_v1.uiscale self._width = 750 if uiscale is bui.UIScale.SMALL else 680 - self._height = 350 + self._height = 450 if uiscale is bui.UIScale.SMALL else 350 assert bui.app.classic is not None self._base_scale = ( 1.9 if uiscale is bui.UIScale.SMALL else 1.5 if uiscale is bui.UIScale.MEDIUM else 1.2 ) + yoffs = -60.0 if uiscale is bui.UIScale.SMALL else 0 self._upgrade_start_time: float | None = None self._name = edit_profile_window.getname() self._edit_profile_window = weakref.ref(edit_profile_window) @@ -53,13 +54,13 @@ class ProfileUpgradeWindow(bui.Window): transition=transition, scale=self._base_scale, stack_offset=( - (0, -30) if uiscale is bui.UIScale.SMALL else (0, 0) + (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) ), ) ) cancel_button = bui.buttonwidget( parent=self._root_widget, - position=(52, 60), + position=(52, self._height - 290 + yoffs), size=(155, 60), scale=0.8, autoselect=True, @@ -68,7 +69,7 @@ class ProfileUpgradeWindow(bui.Window): ) self._upgrade_button = bui.buttonwidget( parent=self._root_widget, - position=(self._width - 190, 60), + position=(self._width - 190, self._height - 290 + yoffs), size=(155, 60), scale=0.8, autoselect=True, @@ -85,7 +86,7 @@ class ProfileUpgradeWindow(bui.Window): assert bui.app.classic is not None bui.textwidget( parent=self._root_widget, - position=(self._width * 0.5, self._height - 38), + position=(self._width * 0.5, self._height - 38 + yoffs), size=(0, 0), text=bui.Lstr(resource=f'{self._r}.upgradeToGlobalProfileText'), color=bui.app.ui_v1.title_color, @@ -98,7 +99,7 @@ class ProfileUpgradeWindow(bui.Window): assert bui.app.classic is not None bui.textwidget( parent=self._root_widget, - position=(self._width * 0.5, self._height - 100), + position=(self._width * 0.5, self._height - 100 + yoffs), size=(0, 0), text=bui.Lstr(resource=f'{self._r}.upgradeProfileInfoText'), color=bui.app.ui_v1.infotextcolor, @@ -110,7 +111,7 @@ class ProfileUpgradeWindow(bui.Window): self._status_text = bui.textwidget( parent=self._root_widget, - position=(self._width * 0.5, self._height - 160), + position=(self._width * 0.5, self._height - 160 + yoffs), size=(0, 0), text=bui.Lstr( resource=f'{self._r}.checkingAvailabilityText', @@ -125,7 +126,7 @@ class ProfileUpgradeWindow(bui.Window): self._price_text = bui.textwidget( parent=self._root_widget, - position=(self._width * 0.5, self._height - 230), + position=(self._width * 0.5, self._height - 230 + yoffs), size=(0, 0), text='', color=(0.2, 1, 0.2), @@ -135,22 +136,6 @@ class ProfileUpgradeWindow(bui.Window): v_align='center', ) - self._tickets_text: bui.Widget | None - # if not bui.app.ui_v1.use_toolbars: - # self._tickets_text = bui.textwidget( - # parent=self._root_widget, - # position=(self._width * 0.9 - 5, self._height - 30), - # size=(0, 0), - # text=bui.charstr(bui.SpecialChar.TICKET) + '123', - # color=(0.2, 1, 0.2), - # maxwidth=100, - # scale=0.5, - # h_align='right', - # v_align='center', - # ) - # else: - self._tickets_text = None - bui.app.classic.master_server_v1_get( 'bsGlobalProfileCheck', {'name': self._name, 'b': bui.app.env.engine_build_number}, @@ -161,7 +146,7 @@ class ProfileUpgradeWindow(bui.Window): ) self._status: str | None = 'waiting' self._update_timer = bui.AppTimer( - 1.0, bui.WeakCall(self._update), repeat=True + 1.023, bui.WeakCall(self._update), repeat=True ) self._update() @@ -256,23 +241,16 @@ class ProfileUpgradeWindow(bui.Window): plus = bui.app.plus assert plus is not None - try: - t_str = str(plus.get_v1_account_ticket_count()) - except Exception: - t_str = '?' - if self._tickets_text is not None: - bui.textwidget( - edit=self._tickets_text, - text=bui.Lstr( - resource='getTicketsWindow.youHaveShortText', - subs=[ - ( - '${COUNT}', - bui.charstr(bui.SpecialChar.TICKET) + t_str, - ) - ], - ), - ) + # If our originating window dies at any point, cancel. + edit_profile_window = self._edit_profile_window() + if edit_profile_window is None: + self._cancel() + return + + # try: + # t_str = str(plus.get_v1_account_ticket_count()) + # except Exception: + # t_str = '?' # Once we've kicked off an upgrade attempt and all transactions go # through, we're done. diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index 63cf9d24..aa918c07 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 = 22013; +const int kEngineBuildNumber = 22014; const char* kEngineVersion = "1.7.37"; const int kEngineApiVersion = 9; From 489d8134cae45985befbe45f0f9f3c22da4d254a Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 25 Sep 2024 21:16:05 -0700 Subject: [PATCH 7/7] fixes for get-more-characters and get-more-icons functionality in player profile editor --- .efrocachemap | 56 +++++++++---------- CHANGELOG.md | 2 +- src/assets/ba_data/python/baenv.py | 2 +- src/assets/ba_data/python/bauiv1/_uitypes.py | 6 +- .../ba_data/python/bauiv1lib/iconpicker.py | 27 +++++---- .../ba_data/python/bauiv1lib/profile/edit.py | 48 ++++++++++++---- .../python/bauiv1lib/profile/upgrade.py | 5 -- src/ballistica/shared/ballistica.cc | 2 +- 8 files changed, 86 insertions(+), 62 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index 0849c084..0d10b9e2 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": "65b928385abc5fb852a9bfca74e25515", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "949ec63b1c4049ca8b53177e3a1b4125", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "3e8a83e2a34261d99879c6be7a035f76", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "b23e959d29accbcacbb2e07983a4585b", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "293bb35597a0f9b39b4a940094b25c80", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "1c79a0db39022e7341c1f4228bbf1bfe", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "3dfaacb9b36d61081d39493ac5e95ae9", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "61a7153508cc55bad48bd9102a672b58", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "daf24f76db0462c10219c0422bef7651", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "4ad78818230f71946ecd45dddad495d3", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "1c22dcc8b478a5673e81eec9484b4c95", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "3ea63c2c531c1201511bd65cc84328c0", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "d1dda1bcd25be89d924f59daeb76deb4", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "461dd43017d4b9ddd66f07b663ea073a", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "8b5f76faeb062bf526f4de2e36756e86", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "b11df699748ceaeabb9d7b1d575d574b", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "0273dbc73771533d13d88636c0a0d920", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "c95d98be2122ffb63ea7ba2ea00bdc94", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "5945a64fbd6a70d3fed7e6cfe042515c", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "dfc3f3e2501435163035e43b2996624f", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "855a05f0dde692555dcd240456c63397", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "46b1d1929707bd20d50509c53c406f80", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "8f0f4ed6508328a4a75c95450ecae525", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "14d5f4e4cdaa859100b6e247f713f23b", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "586cdec51141ee2c2553450b917ccf13", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "cb68c967d6cc12fb98865bd391b630c7", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "8ba734f236f8b3d76a0f3a634d088ef1", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "59a854138d18b814e0913a4608b7fe87", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "cfa3a2f7ef36c88736a88c8229a7389d", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "27677f0f0d72c4b487070dada1e494dd", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "02124d81c73f4212be27028c97bca2b2", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "81297de9661e18bf6c67c20927a6d6b8", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "99e2c966b4855f712fb383a167ae2bb5", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "fc534000c33ad4db9cc0d7756e171947", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "753846937971a4353045178dacc9fd76", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "6ea4ace6e74840ae2534d7df1ebe4b1c", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "c25040a973dbbbe0c51b51934bd13df9", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "8db99aef1dd403903f6d433314d1ca66", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "af04c5cbfad31760865ae59079ee32a4", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "ec2bd6cc16ae27771271eb250634d6b1", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "086a2ce72497e44079ad6b747fc5439f", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "ad908b297b41c2fdf13582e34c434245", @@ -4132,14 +4132,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "4c11b81a574aa9af593f54db4d998e61", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "d7a1d4deb51b0792d083737477e6833b", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "07ac2d15d5fdcaaf8505439b07b5f2aa", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "c55f3ea6d1e8d3f951e0ca08460e853f", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "c93e65e95335b64a5a7de102094bfe75", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "a276c3209acad4d12cdce69936044160", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "464fdc0293df656486ec70358b0bf9e8", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "f827037308d6d4a9b4fc978a362d166f", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "14f7fe0fa80210300c86ba65a5c70b75", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "75a7444330624357cb388077eccd9e69", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "8eea688090f6d2be7b003c1469afc244", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "9409dfcaf0598768143e06690d33ce65", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "a85fb3ac57086dc5f271b3afea90b489", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "30b60a444fba031a67c96ed9193050da", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "b06998159410ed4b02591ca2998b9c38", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "51553d3162f0af5acfd5e55880e454c9", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "215dbbb47e8def7b1f63448275b4d33b", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "52dd9b73e6d72412ca6b273fb342368e", "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 b4721d99..b614e532 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.37 (build 22014, api 9, 2024-09-25) +### 1.7.37 (build 22015, api 9, 2024-09-25) - 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 551ac5b0..ddc1b45d 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 = 22014 +TARGET_BALLISTICA_BUILD = 22015 TARGET_BALLISTICA_VERSION = '1.7.37' diff --git a/src/assets/ba_data/python/bauiv1/_uitypes.py b/src/assets/ba_data/python/bauiv1/_uitypes.py index 16815e04..9158e7c8 100644 --- a/src/assets/ba_data/python/bauiv1/_uitypes.py +++ b/src/assets/ba_data/python/bauiv1/_uitypes.py @@ -327,10 +327,10 @@ def ui_upkeep() -> None: print( 'WARNING:', obj, - 'is still alive 5 second after its widget died;' + 'is still alive 5 second after its Widget died;' ' you might have a memory leak. Look for circular' - ' references or outside things referencing your window' - ' instance. See efro.debug module' + ' references or outside things referencing your Window' + ' class instance. See efro.debug module' ' for tools that can help debug this sort of thing.', ) else: diff --git a/src/assets/ba_data/python/bauiv1lib/iconpicker.py b/src/assets/ba_data/python/bauiv1lib/iconpicker.py index 779100cd..4f186b41 100644 --- a/src/assets/ba_data/python/bauiv1lib/iconpicker.py +++ b/src/assets/ba_data/python/bauiv1lib/iconpicker.py @@ -14,6 +14,18 @@ if TYPE_CHECKING: from typing import Any, Sequence +class IconPickerDelegate: + """Delegate for character-picker.""" + + def on_icon_picker_pick(self, icon: str) -> None: + """Called when a character is selected.""" + raise NotImplementedError() + + def on_icon_picker_get_more_press(self) -> None: + """Called when the 'get more characters' button is pressed.""" + raise NotImplementedError() + + class IconPicker(PopupWindow): """Picker for icons.""" @@ -21,7 +33,7 @@ class IconPicker(PopupWindow): self, parent: bui.Widget, position: tuple[float, float] = (0.0, 0.0), - delegate: Any = None, + delegate: IconPickerDelegate | None = None, scale: float | None = None, *, offset: tuple[float, float] = (0.0, 0.0), @@ -161,24 +173,17 @@ class IconPicker(PopupWindow): def _on_store_press(self) -> None: from bauiv1lib.account import show_sign_in_prompt - # from bauiv1lib.store.browser import StoreBrowserWindow - plus = bui.app.plus assert plus is not None if plus.get_v1_account_state() != 'signed_in': show_sign_in_prompt() return - # self._transition_out() - bui.screenmessage('UNDER CONSTRUCTION') - return + if self._delegate is not None: + self._delegate.on_icon_picker_get_more_press() - # StoreBrowserWindow( - # modal=True, - # show_tab=StoreBrowserWindow.TabID.ICONS, - # origin_widget=self._get_more_icons_button, - # ) + self._transition_out() def _select_icon(self, icon: str) -> None: if self._delegate is not None: diff --git a/src/assets/ba_data/python/bauiv1lib/profile/edit.py b/src/assets/ba_data/python/bauiv1lib/profile/edit.py index d34c5c8c..447bbb72 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/edit.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/edit.py @@ -9,11 +9,14 @@ from typing import cast, override from bauiv1lib.colorpicker import ColorPicker from bauiv1lib.characterpicker import CharacterPickerDelegate +from bauiv1lib.iconpicker import IconPickerDelegate import bauiv1 as bui import bascenev1 as bs -class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): +class EditProfileWindow( + bui.MainWindow, CharacterPickerDelegate, IconPickerDelegate +): """Window for editing a player profile.""" def reload_window(self) -> None: @@ -30,10 +33,12 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): back_state=self.main_window_back_state, ) + # def __del__(self) -> None: + # print(f'~EditProfileWindow({id(self)})') + def __init__( self, existing_profile: str | None, - # in_main_menu: bool, transition: str | None = 'in_right', origin_widget: bui.Widget | None = None, ): @@ -41,12 +46,13 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): # pylint: disable=too-many-branches # pylint: disable=too-many-statements # pylint: disable=too-many-locals + assert bui.app.classic is not None + # print(f'EditProfileWindow({id(self)})') plus = bui.app.plus assert plus is not None - # self._in_main_menu = in_main_menu self._existing_profile = existing_profile self._r = 'editProfileWindow' self._spazzes: list[str] = [] @@ -82,10 +88,7 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): (0, 0) if uiscale is bui.UIScale.SMALL else (0, 0) ), toolbar_visibility=( - # 'menu_minimal' - None - if uiscale is bui.UIScale.SMALL - else 'menu_full' + None if uiscale is bui.UIScale.SMALL else 'menu_full' ), ), transition=transition, @@ -523,12 +526,16 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): def get_main_window_state(self) -> bui.MainWindowState: # Support recreating our window for back/refresh purposes. cls = type(self) + + # Pull things out of self here; if we do it within the lambda + # we'll keep ourself alive which is bad. + + existing_profile = self._existing_profile return bui.BasicMainWindowState( create_call=lambda transition, origin_widget: cls( transition=transition, origin_widget=origin_widget, - existing_profile=self._existing_profile, - # in_main_menu=self._in_main_menu, + existing_profile=existing_profile, ) ) @@ -638,18 +645,35 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): for s in self._spazzes ] + @override def on_icon_picker_pick(self, icon: str) -> None: """An icon has been selected by the picker.""" self._icon = icon self._update_icon() + @override + def on_icon_picker_get_more_press(self) -> None: + """User wants to get more icons.""" + from bauiv1lib.store.browser import StoreBrowserWindow + + if not self.main_window_has_control(): + return + + self.main_window_replace( + StoreBrowserWindow( + minimal_toolbars=True, + show_tab=StoreBrowserWindow.TabID.ICONS, + ) + ) + @override def on_character_picker_pick(self, character: str) -> None: """A character has been selected by the picker.""" if not self._root_widget: return - # The player could have bought a new one while the picker was up. + # The player could have bought a new one while the picker was + # up. self.refresh_characters() self._icon_index = ( self._spazzes.index(character) if character in self._spazzes else 0 @@ -848,8 +872,8 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate): } ) - # Also lets be aware we're no longer global if we're taking a - # new name (will need to re-request it). + # Also lets be aware we're no longer global if we're taking + # a new name (will need to re-request it). self._global = False plus.add_v1_account_transaction( diff --git a/src/assets/ba_data/python/bauiv1lib/profile/upgrade.py b/src/assets/ba_data/python/bauiv1lib/profile/upgrade.py index 3d762184..a9139a3c 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/upgrade.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/upgrade.py @@ -247,11 +247,6 @@ class ProfileUpgradeWindow(bui.Window): self._cancel() return - # try: - # t_str = str(plus.get_v1_account_ticket_count()) - # except Exception: - # t_str = '?' - # Once we've kicked off an upgrade attempt and all transactions go # through, we're done. if ( diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index aa918c07..9a6a509d 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 = 22014; +const int kEngineBuildNumber = 22015; const char* kEngineVersion = "1.7.37"; const int kEngineApiVersion = 9;