updated soundtrack editor for MainWindow system

This commit is contained in:
Eric 2024-09-04 18:13:39 -07:00
parent a6670a0a26
commit e0306ddccc
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
12 changed files with 133 additions and 286 deletions

90
.efrocachemap generated
View File

@ -421,40 +421,40 @@
"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": "65b989c0d893d8981992f66ff81a8a97",
"build/assets/ba_data/data/languages/arabic.json": "3be73283cb8009cc2c95e53df36e8b86",
"build/assets/ba_data/data/langdata.json": "fa2cb506dd6628e30b775ca44604e4f8",
"build/assets/ba_data/data/languages/arabic.json": "609f5d698a488e40e61787b62ee8ea5e",
"build/assets/ba_data/data/languages/belarussian.json": "3d5523d0004293aa2df02f3f6f3b84f8",
"build/assets/ba_data/data/languages/chinese.json": "fc69790c41e6750d20a7719afc5a7527",
"build/assets/ba_data/data/languages/chinesetraditional.json": "86671be47e2b5d0badeb3b90a3db6402",
"build/assets/ba_data/data/languages/chinese.json": "d03ed49486d41cfbdf770e5a54f974a1",
"build/assets/ba_data/data/languages/chinesetraditional.json": "d85c58cc1e0e4bd0b09b2bc768cb1971",
"build/assets/ba_data/data/languages/croatian.json": "b23619cb396ac16640c47458f884b16a",
"build/assets/ba_data/data/languages/czech.json": "61bcfce75c0d53d2f2af709cee42187a",
"build/assets/ba_data/data/languages/danish.json": "8e57db30c5250df2abff14a822f83ea7",
"build/assets/ba_data/data/languages/dutch.json": "b0900d572c9141897d53d6574c471343",
"build/assets/ba_data/data/languages/english.json": "5a73dea22df1117d58a79459def62ff5",
"build/assets/ba_data/data/languages/esperanto.json": "0e397cfa5f3fb8cef5f4a64f21cda880",
"build/assets/ba_data/data/languages/filipino.json": "a291d4d3619adc82c5c4096bbfefe28a",
"build/assets/ba_data/data/languages/french.json": "73a01df9b44b3fb030750a1b5f56f07b",
"build/assets/ba_data/data/languages/german.json": "198b9860c5b9df7b8e3e30b03d8755cb",
"build/assets/ba_data/data/languages/filipino.json": "30f9622136067fe866bebf7e81ee8546",
"build/assets/ba_data/data/languages/french.json": "69578cc38349367912659a62ace5a42d",
"build/assets/ba_data/data/languages/german.json": "c4b8c4d3c078b7902155af3221cf9cf4",
"build/assets/ba_data/data/languages/gibberish.json": "d6810f99fc9055b5203c382a83bc5128",
"build/assets/ba_data/data/languages/greek.json": "d28d1092fbb00ed857cbd53124c0dc78",
"build/assets/ba_data/data/languages/hindi.json": "54cd56bade6922b40989a8ac5e0c17f6",
"build/assets/ba_data/data/languages/hungarian.json": "3a974ea6e6ffccca41aed308ad5a7a26",
"build/assets/ba_data/data/languages/indonesian.json": "ed9038bf4b9216f93eb73e753e162706",
"build/assets/ba_data/data/languages/italian.json": "ffc58952260b63fdf88805a2d9a68257",
"build/assets/ba_data/data/languages/hungarian.json": "9d88004a98f0fbe2ea72edd5e0b3002e",
"build/assets/ba_data/data/languages/indonesian.json": "2ccb3fe081ead7706dbebb1008a8bc4e",
"build/assets/ba_data/data/languages/italian.json": "d9eb41f6eafb19040f8d5c0608790b62",
"build/assets/ba_data/data/languages/korean.json": "4e3524327a0174250aff5e1ef4c0c597",
"build/assets/ba_data/data/languages/malay.json": "f6ce0426d03a62612e3e436ed5d1be1f",
"build/assets/ba_data/data/languages/persian.json": "ededb9c015afb58b1324a096ea740f72",
"build/assets/ba_data/data/languages/polish.json": "62b56ace320191985689bfbcfacd56ea",
"build/assets/ba_data/data/languages/portuguese.json": "2be5c25e55946197bd0e0f646d444b2c",
"build/assets/ba_data/data/languages/polish.json": "89333fb207f9eb2f22fff5a95b022c35",
"build/assets/ba_data/data/languages/portuguese.json": "eb2563e245e1ea00b870264dced3ebd7",
"build/assets/ba_data/data/languages/romanian.json": "55a8744e466801013ea131266a856924",
"build/assets/ba_data/data/languages/russian.json": "c7c5bfc6f82d74e49ac746d187314ba7",
"build/assets/ba_data/data/languages/russian.json": "0fcc60bf1e8e19a74f02b0798728ec68",
"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": "4b262447f703eb4c6683b54af6b7b592",
"build/assets/ba_data/data/languages/swedish.json": "5142a96597d17d8344be96a603da64ac",
"build/assets/ba_data/data/languages/tamil.json": "5ececa2dde2bbe33ad61e580fa5b79ad",
"build/assets/ba_data/data/languages/spanish.json": "0a37387183a6634fc8e9ac225fcf20b1",
"build/assets/ba_data/data/languages/swedish.json": "039c803fad78f1018ad363d2a0be8582",
"build/assets/ba_data/data/languages/tamil.json": "ead39b864228696a9b0d19344bc4b5ec",
"build/assets/ba_data/data/languages/thai.json": "1d665629361f302693dead39de8fa945",
"build/assets/ba_data/data/languages/turkish.json": "1c0a5c0c0c115107fb0752c92907f584",
"build/assets/ba_data/data/languages/turkish.json": "6153ca5248b8e4743e9501ac72378493",
"build/assets/ba_data/data/languages/ukrainian.json": "23a98e5722d3e71e809a8a0063daa603",
"build/assets/ba_data/data/languages/venetian.json": "a1315f5233ebbee1464683ac55d5d9d5",
"build/assets/ba_data/data/languages/vietnamese.json": "5ae84265600b6cfda45c9bed18724e1d",
@ -4096,26 +4096,26 @@
"build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1",
"build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae",
"build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "fa2f9a37401974a330f6406bfdde195a",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "ec0ca83cb8d63837d86024926a9f5792",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "22e11f5d894e02b521f1c77a3b1d14ad",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "803d4449de9e62bc33d62edaccb3a40c",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "5ee49f99993e6f690c955bf4e22ea232",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "f6882aef1cf0c4ab6a4d71b19e048ea3",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "2de6855febbe3fefbd1a696e54ff198c",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "76fff0d53458ff9308ee9050bfe42321",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "4b0f3502089e9a7ea6ea2db0c44ecee9",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "d426ae451363579868ed80e070ee1a7d",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "147e64e814f72846d5f78944df85f879",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "0e28cef28d1097cd61c1faa2f18b900d",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "213712de0e2e9c5fcbaf9b2cebd92ff7",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "34122e2302160ce65f4ac624e6b40876",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "09f8466080d70d84c15d697a659c6561",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "ad91f8448f3106a7d81f2615ab82d71c",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "6a369680967a22140b9a5d3dd65cfd65",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "eb2ccde783e4e7abaf40a76ed0be4a0c",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "112881e2d4429018dc5487a979d53a80",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "04b1f16241efd35e95ff544de09f3444",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "09e1d02460a30d04eabbb2452430c2c2",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "3f7acbf88886a6ead1de37c49d3b6eac",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "eecc40e7d72e0e5321c906b992225c3c",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "2572971053d7aa2b72f23921bf6d0471",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "410330f469fa87e017121f4f51fe5107",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "6c3c924c068c6299429204d634344cf3",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "1cc419fa2065502276c1913ebe2862aa",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "3fcd65bad8c769160ac291f0222c6206",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "8246ae194fa3f01e121ac8feb9c08465",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "0239ca26472abec7facd9d9861456df4",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "f319e26182c705a6e5bb178ff99ee047",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "562937117ff516d2a2fbc3680d1b8b08",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "1edbb82242592aa2a66625e7a1b38c0a",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "17e8a2747695e5594fc4328d8332874b",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "3c55156b1d02cfa37cbf7a545b8a73ce",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "f0f9238f0ba4601e7f108db9e4aef779",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "1377cb4a5370aa185a9020c2c7897a0e",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "abc74dc8348c9ae7be4484b484292501",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "aed20bb1dbaeae0ce0f58df060cf5c61",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "27406336b06f3986f6e03ebbdf746696",
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "73ad3303fe1a82005918fbc5dae3446c",
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "fa659b5d6119acba6570c92ce4d35ae2",
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "73ad3303fe1a82005918fbc5dae3446c",
@ -4132,14 +4132,14 @@
"build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "3e5c5fd0a09f55ba7b05ce1e2ec7171e",
"build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "1659535e95e3047fda529543e265ac97",
"build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "3e5c5fd0a09f55ba7b05ce1e2ec7171e",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "599167b1b452e9a060475c059ebb742e",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "4495e25c4e6e286ebe0ac547c3c785e5",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "ee961522b1a726d982df90d35178f4df",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "de121ab71098df1ff6a9b72b46c30401",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "6319a5f16af08ad8cd396472e623b4e1",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "1464b16e286fc6379aa6e9d8d7b7ddaa",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "64c3bce65d48d16c7b0f5f59105a8856",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "a10c2110bb0155790ddc49a44388ba4c",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "9de8b0fae465ab0336c33b389103083d",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "846a8707586f1073d9a27d282c4f414e",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "6a93c2ae4d42ca2fd7b9acc68c76df84",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "97b2f41be2efc6038d5ef9650a0afb30",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "64ceef6d628e94b3b26cbcc3fe0a2d71",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "b44eac48f052d505c5a3c8a1602e9465",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "f3f556d5939b2ecc840b536dfcee7b17",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "1767f93d5e8c210da88e83c9464b3b97",
"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",

View File

@ -1,4 +1,4 @@
### 1.7.37 (build 21986, api 9, 2024-09-04)
### 1.7.37 (build 21987, api 9, 2024-09-04)
- Bumping api version to 9. As you'll see below, there's some UI changes that
will require a bit of work for any UI mods to adapt to. If your mods don't
touch UI stuff at all you can simply bump your api version and call it a day.
@ -36,6 +36,8 @@
was to add a higher level layer to the UI to make things like saving/restoring
UI states easier, but I now plan to use `WindowState` classes to accomplish
much of that in a more backward-compatible way. More on that below.
- Removed touch-specific button target-area adjustements. If you find any
buttons that are hard to hit accurately on a touchscreen, please holler.
- Added a new `bauiv1.Window` subclass called `bauiv1.MainWindow` which handles
what was previously called the 'main-menu-window' system which was a bit
ad-hoc and messy. MainMenuWindows have a built-in stack system so things like

View File

@ -52,7 +52,7 @@ if TYPE_CHECKING:
# Build number and version of the ballistica binary we expect to be
# using.
TARGET_BALLISTICA_BUILD = 21986
TARGET_BALLISTICA_BUILD = 21987
TARGET_BALLISTICA_VERSION = '1.7.37'

View File

@ -1022,64 +1022,6 @@ class CoopBrowserWindow(bui.MainWindow):
def _enable_selectable_callback(self) -> None:
self._do_selection_callbacks = True
# def _switch_to_league_rankings(self) -> None:
# # pylint: disable=cyclic-import
# from bauiv1lib.account import show_sign_in_prompt
# from bauiv1lib.league.rankwindow import LeagueRankWindow
# # no-op if our underlying widget is dead or on its way out.
# if not self._root_widget or self._root_widget.transitioning_out:
# return
# plus = bui.app.plus
# assert plus is not None
# if plus.get_v1_account_state() != 'signed_in':
# show_sign_in_prompt()
# return
# self._save_state()
# bui.containerwidget(edit=self._root_widget, transition='out_left')
# assert self._league_rank_button is not None
# assert bui.app.classic is not None
# bui.app.ui_v1.set_main_window(
# LeagueRankWindow(
# origin_widget=self._league_rank_button.get_button()
# ),
# from_window=self,
# )
# def _switch_to_score(
# self,
# show_tab: (
# StoreBrowserWindow.TabID | None
# ) = StoreBrowserWindow.TabID.EXTRAS,
# ) -> None:
# # pylint: disable=cyclic-import
# from bauiv1lib.account import show_sign_in_prompt
# # no-op if our underlying widget is dead or on its way out.
# if not self._root_widget or self._root_widget.transitioning_out:
# return
# plus = bui.app.plus
# assert plus is not None
# if plus.get_v1_account_state() != 'signed_in':
# show_sign_in_prompt()
# return
# self._save_state()
# bui.containerwidget(edit=self._root_widget, transition='out_left')
# assert self._store_button is not None
# assert bui.app.classic is not None
# bui.app.ui_v1.set_main_window(
# StoreBrowserWindow(
# origin_widget=self._store_button.get_button(),
# show_tab=show_tab,
# back_location='CoopBrowserWindow',
# ),
# from_window=self,
# )
def is_tourney_data_up_to_date(self) -> bool:
"""Return whether our tourney data is up to date."""
return self._tourney_data_up_to_date
@ -1233,24 +1175,6 @@ class CoopBrowserWindow(bui.MainWindow):
position=tournament_button.button.get_screen_space_center(),
)
# def _back(self) -> None:
# # pylint: disable=cyclic-import
# from bauiv1lib.play import PlayWindow
# # no-op if our underlying widget is dead or on its way out.
# if not self._root_widget or self._root_widget.transitioning_out:
# return
# # If something is selected, store it.
# self._save_state()
# bui.containerwidget(
# edit=self._root_widget, transition=self._transition_out
# )
# assert bui.app.classic is not None
# bui.app.ui_v1.set_main_window(
# PlayWindow(transition='in_left'), from_window=self, is_back=True
# )
def _save_state(self) -> None:
cfg = bui.app.config
try:

View File

@ -33,8 +33,8 @@ class FileSelectorWindow(bui.MainWindow):
valid_file_extensions = []
assert bui.app.classic is not None
uiscale = bui.app.ui_v1.uiscale
self._width = 700 if uiscale is bui.UIScale.SMALL else 600
self._x_inset = x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
self._width = 850 if uiscale is bui.UIScale.SMALL else 600
self._x_inset = x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
self._height = 365 if uiscale is bui.UIScale.SMALL else 418
self._callback = callback
self._base_path = path
@ -54,7 +54,7 @@ class FileSelectorWindow(bui.MainWindow):
root_widget=bui.containerwidget(
size=(self._width, self._height),
scale=(
2.23
1.93
if uiscale is bui.UIScale.SMALL
else 1.4 if uiscale is bui.UIScale.MEDIUM else 1.0
),
@ -175,7 +175,6 @@ class FileSelectorWindow(bui.MainWindow):
bui.getsound('error').play()
def _on_folder_entry_activated(self) -> None:
bui.containerwidget(edit=self._root_widget, transition='out_right')
if self._callback is not None:
assert self._path is not None
self._callback(self._path)
@ -204,9 +203,6 @@ class FileSelectorWindow(bui.MainWindow):
elif os.path.isfile(test_path):
if self._is_valid_file_path(test_path):
bui.getsound('swish').play()
bui.containerwidget(
edit=self._root_widget, transition='out_right'
)
if self._callback is not None:
self._callback(test_path)
else:
@ -486,7 +482,6 @@ class FileSelectorWindow(bui.MainWindow):
)
def _cancel(self) -> None:
# bui.containerwidget(edit=self._root_widget, transition='out_right')
self.main_window_back()
if self._callback is not None:
self._callback(None)

View File

@ -268,13 +268,6 @@ class ProfileBrowserWindow(bui.MainWindow):
self.main_window_replace(EditProfileWindow(existing_profile=None))
# self._save_state()
# bui.containerwidget(edit=self._root_widget, transition='out_left')
# bui.app.ui_v1.set_main_window(
# EditProfileWindow(existing_profile=None),
# from_window=self if self._in_main_menu else False,
# )
def _delete_profile(self) -> None:
# pylint: disable=cyclic-import
from bauiv1lib import confirm

View File

@ -19,19 +19,16 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate):
def reload_window(self) -> None:
"""Transitions out and recreates ourself."""
# no-op if our underlying widget is dead or on its way out.
if not self._root_widget or self._root_widget.transitioning_out:
# no-op if we're not in control.
if not self.main_window_has_control():
return
bui.screenmessage('UNDER CONSTRUCTION')
return
# bui.containerwidget(edit=self._root_widget, transition='out_left')
# assert bui.app.classic is not None
# bui.app.ui_v1.set_main_window(
# EditProfileWindow(self.getname()),
# from_window=self,
# is_back=True,
# )
# Replace ourself with ourself, but keep the same back location.
assert self.main_window_back_state is not None
self.main_window_replace(
EditProfileWindow(self.getname()),
back_state=self.main_window_back_state,
)
def __init__(
self,
@ -548,6 +545,15 @@ class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate):
from bauiv1lib import account
from bauiv1lib.profile import upgrade as pupgrade
new_name = self.getname().strip()
if self._existing_profile and self._existing_profile != new_name:
bui.screenmessage(
'Unsaved changes found; you must save first.', color=(1, 0, 0)
)
bui.getsound('error').play()
return
plus = bui.app.plus
assert plus is not None

View File

@ -15,9 +15,6 @@ if TYPE_CHECKING:
REQUIRE_PRO = False
# Temp.
UNDER_CONSTRUCTION = True
class SoundtrackBrowserWindow(bui.MainWindow):
"""Window for browsing soundtracks."""
@ -397,25 +394,6 @@ class SoundtrackBrowserWindow(bui.MainWindow):
music.music_types[bui.app.classic.MusicPlayMode.REGULAR]
)
# def _back(self) -> None:
# # pylint: disable=cyclic-import
# from bauiv1lib.settings.audio import AudioSettingsWindow
# # no-op if our underlying widget is dead or on its way out.
# if not self._root_widget or self._root_widget.transitioning_out:
# return
# self._save_state()
# bui.containerwidget(
# edit=self._root_widget, transition=self._transition_out
# )
# assert bui.app.classic is not None
# bui.app.ui_v1.set_main_window(
# AudioSettingsWindow(transition='in_left'),
# from_window=self,
# is_back=True,
# )
def _edit_soundtrack_with_sound(self) -> None:
# pylint: disable=cyclic-import
from bauiv1lib.purchase import PurchaseWindow
@ -434,12 +412,8 @@ class SoundtrackBrowserWindow(bui.MainWindow):
from bauiv1lib.purchase import PurchaseWindow
from bauiv1lib.soundtrack.edit import SoundtrackEditWindow
if UNDER_CONSTRUCTION:
bui.screenmessage('UNDER CONSTRUCTION')
return
# no-op if our underlying widget is dead or on its way out.
if not self._root_widget or self._root_widget.transitioning_out:
# no-op if we don't have control.
if not self.main_window_has_control():
return
if REQUIRE_PRO and (
@ -448,8 +422,10 @@ class SoundtrackBrowserWindow(bui.MainWindow):
):
PurchaseWindow(items=['pro'])
return
if self._selected_soundtrack is None:
return
if self._selected_soundtrack == '__default__':
bui.getsound('error').play()
bui.screenmessage(
@ -458,12 +434,8 @@ class SoundtrackBrowserWindow(bui.MainWindow):
)
return
self._save_state()
bui.containerwidget(edit=self._root_widget, transition='out_left')
assert bui.app.classic is not None
bui.app.ui_v1.set_main_window(
SoundtrackEditWindow(existing_soundtrack=self._selected_soundtrack),
from_window=self,
self.main_window_replace(
SoundtrackEditWindow(existing_soundtrack=self._selected_soundtrack)
)
def _get_soundtrack_display_name(self, soundtrack: str) -> bui.Lstr:
@ -554,8 +526,8 @@ class SoundtrackBrowserWindow(bui.MainWindow):
from bauiv1lib.purchase import PurchaseWindow
from bauiv1lib.soundtrack.edit import SoundtrackEditWindow
if UNDER_CONSTRUCTION:
bui.screenmessage('UNDER CONSTRUCTION')
# no-op if we're not in control.
if not self.main_window_has_control():
return
if REQUIRE_PRO and (
@ -564,11 +536,8 @@ class SoundtrackBrowserWindow(bui.MainWindow):
):
PurchaseWindow(items=['pro'])
return
self._save_state()
bui.containerwidget(edit=self._root_widget, transition='out_left')
bui.app.ui_v1.set_main_window(
SoundtrackEditWindow(existing_soundtrack=None), from_window=self
)
self.main_window_replace(SoundtrackEditWindow(existing_soundtrack=None))
def _create_done(self, new_soundtrack: str) -> None:
if new_soundtrack is not None:

View File

@ -26,8 +26,6 @@ class SoundtrackEditWindow(bui.MainWindow):
):
# pylint: disable=too-many-statements
print('SPAWNING EDIT')
appconfig = bui.app.config
self._r = 'editSoundtrackWindow'
self._folder_tex = bui.gettexture('folder')
@ -110,7 +108,7 @@ class SoundtrackEditWindow(bui.MainWindow):
self._existing_soundtrack_name = existing_soundtrack
self._last_edited_song_type = None
else:
# otherwise they can pass info on an in-progress edit
# Otherwise they can pass info on an in-progress edit.
self._soundtrack = existing_soundtrack['soundtrack']
self._soundtrack_name = existing_soundtrack['name']
self._existing_soundtrack_name = existing_soundtrack[
@ -202,7 +200,13 @@ class SoundtrackEditWindow(bui.MainWindow):
# Pull this out of self here; if we do it in the lambda we'll
# keep our window alive due to the 'self' reference.
existing_soundtrack = self._existing_soundtrack
existing_soundtrack = {
'name': self._soundtrack_name,
'existing_name': self._existing_soundtrack_name,
'soundtrack': self._soundtrack,
'last_edited_song_type': self._last_edited_song_type,
}
return bui.BasicMainWindowState(
create_call=lambda transition, origin_widget: cls(
transition=transition,
@ -348,8 +352,6 @@ class SoundtrackEditWindow(bui.MainWindow):
assert bui.app.classic is not None
music = bui.app.classic.music
print('GoT RESTORE', state, musictype, entry)
# Apply the change and recreate the window.
soundtrack = state['soundtrack']
existing_entry = (
@ -370,14 +372,20 @@ class SoundtrackEditWindow(bui.MainWindow):
else:
soundtrack[musictype] = entry
mainwindow = bui.app.ui_v1.get_main_window()
assert mainwindow is not None
mainwindow.main_window_back_state = state['back_state']
mainwindow.main_window_back()
def _get_entry(
self, song_type: str, entry: Any, selection_target_name: str
) -> None:
assert bui.app.classic is not None
music = bui.app.classic.music
# no-op if our underlying widget is dead or on its way out.
if not self._root_widget or self._root_widget.transitioning_out:
# no-op if we're not in control.
if not self.main_window_has_control():
return
if selection_target_name != '':
@ -388,22 +396,17 @@ class SoundtrackEditWindow(bui.MainWindow):
'soundtrack': self._soundtrack,
'last_edited_song_type': song_type,
}
self.main_window_replace(
music.get_music_player().select_entry(
bui.Call(self._restore_editor, state, song_type),
entry,
selection_target_name,
)
new_win = music.get_music_player().select_entry(
bui.Call(self._restore_editor, state, song_type),
entry,
selection_target_name,
)
# bui.containerwidget(edit=self._root_widget, transition='out_left')
# bui.app.ui_v1.set_main_window(
# music.get_music_player().select_entry(
# bui.Call(self._restore_editor, state, song_type),
# entry,
# selection_target_name,
# ),
# from_window=self,
# )
self.main_window_replace(new_win)
# Once we've set the new window, grab the back-state; we'll use
# that to jump back here after selection completes.
assert new_win.main_window_back_state is not None
state['back_state'] = new_win.main_window_back_state
def _test(self, song_type: bs.MusicType) -> None:
assert bui.app.classic is not None
@ -460,15 +463,8 @@ class SoundtrackEditWindow(bui.MainWindow):
music.set_music_play_mode(bui.app.classic.MusicPlayMode.REGULAR)
self.main_window_back()
# bui.containerwidget(edit=self._root_widget, transition='out_right')
# bui.app.ui_v1.set_main_window(
# SoundtrackBrowserWindow(transition='in_left'),
# from_window=self,
# is_back=True,
# )
def _do_it(self) -> None:
# from bauiv1lib.soundtrack.browser import SoundtrackBrowserWindow
# no-op if our underlying widget is dead or on its way out.
if not self._root_widget or self._root_widget.transitioning_out:
@ -514,7 +510,6 @@ class SoundtrackEditWindow(bui.MainWindow):
cfg.commit()
bui.getsound('gunCocking').play()
# bui.containerwidget(edit=self._root_widget, transition='out_right')
# Resets music back to normal.
music.set_music_play_mode(
@ -522,11 +517,6 @@ class SoundtrackEditWindow(bui.MainWindow):
)
self.main_window_back()
# bui.app.ui_v1.set_main_window(
# SoundtrackBrowserWindow(transition='in_left'),
# from_window=self,
# is_back=True,
# )
def _do_it_with_sound(self) -> None:
bui.getsound('swish').play()

View File

@ -189,12 +189,10 @@ class SoundtrackEntryTypeSelectWindow(bui.MainWindow):
MacMusicAppPlaylistSelectWindow,
)
# no-op if our underlying widget is dead or on its way out.
if not self._root_widget or self._root_widget.transitioning_out:
# no-op if we're not in control.
if not self.main_window_has_control():
return
# bui.containerwidget(edit=self._root_widget, transition='out_left')
current_playlist_entry: str | None
if (
music.get_soundtrack_entry_type(self._current_entry)
@ -211,22 +209,16 @@ class SoundtrackEntryTypeSelectWindow(bui.MainWindow):
self._callback, current_playlist_entry, self._current_entry
)
)
# MacMusicAppPlaylistSelectWindow(
# self._callback, current_playlist_entry, self._current_entry
# ),
# from_window=self,
# )
def _on_music_file_press(self) -> None:
from babase import android_get_external_files_dir
from baclassic.osmusic import OSMusicPlayer
from bauiv1lib.fileselector import FileSelectorWindow
# no-op if our underlying widget is dead or on its way out.
if not self._root_widget or self._root_widget.transitioning_out:
# no-op if we're not in control.
if not self.main_window_has_control():
return
# bui.containerwidget(edit=self._root_widget, transition='out_left')
base_path = android_get_external_files_dir()
assert bui.app.classic is not None
@ -241,28 +233,15 @@ class SoundtrackEntryTypeSelectWindow(bui.MainWindow):
allow_folders=False,
),
)
# bui.app.ui_v1.set_main_window(
# FileSelectorWindow(
# base_path,
# callback=self._music_file_selector_cb,
# show_base_path=False,
# valid_file_extensions=(
# OSMusicPlayer.get_valid_music_file_extensions()
# ),
# allow_folders=False,
# ),
# from_window=self,
# )
def _on_music_folder_press(self) -> None:
from bauiv1lib.fileselector import FileSelectorWindow
from babase import android_get_external_files_dir
# no-op if our underlying widget is dead or on its way out.
if not self._root_widget or self._root_widget.transitioning_out:
# no-op if we're not in control.
if not self.main_window_has_control():
return
# bui.containerwidget(edit=self._root_widget, transition='out_left')
base_path = android_get_external_files_dir()
assert bui.app.classic is not None
@ -275,16 +254,6 @@ class SoundtrackEntryTypeSelectWindow(bui.MainWindow):
allow_folders=True,
),
)
# bui.app.ui_v1.set_main_window(
# FileSelectorWindow(
# base_path,
# callback=self._music_folder_selector_cb,
# show_base_path=False,
# valid_file_extensions=[],
# allow_folders=True,
# ),
# from_window=self,
# )
def _music_file_selector_cb(self, result: str | None) -> None:
if result is None:
@ -300,10 +269,8 @@ class SoundtrackEntryTypeSelectWindow(bui.MainWindow):
def _on_default_press(self) -> None:
self.main_window_back()
# bui.containerwidget(edit=self._root_widget, transition='out_right')
self._callback(None)
def _on_cancel_press(self) -> None:
self.main_window_back()
# bui.containerwidget(edit=self._root_widget, transition='out_right')
self._callback(self._current_entry)

View File

@ -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 = 21986;
const int kEngineBuildNumber = 21987;
const char* kEngineVersion = "1.7.37";
const int kEngineApiVersion = 9;

View File

@ -103,15 +103,11 @@ auto ButtonWidget::GetMult(millisecs_t current_time) const -> float {
mult *= 2.0f;
}
} else {
if (!texture_.Exists()) {
} else {
// In desktop mode we want image buttons to light up when we
// mouse over them.
if (!g_core->platform->IsRunningOnDesktop()) {
if (mouse_over_) {
mult = 1.4f;
}
}
// Slightly highlighting all buttons for mouse-over. Once we can
// differentiate between touch events and pointer events we should limit
// this to pointer events.
if (mouse_over_) {
mult = 1.2f;
}
}
return mult;
@ -459,17 +455,22 @@ void ButtonWidget::Draw(base::RenderPass* pass, bool draw_transparent) {
auto ButtonWidget::HandleMessage(const base::WidgetMessage& m) -> bool {
// How far outside button touches register.
float left_overlap, top_overlap, right_overlap, bottom_overlap;
if (g_core->platform->IsRunningOnDesktop()) {
left_overlap = 3.0f;
top_overlap = 1.0f;
right_overlap = 0.0f;
bottom_overlap = 0.0f;
} else {
left_overlap = 3.0f + 9.0f * extra_touch_border_scale_;
top_overlap = 1.0f + 5.0f * extra_touch_border_scale_;
right_overlap = 7.0f * extra_touch_border_scale_;
bottom_overlap = 7.0f * extra_touch_border_scale_;
}
// if (g_core->platform->IsRunningOnDesktop()) {
// UPDATE - removing touch-specific boundary adjustments. If it is
// necessary to reenable these, should do it on a per-event basis so need
// to differentiate between touches and clicks. It is probably sufficient
// to simply expose manual boundary tweaks that apply everywhere though.
left_overlap = 3.0f;
top_overlap = 1.0f;
right_overlap = 0.0f;
bottom_overlap = 0.0f;
// } else {
// left_overlap = 3.0f + 9.0f * extra_touch_border_scale_;
// top_overlap = 1.0f + 5.0f * extra_touch_border_scale_;
// right_overlap = 7.0f * extra_touch_border_scale_;
// bottom_overlap = 7.0f * extra_touch_border_scale_;
// }
// Extra overlap that always applies.
right_overlap += target_extra_right_;