mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-19 21:37:57 +08:00
Merge branch 'efroemling:main' into main
This commit is contained in:
commit
17c1a7307b
98
.efrocachemap
generated
98
.efrocachemap
generated
@ -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": "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",
|
||||
"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": "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",
|
||||
|
||||
18
CHANGELOG.md
18
CHANGELOG.md
@ -1,9 +1,17 @@
|
||||
### 1.7.37 (build 22007, api 9, 2024-09-19)
|
||||
### 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.
|
||||
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.
|
||||
@ -90,6 +98,14 @@
|
||||
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.
|
||||
- (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
|
||||
|
||||
@ -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.1
|
||||
pylsp-mypy==0.6.9
|
||||
pytest==8.3.3
|
||||
python-daemon==3.0.1
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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 \
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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):
|
||||
@ -49,7 +51,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 +111,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()
|
||||
|
||||
@ -121,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
|
||||
|
||||
@ -170,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:
|
||||
@ -198,52 +164,133 @@ 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:
|
||||
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
|
||||
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:
|
||||
@ -267,25 +314,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:
|
||||
@ -300,26 +339,22 @@ 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')
|
||||
)
|
||||
),
|
||||
)
|
||||
|
||||
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:
|
||||
|
||||
@ -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,26 +527,21 @@ 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,
|
||||
*,
|
||||
playlist_type: str = 'Random',
|
||||
playlist_name: str = '__default__',
|
||||
player_count: int = 8,
|
||||
@ -550,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,
|
||||
@ -694,6 +693,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,
|
||||
@ -817,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():
|
||||
@ -842,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,
|
||||
)
|
||||
|
||||
@ -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()))
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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 = 22015
|
||||
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,
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -112,6 +112,7 @@ def animate_array(
|
||||
attr: str,
|
||||
size: int,
|
||||
keys: dict[float, Sequence[float]],
|
||||
*,
|
||||
loop: bool = False,
|
||||
offset: float = 0,
|
||||
) -> None:
|
||||
|
||||
@ -27,6 +27,7 @@ class Level:
|
||||
gametype: type[bascenev1.GameActivity],
|
||||
settings: dict,
|
||||
preview_texture_name: str,
|
||||
*,
|
||||
displayname: str | None = None,
|
||||
):
|
||||
self._name = name
|
||||
|
||||
@ -241,6 +241,7 @@ class HitMessage:
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
srcnode: bascenev1.Node | None = None,
|
||||
pos: Sequence[float] | None = None,
|
||||
velocity: Sequence[float] | None = None,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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']),
|
||||
|
||||
@ -87,6 +87,7 @@ class FreeForAllVictoryScoreScreenActivity(MultiTeamScoreScreenActivity):
|
||||
extrascale: float,
|
||||
flash: bool = False,
|
||||
) -> Text:
|
||||
# pylint: disable=too-many-positional-arguments
|
||||
return Text(
|
||||
text,
|
||||
position=(
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -50,6 +50,7 @@ class Spawner:
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
data: Any = None,
|
||||
pt: Sequence[float] = (0, 0, 0),
|
||||
spawn_time: float = 1.0,
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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]]] = []
|
||||
|
||||
@ -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',
|
||||
@ -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,13 +562,13 @@ 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,
|
||||
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
|
||||
@ -602,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:
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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')
|
||||
|
||||
@ -201,9 +203,11 @@ 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,
|
||||
is_auxiliary: bool = False,
|
||||
back_state: MainWindowState | None = None,
|
||||
suppress_warning: bool = False,
|
||||
) -> None:
|
||||
@ -213,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
|
||||
@ -253,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
|
||||
@ -308,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:
|
||||
@ -385,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
|
||||
|
||||
@ -396,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,
|
||||
)
|
||||
|
||||
@ -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,
|
||||
@ -314,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:
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -6,55 +6,70 @@ 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
|
||||
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.
|
||||
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, 0)
|
||||
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 + yoffs),
|
||||
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 +82,13 @@ 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)
|
||||
+ yoffs,
|
||||
),
|
||||
size=(0, 0),
|
||||
h_align='center',
|
||||
v_align='center',
|
||||
@ -79,16 +99,27 @@ class AchievementsWindow(PopupWindow):
|
||||
)
|
||||
|
||||
self._scrollwidget = bui.scrollwidget(
|
||||
parent=self.root_widget,
|
||||
size=(self._width - 60, self._height - 70),
|
||||
position=(30, 30),
|
||||
parent=self._root_widget,
|
||||
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,
|
||||
)
|
||||
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 +255,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
|
||||
)
|
||||
)
|
||||
|
||||
@ -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
|
||||
@ -194,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
|
||||
|
||||
@ -208,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)
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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(
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
)
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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:
|
||||
@ -89,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
|
||||
)
|
||||
@ -112,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)
|
||||
),
|
||||
@ -129,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,
|
||||
@ -152,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=(
|
||||
@ -196,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),
|
||||
)
|
||||
@ -226,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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -870,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:
|
||||
|
||||
@ -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:
|
||||
@ -115,6 +120,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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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(
|
||||
@ -550,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
|
||||
@ -1080,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')
|
||||
|
||||
@ -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(
|
||||
@ -1448,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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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),
|
||||
@ -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,8 +33,9 @@ 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),
|
||||
tint_color: Sequence[float] = (1.0, 1.0, 1.0),
|
||||
tint2_color: Sequence[float] = (1.0, 1.0, 1.0),
|
||||
@ -160,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:
|
||||
|
||||
@ -6,58 +6,79 @@ 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,
|
||||
):
|
||||
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
|
||||
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.
|
||||
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, 0)
|
||||
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 + yoffs),
|
||||
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._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)
|
||||
+ yoffs,
|
||||
),
|
||||
size=(0, 0),
|
||||
h_align='center',
|
||||
v_align='center',
|
||||
@ -68,16 +89,27 @@ class InboxWindow(PopupWindow):
|
||||
)
|
||||
|
||||
self._scrollwidget = bui.scrollwidget(
|
||||
parent=self.root_widget,
|
||||
size=(self._width - 60, self._height - 70),
|
||||
position=(30, 30),
|
||||
parent=self._root_widget,
|
||||
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,
|
||||
)
|
||||
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 +137,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()
|
||||
|
||||
@ -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'),
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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(
|
||||
@ -1151,10 +1149,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()
|
||||
)
|
||||
|
||||
|
||||
@ -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():
|
||||
|
||||
@ -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(),
|
||||
)
|
||||
@ -551,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,
|
||||
|
||||
@ -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 = (
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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 (
|
||||
@ -108,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:
|
||||
@ -131,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,
|
||||
@ -140,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)
|
||||
@ -157,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,
|
||||
@ -173,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,
|
||||
@ -193,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,
|
||||
@ -485,11 +493,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 +625,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:
|
||||
|
||||
@ -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
|
||||
|
||||
@ -52,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,
|
||||
@ -76,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,
|
||||
@ -88,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,
|
||||
@ -100,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,
|
||||
|
||||
@ -23,6 +23,7 @@ class PlayOptionsWindow(PopupWindow):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
sessiontype: type[bs.Session],
|
||||
playlist: str,
|
||||
scale_origin: tuple[float, float],
|
||||
@ -528,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:
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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] = []
|
||||
@ -62,10 +68,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,13 +85,10 @@ 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'
|
||||
None
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else 'menu_full'
|
||||
None if uiscale is bui.UIScale.SMALL else 'menu_full'
|
||||
),
|
||||
),
|
||||
transition=transition,
|
||||
@ -92,7 +96,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 +106,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 +117,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 +167,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
|
||||
)
|
||||
@ -522,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,
|
||||
)
|
||||
)
|
||||
|
||||
@ -637,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
|
||||
@ -847,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(
|
||||
|
||||
@ -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,11 @@ 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
|
||||
|
||||
# Once we've kicked off an upgrade attempt and all transactions go
|
||||
# through, we're done.
|
||||
|
||||
@ -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():
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -121,16 +127,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),
|
||||
@ -316,7 +312,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:
|
||||
@ -369,12 +365,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')
|
||||
@ -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:
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
# )
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
)
|
||||
)
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
):
|
||||
|
||||
@ -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,
|
||||
):
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user