diff --git a/.efrocachemap b/.efrocachemap index 7b3bbb27..184dac89 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -421,8 +421,8 @@ "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": "e9c687b8c06c4b1df34a933a365ed9e7", - "build/assets/ba_data/data/languages/arabic.json": "c62b3037ef3364b84d4f8dd6610854f8", + "build/assets/ba_data/data/langdata.json": "7ff61ef00a1d673e0a303d09bd1d2bd6", + "build/assets/ba_data/data/languages/arabic.json": "c20d539d98b728bb7913c5dff68a5713", "build/assets/ba_data/data/languages/belarussian.json": "3d5523d0004293aa2df02f3f6f3b84f8", "build/assets/ba_data/data/languages/chinese.json": "2f67c6b127ae85492ac552af1a91e95a", "build/assets/ba_data/data/languages/chinesetraditional.json": "319565f8a15667488f48dbce59278e39", @@ -430,12 +430,12 @@ "build/assets/ba_data/data/languages/czech.json": "74219f9b06ff098387b40f85a5b0124e", "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": "ef2b554d37c256132ee9dcb4f6478c4e", + "build/assets/ba_data/data/languages/english.json": "b88cb9e8035e238ccf327d62bde1d190", "build/assets/ba_data/data/languages/esperanto.json": "0e397cfa5f3fb8cef5f4a64f21cda880", - "build/assets/ba_data/data/languages/filipino.json": "b53910af2d3946d5ff81386e8c1d35a7", + "build/assets/ba_data/data/languages/filipino.json": "f8d101b436fcf8f92f20a9983fb9fdee", "build/assets/ba_data/data/languages/french.json": "b7d11199756f0eb4f1a745ceee652b2a", "build/assets/ba_data/data/languages/german.json": "198b9860c5b9df7b8e3e30b03d8755cb", - "build/assets/ba_data/data/languages/gibberish.json": "fd68975cb527ddd7b2b97e84a7ba22d7", + "build/assets/ba_data/data/languages/gibberish.json": "becbb2e96a0d85661c1af9ebbf6bb2fb", "build/assets/ba_data/data/languages/greek.json": "ad3c0d38f34d809824892d6f22808dbf", "build/assets/ba_data/data/languages/hindi.json": "e56f0ffb57321660aa415e97c2dacfc2", "build/assets/ba_data/data/languages/hungarian.json": "6b08fea24b72cc805ed0dc59e11c4cd6", @@ -443,14 +443,14 @@ "build/assets/ba_data/data/languages/italian.json": "e1d69eb1eec31442bf981121c7cfaf17", "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": "64f162aed6f711d816c844e3fa1d2dcb", + "build/assets/ba_data/data/languages/persian.json": "8e3a88cbb729570ffc8e0b06b3337a8f", "build/assets/ba_data/data/languages/polish.json": "6585f57b1a389b8331b06f610bd8cc6f", "build/assets/ba_data/data/languages/portuguese.json": "615a59bd03f84659158d9f2608a4ab21", "build/assets/ba_data/data/languages/romanian.json": "ef68520f749cf3641d4e4225a6166349", - "build/assets/ba_data/data/languages/russian.json": "4cb481af9d4e2611e0033235a045aa33", + "build/assets/ba_data/data/languages/russian.json": "64f0b7347af86f8c4bec8ba8e781378d", "build/assets/ba_data/data/languages/serbian.json": "d7452dd72ac0e51680cb39b5ebaa1c69", "build/assets/ba_data/data/languages/slovak.json": "3c08c748c96c71bd9e1d7291fb8817b6", - "build/assets/ba_data/data/languages/spanish.json": "485356283e4375a6b8b7cd06614319db", + "build/assets/ba_data/data/languages/spanish.json": "ebb1552a3baabc9ce2588914a8e8563b", "build/assets/ba_data/data/languages/swedish.json": "5142a96597d17d8344be96a603da64ac", "build/assets/ba_data/data/languages/tamil.json": "b9fcc523639f55e05c7f4e7914f3321a", "build/assets/ba_data/data/languages/thai.json": "1d665629361f302693dead39de8fa945", @@ -4062,26 +4062,26 @@ "build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1", "build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae", "build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599", - "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "123ecb04f354552c15aa04d3d5047074", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "b992b3d97a1b066a1a2b74911ed4a44d", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "2ea1e068455ae6d7c0afd3ac5c1453bf", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "7b087cf909f3a71f97abd431c9dbce60", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "26a69101cb282d96d48d38032fe2ae73", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "2fca0da9ff9eaa5af16fb6801c4e7b81", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "657ee4258b874631acf4e37028e512ec", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "942499d3619e551deb7f5795e62e9022", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "5ea6ae7ac701fd0b51f3db6b0e554268", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "be20cf570211f03f8b54c94e95caf579", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "c73fabf8be863554d5b899c7ea4a960e", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "bf29cf0164a08a4aa139e39f20f50423", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "e2272883f9c7405402cb967f8e3b2b28", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "15f5b471a04313a13bac43c86f37eb72", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "a7672fb4c4b14a1d88c3435cf2af9675", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "2f733fe4dc422b7d0db04a5ea017ab68", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "d34cf623c2cca17fac7fdc0918de1202", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "45dbf5edad5a9a71608ac1d6d1954923", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "3002abd737297bf395eab0bd60c535d8", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "e9bf6aaa7e18bcf482223a29a609932e", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "85d4c2662e2abce652fde0d3b11f5f31", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "abdedd2ff24f241cb693c3f734f35679", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "8ec0707c0a05ca3d012363633ff96365", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "5d74f146e115277f321a95ff0d193d2f", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "91e60840bb7a51b5ea7f1c9336c10d6c", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "563235f95a31f507cc4db271235b5e1b", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "f111c46d242d2370896a45b15028382b", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "08dcacd0cb57cd06745729891d188396", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "f67b1cea43f395056b9b6129db15e53e", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "0d95c3f63599a7ddee8c5d7169854fb7", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "370654005e3d1cfb39f5313f5793170f", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "7a3ffc7cb1f32e0bfd8b2dc06fa7a8e7", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "04dbc93723bd680b9f6985830d8511a7", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "658d41499889fd722d12ed73c4555c8a", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "055ee3d6fdba5df2fff2fdf2e02fa935", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "50e350ef3a319da5b7bcfc56c3cf8ab4", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "94597d8d7110d688f2d080c600434938", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "7f837b03773e50bec77aff7f75d24ad4", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "503686dca19cff9ed53561f6d7925978", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "932ea4fc1a2933d0185fd3317a19f8ad", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "ffe8631c0ccc03751b4346fcf52d70ca", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "4241e93e1ea18414ee900046d1a62517", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "ffe8631c0ccc03751b4346fcf52d70ca", @@ -4098,14 +4098,14 @@ "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "0f34f852bf368c787f41533230767b3a", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "1dcd03f0cfc75a53c3e682a3a46c96a0", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "0f34f852bf368c787f41533230767b3a", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "4a8ae45bb9474a0d8faccd195dded56f", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "8eb224db25a69e2faed1c6897f73c8b6", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "25740d352aec852365430d305655f0fe", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "3e19f73203116e9db0943e0c4485f459", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "517d6fc942828b4c3de3972d6165238e", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "c681050518fde161af81ae356ec80027", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "6689ba552f0a3761b6acc5375343dbe5", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "3a6f2f59a965348b5e9b54562954da89", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "7771687267175d527366d72a3d26cc78", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "ee41412d34747620bad2a9d7e9d7d771", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "460b8f8f31ccce4ebd8b913c2322344c", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "0b3fa6e71105821c81622dd3fadbcb89", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "40961c8d37205c6736f956d3880d0dba", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "b952e8a67e93ba9ef0fadf93911ec3b7", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "6957f8ed5b15854711ba9a4f552f40dd", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "31a0a4e90b8855dbbfcb6642ee2cb091", "src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c", "src/assets/ba_data/python/babase/_mgen/enums.py": "cb299985623bbcc86015cb103a424ae6", "src/ballistica/base/mgen/pyembed/binding_base.inc": "efa61468cf098f77cc6a234461d8b86d", diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ac7013d..3393f44f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.36 (build 21939, api 8, 2024-07-24) +### 1.7.36 (build 21942, api 8, 2024-07-25) - Wired up Tokens, BombSquad's new purchasable currency. The first thing these can be used for is storage packs on ballistica.net, but this will expand to other places in the game soon. For a full explanation on why these were added, @@ -33,7 +33,16 @@ `functools.partial` so there's no benefit to maintaining our own special version anymore. This also applies to `ba*.Call` which is redundant in the same way. Both `efro.call.tpartial` and `ba*.Call` will probably be marked - deprecated and go away at some point. + deprecated and go away at some point (or more likely simply not included in + newer apis such as bauiv2). +- Added a `Delete Account` button directly to the account section in-game. +- The app now includes build number when looking for custom sys scripts in the + mods dir. Previously it would have looked for something like `sys/1.7.36` but + now it will look for something like `sys/1.7.36_21940`. I was seeing a lot of + crash reports from people creating sys scripts using early builds of some + version and then upgrading to later builds of the same version containing + incompatibilities with the older sys scripts. This should help with that + problem. ### 1.7.35 (build 21889, api 8, 2024-06-20) - Fixed an issue where the engine would block at exit on some version of Linux diff --git a/src/assets/ba_data/python/babase/modutils.py b/src/assets/ba_data/python/babase/modutils.py index 716a2d22..d63e914d 100644 --- a/src/assets/ba_data/python/babase/modutils.py +++ b/src/assets/ba_data/python/babase/modutils.py @@ -133,7 +133,10 @@ def create_user_system_scripts() -> None: if env.python_directory_app is None: raise RuntimeError('app python dir unset') - path = f'{env.python_directory_user}/sys/{env.engine_version}' + path = ( + f'{env.python_directory_user}/sys/' + f'{env.engine_version}_{env.engine_build_number}' + ) pathtmp = path + '_tmp' if os.path.exists(path): print('Delete Existing User Scripts first!') @@ -181,7 +184,10 @@ def delete_user_system_scripts() -> None: if env.python_directory_user is None: raise RuntimeError('user python dir unset') - path = f'{env.python_directory_user}/sys/{env.engine_version}' + path = ( + f'{env.python_directory_user}/sys/' + f'{env.engine_version}_{env.engine_build_number}' + ) if os.path.exists(path): shutil.rmtree(path) print('User system scripts deleted.') diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 99cb1d8a..1f4a4116 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -52,7 +52,7 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 21939 +TARGET_BALLISTICA_BUILD = 21942 TARGET_BALLISTICA_VERSION = '1.7.36' @@ -348,12 +348,16 @@ def _setup_paths( if user_python_dir is None: user_python_dir = str(Path(config_dir, 'mods')) - # Wherever our user_python_dir is, if we find a sys/FOO dir - # under it where FOO matches our version, use that as our - # app_python_dir. This allows modding built-in stuff on - # platforms where there is no write access to said built-in - # stuff. - check_dir = Path(user_python_dir, 'sys', TARGET_BALLISTICA_VERSION) + # Wherever our user_python_dir is, if we find a sys/FOO_BAR dir + # under it where FOO matches our version and BAR matches our + # build number, use that as our app_python_dir. This allows + # modding built-in stuff on platforms where there is no write + # access to said built-in stuff. + check_dir = Path( + user_python_dir, + 'sys', + f'{TARGET_BALLISTICA_VERSION}_{TARGET_BALLISTICA_BUILD}', + ) try: if check_dir.is_dir(): app_python_dir = str(check_dir) diff --git a/src/assets/ba_data/python/bascenev1lib/tutorial.py b/src/assets/ba_data/python/bascenev1lib/tutorial.py index 119cf6e0..541e6119 100644 --- a/src/assets/ba_data/python/bascenev1lib/tutorial.py +++ b/src/assets/ba_data/python/bascenev1lib/tutorial.py @@ -274,9 +274,9 @@ class TutorialActivity(bs.Activity[Player, Team]): # Need different versions of this: taps/buttons/keys. txt = ( - bs.Lstr(resource=self._r + '.cpuBenchmarkText') + bs.Lstr(resource=f'{self._r}.cpuBenchmarkText') if self._benchmark_type == 'cpu' - else bs.Lstr(resource=self._r + '.toSkipPressAnythingText') + else bs.Lstr(resource=f'{self._r}.toSkipPressAnythingText') ) t = self._skip_text = bs.newnode( 'text', @@ -852,13 +852,13 @@ class TutorialActivity(bs.Activity[Player, Team]): DelayOld(1000), AnalyticsScreen('Tutorial Section 1'), Text( - bs.Lstr(resource=self._r + '.phrase01Text') + bs.Lstr(resource=f'{self._r}.phrase01Text') ), # hi there Celebrate('left'), DelayOld(2000), Text( bs.Lstr( - resource=self._r + '.phrase02Text', + resource=f'{self._r}.phrase02Text', subs=[ ('${APP_NAME}', bs.Lstr(resource='titleText')) ], @@ -888,7 +888,7 @@ class TutorialActivity(bs.Activity[Player, Team]): MoveUD(0), DelayOld(1500), Text( - bs.Lstr(resource=self._r + '.phrase03Text') + bs.Lstr(resource=f'{self._r}.phrase03Text') ), # here's a few tips DelayOld(1000), ShowControls(), @@ -900,7 +900,7 @@ class TutorialActivity(bs.Activity[Player, Team]): AnalyticsScreen('Tutorial Section 2'), Text( bs.Lstr( - resource=self._r + '.phrase04Text', + resource=f'{self._r}.phrase04Text', subs=[ ('${APP_NAME}', bs.Lstr(resource='titleText')) ], @@ -1261,7 +1261,7 @@ class TutorialActivity(bs.Activity[Player, Team]): Move(0, 0), DelayOld(1000), Text( - bs.Lstr(resource=self._r + '.phrase05Text') + bs.Lstr(resource=f'{self._r}.phrase05Text') ), # for example when you punch.. DelayOld(510), Move(0, -0.01), @@ -1279,7 +1279,7 @@ class TutorialActivity(bs.Activity[Player, Team]): (-3.1, 4.3, -2.0), make_current=False, color=(1, 1, 0.4), - name=bs.Lstr(resource=self._r + '.randomName1Text'), + name=bs.Lstr(resource=f'{self._r}.randomName1Text'), ), Move(-1.0, 0), DelayOld(1050), @@ -1288,7 +1288,7 @@ class TutorialActivity(bs.Activity[Player, Team]): Move(0, 0), DelayOld(1000), Text( - bs.Lstr(resource=self._r + '.phrase06Text') + bs.Lstr(resource=f'{self._r}.phrase06Text') ), # your damage is based DelayOld(1200), Move(-0.05, 0), @@ -1304,12 +1304,12 @@ class TutorialActivity(bs.Activity[Player, Team]): Move(0, 0), Text( bs.Lstr( - resource=self._r + '.phrase07Text', + resource=f'{self._r}.phrase07Text', subs=[ ( '${NAME}', bs.Lstr( - resource=self._r + '.randomName1Text' + resource=f'{self._r}.randomName1Text' ), ) ], @@ -1319,7 +1319,7 @@ class TutorialActivity(bs.Activity[Player, Team]): Celebrate('right', spaz_num=1), DelayOld(1400), Text( - bs.Lstr(resource=self._r + '.phrase08Text') + bs.Lstr(resource=f'{self._r}.phrase08Text') ), # lets jump and spin to get more speed DelayOld(30), MoveLR(0), @@ -1520,12 +1520,12 @@ class TutorialActivity(bs.Activity[Player, Team]): Move(0, 0), DelayOld(1000), Text( - bs.Lstr(resource=self._r + '.phrase09Text') + bs.Lstr(resource=f'{self._r}.phrase09Text') ), # ah that's better DelayOld(1900), AnalyticsScreen('Tutorial Section 3'), Text( - bs.Lstr(resource=self._r + '.phrase10Text') + bs.Lstr(resource=f'{self._r}.phrase10Text') ), # running also helps DelayOld(100), SpawnSpaz( @@ -1536,11 +1536,11 @@ class TutorialActivity(bs.Activity[Player, Team]): (3.3, 4.2, -5.8), make_current=False, color=(0.9, 0.5, 1.0), - name=bs.Lstr(resource=self._r + '.randomName2Text'), + name=bs.Lstr(resource=f'{self._r}.randomName2Text'), ), DelayOld(1800), Text( - bs.Lstr(resource=self._r + '.phrase11Text') + bs.Lstr(resource=f'{self._r}.phrase11Text') ), # hold ANY button to run DelayOld(300), MoveUD(0), @@ -1797,7 +1797,7 @@ class TutorialActivity(bs.Activity[Player, Team]): MoveUD(0), AnalyticsScreen('Tutorial Section 4'), Text( - bs.Lstr(resource=self._r + '.phrase12Text') + bs.Lstr(resource=f'{self._r}.phrase12Text') ), # for extra-awesome punches,... DelayOld(200), SpawnSpaz( @@ -1816,7 +1816,7 @@ class TutorialActivity(bs.Activity[Player, Team]): make_current=False, color=(1.0, 0.7, 0.3), # name=R.randomName3Text), - name=bs.Lstr(resource=self._r + '.randomName3Text'), + name=bs.Lstr(resource=f'{self._r}.randomName3Text'), ), DelayOld(100), Powerup(1, (2.5, 0.0, 0), relative_to=0), @@ -2015,12 +2015,12 @@ class TutorialActivity(bs.Activity[Player, Team]): MoveLR(0), Text( bs.Lstr( - resource=self._r + '.phrase13Text', + resource=f'{self._r}.phrase13Text', subs=[ ( '${NAME}', bs.Lstr( - resource=self._r + '.randomName3Text' + resource=f'{self._r}.randomName3Text' ), ) ], @@ -2031,12 +2031,12 @@ class TutorialActivity(bs.Activity[Player, Team]): AnalyticsScreen('Tutorial Section 5'), Text( bs.Lstr( - resource=self._r + '.phrase14Text', + resource=f'{self._r}.phrase14Text', subs=[ ( '${NAME}', bs.Lstr( - resource=self._r + '.randomName4Text' + resource=f'{self._r}.randomName4Text' ), ) ], @@ -2055,7 +2055,7 @@ class TutorialActivity(bs.Activity[Player, Team]): relative_to=0, make_current=False, color=(0.4, 1.0, 0.7), - name=bs.Lstr(resource=self._r + '.randomName4Text'), + name=bs.Lstr(resource=f'{self._r}.randomName4Text'), ), DelayOld(1000), Celebrate('left', 1, duration=1000), @@ -2083,11 +2083,11 @@ class TutorialActivity(bs.Activity[Player, Team]): ), AnalyticsScreen('Tutorial Section 6'), Text( - bs.Lstr(resource=self._r + '.phrase15Text') + bs.Lstr(resource=f'{self._r}.phrase15Text') ), # lastly there's bombs DelayOld(1900), Text( - bs.Lstr(resource=self._r + '.phrase16Text') + bs.Lstr(resource=f'{self._r}.phrase16Text') ), # throwing bombs takes practice DelayOld(2000), Bomb(), @@ -2099,11 +2099,11 @@ class TutorialActivity(bs.Activity[Player, Team]): Bomb(), DelayOld(2000), Text( - bs.Lstr(resource=self._r + '.phrase17Text') + bs.Lstr(resource=f'{self._r}.phrase17Text') ), # not a very good throw DelayOld(3000), Text( - bs.Lstr(resource=self._r + '.phrase18Text') + bs.Lstr(resource=f'{self._r}.phrase18Text') ), # moving helps you get distance DelayOld(1000), Bomb(), @@ -2121,7 +2121,7 @@ class TutorialActivity(bs.Activity[Player, Team]): Move(0, 0), DelayOld(2500), Text( - bs.Lstr(resource=self._r + '.phrase19Text') + bs.Lstr(resource=f'{self._r}.phrase19Text') ), # jumping helps you get height DelayOld(2000), Bomb(), @@ -2141,7 +2141,7 @@ class TutorialActivity(bs.Activity[Player, Team]): Move(0, 0), DelayOld(2000), Text( - bs.Lstr(resource=self._r + '.phrase20Text') + bs.Lstr(resource=f'{self._r}.phrase20Text') ), # whiplash your bombs DelayOld(1000), Bomb(release=False), @@ -2303,7 +2303,7 @@ class TutorialActivity(bs.Activity[Player, Team]): DelayOld(2000), AnalyticsScreen('Tutorial Section 7'), Text( - bs.Lstr(resource=self._r + '.phrase21Text') + bs.Lstr(resource=f'{self._r}.phrase21Text') ), # timing your bombs can be tricky Move(-1, 0), DelayOld(1000), @@ -2323,7 +2323,7 @@ class TutorialActivity(bs.Activity[Player, Team]): relative_to=0, make_current=False, color=(0.3, 0.8, 1.0), - name=bs.Lstr(resource=self._r + '.randomName5Text'), + name=bs.Lstr(resource=f'{self._r}.randomName5Text'), ), DelayOld2(1000), Move(-1, 0), @@ -2341,12 +2341,12 @@ class TutorialActivity(bs.Activity[Player, Team]): DelayOld2(1000), Move(0, 0), DelayOld2(1500), - Text(bs.Lstr(resource=self._r + '.phrase22Text')), # dang + Text(bs.Lstr(resource=f'{self._r}.phrase22Text')), # dang Delay(1500), Text(''), Delay(200), Text( - bs.Lstr(resource=self._r + '.phrase23Text') + bs.Lstr(resource=f'{self._r}.phrase23Text') ), # try cooking off Delay(1500), Bomb(), @@ -2362,7 +2362,7 @@ class TutorialActivity(bs.Activity[Player, Team]): Move(0, 0), Delay(2000), Text( - bs.Lstr(resource=self._r + '.phrase24Text') + bs.Lstr(resource=f'{self._r}.phrase24Text') ), # hooray nicely cooked Celebrate(), DelayOld(2000), @@ -2376,23 +2376,23 @@ class TutorialActivity(bs.Activity[Player, Team]): DelayOld(1000), AnalyticsScreen('Tutorial Section 8'), Text( - bs.Lstr(resource=self._r + '.phrase25Text') + bs.Lstr(resource=f'{self._r}.phrase25Text') ), # well that's just about it DelayOld(2000), Text( - bs.Lstr(resource=self._r + '.phrase26Text') + bs.Lstr(resource=f'{self._r}.phrase26Text') ), # go get em tiger DelayOld(2000), Text( - bs.Lstr(resource=self._r + '.phrase27Text') + bs.Lstr(resource=f'{self._r}.phrase27Text') ), # remember you training DelayOld(3000), Text( - bs.Lstr(resource=self._r + '.phrase28Text') + bs.Lstr(resource=f'{self._r}.phrase28Text') ), # well maybe DelayOld(1600), Text( - bs.Lstr(resource=self._r + '.phrase29Text') + bs.Lstr(resource=f'{self._r}.phrase29Text') ), # good luck Celebrate('right', duration=10000), DelayOld(1000), @@ -2440,7 +2440,7 @@ class TutorialActivity(bs.Activity[Player, Team]): assert self._skip_count_text self._skip_count_text.text = ( bs.Lstr( - resource=self._r + '.skipVoteCountText', + resource=f'{self._r}.skipVoteCountText', subs=[ ('${COUNT}', str(count)), ('${TOTAL}', str(len(self.players))), @@ -2460,7 +2460,7 @@ class TutorialActivity(bs.Activity[Player, Team]): bs.getsound('swish').play() # self._skip_count_text.text = self._r.skippingText self._skip_count_text.text = bs.Lstr( - resource=self._r + '.skippingText' + resource=f'{self._r}.skippingText' ) assert self._skip_text self._skip_text.text = '' @@ -2474,7 +2474,7 @@ class TutorialActivity(bs.Activity[Player, Team]): self._issued_warning = True assert self._skip_text self._skip_text.text = bs.Lstr( - resource=self._r + '.skipConfirmText' + resource=f'{self._r}.skipConfirmText' ) self._skip_text.color = (1, 1, 1) self._skip_text.scale = 1.3 @@ -2510,7 +2510,7 @@ class TutorialActivity(bs.Activity[Player, Team]): def _revert_confirm(self) -> None: assert self._skip_text self._skip_text.text = bs.Lstr( - resource=self._r + '.toSkipPressAnythingText' + resource=f'{self._r}.toSkipPressAnythingText' ) self._skip_text.color = (1, 1, 1) self._issued_warning = False diff --git a/src/assets/ba_data/python/bauiv1lib/account/settings.py b/src/assets/ba_data/python/bauiv1lib/account/settings.py index f92697b6..9476f326 100644 --- a/src/assets/ba_data/python/bauiv1lib/account/settings.py +++ b/src/assets/ba_data/python/bauiv1lib/account/settings.py @@ -8,10 +8,12 @@ from __future__ import annotations import time import logging +from bacommon.cloud import WebLocation from bacommon.login import LoginType import bacommon.cloud import bauiv1 as bui + # These days we're directing people to the web based account settings # for V2 account linking and trying to get them to disconnect remaining # V1 links, but leaving this escape hatch here in case needed. @@ -150,7 +152,7 @@ class AccountSettingsWindow(bui.Window): parent=self._root_widget, position=(self._width * 0.5, self._height - 41), size=(0, 0), - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), color=app.ui_v1.title_color, maxwidth=self._width - 340, h_align='center', @@ -346,11 +348,12 @@ class AccountSettingsWindow(bui.Window): show_reset_progress_button = False reset_progress_button_space = 70.0 - show_manage_v2_account_button = ( - self._v1_signed_in and v1_account_type == 'V2' - ) + show_manage_v2_account_button = primary_v2_account is not None manage_v2_account_button_space = 100.0 + show_delete_account_button = primary_v2_account is not None + delete_account_button_space = 80.0 + show_player_profiles_button = self._v1_signed_in player_profiles_button_space = ( 70.0 if show_manage_v2_account_button else 100.0 @@ -365,22 +368,19 @@ class AccountSettingsWindow(bui.Window): unlink_accounts_button_space = 90.0 # Phasing this out. - # show_v2_link_info = self._v1_signed_in - # and not show_link_accounts_button show_v2_link_info = False v2_link_info_space = 70.0 legacy_unlink_button_space = 120.0 - show_sign_out_button = self._v1_signed_in and v1_account_type in [ - 'Local', - 'V2', - ] + show_sign_out_button = primary_v2_account is not None or ( + self._v1_signed_in and v1_account_type == 'Local' + ) sign_out_button_space = 80.0 # We can show cancel if we're either waiting on an adapter to - # provide us with v2 credentials or waiting for those credentials - # to be verified. + # provide us with v2 credentials or waiting for those + # credentials to be verified. show_cancel_sign_in_button = self._signing_in_adapter is not None or ( plus.accounts.have_primary_credentials() and primary_v2_account is None @@ -435,6 +435,8 @@ class AccountSettingsWindow(bui.Window): self._sub_height += legacy_unlink_button_space if show_sign_out_button: self._sub_height += sign_out_button_space + if show_delete_account_button: + self._sub_height += delete_account_button_space if show_cancel_sign_in_button: self._sub_height += cancel_sign_in_button_space self._subcontainer = bui.containerwidget( @@ -579,7 +581,7 @@ class AccountSettingsWindow(bui.Window): v + sign_in_benefits_space * 0.4, ), size=(0, 0), - text=bui.Lstr(resource=self._r + '.signInInfoText'), + text=bui.Lstr(resource=f'{self._r}.signInInfoText'), max_height=sign_in_benefits_space * 0.9, scale=0.9, color=(0.75, 0.7, 0.8), @@ -624,7 +626,7 @@ class AccountSettingsWindow(bui.Window): ( '${B}', bui.Lstr( - resource=self._r + '.signInWithText', + resource=f'{self._r}.signInWithText', subs=[ ( '${SERVICE}', @@ -669,7 +671,7 @@ class AccountSettingsWindow(bui.Window): ( '${B}', bui.Lstr( - resource=self._r + '.signInWithText', + resource=f'{self._r}.signInWithText', subs=[('${SERVICE}', 'Game Center')], ), ), @@ -703,11 +705,11 @@ class AccountSettingsWindow(bui.Window): ) v2labeltext: bui.Lstr | str = ( - bui.Lstr(resource=self._r + '.signInWithAnEmailAddressText') + bui.Lstr(resource=f'{self._r}.signInWithAnEmailAddressText') if show_game_center_sign_in_button or show_google_play_sign_in_button or show_device_sign_in_button - else bui.Lstr(resource=self._r + '.signInText') + else bui.Lstr(resource=f'{self._r}.signInText') ) v2infotext: bui.Lstr | str | None = None @@ -796,7 +798,7 @@ class AccountSettingsWindow(bui.Window): ( '${B}', bui.Lstr( - resource=self._r + '.signInWithDeviceText' + resource=f'{self._r}.signInWithDeviceText' ), ), ], @@ -811,7 +813,7 @@ class AccountSettingsWindow(bui.Window): v_align='center', size=(0, 0), position=(self._sub_width * 0.5, v - 4), - text=bui.Lstr(resource=self._r + '.signInWithDeviceInfoText'), + text=bui.Lstr(resource=f'{self._r}.signInWithDeviceInfoText'), flatness=1.0, scale=0.57, maxwidth=button_width * 0.9, @@ -1042,10 +1044,10 @@ class AccountSettingsWindow(bui.Window): button_width = 250 if show_reset_progress_button: confirm_text = ( - bui.Lstr(resource=self._r + '.resetProgressConfirmText') + bui.Lstr(resource=f'{self._r}.resetProgressConfirmText') if self._can_reset_achievements else bui.Lstr( - resource=self._r + '.resetProgressConfirmNoAchievementsText' + resource=f'{self._r}.resetProgressConfirmNoAchievementsText' ) ) v -= reset_progress_button_space @@ -1056,7 +1058,7 @@ class AccountSettingsWindow(bui.Window): textcolor=(0.75, 0.7, 0.8), autoselect=True, size=(button_width, 60), - label=bui.Lstr(resource=self._r + '.resetProgressText'), + label=bui.Lstr(resource=f'{self._r}.resetProgressText'), on_activate_call=lambda: confirm.ConfirmWindow( text=confirm_text, width=500, @@ -1083,7 +1085,7 @@ class AccountSettingsWindow(bui.Window): scale=0.9, color=(0.75, 0.7, 0.8), maxwidth=self._sub_width * 0.95, - text=bui.Lstr(resource=self._r + '.linkedAccountsText'), + text=bui.Lstr(resource=f'{self._r}.linkedAccountsText'), h_align='center', v_align='center', ) @@ -1112,7 +1114,7 @@ class AccountSettingsWindow(bui.Window): v_align='center', size=(0, 0), position=(self._sub_width * 0.5, v + 17 + 20), - text=bui.Lstr(resource=self._r + '.linkAccountsText'), + text=bui.Lstr(resource=f'{self._r}.linkAccountsText'), maxwidth=button_width * 0.8, color=(0.75, 0.7, 0.8), ) @@ -1123,7 +1125,7 @@ class AccountSettingsWindow(bui.Window): v_align='center', size=(0, 0), position=(self._sub_width * 0.5, v - 4 + 20), - text=bui.Lstr(resource=self._r + '.linkAccountsInfoText'), + text=bui.Lstr(resource=f'{self._r}.linkAccountsInfoText'), flatness=1.0, scale=0.5, maxwidth=button_width * 0.8, @@ -1157,7 +1159,7 @@ class AccountSettingsWindow(bui.Window): v_align='center', size=(0, 0), position=(self._sub_width * 0.5, v + 55), - text=bui.Lstr(resource=self._r + '.unlinkAccountsText'), + text=bui.Lstr(resource=f'{self._r}.unlinkAccountsText'), maxwidth=button_width * 0.8, color=(0.75, 0.7, 0.8), ) @@ -1212,7 +1214,7 @@ class AccountSettingsWindow(bui.Window): autoselect=True, size=(button_width_w, 60), label=bui.Lstr( - resource=self._r + '.unlinkLegacyV1AccountsText' + resource=f'{self._r}.unlinkLegacyV1AccountsText' ), textcolor=(0.8, 0.4, 0), color=(0.55, 0.5, 0.6), @@ -1225,7 +1227,7 @@ class AccountSettingsWindow(bui.Window): parent=self._subcontainer, position=((self._sub_width - button_width) * 0.5, v), size=(button_width, 60), - label=bui.Lstr(resource=self._r + '.signOutText'), + label=bui.Lstr(resource=f'{self._r}.signOutText'), color=(0.55, 0.5, 0.6), textcolor=(0.75, 0.7, 0.8), autoselect=True, @@ -1261,6 +1263,27 @@ class AccountSettingsWindow(bui.Window): ) bui.widget(edit=btn, left_widget=bbtn, show_buffer_bottom=15) + if show_delete_account_button: + v -= delete_account_button_space + self._delete_account_button = btn = bui.buttonwidget( + parent=self._subcontainer, + position=((self._sub_width - button_width) * 0.5, v), + size=(button_width, 60), + label=bui.Lstr(resource=f'{self._r}.deleteAccountText'), + color=(0.85, 0.5, 0.6), + textcolor=(0.9, 0.7, 0.8), + autoselect=True, + on_activate_call=self._on_delete_account_press, + ) + if first_selectable is None: + first_selectable = btn + if bui.app.ui_v1.use_toolbars: + bui.widget( + edit=btn, + right_widget=bui.get_special_widget('party_button'), + ) + bui.widget(edit=btn, left_widget=bbtn, show_buffer_bottom=15) + # Whatever the topmost selectable thing is, we want it to scroll all # the way up when we select it. if first_selectable is not None: @@ -1303,6 +1326,12 @@ class AccountSettingsWindow(bui.Window): show_what_is_v2_page() def _on_manage_account_press(self) -> None: + self._do_manage_account_press(WebLocation.ACCOUNT_EDITOR) + + def _on_delete_account_press(self) -> None: + self._do_manage_account_press(WebLocation.ACCOUNT_DELETE_SECTION) + + def _do_manage_account_press(self, weblocation: WebLocation) -> None: plus = bui.app.plus assert plus is not None @@ -1327,7 +1356,7 @@ class AccountSettingsWindow(bui.Window): with plus.accounts.primary: plus.cloud.send_message_cb( - bacommon.cloud.ManageAccountMessage(), + bacommon.cloud.ManageAccountMessage(weblocation=weblocation), on_response=bui.WeakCall(self._on_manage_account_response), ) @@ -1414,7 +1443,7 @@ class AccountSettingsWindow(bui.Window): subs=[ ( '${L}', - bui.Lstr(resource=self._r + '.linkedAccountsText'), + bui.Lstr(resource=f'{self._r}.linkedAccountsText'), ), ('${A}', accounts_str), ], @@ -1434,7 +1463,7 @@ class AccountSettingsWindow(bui.Window): # Last level cant be completed; hence the -1; progress = min(1.0, float(levels_complete) / (len(levels) - 1)) p_str = bui.Lstr( - resource=self._r + '.campaignProgressText', + resource=f'{self._r}.campaignProgressText', subs=[('${PROGRESS}', str(int(progress * 100.0)) + '%')], ) except Exception: @@ -1456,7 +1485,7 @@ class AccountSettingsWindow(bui.Window): bui.textwidget( edit=self._tickets_text, text=bui.Lstr( - resource=self._r + '.ticketsText', subs=[('${COUNT}', tc_str)] + resource=f'{self._r}.ticketsText', subs=[('${COUNT}', tc_str)] ), ) @@ -1496,7 +1525,7 @@ class AccountSettingsWindow(bui.Window): ) total = len(bui.app.classic.ach.achievements) txt_final = bui.Lstr( - resource=self._r + '.achievementProgressText', + resource=f'{self._r}.achievementProgressText', subs=[('${COUNT}', str(complete)), ('${TOTAL}', str(total))], ) @@ -1575,7 +1604,7 @@ class AccountSettingsWindow(bui.Window): cfg.commit() bui.buttonwidget( edit=self._sign_out_button, - label=bui.Lstr(resource=self._r + '.signingOutText'), + label=bui.Lstr(resource=f'{self._r}.signingOutText'), ) # Speed UI updates along. diff --git a/src/assets/ba_data/python/bauiv1lib/confirm.py b/src/assets/ba_data/python/bauiv1lib/confirm.py index 69e3ccd5..394f2fe9 100644 --- a/src/assets/ba_data/python/bauiv1lib/confirm.py +++ b/src/assets/ba_data/python/bauiv1lib/confirm.py @@ -18,7 +18,7 @@ class ConfirmWindow: def __init__( self, - text: str | bui.Lstr = 'Are you sure?', + text: str | bui.Lstr | None = None, action: Callable[[], Any] | None = None, width: float = 360.0, height: float = 100.0, @@ -31,6 +31,8 @@ class ConfirmWindow: origin_widget: bui.Widget | None = None, ): # pylint: disable=too-many-locals + if text is None: + text = bui.Lstr(resource='areYouSureText') if ok_text is None: ok_text = bui.Lstr(resource='okText') if cancel_text is None: diff --git a/src/assets/ba_data/python/bauiv1lib/coop/browser.py b/src/assets/ba_data/python/bauiv1lib/coop/browser.py index 540f1804..81a936ef 100644 --- a/src/assets/ba_data/python/bauiv1lib/coop/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/coop/browser.py @@ -684,7 +684,7 @@ class CoopBrowserWindow(bui.Window): text=bui.Lstr( value='${C} (${P})', subs=[ - ('${C}', bui.Lstr(resource=self._r + '.campaignText')), + ('${C}', bui.Lstr(resource=f'{self._r}.campaignText')), ('${P}', p_str), ], ), @@ -694,7 +694,7 @@ class CoopBrowserWindow(bui.Window): # pylint: disable=cyclic-import from bauiv1lib.confirm import ConfirmWindow - txt = bui.Lstr(resource=self._r + '.tournamentInfoText') + txt = bui.Lstr(resource=f'{self._r}.tournamentInfoText') ConfirmWindow( txt, cancel_button=False, diff --git a/src/assets/ba_data/python/bauiv1lib/coop/tournamentbutton.py b/src/assets/ba_data/python/bauiv1lib/coop/tournamentbutton.py index e4adb499..1c5a9267 100644 --- a/src/assets/ba_data/python/bauiv1lib/coop/tournamentbutton.py +++ b/src/assets/ba_data/python/bauiv1lib/coop/tournamentbutton.py @@ -102,7 +102,7 @@ class TournamentButton: position=(x + 360, y + scly - 20), size=(0, 0), h_align='center', - text=bui.Lstr(resource=self._r + '.entryFeeText'), + text=bui.Lstr(resource=f'{self._r}.entryFeeText'), v_align='center', maxwidth=100, scale=0.9, @@ -167,7 +167,7 @@ class TournamentButton: position=(x + 447 + x_offs, y + scly - 20), size=(0, 0), h_align='center', - text=bui.Lstr(resource=self._r + '.prizesText'), + text=bui.Lstr(resource=f'{self._r}.prizesText'), v_align='center', maxwidth=130, scale=0.9, @@ -267,7 +267,7 @@ class TournamentButton: position=(x + 620 + x_offs, y + scly - 20), size=(0, 0), h_align='center', - text=bui.Lstr(resource=self._r + '.currentBestText'), + text=bui.Lstr(resource=f'{self._r}.currentBestText'), v_align='center', maxwidth=180, scale=0.9, @@ -332,7 +332,7 @@ class TournamentButton: position=(x + 820 + x_offs, y + scly - 20), size=(0, 0), h_align='center', - text=bui.Lstr(resource=self._r + '.timeRemainingText'), + text=bui.Lstr(resource=f'{self._r}.timeRemainingText'), v_align='center', maxwidth=180, scale=0.9, @@ -533,13 +533,13 @@ class TournamentButton: bui.textwidget(edit=self.current_leader_score_text, text=leader_score) bui.buttonwidget( edit=self.more_scores_button, - label=bui.Lstr(resource=self._r + '.seeMoreText'), + label=bui.Lstr(resource=f'{self._r}.seeMoreText'), ) out_of_time_text: str | bui.Lstr = ( '-' if 'totalTime' not in entry else bui.Lstr( - resource=self._r + '.ofTotalTimeText', + resource=f'{self._r}.ofTotalTimeText', subs=[ ( '${TOTAL}', diff --git a/src/assets/ba_data/python/bauiv1lib/creditslist.py b/src/assets/ba_data/python/bauiv1lib/creditslist.py index f25449f3..711d3ffc 100644 --- a/src/assets/ba_data/python/bauiv1lib/creditslist.py +++ b/src/assets/ba_data/python/bauiv1lib/creditslist.py @@ -95,7 +95,7 @@ class CreditsListWindow(bui.Window): position=(0, height - (59 if uiscale is bui.UIScale.SMALL else 54)), size=(width, 30), text=bui.Lstr( - resource=self._r + '.titleText', + resource=f'{self._r}.titleText', subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))], ), h_align='center', @@ -156,7 +156,7 @@ class CreditsListWindow(bui.Window): return sval sound_and_music = bui.Lstr( - resource=self._r + '.songCreditText' + resource=f'{self._r}.songCreditText' ).evaluate() sound_and_music = sound_and_music.replace( '${TITLE}', "'William Tell (Trumpet Entry)'" @@ -232,41 +232,41 @@ class CreditsListWindow(bui.Window): # (or add mesh splitting under the hood) credits_text = ( ' ' - + bui.Lstr(resource=self._r + '.codingGraphicsAudioText') + + bui.Lstr(resource=f'{self._r}.codingGraphicsAudioText') .evaluate() .replace('${NAME}', 'Eric Froemling') + '\n' '\n' ' ' - + bui.Lstr(resource=self._r + '.additionalAudioArtIdeasText') + + bui.Lstr(resource=f'{self._r}.additionalAudioArtIdeasText') .evaluate() .replace('${NAME}', 'Raphael Suter') + '\n' '\n' ' ' - + bui.Lstr(resource=self._r + '.soundAndMusicText').evaluate() + + bui.Lstr(resource=f'{self._r}.soundAndMusicText').evaluate() + '\n' '\n' + sound_and_music + '\n' '\n' ' ' - + bui.Lstr(resource=self._r + '.publicDomainMusicViaText') + + bui.Lstr(resource=f'{self._r}.publicDomainMusicViaText') .evaluate() .replace('${NAME}', 'Musopen.com') + '\n' ' ' - + bui.Lstr(resource=self._r + '.thanksEspeciallyToText') + + bui.Lstr(resource=f'{self._r}.thanksEspeciallyToText') .evaluate() .replace('${NAME}', 'the US Army, Navy, and Marine Bands') + '\n' '\n' ' ' - + bui.Lstr(resource=self._r + '.additionalMusicFromText') + + bui.Lstr(resource=f'{self._r}.additionalMusicFromText') .evaluate() .replace('${NAME}', 'The YouTube Audio Library') + '\n' '\n' ' ' - + bui.Lstr(resource=self._r + '.soundsText') + + bui.Lstr(resource=f'{self._r}.soundsText') .evaluate() .replace('${SOURCE}', 'Freesound.org') + '\n' @@ -274,7 +274,7 @@ class CreditsListWindow(bui.Window): '\n' ' ' + bui.Lstr( - resource=self._r + '.languageTranslationsText' + resource=f'{self._r}.languageTranslationsText' ).evaluate() + '\n' '\n' @@ -295,25 +295,25 @@ class CreditsListWindow(bui.Window): ' Holiday theme vector art designed by Freepik\n' '\n' ' ' - + bui.Lstr(resource=self._r + '.specialThanksText').evaluate() + + bui.Lstr(resource=f'{self._r}.specialThanksText').evaluate() + '\n' '\n' ' Todd, Laura, and Robert Froemling\n' ' ' - + bui.Lstr(resource=self._r + '.allMyFamilyText') + + bui.Lstr(resource=f'{self._r}.allMyFamilyText') .evaluate() .replace('\n', '\n ') + '\n' ' ' + bui.Lstr( - resource=self._r + '.whoeverInventedCoffeeText' + resource=f'{self._r}.whoeverInventedCoffeeText' ).evaluate() + '\n' '\n' - ' ' + bui.Lstr(resource=self._r + '.legalText').evaluate() + '\n' + ' ' + bui.Lstr(resource=f'{self._r}.legalText').evaluate() + '\n' '\n' ' ' - + bui.Lstr(resource=self._r + '.softwareBasedOnText') + + bui.Lstr(resource=f'{self._r}.softwareBasedOnText') .evaluate() .replace('${NAME}', 'the Khronos Group') + '\n' diff --git a/src/assets/ba_data/python/bauiv1lib/debug.py b/src/assets/ba_data/python/bauiv1lib/debug.py index 5bcf38fb..e57ae074 100644 --- a/src/assets/ba_data/python/bauiv1lib/debug.py +++ b/src/assets/ba_data/python/bauiv1lib/debug.py @@ -70,7 +70,7 @@ class DebugWindow(bui.Window): parent=self._root_widget, position=(0, height - 60), size=(width, 30), - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), h_align='center', color=bui.app.ui_v1.title_color, v_align='center', @@ -98,7 +98,7 @@ class DebugWindow(bui.Window): position=((self._sub_width - button_width) * 0.5, v), size=(button_width, 60), autoselect=True, - label=bui.Lstr(resource=self._r + '.runCPUBenchmarkText'), + label=bui.Lstr(resource=f'{self._r}.runCPUBenchmarkText'), on_activate_call=self._run_cpu_benchmark_pressed, ) bui.widget( @@ -111,7 +111,7 @@ class DebugWindow(bui.Window): position=((self._sub_width - button_width) * 0.5, v), size=(button_width, 60), autoselect=True, - label=bui.Lstr(resource=self._r + '.runGPUBenchmarkText'), + label=bui.Lstr(resource=f'{self._r}.runGPUBenchmarkText'), on_activate_call=self._run_gpu_benchmark_pressed, ) v -= 60 @@ -121,7 +121,7 @@ class DebugWindow(bui.Window): position=((self._sub_width - button_width) * 0.5, v), size=(button_width, 60), autoselect=True, - label=bui.Lstr(resource=self._r + '.runMediaReloadBenchmarkText'), + label=bui.Lstr(resource=f'{self._r}.runMediaReloadBenchmarkText'), on_activate_call=self._run_media_reload_benchmark_pressed, ) v -= 60 @@ -130,7 +130,7 @@ class DebugWindow(bui.Window): parent=self._subcontainer, position=(self._sub_width * 0.5, v + 22), size=(0, 0), - text=bui.Lstr(resource=self._r + '.stressTestTitleText'), + text=bui.Lstr(resource=f'{self._r}.stressTestTitleText'), maxwidth=200, color=bui.app.ui_v1.heading_color, scale=0.85, @@ -144,7 +144,7 @@ class DebugWindow(bui.Window): parent=self._subcontainer, position=(x_offs - 10, v + 22), size=(0, 0), - text=bui.Lstr(resource=self._r + '.stressTestPlaylistTypeText'), + text=bui.Lstr(resource=f'{self._r}.stressTestPlaylistTypeText'), maxwidth=130, color=bui.app.ui_v1.heading_color, scale=0.65, @@ -174,7 +174,7 @@ class DebugWindow(bui.Window): parent=self._subcontainer, position=(x_offs - 10, v + 22), size=(0, 0), - text=bui.Lstr(resource=self._r + '.stressTestPlaylistNameText'), + text=bui.Lstr(resource=f'{self._r}.stressTestPlaylistNameText'), maxwidth=130, color=bui.app.ui_v1.heading_color, scale=0.65, @@ -192,7 +192,7 @@ class DebugWindow(bui.Window): autoselect=True, color=(0.9, 0.9, 0.9, 1.0), description=bui.Lstr( - resource=self._r + '.stressTestPlaylistDescriptionText' + resource=f'{self._r}.stressTestPlaylistDescriptionText' ), editable=True, padding=4, @@ -205,7 +205,7 @@ class DebugWindow(bui.Window): parent=self._subcontainer, position=(x_offs - 10, v), size=(0, 0), - text=bui.Lstr(resource=self._r + '.stressTestPlayerCountText'), + text=bui.Lstr(resource=f'{self._r}.stressTestPlayerCountText'), color=(0.8, 0.8, 0.8, 1.0), h_align='right', v_align='center', @@ -250,7 +250,7 @@ class DebugWindow(bui.Window): parent=self._subcontainer, position=(x_offs - 10, v), size=(0, 0), - text=bui.Lstr(resource=self._r + '.stressTestRoundDurationText'), + text=bui.Lstr(resource=f'{self._r}.stressTestRoundDurationText'), color=(0.8, 0.8, 0.8, 1.0), h_align='right', v_align='center', @@ -298,7 +298,7 @@ class DebugWindow(bui.Window): position=((self._sub_width - button_width) * 0.5, v), size=(button_width, 60), autoselect=True, - label=bui.Lstr(resource=self._r + '.runStressTestText'), + label=bui.Lstr(resource=f'{self._r}.runStressTestText'), on_activate_call=self._stress_test_pressed, ) bui.widget(btn, show_buffer_bottom=50) diff --git a/src/assets/ba_data/python/bauiv1lib/fileselector.py b/src/assets/ba_data/python/bauiv1lib/fileselector.py index 308b659c..a2547b26 100644 --- a/src/assets/ba_data/python/bauiv1lib/fileselector.py +++ b/src/assets/ba_data/python/bauiv1lib/fileselector.py @@ -70,12 +70,12 @@ class FileSelectorWindow(bui.Window): h_align='center', v_align='center', text=( - bui.Lstr(resource=self._r + '.titleFolderText') + bui.Lstr(resource=f'{self._r}.titleFolderText') if (allow_folders and not valid_file_extensions) else ( - bui.Lstr(resource=self._r + '.titleFileText') + bui.Lstr(resource=f'{self._r}.titleFileText') if not allow_folders - else bui.Lstr(resource=self._r + '.titleFileFolderText') + else bui.Lstr(resource=f'{self._r}.titleFileFolderText') ) ), maxwidth=210, @@ -382,7 +382,7 @@ class FileSelectorWindow(bui.Window): ), size=(self._button_width, 50), label=bui.Lstr( - resource=self._r + '.useThisFolderButtonText' + resource=f'{self._r}.useThisFolderButtonText' ), on_activate_call=self._on_folder_entry_activated, ) diff --git a/src/assets/ba_data/python/bauiv1lib/gather/__init__.py b/src/assets/ba_data/python/bauiv1lib/gather/__init__.py index 710e36c1..6e35d6a8 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/__init__.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/__init__.py @@ -165,7 +165,7 @@ class GatherWindow(bui.Window): ), h_align='center', v_align='center', - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), maxwidth=550, ) @@ -174,23 +174,23 @@ class GatherWindow(bui.Window): # Build up the set of tabs we want. tabdefs: list[tuple[GatherWindow.TabID, bui.Lstr]] = [ - (self.TabID.ABOUT, bui.Lstr(resource=self._r + '.aboutText')) + (self.TabID.ABOUT, bui.Lstr(resource=f'{self._r}.aboutText')) ] if plus.get_v1_account_misc_read_val('enablePublicParties', True): tabdefs.append( ( self.TabID.INTERNET, - bui.Lstr(resource=self._r + '.publicText'), + bui.Lstr(resource=f'{self._r}.publicText'), ) ) tabdefs.append( - (self.TabID.PRIVATE, bui.Lstr(resource=self._r + '.privateText')) + (self.TabID.PRIVATE, bui.Lstr(resource=f'{self._r}.privateText')) ) tabdefs.append( - (self.TabID.NEARBY, bui.Lstr(resource=self._r + '.nearbyText')) + (self.TabID.NEARBY, bui.Lstr(resource=f'{self._r}.nearbyText')) ) tabdefs.append( - (self.TabID.MANUAL, bui.Lstr(resource=self._r + '.manualText')) + (self.TabID.MANUAL, bui.Lstr(resource=f'{self._r}.manualText')) ) # On small UI, push our tabs up closer to the top of the screen to diff --git a/src/assets/ba_data/python/bauiv1lib/gettickets.py b/src/assets/ba_data/python/bauiv1lib/gettickets.py index 09cbf139..3d40a4ac 100644 --- a/src/assets/ba_data/python/bauiv1lib/gettickets.py +++ b/src/assets/ba_data/python/bauiv1lib/gettickets.py @@ -103,7 +103,7 @@ class GetTicketsWindow(bui.Window): scale=1.2, h_align='right', v_align='center', - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), # text='Testing really long text here blah blah', maxwidth=260, ) @@ -242,7 +242,7 @@ class GetTicketsWindow(bui.Window): ) return btn2 - rsrc = self._r + '.ticketsText' + rsrc = f'{self._r}.ticketsText' c2txt = bui.Lstr( resource=rsrc, @@ -374,7 +374,7 @@ class GetTicketsWindow(bui.Window): position=(h + h_offs, v), size=b_size_3, label=bui.Lstr( - resource=self._r + '.ticketsFromASponsorText', + resource=f'{self._r}.ticketsFromASponsorText', subs=[ ( '${COUNT}', @@ -396,7 +396,7 @@ class GetTicketsWindow(bui.Window): self._ad_free_text = bui.textwidget( parent=self._root_widget, - text=bui.Lstr(resource=self._r + '.freeText'), + text=bui.Lstr(resource=f'{self._r}.freeText'), position=( h + h_offs + b_size_3[0] * 0.5, v + b_size_3[1] * 0.5 + 25, @@ -445,7 +445,7 @@ class GetTicketsWindow(bui.Window): bui.textwidget( parent=self._root_widget, - text=bui.Lstr(resource=self._r + '.freeText'), + text=bui.Lstr(resource=f'{self._r}.freeText'), position=( h + h_offs + b_size_3[0] * 0.5, v + b_size_3[1] * 0.5 + 25, @@ -468,13 +468,13 @@ class GetTicketsWindow(bui.Window): v = self._height - 105 + tc_y_offs txt1 = ( - bui.Lstr(resource=self._r + '.youHaveText') + bui.Lstr(resource=f'{self._r}.youHaveText') .evaluate() .partition('${COUNT}')[0] .strip() ) txt2 = ( - bui.Lstr(resource=self._r + '.youHaveText') + bui.Lstr(resource=f'{self._r}.youHaveText') .evaluate() .rpartition('${COUNT}')[-1] .strip() @@ -658,12 +658,12 @@ class GetTicketsWindow(bui.Window): ) ) and plus.get_v1_account_misc_read_val('allowAccountLinking2', False): bui.screenmessage( - bui.Lstr(resource=self._r + '.unavailableLinkAccountText'), + bui.Lstr(resource=f'{self._r}.unavailableLinkAccountText'), color=(1, 0.5, 0), ) else: bui.screenmessage( - bui.Lstr(resource=self._r + '.unavailableText'), + bui.Lstr(resource=f'{self._r}.unavailableText'), color=(1, 0.5, 0), ) bui.getsound('error').play() diff --git a/src/assets/ba_data/python/bauiv1lib/helpui.py b/src/assets/ba_data/python/bauiv1lib/helpui.py index 0a3de5fa..887f0050 100644 --- a/src/assets/ba_data/python/bauiv1lib/helpui.py +++ b/src/assets/ba_data/python/bauiv1lib/helpui.py @@ -68,7 +68,7 @@ class HelpWindow(bui.Window): position=(0, height - (50 if uiscale is bui.UIScale.SMALL else 45)), size=(width, 25), text=bui.Lstr( - resource=self._r + '.titleText', + resource=f'{self._r}.titleText', subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))], ), color=bui.app.ui_v1.title_color, @@ -138,9 +138,9 @@ class HelpWindow(bui.Window): self._sub_width = 660 self._sub_height = ( 1590 - + bui.app.lang.get_resource(self._r + '.someDaysExtraSpace') + + bui.app.lang.get_resource(f'{self._r}.someDaysExtraSpace') + bui.app.lang.get_resource( - self._r + '.orPunchingSomethingExtraSpace' + f'{self._r}.orPunchingSomethingExtraSpace' ) ) @@ -162,7 +162,7 @@ class HelpWindow(bui.Window): paragraph = (0.8, 0.8, 1.0, 1.0) txt = bui.Lstr( - resource=self._r + '.welcomeText', + resource=f'{self._r}.welcomeText', subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))], ).evaluate() txt_scale = 1.4 @@ -198,7 +198,7 @@ class HelpWindow(bui.Window): assert app.classic is not None v -= spacing * 50.0 - txt = bui.Lstr(resource=self._r + '.someDaysText').evaluate() + txt = bui.Lstr(resource=f'{self._r}.someDaysText').evaluate() bui.textwidget( parent=self._subcontainer, position=(h, v), @@ -211,9 +211,9 @@ class HelpWindow(bui.Window): v_align='center', flatness=1.0, ) - v -= spacing * 25.0 + getres(self._r + '.someDaysExtraSpace') + v -= spacing * 25.0 + getres(f'{self._r}.someDaysExtraSpace') txt_scale = 0.66 - txt = bui.Lstr(resource=self._r + '.orPunchingSomethingText').evaluate() + txt = bui.Lstr(resource=f'{self._r}.orPunchingSomethingText').evaluate() bui.textwidget( parent=self._subcontainer, position=(h, v), @@ -226,10 +226,10 @@ class HelpWindow(bui.Window): v_align='center', flatness=1.0, ) - v -= spacing * 27.0 + getres(self._r + '.orPunchingSomethingExtraSpace') + v -= spacing * 27.0 + getres(f'{self._r}.orPunchingSomethingExtraSpace') txt_scale = 1.0 txt = bui.Lstr( - resource=self._r + '.canHelpText', + resource=f'{self._r}.canHelpText', subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))], ).evaluate() bui.textwidget( @@ -246,7 +246,7 @@ class HelpWindow(bui.Window): v -= spacing * 70.0 txt_scale = 1.0 - txt = bui.Lstr(resource=self._r + '.toGetTheMostText').evaluate() + txt = bui.Lstr(resource=f'{self._r}.toGetTheMostText').evaluate() bui.textwidget( parent=self._subcontainer, position=(h, v), @@ -262,7 +262,7 @@ class HelpWindow(bui.Window): v -= spacing * 40.0 txt_scale = 0.74 - txt = bui.Lstr(resource=self._r + '.friendsText').evaluate() + txt = bui.Lstr(resource=f'{self._r}.friendsText').evaluate() hval2 = h - 220 bui.textwidget( parent=self._subcontainer, @@ -278,7 +278,7 @@ class HelpWindow(bui.Window): ) txt = bui.Lstr( - resource=self._r + '.friendsGoodText', + resource=f'{self._r}.friendsGoodText', subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))], ).evaluate() txt_scale = 0.7 @@ -298,9 +298,9 @@ class HelpWindow(bui.Window): v -= spacing * 45.0 txt = ( - bui.Lstr(resource=self._r + '.devicesText').evaluate() + bui.Lstr(resource=f'{self._r}.devicesText').evaluate() if app.env.vr - else bui.Lstr(resource=self._r + '.controllersText').evaluate() + else bui.Lstr(resource=f'{self._r}.controllersText').evaluate() ) txt_scale = 0.74 hval2 = h - 220 @@ -322,7 +322,7 @@ class HelpWindow(bui.Window): infotxt = '.controllersInfoText' txt = bui.Lstr( resource=self._r + infotxt, - fallback_resource=self._r + '.controllersInfoText', + fallback_resource=f'{self._r}.controllersInfoText', subs=[ ('${APP_NAME}', bui.Lstr(resource='titleText')), ('${REMOTE_APP_NAME}', bui.get_remote_app_name()), @@ -330,7 +330,7 @@ class HelpWindow(bui.Window): ).evaluate() else: txt = bui.Lstr( - resource=self._r + '.devicesInfoText', + resource=f'{self._r}.devicesInfoText', subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))], ).evaluate() @@ -349,7 +349,7 @@ class HelpWindow(bui.Window): v -= spacing * 150.0 - txt = bui.Lstr(resource=self._r + '.controlsText').evaluate() + txt = bui.Lstr(resource=f'{self._r}.controlsText').evaluate() txt_scale = 1.4 txt_maxwidth = 480 bui.textwidget( @@ -383,7 +383,7 @@ class HelpWindow(bui.Window): txt_scale = 0.7 txt = bui.Lstr( - resource=self._r + '.controlsSubtitleText', + resource=f'{self._r}.controlsSubtitleText', subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))], ).evaluate() bui.textwidget( @@ -413,8 +413,8 @@ class HelpWindow(bui.Window): color=(1, 0.7, 0.3), ) - txt_scale = getres(self._r + '.punchInfoTextScale') - txt = bui.Lstr(resource=self._r + '.punchInfoText').evaluate() + txt_scale = getres(f'{self._r}.punchInfoTextScale') + txt = bui.Lstr(resource=f'{self._r}.punchInfoText').evaluate() bui.textwidget( parent=self._subcontainer, position=(h - sep - 185 + 70, v + 120), @@ -437,8 +437,8 @@ class HelpWindow(bui.Window): color=(1, 0.3, 0.3), ) - txt = bui.Lstr(resource=self._r + '.bombInfoText').evaluate() - txt_scale = getres(self._r + '.bombInfoTextScale') + txt = bui.Lstr(resource=f'{self._r}.bombInfoText').evaluate() + txt_scale = getres(f'{self._r}.bombInfoTextScale') bui.textwidget( parent=self._subcontainer, position=(h + sep + 50 + 60, v - 35), @@ -462,8 +462,8 @@ class HelpWindow(bui.Window): color=(0.5, 0.5, 1), ) - txtl = bui.Lstr(resource=self._r + '.pickUpInfoText') - txt_scale = getres(self._r + '.pickUpInfoTextScale') + txtl = bui.Lstr(resource=f'{self._r}.pickUpInfoText') + txt_scale = getres(f'{self._r}.pickUpInfoTextScale') bui.textwidget( parent=self._subcontainer, position=(h + 60 + 120, v + sep + 50), @@ -486,8 +486,8 @@ class HelpWindow(bui.Window): color=(0.4, 1, 0.4), ) - txt = bui.Lstr(resource=self._r + '.jumpInfoText').evaluate() - txt_scale = getres(self._r + '.jumpInfoTextScale') + txt = bui.Lstr(resource=f'{self._r}.jumpInfoText').evaluate() + txt_scale = getres(f'{self._r}.jumpInfoTextScale') bui.textwidget( parent=self._subcontainer, position=(h - 250 + 75, v - sep - 15 + 30), @@ -500,8 +500,8 @@ class HelpWindow(bui.Window): v_align='top', ) - txt = bui.Lstr(resource=self._r + '.runInfoText').evaluate() - txt_scale = getres(self._r + '.runInfoTextScale') + txt = bui.Lstr(resource=f'{self._r}.runInfoText').evaluate() + txt_scale = getres(f'{self._r}.runInfoTextScale') bui.textwidget( parent=self._subcontainer, position=(h, v - sep - 100), @@ -517,7 +517,7 @@ class HelpWindow(bui.Window): v -= spacing * 280.0 - txt = bui.Lstr(resource=self._r + '.powerupsText').evaluate() + txt = bui.Lstr(resource=f'{self._r}.powerupsText').evaluate() txt_scale = 1.4 txt_maxwidth = 480 bui.textwidget( @@ -546,8 +546,8 @@ class HelpWindow(bui.Window): ) v -= spacing * 50.0 - txt_scale = getres(self._r + '.powerupsSubtitleTextScale') - txt = bui.Lstr(resource=self._r + '.powerupsSubtitleText').evaluate() + txt_scale = getres(f'{self._r}.powerupsSubtitleTextScale') + txt = bui.Lstr(resource=f'{self._r}.powerupsSubtitleText').evaluate() bui.textwidget( parent=self._subcontainer, position=(h, v), @@ -586,8 +586,8 @@ class HelpWindow(bui.Window): 'powerupLandMines', 'powerupCurse', ]: - name = bui.Lstr(resource=self._r + '.' + tex + 'NameText') - desc = bui.Lstr(resource=self._r + '.' + tex + 'DescriptionText') + name = bui.Lstr(resource=f'{self._r}.' + tex + 'NameText') + desc = bui.Lstr(resource=f'{self._r}.' + tex + 'DescriptionText') v -= spacing * 60.0 diff --git a/src/assets/ba_data/python/bauiv1lib/kiosk.py b/src/assets/ba_data/python/bauiv1lib/kiosk.py index 3543e5ce..46475635 100644 --- a/src/assets/ba_data/python/bauiv1lib/kiosk.py +++ b/src/assets/ba_data/python/bauiv1lib/kiosk.py @@ -69,7 +69,7 @@ class KioskWindow(bui.Window): size=(0, 0), position=(self._width * 0.5, self._height + y_extra - 44), transition_delay=tdelay, - text=bui.Lstr(resource=self._r + '.singlePlayerExamplesText'), + text=bui.Lstr(resource=f'{self._r}.singlePlayerExamplesText'), flatness=1.0, scale=1.2, h_align='center', @@ -116,7 +116,7 @@ class KioskWindow(bui.Window): size=(0, 0), position=(h, label_height), maxwidth=b_width * 0.7, - text=bui.Lstr(resource=self._r + '.easyText'), + text=bui.Lstr(resource=f'{self._r}.easyText'), scale=1.3, h_align='center', v_align='center', @@ -151,7 +151,7 @@ class KioskWindow(bui.Window): size=(0, 0), position=(h, label_height), maxwidth=b_width * 0.7, - text=bui.Lstr(resource=self._r + '.mediumText'), + text=bui.Lstr(resource=f'{self._r}.mediumText'), scale=1.3, h_align='center', v_align='center', @@ -215,7 +215,7 @@ class KioskWindow(bui.Window): size=(0, 0), position=(self._width * 0.5, self._height + y_extra - 44), transition_delay=tdelay, - text=bui.Lstr(resource=self._r + '.versusExamplesText'), + text=bui.Lstr(resource=f'{self._r}.versusExamplesText'), flatness=1.0, scale=1.2, h_align='center', @@ -312,7 +312,7 @@ class KioskWindow(bui.Window): size=(0, 0), position=(h, label_height), maxwidth=b_width * 0.7, - text=bui.Lstr(resource=self._r + '.epicModeText'), + text=bui.Lstr(resource=f'{self._r}.epicModeText'), scale=1.3, h_align='center', v_align='center', @@ -342,7 +342,7 @@ class KioskWindow(bui.Window): scale=0.5, position=(self._width * 0.5 - 60.0, b_v - 70.0), transition_delay=tdelay, - label=bui.Lstr(resource=self._r + '.fullMenuText'), + label=bui.Lstr(resource=f'{self._r}.fullMenuText'), on_activate_call=self._do_full_menu, ) else: diff --git a/src/assets/ba_data/python/bauiv1lib/mainmenu.py b/src/assets/ba_data/python/bauiv1lib/mainmenu.py index 0f10f1cc..cc793476 100644 --- a/src/assets/ba_data/python/bauiv1lib/mainmenu.py +++ b/src/assets/ba_data/python/bauiv1lib/mainmenu.py @@ -255,7 +255,7 @@ class MainMenuWindow(bui.Window): size=(self._button_width, self._button_height), scale=scale, autoselect=self._use_autoselect, - label=bui.Lstr(resource=self._r + '.settingsText'), + label=bui.Lstr(resource=f'{self._r}.settingsText'), transition_delay=self._tdelay, on_activate_call=self._settings, ) @@ -324,7 +324,7 @@ class MainMenuWindow(bui.Window): scale=scale, size=(self._button_width, self._button_height), autoselect=self._use_autoselect, - label=bui.Lstr(resource=self._r + '.leavePartyText'), + label=bui.Lstr(resource=f'{self._r}.leavePartyText'), on_activate_call=self._confirm_leave_party, ) @@ -881,7 +881,7 @@ class MainMenuWindow(bui.Window): scale=scale, autoselect=self._use_autoselect, size=(self._button_width, self._button_height), - label=bui.Lstr(resource=self._r + '.howToPlayText'), + label=bui.Lstr(resource=f'{self._r}.howToPlayText'), transition_delay=self._tdelay, on_activate_call=self._howtoplay, ) @@ -913,7 +913,7 @@ class MainMenuWindow(bui.Window): position=(h - self._button_width * 0.5 * scale, v), size=(self._button_width, self._button_height), autoselect=self._use_autoselect, - label=bui.Lstr(resource=self._r + '.creditsText'), + label=bui.Lstr(resource=f'{self._r}.creditsText'), scale=scale, transition_delay=self._tdelay, on_activate_call=self._credits, @@ -1006,7 +1006,7 @@ class MainMenuWindow(bui.Window): position=(h - self._button_width / 2, v), size=(self._button_width, self._button_height), scale=scale, - label=bui.Lstr(resource=self._r + '.resumeText'), + label=bui.Lstr(resource=f'{self._r}.resumeText'), autoselect=self._use_autoselect, on_activate_call=self._resume, ) @@ -1057,7 +1057,7 @@ class MainMenuWindow(bui.Window): and player_name[-1] != '>' ): txt = bui.Lstr( - resource=self._r + '.justPlayerText', + resource=f'{self._r}.justPlayerText', subs=[('${NAME}', player_name)], ) else: @@ -1071,7 +1071,7 @@ class MainMenuWindow(bui.Window): * (0.64 if player_name != '' else 0.5), ), size=(0, 0), - text=bui.Lstr(resource=self._r + '.leaveGameText'), + text=bui.Lstr(resource=f'{self._r}.leaveGameText'), scale=(0.83 if player_name != '' else 1.0), color=(0.75, 1.0, 0.7), h_align='center', @@ -1210,7 +1210,7 @@ class MainMenuWindow(bui.Window): # Select cancel by default; this occasionally gets called by accident # in a fit of button mashing and this will help reduce damage. ConfirmWindow( - bui.Lstr(resource=self._r + '.exitToMenuText'), + bui.Lstr(resource=f'{self._r}.exitToMenuText'), self._end_game, cancel_is_selected=True, ) @@ -1222,7 +1222,7 @@ class MainMenuWindow(bui.Window): # Select cancel by default; this occasionally gets called by accident # in a fit of button mashing and this will help reduce damage. ConfirmWindow( - bui.Lstr(resource=self._r + '.exitToMenuText'), + bui.Lstr(resource=f'{self._r}.exitToMenuText'), self._end_game, cancel_is_selected=True, ) @@ -1234,7 +1234,7 @@ class MainMenuWindow(bui.Window): # Select cancel by default; this occasionally gets called by accident # in a fit of button mashing and this will help reduce damage. ConfirmWindow( - bui.Lstr(resource=self._r + '.exitToMenuText'), + bui.Lstr(resource=f'{self._r}.exitToMenuText'), self._end_game, cancel_is_selected=True, ) @@ -1246,7 +1246,7 @@ class MainMenuWindow(bui.Window): # Select cancel by default; this occasionally gets called by accident # in a fit of button mashing and this will help reduce damage. ConfirmWindow( - bui.Lstr(resource=self._r + '.leavePartyConfirmText'), + bui.Lstr(resource=f'{self._r}.leavePartyConfirmText'), self._leave_party, cancel_is_selected=True, ) diff --git a/src/assets/ba_data/python/bauiv1lib/party.py b/src/assets/ba_data/python/bauiv1lib/party.py index d54fd46a..199db42f 100644 --- a/src/assets/ba_data/python/bauiv1lib/party.py +++ b/src/assets/ba_data/python/bauiv1lib/party.py @@ -96,7 +96,7 @@ class PartyWindow(bui.Window): if info is not None and info.name != '': title = bui.Lstr(value=info.name) else: - title = bui.Lstr(resource=self._r + '.titleText') + title = bui.Lstr(resource=f'{self._r}.titleText') self._title_text = bui.textwidget( parent=self._root_widget, @@ -151,7 +151,7 @@ class PartyWindow(bui.Window): maxwidth=494, shadow=0.3, flatness=1.0, - description=bui.Lstr(resource=self._r + '.chatMessageText'), + description=bui.Lstr(resource=f'{self._r}.chatMessageText'), autoselect=True, v_align='center', corner_scale=0.7, @@ -175,7 +175,7 @@ class PartyWindow(bui.Window): btn = bui.buttonwidget( parent=self._root_widget, size=(50, 35), - label=bui.Lstr(resource=self._r + '.sendText'), + label=bui.Lstr(resource=f'{self._r}.sendText'), button_type='square', autoselect=True, position=(self._width - 70, 35), @@ -294,7 +294,7 @@ class PartyWindow(bui.Window): top_section_height = 60 bui.textwidget( edit=self._empty_str, - text=bui.Lstr(resource=self._r + '.emptyText'), + text=bui.Lstr(resource=f'{self._r}.emptyText'), ) bui.scrollwidget( edit=self._scrollwidget, @@ -428,7 +428,7 @@ class PartyWindow(bui.Window): maxwidth=c_width * 0.96 - twd, color=(0.1, 1, 0.1, 0.5), text=bui.Lstr( - resource=self._r + '.hostText' + resource=f'{self._r}.hostText' ), scale=0.4, shadow=0.1, diff --git a/src/assets/ba_data/python/bauiv1lib/play.py b/src/assets/ba_data/python/bauiv1lib/play.py index eda60abd..f33ffe61 100644 --- a/src/assets/ba_data/python/bauiv1lib/play.py +++ b/src/assets/ba_data/python/bauiv1lib/play.py @@ -82,7 +82,7 @@ class PlayWindow(bui.Window): size=(0, 0), text=bui.Lstr( resource=( - (self._r + '.titleText') + (f'{self._r}.titleText') if self._is_main_menu else 'playlistsText' ) @@ -228,7 +228,7 @@ class PlayWindow(bui.Window): draw_controller=btn, position=(hoffs + scl * (-10), v + (scl * 54)), size=(scl * button_width, scl * 30), - text=bui.Lstr(resource=self._r + '.oneToFourPlayersText'), + text=bui.Lstr(resource=f'{self._r}.oneToFourPlayersText'), h_align='center', v_align='center', scale=0.83 * scl, @@ -359,7 +359,7 @@ class PlayWindow(bui.Window): draw_controller=btn, position=(hoffs + scl * (-10), v + (scl * 54)), size=(scl * button_width, scl * 30), - text=bui.Lstr(resource=self._r + '.twoToEightPlayersText'), + text=bui.Lstr(resource=f'{self._r}.twoToEightPlayersText'), h_align='center', v_align='center', res_scale=1.5, @@ -480,7 +480,7 @@ class PlayWindow(bui.Window): draw_controller=btn, position=(hoffs + scl * (-10), v + (scl * 54)), size=(scl * button_width, scl * 30), - text=bui.Lstr(resource=self._r + '.twoToEightPlayersText'), + text=bui.Lstr(resource=f'{self._r}.twoToEightPlayersText'), h_align='center', v_align='center', scale=0.9 * scl, diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/addgame.py b/src/assets/ba_data/python/bauiv1lib/playlist/addgame.py index dce81eec..317c9e9e 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/addgame.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/addgame.py @@ -81,7 +81,7 @@ class PlaylistAddGameWindow(bui.Window): position=(self._width * 0.5, self._height - 28), size=(0, 0), scale=1.0, - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), h_align='center', color=bui.app.ui_v1.title_color, maxwidth=250, @@ -211,7 +211,7 @@ class PlaylistAddGameWindow(bui.Window): self._get_more_games_button = bui.buttonwidget( parent=self._column, autoselect=True, - label=bui.Lstr(resource=self._r + '.getMoreGamesText'), + label=bui.Lstr(resource=f'{self._r}.getMoreGamesText'), color=(0.54, 0.52, 0.67), textcolor=(0.7, 0.65, 0.7), on_activate_call=self._on_get_more_games_press, diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/customizebrowser.py b/src/assets/ba_data/python/bauiv1lib/playlist/customizebrowser.py index 9880c4d5..10b147ba 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/customizebrowser.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/customizebrowser.py @@ -88,7 +88,7 @@ class PlaylistCustomizeBrowserWindow(bui.Window): position=(0, self._height - 47), size=(self._width, 25), text=bui.Lstr( - resource=self._r + '.titleText', + resource=f'{self._r}.titleText', subs=[('${TYPE}', self._pvars.window_title_name)], ), color=bui.app.ui_v1.heading_color, @@ -129,7 +129,7 @@ class PlaylistCustomizeBrowserWindow(bui.Window): textcolor=b_textcolor, text_scale=0.7, label=bui.Lstr( - resource='newText', fallback_resource=self._r + '.newText' + resource='newText', fallback_resource=f'{self._r}.newText' ), ) self._lock_images.append( @@ -154,7 +154,7 @@ class PlaylistCustomizeBrowserWindow(bui.Window): button_type='square', text_scale=0.7, label=bui.Lstr( - resource='editText', fallback_resource=self._r + '.editText' + resource='editText', fallback_resource=f'{self._r}.editText' ), ) self._lock_images.append( @@ -180,7 +180,7 @@ class PlaylistCustomizeBrowserWindow(bui.Window): text_scale=0.7, label=bui.Lstr( resource='duplicateText', - fallback_resource=self._r + '.duplicateText', + fallback_resource=f'{self._r}.duplicateText', ), ) self._lock_images.append( @@ -205,7 +205,7 @@ class PlaylistCustomizeBrowserWindow(bui.Window): button_type='square', text_scale=0.7, label=bui.Lstr( - resource='deleteText', fallback_resource=self._r + '.deleteText' + resource='deleteText', fallback_resource=f'{self._r}.deleteText' ), ) self._lock_images.append( @@ -509,7 +509,7 @@ class PlaylistCustomizeBrowserWindow(bui.Window): if self._selected_playlist_name == '__default__': bui.getsound('error').play() bui.screenmessage( - bui.Lstr(resource=self._r + '.cantEditDefaultText') + bui.Lstr(resource=f'{self._r}.cantEditDefaultText') ) return self._save_playlist_selection() @@ -598,7 +598,7 @@ class PlaylistCustomizeBrowserWindow(bui.Window): if self._selected_playlist_name == '__default__': bui.getsound('error').play() bui.screenmessage( - bui.Lstr(resource=self._r + '.cantShareDefaultText'), + bui.Lstr(resource=f'{self._r}.cantShareDefaultText'), color=(1, 0, 0), ) return @@ -635,12 +635,12 @@ class PlaylistCustomizeBrowserWindow(bui.Window): if self._selected_playlist_name == '__default__': bui.getsound('error').play() bui.screenmessage( - bui.Lstr(resource=self._r + '.cantDeleteDefaultText') + bui.Lstr(resource=f'{self._r}.cantDeleteDefaultText') ) else: ConfirmWindow( bui.Lstr( - resource=self._r + '.deleteConfirmText', + resource=f'{self._r}.deleteConfirmText', subs=[('${LIST}', self._selected_playlist_name)], ), self._do_delete_playlist, diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/edit.py b/src/assets/ba_data/python/bauiv1lib/playlist/edit.py index d01badba..a671606b 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/edit.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/edit.py @@ -90,7 +90,7 @@ class PlaylistEditWindow(bui.Window): parent=self._root_widget, position=(-10, self._height - 50), size=(self._width, 25), - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), color=bui.app.ui_v1.title_color, scale=1.05, h_align='center', @@ -104,7 +104,7 @@ class PlaylistEditWindow(bui.Window): bui.textwidget( parent=self._root_widget, - text=bui.Lstr(resource=self._r + '.listNameText'), + text=bui.Lstr(resource=f'{self._r}.listNameText'), position=(196 + x_inset, v + 31), maxwidth=150, color=(0.8, 0.8, 0.8, 0.5), @@ -124,7 +124,7 @@ class PlaylistEditWindow(bui.Window): max_chars=40, autoselect=True, color=(0.9, 0.9, 0.9, 1.0), - description=bui.Lstr(resource=self._r + '.listNameText'), + description=bui.Lstr(resource=f'{self._r}.listNameText'), editable=True, padding=4, on_return_press_call=self._save_press_with_sound, @@ -160,7 +160,7 @@ class PlaylistEditWindow(bui.Window): color=b_color, textcolor=b_textcolor, text_scale=0.8, - label=bui.Lstr(resource=self._r + '.addGameText'), + label=bui.Lstr(resource=f'{self._r}.addGameText'), ) bui.widget(edit=add_game_button, up_widget=self._text_field) v -= 63.0 * scl @@ -176,7 +176,7 @@ class PlaylistEditWindow(bui.Window): color=b_color, textcolor=b_textcolor, text_scale=0.8, - label=bui.Lstr(resource=self._r + '.editGameText'), + label=bui.Lstr(resource=f'{self._r}.editGameText'), ) v -= 63.0 * scl @@ -190,7 +190,7 @@ class PlaylistEditWindow(bui.Window): button_type='square', color=b_color, textcolor=b_textcolor, - label=bui.Lstr(resource=self._r + '.removeGameText'), + label=bui.Lstr(resource=f'{self._r}.removeGameText'), ) v -= 40 h += 9 @@ -330,7 +330,7 @@ class PlaylistEditWindow(bui.Window): ] ): bui.screenmessage( - bui.Lstr(resource=self._r + '.cantSaveAlreadyExistsText') + bui.Lstr(resource=f'{self._r}.cantSaveAlreadyExistsText') ) bui.getsound('error').play() return @@ -339,7 +339,7 @@ class PlaylistEditWindow(bui.Window): return if not self._editcontroller.get_playlist(): bui.screenmessage( - bui.Lstr(resource=self._r + '.cantSaveEmptyListText') + bui.Lstr(resource=f'{self._r}.cantSaveEmptyListText') ) bui.getsound('error').play() return @@ -348,7 +348,7 @@ class PlaylistEditWindow(bui.Window): # using its exact name to avoid confusion. if new_name == self._editcontroller.get_default_list_name().evaluate(): bui.screenmessage( - bui.Lstr(resource=self._r + '.cantOverwriteDefaultText') + bui.Lstr(resource=f'{self._r}.cantOverwriteDefaultText') ) bui.getsound('error').play() return diff --git a/src/assets/ba_data/python/bauiv1lib/playlist/editgame.py b/src/assets/ba_data/python/bauiv1lib/playlist/editgame.py index c7dea649..993aac37 100644 --- a/src/assets/ba_data/python/bauiv1lib/playlist/editgame.py +++ b/src/assets/ba_data/python/bauiv1lib/playlist/editgame.py @@ -159,7 +159,7 @@ class PlaylistEditGameWindow(bui.Window): scale=0.75, text_scale=1.3, label=( - bui.Lstr(resource=self._r + '.addGameText') + bui.Lstr(resource=f'{self._r}.addGameText') if is_add else bui.Lstr(resource='doneText') ), diff --git a/src/assets/ba_data/python/bauiv1lib/playoptions.py b/src/assets/ba_data/python/bauiv1lib/playoptions.py index a49045c4..cc69b3d4 100644 --- a/src/assets/ba_data/python/bauiv1lib/playoptions.py +++ b/src/assets/ba_data/python/bauiv1lib/playoptions.py @@ -341,7 +341,7 @@ class PlayOptionsWindow(PopupWindow): scale=1.0, size=(250, 30), autoselect=True, - text=bui.Lstr(resource=self._r + '.shuffleGameOrderText'), + text=bui.Lstr(resource=f'{self._r}.shuffleGameOrderText'), maxwidth=300, textcolor=(0.8, 0.8, 0.8), value=self._do_randomize_val, @@ -362,7 +362,7 @@ class PlayOptionsWindow(PopupWindow): scale=1.0, size=(250, 30), autoselect=True, - text=bui.Lstr(resource=self._r + '.showTutorialText'), + text=bui.Lstr(resource=f'{self._r}.showTutorialText'), maxwidth=300, textcolor=(0.8, 0.8, 0.8), value=show_tutorial, diff --git a/src/assets/ba_data/python/bauiv1lib/profile/browser.py b/src/assets/ba_data/python/bauiv1lib/profile/browser.py index 70d1cf3e..4529cdb6 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/browser.py @@ -96,7 +96,7 @@ class ProfileBrowserWindow(bui.Window): parent=self._root_widget, position=(self._width * 0.5, self._height - 36), size=(0, 0), - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), maxwidth=300, color=bui.app.ui_v1.title_color, scale=0.9, @@ -134,7 +134,7 @@ class ProfileBrowserWindow(bui.Window): autoselect=True, textcolor=(0.75, 0.7, 0.8), text_scale=0.7, - label=bui.Lstr(resource=self._r + '.newButtonText'), + label=bui.Lstr(resource=f'{self._r}.newButtonText'), ) v -= 70.0 * scl self._edit_button = bui.buttonwidget( @@ -147,7 +147,7 @@ class ProfileBrowserWindow(bui.Window): autoselect=True, textcolor=(0.75, 0.7, 0.8), text_scale=0.7, - label=bui.Lstr(resource=self._r + '.editButtonText'), + label=bui.Lstr(resource=f'{self._r}.editButtonText'), ) v -= 70.0 * scl self._delete_button = bui.buttonwidget( @@ -160,7 +160,7 @@ class ProfileBrowserWindow(bui.Window): autoselect=True, textcolor=(0.75, 0.7, 0.8), text_scale=0.7, - label=bui.Lstr(resource=self._r + '.deleteButtonText'), + label=bui.Lstr(resource=f'{self._r}.deleteButtonText'), ) v = self._height - 87 @@ -169,7 +169,7 @@ class ProfileBrowserWindow(bui.Window): parent=self._root_widget, position=(self._width * 0.5, self._height - 71), size=(0, 0), - text=bui.Lstr(resource=self._r + '.explanationText'), + text=bui.Lstr(resource=f'{self._r}.explanationText'), color=bui.app.ui_v1.infotextcolor, maxwidth=self._width * 0.83, scale=0.6, @@ -269,13 +269,13 @@ class ProfileBrowserWindow(bui.Window): if self._selected_profile == '__account__': bui.getsound('error').play() bui.screenmessage( - bui.Lstr(resource=self._r + '.cantDeleteAccountProfileText'), + bui.Lstr(resource=f'{self._r}.cantDeleteAccountProfileText'), color=(1, 0, 0), ) return confirm.ConfirmWindow( bui.Lstr( - resource=self._r + '.deleteConfirmText', + resource=f'{self._r}.deleteConfirmText', subs=[('${PROFILE}', self._selected_profile)], ), self._do_delete_profile, diff --git a/src/assets/ba_data/python/bauiv1lib/profile/edit.py b/src/assets/ba_data/python/bauiv1lib/profile/edit.py index 6c6f2a26..b4747769 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/edit.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/edit.py @@ -110,9 +110,9 @@ class EditProfileWindow(bui.Window): position=(self._width * 0.5, height - 38), size=(0, 0), text=( - bui.Lstr(resource=self._r + '.titleNewText') + bui.Lstr(resource=f'{self._r}.titleNewText') if existing_profile is None - else bui.Lstr(resource=self._r + '.titleEditText') + else bui.Lstr(resource=f'{self._r}.titleEditText') ), color=bui.app.ui_v1.title_color, maxwidth=290, @@ -200,7 +200,7 @@ class EditProfileWindow(bui.Window): if not self._is_account_profile and not self._global: bui.textwidget( parent=self._root_widget, - text=bui.Lstr(resource=self._r + '.nameText'), + text=bui.Lstr(resource=f'{self._r}.nameText'), position=(200 + x_inset, v - 6), size=(0, 0), h_align='right', @@ -286,7 +286,7 @@ class EditProfileWindow(bui.Window): position=(self._width * 0.5 - 160, v - 55 - 15), size=(0, 0), draw_controller=btn, - text=bui.Lstr(resource=self._r + '.iconText'), + text=bui.Lstr(resource=f'{self._r}.iconText'), scale=0.7, color=bui.app.ui_v1.title_color, maxwidth=120, @@ -343,7 +343,7 @@ class EditProfileWindow(bui.Window): h_align='left', v_align='center', max_chars=16, - description=bui.Lstr(resource=self._r + '.nameDescriptionText'), + description=bui.Lstr(resource=f'{self._r}.nameDescriptionText'), autoselect=True, editable=True, padding=4, @@ -433,7 +433,7 @@ class EditProfileWindow(bui.Window): position=(self._width * 0.5 - b_offs, v - 65), size=(0, 0), draw_controller=btn, - text=bui.Lstr(resource=self._r + '.colorText'), + text=bui.Lstr(resource=f'{self._r}.colorText'), scale=0.7, color=bui.app.ui_v1.title_color, maxwidth=120, @@ -461,7 +461,7 @@ class EditProfileWindow(bui.Window): position=(self._width * 0.5, v - 80), size=(0, 0), draw_controller=btn, - text=bui.Lstr(resource=self._r + '.characterText'), + text=bui.Lstr(resource=f'{self._r}.characterText'), scale=0.7, color=bui.app.ui_v1.title_color, maxwidth=130, @@ -505,7 +505,7 @@ class EditProfileWindow(bui.Window): position=(self._width * 0.5 + b_offs, v - 65), size=(0, 0), draw_controller=btn, - text=bui.Lstr(resource=self._r + '.highlightText'), + text=bui.Lstr(resource=f'{self._r}.highlightText'), scale=0.7, color=bui.app.ui_v1.title_color, maxwidth=120, diff --git a/src/assets/ba_data/python/bauiv1lib/profile/upgrade.py b/src/assets/ba_data/python/bauiv1lib/profile/upgrade.py index 23ed962c..89340bb4 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/upgrade.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/upgrade.py @@ -87,7 +87,7 @@ class ProfileUpgradeWindow(bui.Window): parent=self._root_widget, position=(self._width * 0.5, self._height - 38), size=(0, 0), - text=bui.Lstr(resource=self._r + '.upgradeToGlobalProfileText'), + text=bui.Lstr(resource=f'{self._r}.upgradeToGlobalProfileText'), color=bui.app.ui_v1.title_color, maxwidth=self._width * 0.45, scale=1.0, @@ -100,7 +100,7 @@ class ProfileUpgradeWindow(bui.Window): parent=self._root_widget, position=(self._width * 0.5, self._height - 100), size=(0, 0), - text=bui.Lstr(resource=self._r + '.upgradeProfileInfoText'), + text=bui.Lstr(resource=f'{self._r}.upgradeProfileInfoText'), color=bui.app.ui_v1.infotextcolor, maxwidth=self._width * 0.8, scale=0.7, @@ -113,7 +113,7 @@ class ProfileUpgradeWindow(bui.Window): position=(self._width * 0.5, self._height - 160), size=(0, 0), text=bui.Lstr( - resource=self._r + '.checkingAvailabilityText', + resource=f'{self._r}.checkingAvailabilityText', subs=[('${NAME}', self._name)], ), color=(0.8, 0.4, 0.0), @@ -183,7 +183,7 @@ class ProfileUpgradeWindow(bui.Window): bui.textwidget( edit=self._status_text, text=bui.Lstr( - resource=self._r + '.availableText', + resource=f'{self._r}.availableText', subs=[('${NAME}', self._name)], ), color=(0, 1, 0), @@ -197,7 +197,7 @@ class ProfileUpgradeWindow(bui.Window): bui.textwidget( edit=self._status_text, text=bui.Lstr( - resource=self._r + '.unavailableText', + resource=f'{self._r}.unavailableText', subs=[('${NAME}', self._name)], ), color=(1, 0, 0), diff --git a/src/assets/ba_data/python/bauiv1lib/sendinfo.py b/src/assets/ba_data/python/bauiv1lib/sendinfo.py index 5915e4f7..0a1cf59e 100644 --- a/src/assets/ba_data/python/bauiv1lib/sendinfo.py +++ b/src/assets/ba_data/python/bauiv1lib/sendinfo.py @@ -109,7 +109,7 @@ class SendInfoWindow(bui.Window): parent=self._root_widget, text=bui.Lstr( resource=( - self._r + '.codeText' + f'{self._r}.codeText' if legacy_code_mode else 'descriptionText' ) @@ -133,7 +133,7 @@ class SendInfoWindow(bui.Window): color=(0.9, 0.9, 0.9, 1.0), description=bui.Lstr( resource=( - self._r + '.codeText' + f'{self._r}.codeText' if legacy_code_mode else 'descriptionText' ) @@ -152,7 +152,7 @@ class SendInfoWindow(bui.Window): size=(b_width, 60), scale=1.0, label=bui.Lstr( - resource='submitText', fallback_resource=self._r + '.enterText' + resource='submitText', fallback_resource=f'{self._r}.enterText' ), on_activate_call=self._do_enter, ) diff --git a/src/assets/ba_data/python/bauiv1lib/settings/allsettings.py b/src/assets/ba_data/python/bauiv1lib/settings/allsettings.py index 6e6ed9d4..746000a9 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/allsettings.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/allsettings.py @@ -87,7 +87,7 @@ class AllSettingsWindow(bui.Window): parent=self._root_widget, position=(0, height - 44), size=(width, 25), - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), color=bui.app.ui_v1.title_color, h_align='center', v_align='center', @@ -143,7 +143,7 @@ class AllSettingsWindow(bui.Window): bbtn = bui.get_special_widget('back_button') bui.widget(edit=ctb, left_widget=bbtn) _b_title( - x_offs2, v, ctb, bui.Lstr(resource=self._r + '.controllersText') + x_offs2, v, ctb, bui.Lstr(resource=f'{self._r}.controllersText') ) imgw = imgh = 130 bui.imagewidget( @@ -166,7 +166,7 @@ class AllSettingsWindow(bui.Window): if bui.app.ui_v1.use_toolbars: pbtn = bui.get_special_widget('party_button') bui.widget(edit=gfxb, up_widget=pbtn, right_widget=pbtn) - _b_title(x_offs3, v, gfxb, bui.Lstr(resource=self._r + '.graphicsText')) + _b_title(x_offs3, v, gfxb, bui.Lstr(resource=f'{self._r}.graphicsText')) imgw = imgh = 110 bui.imagewidget( parent=self._root_widget, @@ -187,7 +187,7 @@ class AllSettingsWindow(bui.Window): label='', on_activate_call=self._do_audio, ) - _b_title(x_offs4, v, abtn, bui.Lstr(resource=self._r + '.audioText')) + _b_title(x_offs4, v, abtn, bui.Lstr(resource=f'{self._r}.audioText')) imgw = imgh = 120 bui.imagewidget( parent=self._root_widget, @@ -207,7 +207,7 @@ class AllSettingsWindow(bui.Window): label='', on_activate_call=self._do_advanced, ) - _b_title(x_offs5, v, avb, bui.Lstr(resource=self._r + '.advancedText')) + _b_title(x_offs5, v, avb, bui.Lstr(resource=f'{self._r}.advancedText')) imgw = imgh = 120 bui.imagewidget( parent=self._root_widget, diff --git a/src/assets/ba_data/python/bauiv1lib/settings/audio.py b/src/assets/ba_data/python/bauiv1lib/settings/audio.py index 27ed2e4b..d04cdf68 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/audio.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/audio.py @@ -97,7 +97,7 @@ class AudioSettingsWindow(bui.Window): parent=self._root_widget, position=(width * 0.5, height - 32), size=(0, 0), - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), color=bui.app.ui_v1.title_color, maxwidth=180, h_align='center', @@ -116,7 +116,7 @@ class AudioSettingsWindow(bui.Window): position=(40, v), xoffset=10, configkey='Sound Volume', - displayname=bui.Lstr(resource=self._r + '.soundVolumeText'), + displayname=bui.Lstr(resource=f'{self._r}.soundVolumeText'), minval=0.0, maxval=1.0, increment=0.05, @@ -133,7 +133,7 @@ class AudioSettingsWindow(bui.Window): position=(40, v), xoffset=10, configkey='Music Volume', - displayname=bui.Lstr(resource=self._r + '.musicVolumeText'), + displayname=bui.Lstr(resource=f'{self._r}.musicVolumeText'), minval=0.0, maxval=1.0, increment=0.05, @@ -151,7 +151,7 @@ class AudioSettingsWindow(bui.Window): parent=self._root_widget, position=(40, v + 24), size=(0, 0), - text=bui.Lstr(resource=self._r + '.headRelativeVRAudioText'), + text=bui.Lstr(resource=f'{self._r}.headRelativeVRAudioText'), color=(0.8, 0.8, 0.8), maxwidth=230, h_align='left', @@ -179,7 +179,7 @@ class AudioSettingsWindow(bui.Window): position=(width * 0.5, v - 11), size=(0, 0), text=bui.Lstr( - resource=self._r + '.headRelativeVRAudioInfoText' + resource=f'{self._r}.headRelativeVRAudioInfoText' ), scale=0.5, color=(0.7, 0.8, 0.7), @@ -200,7 +200,7 @@ class AudioSettingsWindow(bui.Window): position=((width - 310) / 2, v), size=(310, 50), autoselect=True, - label=bui.Lstr(resource=self._r + '.soundtrackButtonText'), + label=bui.Lstr(resource=f'{self._r}.soundtrackButtonText'), on_activate_call=self._do_soundtracks, ) v -= spacing * 0.5 @@ -208,7 +208,7 @@ class AudioSettingsWindow(bui.Window): parent=self._root_widget, position=(0, v), size=(width, 20), - text=bui.Lstr(resource=self._r + '.soundtrackDescriptionText'), + text=bui.Lstr(resource=f'{self._r}.soundtrackDescriptionText'), flatness=1.0, h_align='center', scale=0.5, diff --git a/src/assets/ba_data/python/bauiv1lib/settings/controls.py b/src/assets/ba_data/python/bauiv1lib/settings/controls.py index 756214b0..6a85dfdf 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/controls.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/controls.py @@ -152,7 +152,7 @@ class ControlsSettingsWindow(bui.Window): parent=self._root_widget, position=(0, height - 49), size=(width, 25), - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), color=bui.app.ui_v1.title_color, h_align='center', v_align='top', @@ -173,7 +173,7 @@ class ControlsSettingsWindow(bui.Window): position=((width - button_width) / 2, v), size=(button_width, 43), autoselect=True, - label=bui.Lstr(resource=self._r + '.configureTouchText'), + label=bui.Lstr(resource=f'{self._r}.configureTouchText'), on_activate_call=self._do_touchscreen, ) if bui.app.ui_v1.use_toolbars: @@ -197,7 +197,7 @@ class ControlsSettingsWindow(bui.Window): position=((width - button_width) / 2 - 7, v), size=(button_width, 43), autoselect=True, - label=bui.Lstr(resource=self._r + '.configureControllersText'), + label=bui.Lstr(resource=f'{self._r}.configureControllersText'), on_activate_call=self._do_gamepads, ) if bui.app.ui_v1.use_toolbars: @@ -226,7 +226,7 @@ class ControlsSettingsWindow(bui.Window): position=((width - button_width) / 2 - 5, v), size=(button_width, 43), autoselect=True, - label=bui.Lstr(resource=self._r + '.configureKeyboardText'), + label=bui.Lstr(resource=f'{self._r}.configureKeyboardText'), on_activate_call=self._config_keyboard, ) bui.widget( @@ -252,7 +252,7 @@ class ControlsSettingsWindow(bui.Window): position=((width - button_width) / 2 - 3, v), size=(button_width, 43), autoselect=True, - label=bui.Lstr(resource=self._r + '.configureKeyboard2Text'), + label=bui.Lstr(resource=f'{self._r}.configureKeyboard2Text'), on_activate_call=self._config_keyboard2, ) v -= spacing @@ -268,7 +268,7 @@ class ControlsSettingsWindow(bui.Window): position=((width - button_width) / 2 - 5, v), size=(button_width, 43), autoselect=True, - label=bui.Lstr(resource=self._r + '.configureMobileText'), + label=bui.Lstr(resource=f'{self._r}.configureMobileText'), on_activate_call=self._do_mobile_devices, ) bui.widget( diff --git a/src/assets/ba_data/python/bauiv1lib/settings/gamepad.py b/src/assets/ba_data/python/bauiv1lib/settings/gamepad.py index 4661f151..390af52a 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/gamepad.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/gamepad.py @@ -205,7 +205,7 @@ class GamepadSettingsWindow(bui.Window): parent=self._root_widget, position=(0, v + 5), size=(self._width, 25), - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), color=bui.app.ui_v1.title_color, maxwidth=310, h_align='center', @@ -229,7 +229,7 @@ class GamepadSettingsWindow(bui.Window): parent=self._root_widget, position=(50, v + 10), size=(self._width - 100, 30), - text=bui.Lstr(resource=self._r + '.appliesToAllText'), + text=bui.Lstr(resource=f'{self._r}.appliesToAllText'), maxwidth=330, scale=0.65, color=(0.5, 0.6, 0.5, 1.0), @@ -244,7 +244,7 @@ class GamepadSettingsWindow(bui.Window): parent=self._root_widget, position=(0, v + 5), size=(self._width, 25), - text=bui.Lstr(resource=self._r + '.secondaryText'), + text=bui.Lstr(resource=f'{self._r}.secondaryText'), color=bui.app.ui_v1.title_color, maxwidth=300, h_align='center', @@ -256,7 +256,7 @@ class GamepadSettingsWindow(bui.Window): parent=self._root_widget, position=(50, v + 10), size=(self._width - 100, 30), - text=bui.Lstr(resource=self._r + '.secondHalfText'), + text=bui.Lstr(resource=f'{self._r}.secondHalfText'), maxwidth=300, scale=0.65, color=(0.6, 0.8, 0.6, 1.0), @@ -269,7 +269,7 @@ class GamepadSettingsWindow(bui.Window): autoselect=True, on_value_change_call=self._enable_check_box_changed, size=(200, 30), - text=bui.Lstr(resource=self._r + '.secondaryEnableText'), + text=bui.Lstr(resource=f'{self._r}.secondaryEnableText'), scale=1.2, ) v = self._height - 205 @@ -279,8 +279,8 @@ class GamepadSettingsWindow(bui.Window): d_color = (0.4, 0.4, 0.8) sclx = 1.2 scly = 0.98 - dpm = bui.Lstr(resource=self._r + '.pressAnyButtonOrDpadText') - dpm2 = bui.Lstr(resource=self._r + '.ifNothingHappensTryAnalogText') + dpm = bui.Lstr(resource=f'{self._r}.pressAnyButtonOrDpadText') + dpm2 = bui.Lstr(resource=f'{self._r}.ifNothingHappensTryAnalogText') self._capture_button( pos=(h_offs, v + scly * dist), color=d_color, @@ -318,7 +318,7 @@ class GamepadSettingsWindow(bui.Window): message2=dpm2, ) - dpm3 = bui.Lstr(resource=self._r + '.ifNothingHappensTryDpadText') + dpm3 = bui.Lstr(resource=f'{self._r}.ifNothingHappensTryDpadText') self._capture_button( pos=(h_offs + 130, v - 125), color=(0.4, 0.4, 0.6), @@ -326,7 +326,7 @@ class GamepadSettingsWindow(bui.Window): maxwidth=140, texture=bui.gettexture('analogStick'), scale=1.2, - message=bui.Lstr(resource=self._r + '.pressLeftRightText'), + message=bui.Lstr(resource=f'{self._r}.pressLeftRightText'), message2=dpm3, ) @@ -563,13 +563,13 @@ class GamepadSettingsWindow(bui.Window): + ' / ' + self._input.get_axis_name(sval2) ) - return bui.Lstr(resource=self._r + '.unsetText') + return bui.Lstr(resource=f'{self._r}.unsetText') # If they're looking for triggers. if control in ['triggerRun1' + self._ext, 'triggerRun2' + self._ext]: if control in self._settings: return self._input.get_axis_name(self._settings[control]) - return bui.Lstr(resource=self._r + '.unsetText') + return bui.Lstr(resource=f'{self._r}.unsetText') # Dead-zone. if control == 'analogStickDeadZone' + self._ext: @@ -590,7 +590,7 @@ class GamepadSettingsWindow(bui.Window): if any(b in self._settings for b in dpad_buttons): if control in self._settings: return self._input.get_button_name(self._settings[control]) - return bui.Lstr(resource=self._r + '.unsetText') + return bui.Lstr(resource=f'{self._r}.unsetText') # No dpad buttons - show the dpad number for all 4. dpadnum = ( @@ -603,19 +603,19 @@ class GamepadSettingsWindow(bui.Window): return bui.Lstr( value='${A} ${B}', subs=[ - ('${A}', bui.Lstr(resource=self._r + '.dpadText')), + ('${A}', bui.Lstr(resource=f'{self._r}.dpadText')), ( '${B}', str(dpadnum), ), ], ) - return bui.Lstr(resource=self._r + '.unsetText') + return bui.Lstr(resource=f'{self._r}.unsetText') # Other buttons. if control in self._settings: return self._input.get_button_name(self._settings[control]) - return bui.Lstr(resource=self._r + '.unsetText') + return bui.Lstr(resource=f'{self._r}.unsetText') def _gamepad_event( self, @@ -694,7 +694,7 @@ class GamepadSettingsWindow(bui.Window): self._input, 'analogStickUD' + ext, self._gamepad_event, - bui.Lstr(resource=self._r + '.pressUpDownText'), + bui.Lstr(resource=f'{self._r}.pressUpDownText'), ) elif control == 'analogStickUD' + ext: @@ -745,7 +745,7 @@ class GamepadSettingsWindow(bui.Window): maxwidth: float = 80.0, ) -> bui.Widget: if message is None: - message = bui.Lstr(resource=self._r + '.pressAnyButtonText') + message = bui.Lstr(resource=f'{self._r}.pressAnyButtonText') base_size = 79 btn = bui.buttonwidget( parent=self._root_widget, @@ -852,7 +852,7 @@ class GamepadSettingsWindow(bui.Window): 'reset', ] choices_display: list[bui.Lstr] = [ - bui.Lstr(resource=self._r + '.advancedText'), + bui.Lstr(resource=f'{self._r}.advancedText'), bui.Lstr(resource='settingsWindowAdvanced.resetText'), ] diff --git a/src/assets/ba_data/python/bauiv1lib/settings/gamepadadvanced.py b/src/assets/ba_data/python/bauiv1lib/settings/gamepadadvanced.py index 4249cbb1..7ac9b807 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/gamepadadvanced.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/gamepadadvanced.py @@ -58,7 +58,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): self._height - (40 if uiscale is bui.UIScale.SMALL else 34), ), size=(0, 0), - text=bui.Lstr(resource=self._r + '.advancedTitleText'), + text=bui.Lstr(resource=f'{self._r}.advancedTitleText'), maxwidth=320, color=bui.app.ui_v1.title_color, h_align='center', @@ -126,7 +126,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): parent=self._subcontainer, position=(h + 70, v), size=(500, 30), - text=bui.Lstr(resource=self._r + '.unassignedButtonsRunText'), + text=bui.Lstr(resource=f'{self._r}.unassignedButtonsRunText'), textcolor=(0.8, 0.8, 0.8), maxwidth=330, scale=1.0, @@ -140,7 +140,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): v -= 60 capb = self._capture_button( pos=(h2, v), - name=bui.Lstr(resource=self._r + '.runButton1Text'), + name=bui.Lstr(resource=f'{self._r}.runButton1Text'), control='buttonRun1' + self._parent_window.get_ext(), ) if self._parent_window.get_is_secondary(): @@ -149,14 +149,14 @@ class GamepadAdvancedSettingsWindow(bui.Window): v -= 42 self._capture_button( pos=(h2, v), - name=bui.Lstr(resource=self._r + '.runButton2Text'), + name=bui.Lstr(resource=f'{self._r}.runButton2Text'), control='buttonRun2' + self._parent_window.get_ext(), ) bui.textwidget( parent=self._subcontainer, position=(self._sub_width * 0.5, v - 24), size=(0, 0), - text=bui.Lstr(resource=self._r + '.runTriggerDescriptionText'), + text=bui.Lstr(resource=f'{self._r}.runTriggerDescriptionText'), color=(0.7, 1, 0.7, 0.6), maxwidth=self._sub_width * 0.8, scale=0.7, @@ -168,16 +168,16 @@ class GamepadAdvancedSettingsWindow(bui.Window): self._capture_button( pos=(h2, v), - name=bui.Lstr(resource=self._r + '.runTrigger1Text'), + name=bui.Lstr(resource=f'{self._r}.runTrigger1Text'), control='triggerRun1' + self._parent_window.get_ext(), - message=bui.Lstr(resource=self._r + '.pressAnyAnalogTriggerText'), + message=bui.Lstr(resource=f'{self._r}.pressAnyAnalogTriggerText'), ) v -= 42 self._capture_button( pos=(h2, v), - name=bui.Lstr(resource=self._r + '.runTrigger2Text'), + name=bui.Lstr(resource=f'{self._r}.runTrigger2Text'), control='triggerRun2' + self._parent_window.get_ext(), - message=bui.Lstr(resource=self._r + '.pressAnyAnalogTriggerText'), + message=bui.Lstr(resource=f'{self._r}.pressAnyAnalogTriggerText'), ) # in vr mode, allow assigning a reset-view button @@ -185,45 +185,45 @@ class GamepadAdvancedSettingsWindow(bui.Window): v -= 50 self._capture_button( pos=(h2, v), - name=bui.Lstr(resource=self._r + '.vrReorientButtonText'), + name=bui.Lstr(resource=f'{self._r}.vrReorientButtonText'), control='buttonVRReorient' + self._parent_window.get_ext(), ) v -= 60 self._capture_button( pos=(h2, v), - name=bui.Lstr(resource=self._r + '.extraStartButtonText'), + name=bui.Lstr(resource=f'{self._r}.extraStartButtonText'), control='buttonStart2' + self._parent_window.get_ext(), ) v -= 60 self._capture_button( pos=(h2, v), - name=bui.Lstr(resource=self._r + '.ignoredButton1Text'), + name=bui.Lstr(resource=f'{self._r}.ignoredButton1Text'), control='buttonIgnored' + self._parent_window.get_ext(), ) v -= 42 self._capture_button( pos=(h2, v), - name=bui.Lstr(resource=self._r + '.ignoredButton2Text'), + name=bui.Lstr(resource=f'{self._r}.ignoredButton2Text'), control='buttonIgnored2' + self._parent_window.get_ext(), ) v -= 42 self._capture_button( pos=(h2, v), - name=bui.Lstr(resource=self._r + '.ignoredButton3Text'), + name=bui.Lstr(resource=f'{self._r}.ignoredButton3Text'), control='buttonIgnored3' + self._parent_window.get_ext(), ) v -= 42 self._capture_button( pos=(h2, v), - name=bui.Lstr(resource=self._r + '.ignoredButton4Text'), + name=bui.Lstr(resource=f'{self._r}.ignoredButton4Text'), control='buttonIgnored4' + self._parent_window.get_ext(), ) bui.textwidget( parent=self._subcontainer, position=(self._sub_width * 0.5, v - 14), size=(0, 0), - text=bui.Lstr(resource=self._r + '.ignoredButtonDescriptionText'), + text=bui.Lstr(resource=f'{self._r}.ignoredButtonDescriptionText'), color=(0.7, 1, 0.7, 0.6), scale=0.8, maxwidth=self._sub_width * 0.8, @@ -239,7 +239,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): position=(h + 50, v), size=(400, 30), text=bui.Lstr( - resource=self._r + '.startButtonActivatesDefaultText' + resource=f'{self._r}.startButtonActivatesDefaultText' ), textcolor=(0.8, 0.8, 0.8), maxwidth=450, @@ -254,7 +254,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): position=(self._sub_width * 0.5, v - 12), size=(0, 0), text=bui.Lstr( - resource=self._r + '.startButtonActivatesDefaultDescriptionText' + resource=f'{self._r}.startButtonActivatesDefaultDescriptionText' ), color=(0.7, 1, 0.7, 0.6), maxwidth=self._sub_width * 0.8, @@ -269,7 +269,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): autoselect=True, position=(h + 50, v), size=(400, 30), - text=bui.Lstr(resource=self._r + '.uiOnlyText'), + text=bui.Lstr(resource=f'{self._r}.uiOnlyText'), textcolor=(0.8, 0.8, 0.8), maxwidth=450, scale=0.9, @@ -280,7 +280,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): parent=self._subcontainer, position=(self._sub_width * 0.5, v - 12), size=(0, 0), - text=bui.Lstr(resource=self._r + '.uiOnlyDescriptionText'), + text=bui.Lstr(resource=f'{self._r}.uiOnlyDescriptionText'), color=(0.7, 1, 0.7, 0.6), maxwidth=self._sub_width * 0.8, scale=0.7, @@ -294,7 +294,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): autoselect=True, position=(h + 50, v), size=(400, 30), - text=bui.Lstr(resource=self._r + '.ignoreCompletelyText'), + text=bui.Lstr(resource=f'{self._r}.ignoreCompletelyText'), textcolor=(0.8, 0.8, 0.8), maxwidth=450, scale=0.9, @@ -306,7 +306,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): position=(self._sub_width * 0.5, v - 12), size=(0, 0), text=bui.Lstr( - resource=self._r + '.ignoreCompletelyDescriptionText' + resource=f'{self._r}.ignoreCompletelyDescriptionText' ), color=(0.7, 1, 0.7, 0.6), maxwidth=self._sub_width * 0.8, @@ -322,7 +322,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): autoselect=True, position=(h + 50, v), size=(400, 30), - text=bui.Lstr(resource=self._r + '.autoRecalibrateText'), + text=bui.Lstr(resource=f'{self._r}.autoRecalibrateText'), textcolor=(0.8, 0.8, 0.8), maxwidth=450, scale=0.9, @@ -333,7 +333,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): parent=self._subcontainer, position=(self._sub_width * 0.5, v - 12), size=(0, 0), - text=bui.Lstr(resource=self._r + '.autoRecalibrateDescriptionText'), + text=bui.Lstr(resource=f'{self._r}.autoRecalibrateDescriptionText'), color=(0.7, 1, 0.7, 0.6), maxwidth=self._sub_width * 0.8, scale=0.7, @@ -343,7 +343,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): v -= 80 buttons = self._config_value_editor( - bui.Lstr(resource=self._r + '.analogStickDeadZoneText'), + bui.Lstr(resource=f'{self._r}.analogStickDeadZoneText'), control=('analogStickDeadZone' + self._parent_window.get_ext()), position=(h + 40, v), min_val=0, @@ -359,7 +359,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): position=(self._sub_width * 0.5, v - 12), size=(0, 0), text=bui.Lstr( - resource=self._r + '.analogStickDeadZoneDescriptionText' + resource=f'{self._r}.analogStickDeadZoneDescriptionText' ), color=(0.7, 1, 0.7, 0.6), maxwidth=self._sub_width * 0.8, @@ -375,7 +375,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): bui.buttonwidget( parent=self._subcontainer, autoselect=True, - label=bui.Lstr(resource=self._r + '.twoInOneSetupText'), + label=bui.Lstr(resource=f'{self._r}.twoInOneSetupText'), position=(40, v), size=(self._sub_width - 80, 50), on_activate_call=self._parent_window.show_secondary_editor, @@ -414,7 +414,7 @@ class GamepadAdvancedSettingsWindow(bui.Window): left_widget=btn, color=(0.45, 0.4, 0.5), textcolor=(0.65, 0.6, 0.7), - label=bui.Lstr(resource=self._r + '.clearText'), + label=bui.Lstr(resource=f'{self._r}.clearText'), size=(110, 50), scale=0.7, on_activate_call=bui.Call(self._clear_control, control), diff --git a/src/assets/ba_data/python/bauiv1lib/settings/gamepadselect.py b/src/assets/ba_data/python/bauiv1lib/settings/gamepadselect.py index 416d48f6..ab0e7e1c 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/gamepadselect.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/gamepadselect.py @@ -147,7 +147,7 @@ class GamepadSelectWindow(bui.Window): parent=self._root_widget, position=(20, height - 50), size=(width, 25), - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), maxwidth=250, color=bui.app.ui_v1.title_color, h_align='center', @@ -168,7 +168,7 @@ class GamepadSelectWindow(bui.Window): position=(15, v), size=(width - 30, 30), scale=0.8, - text=bui.Lstr(resource=self._r + '.pressAnyButtonText'), + text=bui.Lstr(resource=f'{self._r}.pressAnyButtonText'), maxwidth=width * 0.95, color=bui.app.ui_v1.infotextcolor, h_align='center', @@ -181,7 +181,7 @@ class GamepadSelectWindow(bui.Window): position=(15, v), size=(width - 30, 30), scale=0.46, - text=bui.Lstr(resource=self._r + '.androidNoteText'), + text=bui.Lstr(resource=f'{self._r}.androidNoteText'), maxwidth=width * 0.95, color=(0.7, 0.9, 0.7, 0.5), h_align='center', diff --git a/src/assets/ba_data/python/bauiv1lib/settings/graphics.py b/src/assets/ba_data/python/bauiv1lib/settings/graphics.py index 3eaf429e..650d3cd4 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/graphics.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/graphics.py @@ -111,7 +111,7 @@ class GraphicsSettingsWindow(bui.Window): parent=self._root_widget, position=(0, height - 44), size=(width, 25), - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), color=bui.app.ui_v1.title_color, h_align='center', v_align='top', @@ -159,7 +159,7 @@ class GraphicsSettingsWindow(bui.Window): parent=self._root_widget, position=(60, v), size=(160, 25), - text=bui.Lstr(resource=self._r + '.visualsText'), + text=bui.Lstr(resource=f'{self._r}.visualsText'), color=bui.app.ui_v1.heading_color, scale=0.65, maxwidth=150, @@ -179,10 +179,10 @@ class GraphicsSettingsWindow(bui.Window): ), choices_display=[ bui.Lstr(resource='autoText'), - bui.Lstr(resource=self._r + '.higherText'), - bui.Lstr(resource=self._r + '.highText'), - bui.Lstr(resource=self._r + '.mediumText'), - bui.Lstr(resource=self._r + '.lowText'), + bui.Lstr(resource=f'{self._r}.higherText'), + bui.Lstr(resource=f'{self._r}.highText'), + bui.Lstr(resource=f'{self._r}.mediumText'), + bui.Lstr(resource=f'{self._r}.lowText'), ], current_choice=bui.app.config.resolve('Graphics Quality'), on_value_change_call=self._set_quality, @@ -193,7 +193,7 @@ class GraphicsSettingsWindow(bui.Window): parent=self._root_widget, position=(230, v), size=(160, 25), - text=bui.Lstr(resource=self._r + '.texturesText'), + text=bui.Lstr(resource=f'{self._r}.texturesText'), color=bui.app.ui_v1.heading_color, scale=0.65, maxwidth=150, @@ -208,9 +208,9 @@ class GraphicsSettingsWindow(bui.Window): choices=['Auto', 'High', 'Medium', 'Low'], choices_display=[ bui.Lstr(resource='autoText'), - bui.Lstr(resource=self._r + '.highText'), - bui.Lstr(resource=self._r + '.mediumText'), - bui.Lstr(resource=self._r + '.lowText'), + bui.Lstr(resource=f'{self._r}.highText'), + bui.Lstr(resource=f'{self._r}.mediumText'), + bui.Lstr(resource=f'{self._r}.lowText'), ], current_choice=bui.app.config.resolve('Texture Quality'), on_value_change_call=self._set_textures, @@ -231,7 +231,7 @@ class GraphicsSettingsWindow(bui.Window): parent=self._root_widget, position=(h_offs + 60, v), size=(160, 25), - text=bui.Lstr(resource=self._r + '.resolutionText'), + text=bui.Lstr(resource=f'{self._r}.resolutionText'), color=bui.app.ui_v1.heading_color, scale=0.65, maxwidth=150, @@ -319,7 +319,7 @@ class GraphicsSettingsWindow(bui.Window): parent=self._root_widget, position=(230, v), size=(160, 25), - text=bui.Lstr(resource=self._r + '.verticalSyncText'), + text=bui.Lstr(resource=f'{self._r}.verticalSyncText'), color=bui.app.ui_v1.heading_color, scale=0.65, maxwidth=150, @@ -334,8 +334,8 @@ class GraphicsSettingsWindow(bui.Window): choices=['Auto', 'Always', 'Never'], choices_display=[ bui.Lstr(resource='autoText'), - bui.Lstr(resource=self._r + '.alwaysText'), - bui.Lstr(resource=self._r + '.neverText'), + bui.Lstr(resource=f'{self._r}.alwaysText'), + bui.Lstr(resource=f'{self._r}.neverText'), ], current_choice=bui.app.config.resolve('Vertical Sync'), on_value_change_call=self._set_vsync, @@ -360,7 +360,7 @@ class GraphicsSettingsWindow(bui.Window): parent=self._root_widget, position=(155, v + 10), size=(0, 0), - text=bui.Lstr(resource=self._r + '.maxFPSText'), + text=bui.Lstr(resource=f'{self._r}.maxFPSText'), color=bui.app.ui_v1.heading_color, scale=0.9, maxwidth=90, @@ -399,7 +399,7 @@ class GraphicsSettingsWindow(bui.Window): size=(210, 30), scale=0.86, configkey='Show FPS', - displayname=bui.Lstr(resource=self._r + '.showFPSText'), + displayname=bui.Lstr(resource=f'{self._r}.showFPSText'), maxwidth=130, ) if self._max_fps_text is not None: @@ -419,7 +419,7 @@ class GraphicsSettingsWindow(bui.Window): size=(210, 30), scale=0.86, configkey='TV Border', - displayname=bui.Lstr(resource=self._r + '.tvBorderText'), + displayname=bui.Lstr(resource=f'{self._r}.tvBorderText'), maxwidth=130, ) bui.widget(edit=fpsc.widget, right_widget=tvc.widget) diff --git a/src/assets/ba_data/python/bauiv1lib/settings/keyboard.py b/src/assets/ba_data/python/bauiv1lib/settings/keyboard.py index 7023250e..9bda0fb4 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/keyboard.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/keyboard.py @@ -111,7 +111,7 @@ class ConfigKeyboardWindow(bui.Window): position=(self._width * 0.5, v + 15), size=(0, 0), text=bui.Lstr( - resource=self._r + '.configuringText', + resource=f'{self._r}.configuringText', subs=[('${DEVICE}', self._displayname)], ), color=bui.app.ui_v1.title_color, @@ -129,7 +129,7 @@ class ConfigKeyboardWindow(bui.Window): parent=self._root_widget, position=(0, v + 19), size=(self._width, 50), - text=bui.Lstr(resource=self._r + '.keyboard2NoteText'), + text=bui.Lstr(resource=f'{self._r}.keyboard2NoteText'), scale=0.7, maxwidth=self._width * 0.75, max_height=110, diff --git a/src/assets/ba_data/python/bauiv1lib/settings/remoteapp.py b/src/assets/ba_data/python/bauiv1lib/settings/remoteapp.py index 80fc3c19..f6a8216e 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/remoteapp.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/remoteapp.py @@ -48,7 +48,7 @@ class RemoteAppSettingsWindow(bui.Window): parent=self._root_widget, position=(width * 0.5, height - 42), size=(0, 0), - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), maxwidth=370, color=bui.app.ui_v1.title_color, scale=0.8, @@ -73,7 +73,7 @@ class RemoteAppSettingsWindow(bui.Window): color=(0.7, 0.9, 0.7, 1.0), scale=0.8, text=bui.Lstr( - resource=self._r + '.explanationText', + resource=f'{self._r}.explanationText', subs=[ ('${APP_NAME}', bui.Lstr(resource='titleText')), ('${REMOTE_APP_NAME}', bui.get_remote_app_name()), @@ -106,7 +106,7 @@ class RemoteAppSettingsWindow(bui.Window): size=(0, 0), color=(0.7, 0.9, 0.7, 0.8), scale=0.65, - text=bui.Lstr(resource=self._r + '.bestResultsText'), + text=bui.Lstr(resource=f'{self._r}.bestResultsText'), maxwidth=width * 0.95, max_height=height * 0.19, h_align='center', diff --git a/src/assets/ba_data/python/bauiv1lib/settings/touchscreen.py b/src/assets/ba_data/python/bauiv1lib/settings/touchscreen.py index b3e1d2bf..38aec5f9 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/touchscreen.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/touchscreen.py @@ -55,7 +55,7 @@ class TouchscreenSettingsWindow(bui.Window): parent=self._root_widget, position=(25, self._height - 50), size=(self._width, 25), - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), color=bui.app.ui_v1.title_color, maxwidth=280, h_align='center', @@ -111,7 +111,7 @@ class TouchscreenSettingsWindow(bui.Window): parent=self._subcontainer, position=(-10, v + 43), size=(self._sub_width, 25), - text=bui.Lstr(resource=self._r + '.swipeInfoText'), + text=bui.Lstr(resource=f'{self._r}.swipeInfoText'), flatness=1.0, color=(0, 0.9, 0.1, 0.7), maxwidth=self._sub_width * 0.9, @@ -124,7 +124,7 @@ class TouchscreenSettingsWindow(bui.Window): parent=self._subcontainer, position=(h, v - 2), size=(0, 30), - text=bui.Lstr(resource=self._r + '.movementText'), + text=bui.Lstr(resource=f'{self._r}.movementText'), maxwidth=190, color=clr, v_align='center', @@ -133,7 +133,7 @@ class TouchscreenSettingsWindow(bui.Window): parent=self._subcontainer, position=(h + 220, v), size=(170, 30), - text=bui.Lstr(resource=self._r + '.joystickText'), + text=bui.Lstr(resource=f'{self._r}.joystickText'), maxwidth=100, textcolor=clr2, scale=0.9, @@ -142,7 +142,7 @@ class TouchscreenSettingsWindow(bui.Window): parent=self._subcontainer, position=(h + 357, v), size=(170, 30), - text=bui.Lstr(resource=self._r + '.swipeText'), + text=bui.Lstr(resource=f'{self._r}.swipeText'), maxwidth=100, textcolor=clr2, value=False, @@ -158,7 +158,7 @@ class TouchscreenSettingsWindow(bui.Window): xoffset=65, configkey='Touch Controls Scale Movement', displayname=bui.Lstr( - resource=self._r + '.movementControlScaleText' + resource=f'{self._r}.movementControlScaleText' ), changesound=False, minval=0.1, @@ -171,7 +171,7 @@ class TouchscreenSettingsWindow(bui.Window): parent=self._subcontainer, position=(h, v - 2), size=(0, 30), - text=bui.Lstr(resource=self._r + '.actionsText'), + text=bui.Lstr(resource=f'{self._r}.actionsText'), maxwidth=190, color=clr, v_align='center', @@ -180,7 +180,7 @@ class TouchscreenSettingsWindow(bui.Window): parent=self._subcontainer, position=(h + 220, v), size=(170, 30), - text=bui.Lstr(resource=self._r + '.buttonsText'), + text=bui.Lstr(resource=f'{self._r}.buttonsText'), maxwidth=100, textcolor=clr2, scale=0.9, @@ -189,7 +189,7 @@ class TouchscreenSettingsWindow(bui.Window): parent=self._subcontainer, position=(h + 357, v), size=(170, 30), - text=bui.Lstr(resource=self._r + '.swipeText'), + text=bui.Lstr(resource=f'{self._r}.swipeText'), maxwidth=100, textcolor=clr2, scale=0.9, @@ -203,7 +203,7 @@ class TouchscreenSettingsWindow(bui.Window): position=(h, v), xoffset=65, configkey='Touch Controls Scale Actions', - displayname=bui.Lstr(resource=self._r + '.actionControlScaleText'), + displayname=bui.Lstr(resource=f'{self._r}.actionControlScaleText'), changesound=False, minval=0.1, maxval=4.0, @@ -217,7 +217,7 @@ class TouchscreenSettingsWindow(bui.Window): size=(400, 30), maxwidth=400, configkey='Touch Controls Swipe Hidden', - displayname=bui.Lstr(resource=self._r + '.swipeControlsHiddenText'), + displayname=bui.Lstr(resource=f'{self._r}.swipeControlsHiddenText'), ) v -= 65 @@ -225,7 +225,7 @@ class TouchscreenSettingsWindow(bui.Window): parent=self._subcontainer, position=(self._sub_width * 0.5 - 70, v), size=(170, 60), - label=bui.Lstr(resource=self._r + '.resetText'), + label=bui.Lstr(resource=f'{self._r}.resetText'), scale=0.75, on_activate_call=self._reset, ) @@ -235,7 +235,7 @@ class TouchscreenSettingsWindow(bui.Window): position=(self._width * 0.5, 38), size=(0, 0), h_align='center', - text=bui.Lstr(resource=self._r + '.dragControlsText'), + text=bui.Lstr(resource=f'{self._r}.dragControlsText'), maxwidth=self._width * 0.8, scale=0.65, color=(1, 1, 1, 0.4), diff --git a/src/assets/ba_data/python/bauiv1lib/soundtrack/browser.py b/src/assets/ba_data/python/bauiv1lib/soundtrack/browser.py index c25b888e..f16073bd 100644 --- a/src/assets/ba_data/python/bauiv1lib/soundtrack/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/soundtrack/browser.py @@ -90,7 +90,7 @@ class SoundtrackBrowserWindow(bui.Window): position=(self._width * 0.5, self._height - 35), size=(0, 0), maxwidth=300, - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), color=bui.app.ui_v1.title_color, h_align='center', v_align='center', @@ -119,7 +119,7 @@ class SoundtrackBrowserWindow(bui.Window): autoselect=True, textcolor=b_textcolor, text_scale=0.7, - label=bui.Lstr(resource=self._r + '.newText'), + label=bui.Lstr(resource=f'{self._r}.newText'), ) self._lock_images.append( bui.imagewidget( @@ -148,7 +148,7 @@ class SoundtrackBrowserWindow(bui.Window): autoselect=True, textcolor=b_textcolor, text_scale=0.7, - label=bui.Lstr(resource=self._r + '.editText'), + label=bui.Lstr(resource=f'{self._r}.editText'), ) self._lock_images.append( bui.imagewidget( @@ -176,7 +176,7 @@ class SoundtrackBrowserWindow(bui.Window): color=b_color, textcolor=b_textcolor, text_scale=0.7, - label=bui.Lstr(resource=self._r + '.duplicateText'), + label=bui.Lstr(resource=f'{self._r}.duplicateText'), ) self._lock_images.append( bui.imagewidget( @@ -204,7 +204,7 @@ class SoundtrackBrowserWindow(bui.Window): autoselect=True, textcolor=b_textcolor, text_scale=0.7, - label=bui.Lstr(resource=self._r + '.deleteText'), + label=bui.Lstr(resource=f'{self._r}.deleteText'), ) self._lock_images.append( bui.imagewidget( @@ -303,13 +303,13 @@ class SoundtrackBrowserWindow(bui.Window): if self._selected_soundtrack == '__default__': bui.getsound('error').play() bui.screenmessage( - bui.Lstr(resource=self._r + '.cantDeleteDefaultText'), + bui.Lstr(resource=f'{self._r}.cantDeleteDefaultText'), color=(1, 0, 0), ) else: ConfirmWindow( bui.Lstr( - resource=self._r + '.deleteConfirmText', + resource=f'{self._r}.deleteConfirmText', subs=[('${NAME}', self._selected_soundtrack)], ), self._do_delete_soundtrack, @@ -438,7 +438,7 @@ class SoundtrackBrowserWindow(bui.Window): if self._selected_soundtrack == '__default__': bui.getsound('error').play() bui.screenmessage( - bui.Lstr(resource=self._r + '.cantEditDefaultText'), + bui.Lstr(resource=f'{self._r}.cantEditDefaultText'), color=(1, 0, 0), ) return @@ -455,7 +455,7 @@ class SoundtrackBrowserWindow(bui.Window): def _get_soundtrack_display_name(self, soundtrack: str) -> bui.Lstr: if soundtrack == '__default__': - return bui.Lstr(resource=self._r + '.defaultSoundtrackNameText') + return bui.Lstr(resource=f'{self._r}.defaultSoundtrackNameText') return bui.Lstr(value=soundtrack) def _refresh(self, select_soundtrack: str | None = None) -> None: diff --git a/src/assets/ba_data/python/bauiv1lib/soundtrack/edit.py b/src/assets/ba_data/python/bauiv1lib/soundtrack/edit.py index 4ede4d83..9a155a51 100644 --- a/src/assets/ba_data/python/bauiv1lib/soundtrack/edit.py +++ b/src/assets/ba_data/python/bauiv1lib/soundtrack/edit.py @@ -121,7 +121,7 @@ class SoundtrackEditWindow(bui.Window): bui.textwidget( parent=self._root_widget, - text=bui.Lstr(resource=self._r + '.nameText'), + text=bui.Lstr(resource=f'{self._r}.nameText'), maxwidth=80, scale=0.8, position=(105 + x_inset, v + 19), @@ -135,7 +135,7 @@ class SoundtrackEditWindow(bui.Window): if existing_soundtrack is None: i = 1 st_name_text = bui.Lstr( - resource=self._r + '.newSoundtrackNameText' + resource=f'{self._r}.newSoundtrackNameText' ).evaluate() if '${COUNT}' not in st_name_text: # make sure we insert number *somewhere* @@ -155,7 +155,7 @@ class SoundtrackEditWindow(bui.Window): v_align='center', max_chars=32, autoselect=True, - description=bui.Lstr(resource=self._r + '.nameText'), + description=bui.Lstr(resource=f'{self._r}.nameText'), editable=True, padding=4, on_return_press_call=self._do_it_with_sound, @@ -305,7 +305,7 @@ class SoundtrackEditWindow(bui.Window): btn = bui.buttonwidget( parent=row, size=(50, 32), - label=bui.Lstr(resource=self._r + '.testText'), + label=bui.Lstr(resource=f'{self._r}.testText'), text_scale=0.6, on_activate_call=bui.Call(self._test, bs.MusicType(song_type)), up_widget=( @@ -389,7 +389,7 @@ class SoundtrackEditWindow(bui.Window): if bui.app.config.resolve('Music Volume') < 0.01: bui.getsound('error').play() bui.screenmessage( - bui.Lstr(resource=self._r + '.musicVolumeZeroWarning'), + bui.Lstr(resource=f'{self._r}.musicVolumeZeroWarning'), color=(1, 0.5, 0), ) music.set_music_play_mode(bui.app.classic.MusicPlayMode.TEST) @@ -405,7 +405,7 @@ class SoundtrackEditWindow(bui.Window): etype = music.get_soundtrack_entry_type(entry) ename: str | bui.Lstr if etype == 'default': - ename = bui.Lstr(resource=self._r + '.defaultGameMusicText') + ename = bui.Lstr(resource=f'{self._r}.defaultGameMusicText') elif etype in ('musicFile', 'musicFolder'): ename = os.path.basename(music.get_soundtrack_entry_name(entry)) else: @@ -453,7 +453,7 @@ class SoundtrackEditWindow(bui.Window): new_name = cast(str, bui.textwidget(query=self._text_field)) if new_name != self._soundtrack_name and new_name in cfg['Soundtracks']: bui.screenmessage( - bui.Lstr(resource=self._r + '.cantSaveAlreadyExistsText') + bui.Lstr(resource=f'{self._r}.cantSaveAlreadyExistsText') ) bui.getsound('error').play() return @@ -463,11 +463,11 @@ class SoundtrackEditWindow(bui.Window): if ( new_name == bui.Lstr( - resource=self._r + '.defaultSoundtrackNameText' + resource=f'{self._r}.defaultSoundtrackNameText' ).evaluate() ): bui.screenmessage( - bui.Lstr(resource=self._r + '.cantOverwriteDefaultText') + bui.Lstr(resource=f'{self._r}.cantOverwriteDefaultText') ) bui.getsound('error').play() return diff --git a/src/assets/ba_data/python/bauiv1lib/soundtrack/entrytypeselect.py b/src/assets/ba_data/python/bauiv1lib/soundtrack/entrytypeselect.py index c1a7d2e2..d0e6547f 100644 --- a/src/assets/ba_data/python/bauiv1lib/soundtrack/entrytypeselect.py +++ b/src/assets/ba_data/python/bauiv1lib/soundtrack/entrytypeselect.py @@ -82,7 +82,7 @@ class SoundtrackEntryTypeSelectWindow(bui.Window): parent=self._root_widget, position=(self._width * 0.5, self._height - 32), size=(0, 0), - text=bui.Lstr(resource=self._r + '.selectASourceText'), + text=bui.Lstr(resource=f'{self._r}.selectASourceText'), color=bui.app.ui_v1.title_color, maxwidth=230, h_align='center', @@ -110,7 +110,7 @@ class SoundtrackEntryTypeSelectWindow(bui.Window): parent=self._root_widget, size=(self._width - 100, 60), position=(50, v), - label=bui.Lstr(resource=self._r + '.useDefaultGameMusicText'), + label=bui.Lstr(resource=f'{self._r}.useDefaultGameMusicText'), on_activate_call=self._on_default_press, ) if current_entry_type == 'default': @@ -122,7 +122,7 @@ class SoundtrackEntryTypeSelectWindow(bui.Window): parent=self._root_widget, size=(self._width - 100, 60), position=(50, v), - label=bui.Lstr(resource=self._r + '.useITunesPlaylistText'), + label=bui.Lstr(resource=f'{self._r}.useITunesPlaylistText'), on_activate_call=self._on_mac_music_app_playlist_press, icon=None, ) @@ -135,7 +135,7 @@ class SoundtrackEntryTypeSelectWindow(bui.Window): parent=self._root_widget, size=(self._width - 100, 60), position=(50, v), - label=bui.Lstr(resource=self._r + '.useMusicFileText'), + label=bui.Lstr(resource=f'{self._r}.useMusicFileText'), on_activate_call=self._on_music_file_press, icon=bui.gettexture('file'), ) @@ -148,7 +148,7 @@ class SoundtrackEntryTypeSelectWindow(bui.Window): parent=self._root_widget, size=(self._width - 100, 60), position=(50, v), - label=bui.Lstr(resource=self._r + '.useMusicFolderText'), + label=bui.Lstr(resource=f'{self._r}.useMusicFolderText'), on_activate_call=self._on_music_folder_press, icon=bui.gettexture('folder'), icon_color=(1.1, 0.8, 0.2), diff --git a/src/assets/ba_data/python/bauiv1lib/soundtrack/macmusicapp.py b/src/assets/ba_data/python/bauiv1lib/soundtrack/macmusicapp.py index de556d95..99c60a69 100644 --- a/src/assets/ba_data/python/bauiv1lib/soundtrack/macmusicapp.py +++ b/src/assets/ba_data/python/bauiv1lib/soundtrack/macmusicapp.py @@ -52,7 +52,7 @@ class MacMusicAppPlaylistSelectWindow(bui.Window): parent=self._root_widget, position=(20, self._height - 54), size=(self._width, 25), - text=bui.Lstr(resource=self._r + '.selectAPlaylistText'), + text=bui.Lstr(resource=f'{self._r}.selectAPlaylistText'), color=bui.app.ui_v1.title_color, h_align='center', v_align='center', @@ -75,7 +75,7 @@ class MacMusicAppPlaylistSelectWindow(bui.Window): bui.textwidget( parent=self._column, size=(self._width - 80, 22), - text=bui.Lstr(resource=self._r + '.fetchingITunesText'), + text=bui.Lstr(resource=f'{self._r}.fetchingITunesText'), color=(0.6, 0.9, 0.6, 1.0), scale=0.8, ) diff --git a/src/assets/ba_data/python/bauiv1lib/store/browser.py b/src/assets/ba_data/python/bauiv1lib/store/browser.py index 129a7a37..8ab52102 100644 --- a/src/assets/ba_data/python/bauiv1lib/store/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/store/browser.py @@ -205,17 +205,17 @@ class StoreBrowserWindow(bui.Window): tab_buffer_h = 250 + 2 * x_inset tabs_def = [ - (self.TabID.EXTRAS, bui.Lstr(resource=self._r + '.extrasText')), - (self.TabID.MAPS, bui.Lstr(resource=self._r + '.mapsText')), + (self.TabID.EXTRAS, bui.Lstr(resource=f'{self._r}.extrasText')), + (self.TabID.MAPS, bui.Lstr(resource=f'{self._r}.mapsText')), ( self.TabID.MINIGAMES, - bui.Lstr(resource=self._r + '.miniGamesText'), + bui.Lstr(resource=f'{self._r}.miniGamesText'), ), ( self.TabID.CHARACTERS, - bui.Lstr(resource=self._r + '.charactersText'), + bui.Lstr(resource=f'{self._r}.charactersText'), ), - (self.TabID.ICONS, bui.Lstr(resource=self._r + '.iconsText')), + (self.TabID.ICONS, bui.Lstr(resource=f'{self._r}.iconsText')), ] self._tab_row = TabRow( @@ -449,7 +449,7 @@ class StoreBrowserWindow(bui.Window): color=(1, 0.7, 1, 0.5), h_align='center', v_align='center', - text=bui.Lstr(resource=self._r + '.loadingText'), + text=bui.Lstr(resource=f'{self._r}.loadingText'), maxwidth=self._scroll_width * 0.9, ) @@ -653,7 +653,7 @@ class StoreBrowserWindow(bui.Window): def _print_already_own(self, charname: str) -> None: bui.screenmessage( bui.Lstr( - resource=self._r + '.alreadyOwnText', + resource=f'{self._r}.alreadyOwnText', subs=[('${NAME}', charname)], ), color=(1, 0, 0), @@ -868,7 +868,7 @@ class StoreBrowserWindow(bui.Window): color=(1, 0.3, 0.3, 1.0), h_align='center', v_align='center', - text=bui.Lstr(resource=self._r + '.loadErrorText'), + text=bui.Lstr(resource=f'{self._r}.loadErrorText'), maxwidth=self._scroll_width * 0.9, ) else: @@ -1238,7 +1238,7 @@ class StoreBrowserWindow(bui.Window): color=(1, 1, 0.3, 1.0), h_align='center', v_align='center', - text=bui.Lstr(resource=self._r + '.comingSoonText'), + text=bui.Lstr(resource=f'{self._r}.comingSoonText'), maxwidth=self._scroll_width * 0.9, ) diff --git a/src/assets/ba_data/python/bauiv1lib/watch.py b/src/assets/ba_data/python/bauiv1lib/watch.py index 0757c68e..84ef3c87 100644 --- a/src/assets/ba_data/python/bauiv1lib/watch.py +++ b/src/assets/ba_data/python/bauiv1lib/watch.py @@ -116,14 +116,14 @@ class WatchWindow(bui.Window): scale=1.5, h_align='center', v_align='center', - text=bui.Lstr(resource=self._r + '.titleText'), + text=bui.Lstr(resource=f'{self._r}.titleText'), maxwidth=400, ) tabdefs = [ ( self.TabID.MY_REPLAYS, - bui.Lstr(resource=self._r + '.myReplaysText'), + bui.Lstr(resource=f'{self._r}.myReplaysText'), ), # (self.TabID.TEST_TAB, bui.Lstr(value='Testing')), ] @@ -276,7 +276,7 @@ class WatchWindow(bui.Window): textcolor=b_textcolor, on_activate_call=self._on_my_replay_play_press, text_scale=tscl, - label=bui.Lstr(resource=self._r + '.watchReplayButtonText'), + label=bui.Lstr(resource=f'{self._r}.watchReplayButtonText'), autoselect=True, ) bui.widget(edit=btn1, up_widget=self._tab_row.tabs[tab_id].button) @@ -296,7 +296,7 @@ class WatchWindow(bui.Window): textcolor=b_textcolor, on_activate_call=self._on_my_replay_rename_press, text_scale=tscl, - label=bui.Lstr(resource=self._r + '.renameReplayButtonText'), + label=bui.Lstr(resource=f'{self._r}.renameReplayButtonText'), autoselect=True, ) btnv -= b_height + b_space_extra @@ -309,7 +309,7 @@ class WatchWindow(bui.Window): textcolor=b_textcolor, on_activate_call=self._on_my_replay_delete_press, text_scale=tscl, - label=bui.Lstr(resource=self._r + '.deleteReplayButtonText'), + label=bui.Lstr(resource=f'{self._r}.deleteReplayButtonText'), autoselect=True, ) @@ -339,7 +339,7 @@ class WatchWindow(bui.Window): def _no_replay_selected_error(self) -> None: bui.screenmessage( - bui.Lstr(resource=self._r + '.noReplaySelectedErrorText'), + bui.Lstr(resource=f'{self._r}.noReplaySelectedErrorText'), color=(1, 0, 0), ) bui.getsound('error').play() @@ -395,7 +395,7 @@ class WatchWindow(bui.Window): h_align='center', v_align='center', text=bui.Lstr( - resource=self._r + '.renameReplayText', + resource=f'{self._r}.renameReplayText', subs=[('${REPLAY}', dname)], ), maxwidth=c_width * 0.8, @@ -408,7 +408,7 @@ class WatchWindow(bui.Window): v_align='center', text=dname, editable=True, - description=bui.Lstr(resource=self._r + '.replayNameText'), + description=bui.Lstr(resource=f'{self._r}.replayNameText'), position=(c_width * 0.1, c_height - 140), autoselect=True, maxwidth=c_width * 0.7, @@ -427,7 +427,7 @@ class WatchWindow(bui.Window): ) okb = bui.buttonwidget( parent=cnt, - label=bui.Lstr(resource=self._r + '.renameText'), + label=bui.Lstr(resource=f'{self._r}.renameText'), size=(180, 60), position=(c_width - 230, 30), on_activate_call=bui.Call( @@ -477,7 +477,7 @@ class WatchWindow(bui.Window): bui.getsound('error').play() bui.screenmessage( bui.Lstr( - resource=self._r + '.replayRenameErrorInvalidName' + resource=f'{self._r}.replayRenameErrorInvalidName' ), color=(1, 0, 0), ) @@ -492,7 +492,7 @@ class WatchWindow(bui.Window): ) bui.getsound('error').play() bui.screenmessage( - bui.Lstr(resource=self._r + '.replayRenameErrorText'), + bui.Lstr(resource=f'{self._r}.replayRenameErrorText'), color=(1, 0, 0), ) @@ -508,7 +508,7 @@ class WatchWindow(bui.Window): return confirm.ConfirmWindow( bui.Lstr( - resource=self._r + '.deleteConfirmText', + resource=f'{self._r}.deleteConfirmText', subs=[ ( '${REPLAY}', @@ -540,7 +540,7 @@ class WatchWindow(bui.Window): logging.exception("Error deleting replay '%s'.", replay) bui.getsound('error').play() bui.screenmessage( - bui.Lstr(resource=self._r + '.replayDeleteErrorText'), + bui.Lstr(resource=f'{self._r}.replayDeleteErrorText'), color=(1, 0, 0), ) diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index feb05206..969ebd74 100644 --- a/src/ballistica/shared/ballistica.cc +++ b/src/ballistica/shared/ballistica.cc @@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int { namespace ballistica { // These are set automatically via script; don't modify them here. -const int kEngineBuildNumber = 21939; +const int kEngineBuildNumber = 21942; const char* kEngineVersion = "1.7.36"; const int kEngineApiVersion = 8; diff --git a/tools/bacommon/cloud.py b/tools/bacommon/cloud.py index 0990dd7c..223fb714 100644 --- a/tools/bacommon/cloud.py +++ b/tools/bacommon/cloud.py @@ -16,6 +16,13 @@ if TYPE_CHECKING: pass +class WebLocation(Enum): + """Set of places we can be directed on ballistica.net.""" + + ACCOUNT_EDITOR = 'e' + ACCOUNT_DELETE_SECTION = 'd' + + @ioprepped @dataclass class LoginProxyRequestMessage(Message): @@ -238,6 +245,10 @@ class SignInResponse(Response): class ManageAccountMessage(Message): """Message asking for a manage-account url.""" + weblocation: Annotated[WebLocation, IOAttrs('l')] = ( + WebLocation.ACCOUNT_EDITOR + ) + @override @classmethod def get_response_types(cls) -> list[type[Response] | None]: