mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-05 06:53:18 +08:00
Fixing more conflitcs
This commit is contained in:
parent
a9efb4a0ca
commit
f24cc3ccc9
@ -7,13 +7,13 @@ from __future__ import annotations
|
|||||||
import random
|
import random
|
||||||
from typing import cast, override
|
from typing import cast, override
|
||||||
|
|
||||||
|
from bauiv1lib.colorpicker import ColorPicker
|
||||||
|
from bauiv1lib.characterpicker import CharacterPickerDelegate
|
||||||
import bauiv1 as bui
|
import bauiv1 as bui
|
||||||
import bascenev1 as bs
|
import bascenev1 as bs
|
||||||
from bauiv1lib.colorpicker import ColorPicker
|
|
||||||
from bauiv1lib.profile.browser import ProfileBrowserWindow
|
|
||||||
|
|
||||||
|
|
||||||
class EditProfileWindow(bui.MainWindow):
|
class EditProfileWindow(bui.MainWindow, CharacterPickerDelegate):
|
||||||
"""Window for editing a player profile."""
|
"""Window for editing a player profile."""
|
||||||
|
|
||||||
def reload_window(self) -> None:
|
def reload_window(self) -> None:
|
||||||
@ -23,18 +23,20 @@ class EditProfileWindow(bui.MainWindow):
|
|||||||
if not self._root_widget or self._root_widget.transitioning_out:
|
if not self._root_widget or self._root_widget.transitioning_out:
|
||||||
return
|
return
|
||||||
|
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.screenmessage('UNDER CONSTRUCTION')
|
||||||
assert bui.app.classic is not None
|
return
|
||||||
bui.app.ui_v1.set_main_window(
|
# bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
EditProfileWindow(self.getname(), self._in_main_menu),
|
# assert bui.app.classic is not None
|
||||||
from_window=self,
|
# bui.app.ui_v1.set_main_window(
|
||||||
is_back=True,
|
# EditProfileWindow(self.getname()),
|
||||||
)
|
# from_window=self,
|
||||||
|
# is_back=True,
|
||||||
|
# )
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
existing_profile: str | None,
|
existing_profile: str | None,
|
||||||
in_main_menu: bool,
|
# in_main_menu: bool,
|
||||||
transition: str | None = 'in_right',
|
transition: str | None = 'in_right',
|
||||||
origin_widget: bui.Widget | None = None,
|
origin_widget: bui.Widget | None = None,
|
||||||
):
|
):
|
||||||
@ -47,7 +49,7 @@ class EditProfileWindow(bui.MainWindow):
|
|||||||
plus = bui.app.plus
|
plus = bui.app.plus
|
||||||
assert plus is not None
|
assert plus is not None
|
||||||
|
|
||||||
self._in_main_menu = in_main_menu
|
# self._in_main_menu = in_main_menu
|
||||||
self._existing_profile = existing_profile
|
self._existing_profile = existing_profile
|
||||||
self._r = 'editProfileWindow'
|
self._r = 'editProfileWindow'
|
||||||
self._spazzes: list[str] = []
|
self._spazzes: list[str] = []
|
||||||
@ -81,6 +83,12 @@ class EditProfileWindow(bui.MainWindow):
|
|||||||
stack_offset=(
|
stack_offset=(
|
||||||
(0, -40) if uiscale is bui.UIScale.SMALL else (0, 0)
|
(0, -40) if uiscale is bui.UIScale.SMALL else (0, 0)
|
||||||
),
|
),
|
||||||
|
toolbar_visibility=(
|
||||||
|
# 'menu_minimal'
|
||||||
|
None
|
||||||
|
if uiscale is bui.UIScale.SMALL
|
||||||
|
else 'menu_full'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
transition=transition,
|
transition=transition,
|
||||||
origin_widget=origin_widget,
|
origin_widget=origin_widget,
|
||||||
@ -522,7 +530,7 @@ class EditProfileWindow(bui.MainWindow):
|
|||||||
transition=transition,
|
transition=transition,
|
||||||
origin_widget=origin_widget,
|
origin_widget=origin_widget,
|
||||||
existing_profile=self._existing_profile,
|
existing_profile=self._existing_profile,
|
||||||
in_main_menu=self._in_main_menu,
|
# in_main_menu=self._in_main_menu,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -628,6 +636,7 @@ class EditProfileWindow(bui.MainWindow):
|
|||||||
self._icon = icon
|
self._icon = icon
|
||||||
self._update_icon()
|
self._update_icon()
|
||||||
|
|
||||||
|
@override
|
||||||
def on_character_picker_pick(self, character: str) -> None:
|
def on_character_picker_pick(self, character: str) -> None:
|
||||||
"""A character has been selected by the picker."""
|
"""A character has been selected by the picker."""
|
||||||
if not self._root_widget:
|
if not self._root_widget:
|
||||||
@ -640,6 +649,20 @@ class EditProfileWindow(bui.MainWindow):
|
|||||||
)
|
)
|
||||||
self._update_character()
|
self._update_character()
|
||||||
|
|
||||||
|
@override
|
||||||
|
def on_character_picker_get_more_press(self) -> None:
|
||||||
|
from bauiv1lib.store.browser import StoreBrowserWindow
|
||||||
|
|
||||||
|
if not self.main_window_has_control():
|
||||||
|
return
|
||||||
|
|
||||||
|
self.main_window_replace(
|
||||||
|
StoreBrowserWindow(
|
||||||
|
minimal_toolbars=True,
|
||||||
|
show_tab=StoreBrowserWindow.TabID.CHARACTERS,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
def _on_character_press(self) -> None:
|
def _on_character_press(self) -> None:
|
||||||
from bauiv1lib import characterpicker
|
from bauiv1lib import characterpicker
|
||||||
|
|
||||||
@ -686,27 +709,7 @@ class EditProfileWindow(bui.MainWindow):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def _cancel(self) -> None:
|
def _cancel(self) -> None:
|
||||||
|
self.main_window_back()
|
||||||
if self._in_main_menu:
|
|
||||||
self.main_window_back()
|
|
||||||
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:
|
|
||||||
return
|
|
||||||
|
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
|
||||||
assert bui.app.classic is not None
|
|
||||||
|
|
||||||
bui.app.ui_v1.set_main_window(
|
|
||||||
ProfileBrowserWindow(
|
|
||||||
'in_left',
|
|
||||||
selected_profile=self._existing_profile,
|
|
||||||
in_main_menu=self._in_main_menu,
|
|
||||||
),
|
|
||||||
from_window=self,
|
|
||||||
is_back=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
def _set_color(self, color: tuple[float, float, float]) -> None:
|
def _set_color(self, color: tuple[float, float, float]) -> None:
|
||||||
self._color = color
|
self._color = color
|
||||||
@ -858,19 +861,6 @@ class EditProfileWindow(bui.MainWindow):
|
|||||||
|
|
||||||
if transition_out:
|
if transition_out:
|
||||||
plus.run_v1_account_transactions()
|
plus.run_v1_account_transactions()
|
||||||
if self._in_main_menu:
|
self.main_window_back()
|
||||||
self.main_window_back()
|
|
||||||
return True
|
|
||||||
bui.containerwidget(edit=self._root_widget,
|
|
||||||
transition='out_right')
|
|
||||||
assert bui.app.classic is not None
|
|
||||||
bui.app.ui_v1.set_main_window(
|
|
||||||
ProfileBrowserWindow(
|
|
||||||
'in_left',
|
|
||||||
selected_profile=new_name,
|
|
||||||
in_main_menu=self._in_main_menu,
|
|
||||||
),
|
|
||||||
from_window=self,
|
|
||||||
is_back=True,
|
|
||||||
)
|
|
||||||
return True
|
return True
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user