def _new_soundtrack(self) -> None: # pylint: disable=cyclic-import from bastd.ui.purchase import PurchaseWindow from bastd.ui.soundtrack.edit import SoundtrackEditWindow if not ba.app.accounts_v1.have_pro_options(): PurchaseWindow(items=['pro']) return self._save_state() ba.containerwidget(edit=self._root_widget, transition='out_left') SoundtrackEditWindow(existing_soundtrack=None)
def _edit_soundtrack(self) -> None: # pylint: disable=cyclic-import from bastd.ui.purchase import PurchaseWindow from bastd.ui.soundtrack.edit import SoundtrackEditWindow if not ba.app.accounts_v1.have_pro_options(): PurchaseWindow(items=['pro']) return if self._selected_soundtrack is None: return if self._selected_soundtrack == '__default__': ba.playsound(ba.getsound('error')) ba.screenmessage(ba.Lstr(resource=self._r + '.cantEditDefaultText'), color=(1, 0, 0)) return self._save_state() ba.containerwidget(edit=self._root_widget, transition='out_left') ba.app.ui.set_main_menu_window( SoundtrackEditWindow(existing_soundtrack=self._selected_soundtrack ).get_root_widget())