bauiv1lib package¶
Library of stuff using the bauiv1 api: windows, custom controls, etc.
Subpackages¶
Submodules¶
bauiv1lib.achievements module¶
Provides a popup window to view achievements.
- class bauiv1lib.achievements.AchievementsWindow(transition: str | None = 'in_right', origin_widget: Widget | None = None, auxiliary_style: bool = True)[source]¶
Bases:
MainWindowPopup window to view achievements.
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).
bauiv1lib.appinvite module¶
UI functionality related to inviting people to try the game.
bauiv1lib.characterpicker module¶
Provides a picker for characters.
- class bauiv1lib.characterpicker.CharacterPicker(parent: Widget, position: tuple[float, float] = (0.0, 0.0), delegate: CharacterPickerDelegate | None = None, scale: float | None = None, offset: tuple[float, float] = (0.0, 0.0), tint_color: Sequence[float] = (1.0, 1.0, 1.0), tint2_color: Sequence[float] = (1.0, 1.0, 1.0), selected_character: str | None = None)[source]¶
Bases:
PopupWindowPopup window for selecting characters.
bauiv1lib.characterpreviewui module¶
The profile editor for a character being previewed.
Opened from the lobby of a character preview session (see
baclassic._characterpreview): the cloud’s profile editor, aimed at
the previewed character rather than at one of the player’s own
profiles. Saving hands the edited character back to the session.
- class bauiv1lib.characterpreviewui.CharacterPreviewUIController[source]¶
Bases:
TypedDocUIController[Edit|Save,Saved]DocUI setup for editing a previewed character’s profile.
- fulfill_route(route: bacommon.docui.routes.classiccharacterpreview.AnyCharacterPreviewRoute) DocUIResponse[source]¶
Handle fulfillment for a route.
The type-safe equivalent of
fulfill_request(); the same rules apply (called in a background thread; should always return a response).
- fulfill_unrouted_request(request: bacommon.docui.v2.Request, error: str) DocUIResponse[source]¶
Handle a request that maps to none of our routes.
The default shows
error. Controllers fronting a server should generally forward the request as-is here instead; a server is free to grow pages (or arg values) that older clients have no routes for, and those should keep working.
- classmethod get_local_action_type() type[CharacterPreviewLocalAction][source]¶
Return the family class for the local-actions we handle.
Domains with no local-actions can leave this as is and pass
typing.Neveras their local-action type arg.
- classmethod get_route_type() type[CharacterPreviewRoute][source]¶
Return the family class for the routes we handle.
- run_local_action(action: bacommon.docui.routes.classiccharacterpreview.AnyCharacterPreviewLocalAction, context: DocUILocalAction) None[source]¶
Do something locally on behalf of the doc-ui.
The type-safe equivalent of
local_action(); the same cautions apply. The original action is passed ascontextfor access to the originating widget and window.
bauiv1lib.chestui module¶
The doc-ui based chest window.
- class bauiv1lib.chestui.ChestUIController[source]¶
Bases:
TypedDocUIController[Root|Open|AdWatched,WatchAd|StopReminding|GetTokens]DocUI setup for a chest slot.
- fulfill_route(route: bacommon.docui.routes.classicchest.AnyChestRoute) DocUIResponse[source]¶
Handle fulfillment for a route.
The type-safe equivalent of
fulfill_request(); the same rules apply (called in a background thread; should always return a response).
- fulfill_unrouted_request(request: bacommon.docui.v2.Request, error: str) DocUIResponse[source]¶
Handle a request that maps to none of our routes.
The default shows
error. Controllers fronting a server should generally forward the request as-is here instead; a server is free to grow pages (or arg values) that older clients have no routes for, and those should keep working.
- classmethod get_local_action_type() type[ChestLocalAction][source]¶
Return the family class for the local-actions we handle.
Domains with no local-actions can leave this as is and pass
typing.Neveras their local-action type arg.
- classmethod get_route_type() type[ChestRoute][source]¶
Return the family class for the routes we handle.
- run_local_action(action: bacommon.docui.routes.classicchest.AnyChestLocalAction, context: DocUILocalAction) None[source]¶
Do something locally on behalf of the doc-ui.
The type-safe equivalent of
local_action(); the same cautions apply. The original action is passed ascontextfor access to the originating widget and window.
- bauiv1lib.chestui.HIGHLIGHT_TOKEN_PURCHASES_CONFIG_KEY = 'Highlight Potential Token Purchases'¶
Config key for whether to remind about opening chests early.
bauiv1lib.colorpicker module¶
Provides popup windows for choosing colors.
- class bauiv1lib.colorpicker.ColorPicker(parent: Widget, position: tuple[float, float], *, initial_color: Sequence[float] = (1.0, 1.0, 1.0), delegate: Any = None, scale: float | None = None, offset: tuple[float, float] = (0.0, 0.0), tag: Any = '')[source]¶
Bases:
PopupWindowA popup UI to select from a set of colors.
Passes the color to the delegate’s color_picker_selected_color() method.
- class bauiv1lib.colorpicker.ColorPickerExact(parent: Widget, position: tuple[float, float], *, initial_color: Sequence[float] = (1.0, 1.0, 1.0), delegate: Any = None, scale: float | None = None, offset: tuple[float, float] = (0.0, 0.0), tag: Any = '')[source]¶
Bases:
PopupWindowpops up a ui to select from a set of colors. passes the color to the delegate’s color_picker_selected_color() method
- bauiv1lib.colorpicker.color_overlay_func(r: float, g: float, b: float, a: float | None = None) tuple[float, ...][source]¶
I could NOT come up with a better function name.
- Parameters:
r – Red.
g – Green.
b – Blue.
a – Alpha. Defaults to None.
- Returns:
- A brighter color if the provided one is dark,
and a darker one if it’s darker.
- Return type:
- bauiv1lib.colorpicker.color_to_hex(r: float, g: float, b: float, a: float | None = 1.0) str[source]¶
Converts an rgb1 tuple to a HEX color code.
- Parameters:
r – Red.
g – Green.
b – Blue.
a – Alpha. Defaults to 1.0.
- Returns:
The hexified rgba values.
- Return type:
- bauiv1lib.colorpicker.hex_to_color(hex_color: str) tuple[source]¶
Transforms an RGB / RGBA hex code into an rgb1/rgba1 tuple.
- Parameters:
hex_color (str) – The HEX color.
- Raises:
ValueError – If the provided HEX color isn’t 6 or 8 characters long.
- Returns:
The color tuple divided by 255.
- Return type:
bauiv1lib.config module¶
Functionality for editing config values and applying them to the game.
- bauiv1lib.config.CONTROL_HEIGHT = 28.0¶
Height of a row’s editing widgets.
- bauiv1lib.config.CONTROL_X_OFFSET = 230.0¶
Where a control’s editing widgets begin, measured from the row’s position. Shared so a row keeps its layout when its control is swapped for a different kind.
- class bauiv1lib.config.ConfigCheckBox(parent: Widget, configkey: str, position: tuple[float, float], size: tuple[float, float], *, displayname: str | Lstr | LangStr | None = None, scale: float | None = None, maxwidth: float | None = None, autoselect: bool = True, value_change_call: Callable[[Any], Any] | None = None, check_box_id: str | None = None, style: Literal['default', 'right'] | None = None)[source]¶
Bases:
objectA checkbox wired up to control a config value.
It will automatically save and apply the config when its value changes.
- class bauiv1lib.config.ConfigNumberEdit(parent: Widget, configkey: str, position: tuple[float, float], *, minval: float = 0.0, maxval: float = 100.0, increment: float = 1.0, callback: Callable[[float], Any] | None = None, xoffset: float = 0.0, displayname: str | Lstr | LangStr | None = None, changesound: bool = True, textscale: float = 1.0, as_percent: bool = False, fallback_value: float = 0.0, f: int = 1, idprefix: str | None = None)[source]¶
Bases:
_NumericConfigControlA set of controls for editing a numeric config value.
It will automatically save and apply the config when its value changes.
- class bauiv1lib.config.ConfigSlider(parent: Widget, configkey: str, position: tuple[float, float], *, minval: float = 0.0, maxval: float = 100.0, increment: float = 1.0, callback: Callable[[float], Any] | None = None, xoffset: float = 0.0, width: float = 200.0, displayname: str | Lstr | LangStr | None = None, textscale: float = 1.0, as_percent: bool = False, fallback_value: float = 0.0, f: int = 1, idprefix: str | None = None, drag_apply_interval: float = 0.25, drag_apply_delay: float = 0.0)[source]¶
Bases:
_NumericConfigControlA slider for editing a numeric config value.
Same config behavior as
ConfigNumberEdit– it reads the value at construction and saves and applies it on change – but driven by a draggable slider rather than a +/- pair. It begins where that pair does, so swapping one for the other leaves the rest of a settings row where it was.
- bauiv1lib.config.DRAG_APPLY_INTERVAL = 0.25¶
Default for how often a drag in progress applies its value to the running app. Paced for what accompanies an apply – a sound, a music level shifting – rather than for the cost of the apply itself; those read as busy well before they become expensive. Note this throttles only the apply: whatever a control refreshes cheaply per drag step (its value text, say) is not on this clock. A row wanting a different pace passes its own
drag_apply_interval– slower where an apply is audible, faster where it drives something visible on screen.
bauiv1lib.confirm module¶
Provides ConfirmWindow base class and commonly used derivatives.
- class bauiv1lib.confirm.ConfirmWindow(text: str | Lstr | LangStr | None = None, action: Callable[[], Any] | None = None, width: float = 360.0, height: float = 100.0, *, cancel_button: bool = True, cancel_is_selected: bool = False, color: tuple[float, float, float] = (1, 1, 1), text_scale: float = 1.0, ok_text: str | Lstr | LangStr | None = None, cancel_text: str | Lstr | LangStr | None = None, origin_widget: Widget | None = None, permanent_ok_fade: bool = False, scale: float | None = None)[source]¶
Bases:
objectWindow for answering simple yes/no questions.
bauiv1lib.connect module¶
UI functionality related to master-server connectivity.
bauiv1lib.connectivity module¶
UI functionality related to master-server connectivity.
- class bauiv1lib.connectivity.WaitForConnectivityWindow(on_connected: Callable[[], Any], on_cancel: Callable[[], Any] | None)[source]¶
Bases:
WindowWindow informing the user that the game is establishing connectivity.
- bauiv1lib.connectivity.wait_for_connectivity(on_connected: Callable[[], Any], on_cancel: Callable[[], Any] | None = None) None[source]¶
Wait for the engine to establish a master-server connection.
If need be, shows a window to keep the user informed of connectivity state and allows the user to cancel the operation. Note that canceling does not prevent the engine from continuing its attempt to establish connectivity; it simply cancels the operation that is waiting for connectivity.
bauiv1lib.controlpermission module¶
Asking whether an outside party may control this app.
- class bauiv1lib.controlpermission.ControlPermissionWindow(*, on_result: Callable[[bool, bool], None], allow_remember: bool)[source]¶
Bases:
objectPuts a request to control this app in front of the user.
Answers exactly once, whatever happens to the window: dismissing it counts as a refusal, because ‘they walked away’ and ‘they said no’ should not lead to different amounts of access.
bauiv1lib.credits module¶
Provides a window to display game credits.
- class bauiv1lib.credits.CreditsWindow(transition: str | None = 'in_right', origin_widget: Widget | None = None)[source]¶
Bases:
MainWindowWindow for displaying game credits.
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).
bauiv1lib.discord module¶
UI functionality for the Discord window.
bauiv1lib.docuitest module¶
Examples/tests for using DocUI to build UIs.
- class bauiv1lib.docuitest.TestDocUIV2Controller[source]¶
Bases:
TypedDocUIController[Root|Test2|Slow|TimedActions|DisplayItems|TextImages|LiveTimes|TextWrapping|Animation|Depictions|Viewers|Names|NinePatch|EmptyPage|BoundsTests|Widgets|NavTest|Sections|ButtonGrids|WindowLayouts|WideFit|WebTestGet|WebTestPost|CloudMsgTestGet|CloudMsgTestPost,TestAction|ShowVolume]Tests/demonstrations of native (v2 / l-string) docui.
Local pages are authored client-side; the web-test and cloud-msg-test routes fetch equivalent v2 pages from bamaster.
- fulfill_route(route: bacommon.docui.routes.docuitest.AnyTestRoute) DocUIResponse[source]¶
Fulfill a route (called in a background thread).
- classmethod get_local_action_type() type[bacommon.docui.routes.docuitest.TestLocalAction][source]¶
Return the family class for the local-actions we handle.
Domains with no local-actions can leave this as is and pass
typing.Neveras their local-action type arg.
- classmethod get_route_type() type[bacommon.docui.routes.docuitest.TestRoute][source]¶
Return the family class for the routes we handle.
- run_local_action(action: bacommon.docui.routes.docuitest.AnyTestLocalAction, context: DocUILocalAction) None[source]¶
Do something locally on behalf of the doc-ui.
The type-safe equivalent of
local_action(); the same cautions apply. The original action is passed ascontextfor access to the originating widget and window.
- bauiv1lib.docuitest.show_test_doc_ui_v2_window() None[source]¶
Bust out a doc-ui test window built locally on the client.
Test pages authored as language-agnostic v2 documents — text as
LangStrSpecvalues from thebadocuiv2testassetspackage (decoded in the client’s locale at render time), textures/meshes as typed refs, and multi-line labels via wrap-params instead of hand-baked newlines. The Cloud-Msg and Web buttons fetch equivalent v2 pages from bamaster, keeping the full cloud/web resolve -> decode -> render paths exercised.
bauiv1lib.docuitestanimation module¶
The doc-ui animation test page.
Decorations carrying an anim_id animated by
bacommon.clienteffect.KeyframeAnimation effects: a box shakes
with growing amplitude while shrinking (step keys, like the chest
open), then pops back; a label fades and grows in (linear keys). The
effects run when the page arrives and again on ‘Replay’.
- bauiv1lib.docuitestanimation.test_page_animation() bacommon.docui.v2.Response[source]¶
Testing keyframe animation of decorations.
bauiv1lib.docuitestdepictions module¶
The doc-ui depictions test page.
Shows each depiction kind as a
bacommon.docui.v2.Depiction decoration on a button, then on a
disabled button, then fitted into boxes of other shapes and alignments.
Hovering, pressing, and selecting the buttons exercises how depictions
follow their button’s emphasis; the disabled row, the standard disabled
look. The precise-fit rows check the fit exactly: a flat white
depiction of a known shape, with a half-black image laid over where
it should land (computed here, independently of the native fit), so
a correct fit is a plain grey rect and any offset shows as a white or
dark fringe. The button-body rows do the same with the white shape as
the button’s own body (its depiction).
Characters come from the classic character package’s wrapper (built from its .bchar files), the way game code gets them; names are plain text.
- bauiv1lib.docuitestdepictions.test_page_depictions(route: bacommon.docui.routes.docuitest.Depictions) bacommon.docui.v2.Response[source]¶
Testing depictions.
bauiv1lib.docuitestgrids module¶
The doc-ui button grids test page.
- meta private:
bauiv1lib.docuitestitems module¶
The doc-ui display-items test page.
A display-item stays what it always was – show this thing in this
style. It turns into plain doc-ui decorations
(bacommon.displayitem.DisplayItem.decorations) rather than being
derived client-side from the item type. This page is a renderer
regression check – every item type and style, drawable with no server
and no account.
- bauiv1lib.docuitestitems.test_page_display_items(route: bacommon.docui.routes.docuitest.DisplayItems) bacommon.docui.v2.Response[source]¶
Testing display-items (v2 mirror of ‘/displayitems’).
bauiv1lib.docuitestlayouts module¶
Doc-ui test page for judging window layouts.
The root test page browses here at each
bacommon.docui.v2.WindowLayout; the page itself is the same
either way. It carries the things layouts stress: control rows (label to
value distance), titles and short button rows at every alignment, and
long rows, which in a narrow column scroll within it.
- bauiv1lib.docuitestlayouts.test_page_bounds() bacommon.docui.v2.Response[source]¶
Button-style bounds tests (v2 mirror of ‘/boundstests’).
- bauiv1lib.docuitestlayouts.test_page_window_layouts(route: bacommon.docui.routes.docuitest.WindowLayouts) bacommon.docui.v2.Response[source]¶
Assorted rows for eyeballing a window layout.
bauiv1lib.docuitestlivetimes module¶
The doc-ui live-times test page.
Text holding a moment in time
(bacommon.langstr.LangStrSpecTimeTarget) re-renders itself as
time passes: each widget re-evaluates exactly when its visible text is
due to change, so a seconds countdown ticks once a second, one showing
milliseconds every frame, and one showing only minutes once a minute.
Nothing on this page asks the server (or Python) for updates.
Every moment is a fixed offset from when the page was built; the restart button rebuilds it.
- bauiv1lib.docuitestlivetimes.test_page_live_times(route: bacommon.docui.routes.docuitest.LiveTimes) bacommon.docui.v2.Response[source]¶
Testing time-varying text.
bauiv1lib.docuitestnames module¶
The doc-ui names test page.
Name depictions in their two forms – basic (colored text) and capsule (text in a rounded capsule, optionally with an icon covering its left end) – fitted into boxes of various shapes and alignments. Builtin circle textures stand in for real capsule and icon art. With debug on, each depiction shows its box (red) and the box it reports covering (blue; what a hit-tested button takes presses over): a capsule’s body should exactly fill the blue box, glow aside.
- bauiv1lib.docuitestnames.test_page_names(route: bacommon.docui.routes.docuitest.Names) bacommon.docui.v2.Response[source]¶
Testing name depictions.
bauiv1lib.docuitestninepatch module¶
The doc-ui 9-patch test page.
Images drawn as 9-patches (bacommon.docui.v2.ImageNinePatch):
striped capsule art whose middle half either stretches or repeats at
its ends’ scale (tile-fit), optionally tinted three colors through an
rgb tint texture. A 9-patch fills its image’s box exactly, so with
debug on each image’s outline (its box) should sit right on the
capsule’s edge, with no gap or overhang anywhere.
- bauiv1lib.docuitestninepatch.test_page_nine_patch(route: bacommon.docui.routes.docuitest.NinePatch) bacommon.docui.v2.Response[source]¶
Testing 9-patch images.
bauiv1lib.docuitestsections module¶
The doc-ui sections test page.
- meta private:
bauiv1lib.docuitestsimple module¶
Small doc-ui test pages (navigation, slow loads, timed actions).
- bauiv1lib.docuitestsimple.test_page_2() bacommon.docui.v2.Response[source]¶
More testing (v2 mirror of the v1 ‘/test2’ page).
- bauiv1lib.docuitestsimple.test_page_empty() bacommon.docui.v2.Response[source]¶
An empty page (v2 mirror of ‘/emptypage’).
- bauiv1lib.docuitestsimple.test_page_long() bacommon.docui.v2.Response[source]¶
Testing a page that takes a bit of time to load (v2 mirror).
- bauiv1lib.docuitestsimple.test_page_timed_actions(route: bacommon.docui.routes.docuitest.TimedActions) bacommon.docui.v2.Response[source]¶
Testing timed actions (v2 mirror of ‘/timedactions’).
bauiv1lib.docuitesttextimages module¶
The doc-ui text-images test page.
A text can carry an image at either end
(bacommon.docui.v2.Text.image_left /
image_right); the client measures the
text and its images as one unit, shrinks that to fit the text’s size
box, and aligns it there. This page exercises each part.
The first row’s composition is deliberately far too big for the boxes it is given, so fitting has to both scale and center for it to land – one that already fitted would prove nothing. The debug toggle draws each text’s size box.
- bauiv1lib.docuitesttextimages.test_page_text_images(route: bacommon.docui.routes.docuitest.TextImages) bacommon.docui.v2.Response[source]¶
Testing text with images fixed to its ends.
bauiv1lib.docuitesttextwrap module¶
The doc-ui text-wrapping test page.
Row and section titles, subtitles and footnotes word-wrap to their columns: in background prep each is evaluated (ignoring the string’s own wrap hints) and wrapped with the engine’s own text measure at the width and scale its text widget gets, so every line fits and nothing shrinks to fit. Lines break only where the OS’s line-break rules allow, and each line fills as far as it will go before the next starts (so only the last runs short). With debug on, each row’s outline shows its column; text should reach close to its right edge but never past it, and rows grow taller to fit their wrapped text.
The live-time row is the one deliberate exception: time-varying text
can’t be wrapped once up front, so its subtitle stays a single line
(squished to fit, as unwrapped text always was) and the client logs
one ba.ui warning about it.
- bauiv1lib.docuitesttextwrap.test_page_text_wrapping(route: bacommon.docui.routes.docuitest.TextWrapping) bacommon.docui.v2.Response[source]¶
Testing word-wrapped titles, subtitles and footnotes.
bauiv1lib.docuitestviewers module¶
Doc-ui test page for live viewers (the page’s viewer pane).
Shows one case at a time in the pane: viewers that should work, empty panes (and no pane at all), and bad data that should show the broken-depiction placeholder (an outlined box with a question mark) and log why, rather than a blank pane. The page’s controls switch the case and the pane’s frame style, background and side in place.
- bauiv1lib.docuitestviewers.test_page_viewers(route: bacommon.docui.routes.docuitest.Viewers) bacommon.docui.v2.Response[source]¶
Live viewer tests.
bauiv1lib.docuitestwidgets module¶
Doc-ui test page for control rows and page state.
- bauiv1lib.docuitestwidgets.test_page_widgets(route: bacommon.docui.routes.docuitest.Widgets) bacommon.docui.v2.Response[source]¶
Control rows, plus a readout of the state each request carried.
bauiv1lib.fileselector module¶
UI functionality for selecting files.
- class bauiv1lib.fileselector.FileSelectorWindow(path: str, callback: Callable[[str | None], Any] | None = None, *, show_base_path: bool = True, valid_file_extensions: Sequence[str] | None = None, allow_folders: bool = False, transition: str | None = 'in_right', origin_widget: Widget | None = None)[source]¶
Bases:
MainWindowWindow for selecting files.
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).
bauiv1lib.getremote module¶
Provides a popup telling the user about the BSRemote app.
bauiv1lib.gettokens module¶
UI functionality for purchasing/acquiring currency.
- class bauiv1lib.gettokens.GetTokensWindow(transition: str | None = 'in_right', origin_widget: Widget | None = None, auxiliary_style: bool = True)[source]¶
Bases:
MainWindowWindow for purchasing/acquiring classic tickets.
- class State(*values)[source]¶
Bases:
EnumWhat are we doing?
- HAVE_GOLD_PASS = 'have_gold_pass'¶
- LOADING = 'loading'¶
- NOT_SIGNED_IN = 'not_signed_in'¶
- SHOWING_STORE = 'showing_store'¶
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).
- class bauiv1lib.gettokens.TextContents(*values)[source]¶
Bases:
EnumSome type of text to show.
- PRICE = 'price'¶
bauiv1lib.help module¶
Provides help related ui.
- class bauiv1lib.help.HelpWindow(transition: str | None = 'in_right', origin_widget: Widget | None = None)[source]¶
Bases:
MainWindowA window providing help on how to play.
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).
bauiv1lib.hostdocui module¶
Doc-ui windows showing pages a game host serves (host doc-ui).
A host’s pages arrive over the game connection and the host is
untrusted, so before showing one we refuse references outside the
host’s package universe, drop client-effects untrusted sources may not
run, and drop local-actions entirely. Our own pages (when we’re the
host) skip all that. Design: docs/initiatives/host-docui.md.
- class bauiv1lib.hostdocui.HostDocUIController[source]¶
Bases:
DocUIControllerFulfills requests for host-served pages.
Our own pages (when we’re the host) arrive as response objects and are trusted; a host’s arrive encoded, and get decoded and vetted here.
- fulfill_request(request: DocUIRequest) DocUIResponse[source]¶
Handle request fulfillment.
Expected to be overridden by child classes.
Be aware that this will always be called in a background thread.
This method is expected to always return a response, even in the case of errors. Use
error_response()to translate error conditions to responses.The one exception to this rule (no pun intended) is the
efro.error.CleanErrorexception. This can be raised as a quick and dirty way to show custom error messages. The coderaise CleanError('Something broke.')will have the same effect asreturn self.error_response(custom_message='Something broke.').
- get_cache_key_extra() str | None[source]¶
Extra identity for response caching.
Cached responses are keyed by controller class, request, account and locale. A controller whose instance state changes what it returns for a given request must declare that state here; otherwise two instances differing in it share one cache entry and briefly show each other’s pages.
Return
Noneto opt out of caching entirely, which is the right answer when a response depends on state that cannot be summarized as a string.
- bauiv1lib.hostdocui.REQUEST_TIMEOUT = 10.0¶
How long to wait for a host to answer (seconds). Doc-ui windows share only a couple of background workers, so a silent host must not hold one for long.
bauiv1lib.iconpicker module¶
Provides a picker for icons.
- class bauiv1lib.iconpicker.IconPicker(parent: Widget, position: tuple[float, float] = (0.0, 0.0), delegate: IconPickerDelegate | None = None, scale: float | None = None, *, offset: tuple[float, float] = (0.0, 0.0), tint_color: Sequence[float] = (1.0, 1.0, 1.0), tint2_color: Sequence[float] = (1.0, 1.0, 1.0), selected_icon: str | None = None)[source]¶
Bases:
PopupWindowPicker for icons.
bauiv1lib.inboxui module¶
The doc-ui based inbox.
- class bauiv1lib.inboxui.InboxUIController[source]¶
Bases:
TypedDocUIController[Root|Respond,OpenUrl|TourneyScores]DocUI setup for the inbox.
- fulfill_route(route: bacommon.docui.routes.classicinbox.AnyInboxRoute) DocUIResponse[source]¶
Handle fulfillment for a route.
The type-safe equivalent of
fulfill_request(); the same rules apply (called in a background thread; should always return a response).
- fulfill_unrouted_request(request: bacommon.docui.v2.Request, error: str) DocUIResponse[source]¶
Handle a request that maps to none of our routes.
The default shows
error. Controllers fronting a server should generally forward the request as-is here instead; a server is free to grow pages (or arg values) that older clients have no routes for, and those should keep working.
- classmethod get_local_action_type() type[bacommon.docui.routes.classicinbox.InboxLocalAction][source]¶
Return the family class for the local-actions we handle.
Domains with no local-actions can leave this as is and pass
typing.Neveras their local-action type arg.
- classmethod get_route_type() type[bacommon.docui.routes.classicinbox.InboxRoute][source]¶
Return the family class for the routes we handle.
- run_local_action(action: bacommon.docui.routes.classicinbox.AnyInboxLocalAction, context: DocUILocalAction) None[source]¶
Do something locally on behalf of the doc-ui.
The type-safe equivalent of
local_action(); the same cautions apply. The original action is passed ascontextfor access to the originating widget and window.
bauiv1lib.inventory module¶
Provides help related ui.
- class bauiv1lib.inventory.InventoryUIController(player_profiles_only: bool = False)[source]¶
Bases:
TypedDocUIController[Root|Purchase|PurchaseConfirm|ProfileEdit|ProfileSave|ProfileDelete|ProfileDeleteConfirm|ProfileCharacter|ProfileIcon|ProfileGlobalUpgrade|ProfileGlobalUpgradeBuy|ProfileMigrate,NewProfile|EditProfile|SpawnBot|ShowLegacyProfiles|ShowCloudProfiles]DocUI setup for inventory.
Player profiles come in two flavors here. Cloud profiles are stored on the v2 master server and the server renders their rows and editor into the inventory page itself. Legacy profiles are the local-config ones (synced via the v1 account); their rows are spliced in client-side so they work offline. We show cloud profiles by default and switch to legacy when the user asks (
show_legacy_profiles) or when the cloud page can’t be fetched.- fulfill_route(route: bacommon.docui.routes.classicstore.AnyStoreRoute) DocUIResponse[source]¶
Handle fulfillment for a route.
The type-safe equivalent of
fulfill_request(); the same rules apply (called in a background thread; should always return a response).
- fulfill_unrouted_request(request: bacommon.docui.v2.Request, error: str) DocUIResponse[source]¶
Handle a request that maps to none of our routes.
The default shows
error. Controllers fronting a server should generally forward the request as-is here instead; a server is free to grow pages (or arg values) that older clients have no routes for, and those should keep working.
- get_cache_key_extra() str | None[source]¶
Extra identity for response caching.
Cached responses are keyed by controller class, request, account and locale. A controller whose instance state changes what it returns for a given request must declare that state here; otherwise two instances differing in it share one cache entry and briefly show each other’s pages.
Return
Noneto opt out of caching entirely, which is the right answer when a response depends on state that cannot be summarized as a string.
- classmethod get_local_action_type() type[bacommon.docui.routes.classicstore.InventoryLocalAction][source]¶
Return the family class for the local-actions we handle.
Domains with no local-actions can leave this as is and pass
typing.Neveras their local-action type arg.
- classmethod get_route_type() type[bacommon.docui.routes.classicstore.StoreRoute][source]¶
Return the family class for the routes we handle.
Called when a window shared state is being restored.
- run_local_action(action: bacommon.docui.routes.classicstore.AnyInventoryLocalAction, context: DocUILocalAction) None[source]¶
Do something locally on behalf of the doc-ui.
The type-safe equivalent of
local_action(); the same cautions apply. The original action is passed ascontextfor access to the originating widget and window.
bauiv1lib.kiosk module¶
UI functionality for running the game in kiosk mode.
- class bauiv1lib.kiosk.KioskWindow(transition: str | None = 'in_right', origin_widget: Widget | None = None)[source]¶
Bases:
MainWindowKiosk mode window.
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).
bauiv1lib.meshviewer module¶
A viewer showing a few meshes, turning.
bauiv1lib.party module¶
Provides party related UI.
bauiv1lib.partyqueue module¶
UI related to waiting in line for a party.
- class bauiv1lib.partyqueue.PartyQueueWindow(queue_id: str, address: str, port: int)[source]¶
Bases:
WindowWindow showing players waiting to join a server.
- class Dude(parent: PartyQueueWindow, distance: float, initial_offset: float, is_player: bool, account_id: str, name: str)[source]¶
Bases:
objectRepresents a single dude waiting in a server line.
- on_account_press(account_id: str | None, origin_widget: Widget) None[source]¶
A dude was clicked so we should show his account info.
bauiv1lib.passwordprompt module¶
A minimal password-entry prompt dialog.
- class bauiv1lib.passwordprompt.PasswordPromptWindow(*, description: str | Lstr | LangStr | None = None, on_result: Callable[[str | None], None] | None = None)[source]¶
Bases:
objectSmall modal overlay window prompting for a password.
Calls
on_resultexactly once: the entered password on submit or None on cancel (via the cancel button, back press, or an externaldismiss()).
bauiv1lib.playdocui module¶
The top level play window, as a doc-ui page.
A client-local doc-ui domain: one centered row of big buttons leading
to co-op (a legacy window) and the teams/free-for-all playlist browsers
(bauiv1lib.playlist.browserdocui).
Also the first step of gather’s private-party playlist selection, in select mode: just the teams and free-for-all buttons, leading to the playlist browsers’ own select mode.
- class bauiv1lib.playdocui.Open(target: Target, select: bool = False)[source]¶
Bases:
PlayLocalActionGo somewhere.
- classmethod get_press_sound() PressSound[source]¶
What a button plays when pressed to run this local-action.
Actions that stay on the page click (the default); override to return
SWISHfor ones that go somewhere (open a window or popup). A press whose action hasdefault_soundoff plays nothing either way.
- class bauiv1lib.playdocui.PlayController[source]¶
Bases:
TypedDocUIController[Root,Open]Doc-ui controller for the play page.
- fulfill_route(route: AnyPlayRoute) DocUIResponse[source]¶
Handle fulfillment for a route.
The type-safe equivalent of
fulfill_request(); the same rules apply (called in a background thread; should always return a response).
- classmethod get_local_action_type() type[PlayLocalAction][source]¶
Return the family class for the local-actions we handle.
Domains with no local-actions can leave this as is and pass
typing.Neveras their local-action type arg.
- classmethod get_route_type() type[PlayRoute][source]¶
Return the family class for the routes we handle.
- get_window_toolbar_visibility() Literal['menu_full', 'menu_minimal'][source]¶
Which toolbar our windows show.
Everything by default. Settings-style pages reachable mid-game typically return
'menu_minimal'unlessbauiv1.in_main_menu(), as the classic settings windows do.
- run_local_action(action: AnyPlayLocalAction, context: DocUILocalAction) None[source]¶
Do something locally on behalf of the doc-ui.
The type-safe equivalent of
local_action(); the same cautions apply. The original action is passed ascontextfor access to the originating widget and window.
- class bauiv1lib.playdocui.PlayLocalAction[source]¶
Bases:
DocUILocalActionBaseFamily class for the play local-actions.
- classmethod get_action_types() tuple[type[DocUILocalActionBase], ...][source]¶
Return all concrete local-actions in this family.
Must be overridden by each family class; see
get_route_types().
- class bauiv1lib.playdocui.PlayRoute[source]¶
Bases:
DocUIRouteFamily class for the play routes.
- classmethod get_route_types() tuple[type[DocUIRoute], ...][source]¶
Return all concrete routes in this family.
Must be overridden by each family class. A family generally defines a union alias of its routes (which also gives handlers
assert_neverexhaustiveness) and returnsfamily_members()of it here.
- classmethod get_window_layout() WindowLayout[source]¶
The layout windows browsing to this route open with.
browse()uses this unless told otherwise, so a route whose page is best shown at some layout declares it once rather than at every link.Defaults to
WIDE, which is the same size at every ui-scale, so a one-off page (a confirmation, a dialog) never ends up as a big mostly-empty window.LARGE, which grows to fill more of the screen at medium/large ui-scale, is for pages built to use that room (store listings and the like), and they ask for it explicitly.
- class bauiv1lib.playdocui.PlaySelectController[source]¶
Bases:
PlayControllerThe play page as the first step of picking a private-party playlist.
Open it at a
Rootroute withselectset. Its own class keeps these windows distinct from the play flow’s for navigation, and it shows a minimal toolbar (as the legacy select flow did): we’re mid-errand for the gather window.
bauiv1lib.playoptions module¶
Provides a window for configuring play options.
bauiv1lib.popup module¶
Popup window/menu related functionality.
- class bauiv1lib.popup.PopupMenu(parent: Widget, position: tuple[float, float], choices: Sequence[str], *, button_id: str | None = None, current_choice: str | None = None, on_value_change_call: Callable[[str], Any] | None = None, opening_call: Callable[[], Any] | None = None, closing_call: Callable[[], Any] | None = None, width: float = 100.0, maxwidth: float | None = None, scale: float | None = None, choices_disabled: Sequence[str] | None = None, choices_display: Sequence[Lstr | LangStr] | None = None, button_size: tuple[float, float] = (160.0, 50.0), autoselect: bool = True, transition_delay: float | None = None, transition_type: Literal['in_left', 'scale'] | None = None, better_bg_fit: bool = False)[source]¶
Bases:
objectA complete popup-menu control.
This creates a button and wrangles its pop-up menu.
- get_window_widget() Widget | None[source]¶
Return the menu’s window widget (or None if nonexistent).
Called when the menu is closing.
Called when a choice is selected.
- class bauiv1lib.popup.PopupMenuWindow(position: tuple[float, float], choices: Sequence[str], current_choice: str | None, *, delegate: Any = None, width: float = 230.0, maxwidth: float | None = None, scale: float = 1.0, choices_disabled: Sequence[str] | None = None, choices_display: Sequence[Lstr | LangStr] | None = None)[source]¶
Bases:
PopupWindowA menu built using popup-window functionality.
Pass None for
current_choicefor a menu with no current value (a list of things to do rather than values to pick from): nothing is drawn as current and selection starts at the first pickable choice.
- class bauiv1lib.popup.PopupWindow(position: tuple[float, float], size: tuple[float, float], scale: float = 1.0, *, offset: tuple[float, float] = (0, 0), bg_color: tuple[float, float, float] = (0.35, 0.55, 0.15), focus_position: tuple[float, float] = (0, 0), focus_size: tuple[float, float] | None = None, toolbar_visibility: Literal['inherit', 'menu_minimal_no_back', 'menu_store_no_back'] = 'menu_minimal_no_back', edge_buffer_scale: float = 1.0, darken_behind: bool = True)[source]¶
Bases:
objectA transient window that pops up from some position.
Scale popup menus get at the current ui-scale unless told otherwise.
bauiv1lib.qrcode module¶
Provides functionality for displaying QR codes.
bauiv1lib.radiogroup module¶
UI functionality for creating radio groups of buttons.
bauiv1lib.report module¶
UI related to reporting bad behavior/etc.
bauiv1lib.resourcetypeinfo module¶
Provides a window which shows info about resource types.
- class bauiv1lib.resourcetypeinfo.ResourceTypeInfoWindow(resource_type: Literal['tickets', 'tokens', 'trophies', 'xp'], origin_widget: Widget)[source]¶
Bases:
PopupWindowPopup window providing info about resource types.
bauiv1lib.sendinfo module¶
UI for sending info (codes and such) to the developer.
The send-info page (Advanced settings’ ‘Send Info’) is a client-local doc-ui domain: whatever gets typed goes to the master server, which handles promo codes itself and passes others (old-style codes, share codes) along to the v1 server. The legacy modal window here is only a base for the playlist-import window.
- class bauiv1lib.sendinfo.Root[source]¶
Bases:
SendInfoRouteThe send-info page.
- class bauiv1lib.sendinfo.SendInfoController[source]¶
Bases:
TypedDocUIController[Root,Submit]Doc-ui controller for the send-info page.
- fulfill_route(route: AnySendInfoRoute) DocUIResponse[source]¶
Handle fulfillment for a route.
The type-safe equivalent of
fulfill_request(); the same rules apply (called in a background thread; should always return a response).
- classmethod get_local_action_type() type[SendInfoLocalAction][source]¶
Return the family class for the local-actions we handle.
Domains with no local-actions can leave this as is and pass
typing.Neveras their local-action type arg.
- classmethod get_route_type() type[SendInfoRoute][source]¶
Return the family class for the routes we handle.
- get_window_toolbar_visibility() Literal['menu_full', 'menu_minimal'][source]¶
Which toolbar our windows show.
Everything by default. Settings-style pages reachable mid-game typically return
'menu_minimal'unlessbauiv1.in_main_menu(), as the classic settings windows do.
- run_local_action(action: AnySendInfoLocalAction, context: DocUILocalAction) None[source]¶
Do something locally on behalf of the doc-ui.
The type-safe equivalent of
local_action(); the same cautions apply. The original action is passed ascontextfor access to the originating widget and window.
- class bauiv1lib.sendinfo.SendInfoLocalAction[source]¶
Bases:
DocUILocalActionBaseFamily class for the send-info local-actions.
- classmethod get_action_types() tuple[type[DocUILocalActionBase], ...][source]¶
Return all concrete local-actions in this family.
Must be overridden by each family class; see
get_route_types().
- class bauiv1lib.sendinfo.SendInfoRoute[source]¶
Bases:
DocUIRouteFamily class for the send-info routes.
- classmethod get_route_types() tuple[type[DocUIRoute], ...][source]¶
Return all concrete routes in this family.
Must be overridden by each family class. A family generally defines a union alias of its routes (which also gives handlers
assert_neverexhaustiveness) and returnsfamily_members()of it here.
- classmethod get_window_layout() WindowLayout[source]¶
The layout windows browsing to this route open with.
browse()uses this unless told otherwise, so a route whose page is best shown at some layout declares it once rather than at every link.Defaults to
WIDE, which is the same size at every ui-scale, so a one-off page (a confirmation, a dialog) never ends up as a big mostly-empty window.LARGE, which grows to fill more of the screen at medium/large ui-scale, is for pages built to use that room (store listings and the like), and they ask for it explicitly.
- class bauiv1lib.sendinfo.SendInfoState(description: str = '')[source]¶
Bases:
DocUIStateWhat’s been typed.
- class bauiv1lib.sendinfo.SendInfoWindowLegacyModal(transition: str | None = 'in_scale', origin_widget: Widget | None = None)[source]¶
Bases:
WindowWindow for sending info to the developer.
- class bauiv1lib.sendinfo.Submit[source]¶
Bases:
SendInfoLocalActionSend what’s been typed, going back as it goes out.
bauiv1lib.serverdialog module¶
Dialog window controlled by the master server.
- class bauiv1lib.serverdialog.ServerDialogData(dialog_id: str, text: str, subs: list[tuple[str, str]]=<factory>, show_cancel: bool = True, copy_text: str | None = None)[source]¶
Bases:
objectData for ServerDialog.
- class bauiv1lib.serverdialog.ServerDialogWindow(data: ServerDialogData)[source]¶
Bases:
WindowA dialog window driven by the master-server.
bauiv1lib.store module¶
Shiny new doc-ui based store.
- class bauiv1lib.store.StoreUIController[source]¶
Bases:
TypedDocUIController[Root|Purchase|PurchaseConfirm|ProfileEdit|ProfileSave|ProfileDelete|ProfileDeleteConfirm|ProfileCharacter|ProfileIcon|ProfileGlobalUpgrade|ProfileGlobalUpgradeBuy|ProfileMigrate,GetTokens|RestorePurchases]DocUI setup for store.
- fulfill_route(route: bacommon.docui.routes.classicstore.AnyStoreRoute) DocUIResponse[source]¶
Handle fulfillment for a route.
The type-safe equivalent of
fulfill_request(); the same rules apply (called in a background thread; should always return a response).
- fulfill_unrouted_request(request: bacommon.docui.v2.Request, error: str) DocUIResponse[source]¶
Handle a request that maps to none of our routes.
The default shows
error. Controllers fronting a server should generally forward the request as-is here instead; a server is free to grow pages (or arg values) that older clients have no routes for, and those should keep working.
- classmethod get_local_action_type() type[bacommon.docui.routes.classicstore.StoreLocalAction][source]¶
Return the family class for the local-actions we handle.
Domains with no local-actions can leave this as is and pass
typing.Neveras their local-action type arg.
- classmethod get_route_type() type[bacommon.docui.routes.classicstore.StoreRoute][source]¶
Return the family class for the routes we handle.
- run_local_action(action: bacommon.docui.routes.classicstore.AnyStoreLocalAction, context: DocUILocalAction) None[source]¶
Do something locally on behalf of the doc-ui.
The type-safe equivalent of
local_action(); the same cautions apply. The original action is passed ascontextfor access to the originating widget and window.
bauiv1lib.tabs module¶
UI functionality for creating tab style buttons.
- class bauiv1lib.tabs.Tab(button: Widget, position: tuple[float, float], size: tuple[float, float])[source]¶
Bases:
objectInfo for an individual tab in a TabRow
- class bauiv1lib.tabs.TabRow(parent: bui.Widget, tabdefs: Sequence[tuple[T, bui.Lstr | bui.LangStr]], pos: tuple[float, float], size: tuple[float, float], *, on_select_call: Callable[[T], None] | None = None, idprefix: str | None = None)[source]¶
Bases:
GenericEncapsulates a row of tab-styled buttons.
Tabs are indexed by id which is an arbitrary user-provided type.
bauiv1lib.teamnamescolors module¶
Provides a window to customize team names and colors.
- class bauiv1lib.teamnamescolors.TeamNamesColorsWindow(scale_origin: tuple[float, float])[source]¶
Bases:
PopupWindowA popup window for customizing team names and colors.
- color_picker_closing(picker: ColorPicker) None[source]¶
Called when the color picker is closing.
bauiv1lib.template module¶
Useful starting points for new classes and whatnot.
- class bauiv1lib.template.TemplateMainWindow(dummy_data: int, *, transition: str | None = 'in_right', origin_widget: Widget | None = None, auxiliary_style: bool = True)[source]¶
Bases:
MainWindowAn example of a well-behaved main-window.
Provide a custom id for window shared state.
Unlike
MainWindowState, which is used to save and restore a single main-window instance, shared-state is intended to hold values that can apply to multiple instances of a window.By default, shared state uses the window class as an index (so is shared by all windows of the same class), but this method can be overridden to provide more distinct states. For example, a store-page main-window class might want to keep distinct states for different sub-pages it can display instead of having a single state for the whole class.
Note that shared state only persists for the current run of the app.
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).
bauiv1lib.tournamententry module¶
Defines a popup window for entering tournaments.
- class bauiv1lib.tournamententry.TournamentEntryWindow(tournament_id: str, tournament_activity: bs.Activity | None = None, position: tuple[float, float] = (0.0, 0.0), delegate: Any = None, scale: float | None = None, offset: tuple[float, float] = (0.0, 0.0), on_close_call: Callable[[], Any] | None = None)[source]¶
Bases:
PopupWindowPopup window for entering tournaments.
bauiv1lib.tournamentscores module¶
Provides a popup for viewing tournament scores.
bauiv1lib.trophies module¶
Provides a popup window for viewing trophies.
bauiv1lib.url module¶
UI functionality related to URLs.
bauiv1lib.utils module¶
Useful bits to use with UIs.
- bauiv1lib.utils.TOOLBAR_SCROLL_FADE = 85.0¶
How far in from the top/bottom of a full-screen (small ui-scale) scroll area
apply_toolbar_scroll_fades()fades content, in the scroll area’s local units. Calibrated against the toolbars, so it assumes the scroll area’s top and bottom sit at the virtual rect’s.
- bauiv1lib.utils.apply_toolbar_scroll_fades(scrollwidget: Widget, *, top_fade: float = 85.0, bottom_fade: float = 85.0, left_fade: float = 0.0, right_fade: float = 0.0) None[source]¶
Fade a full-screen scroll area’s content out toward the toolbars.
For scroll areas filling the screen at small ui-scale. Content fades into the window backing over
top_fade/bottom_fadeunits in from the top/bottom (zero for none). The sides get nothing by default, as content just scrolls off the screen there; a scroll area with a side edge on screen instead (beside a viewer pane, say) can fade that one overleft_fade/right_fade. The scroll area must be a direct child of a window with a backing, with its top and bottom at the virtual rect’s (not extended into screen margins), which the defaultTOOLBAR_SCROLL_FADEis calibrated against.
- bauiv1lib.utils.get_screen_margins(root_scale: float) tuple[float, float, float, float][source]¶
Return visible-screen margins outside the virtual rect.
Returns
(left, right, bottom, top)distances between the virtual rect edges and the virtual outer rect (true visible area) edges, converted into a window’s local coordinate space via its root container’sroot_scale. All values are zero unless the virtual bounds are inset (camera cutouts and such).Windows that fill the screen at small ui-scale should extend backing elements such as scroll areas outward by these amounts (insetting their content by the same amounts so it stays put) so the backing reaches the true screen edges instead of stopping at the virtual rect. A scroll area using
apply_toolbar_scroll_fades()should only do so at its sides, keeping its top and bottom at the virtual rect’s.
bauiv1lib.v2upgrade module¶
UI for upgrading V1 accounts to V2.
bauiv1lib.watch module¶
Provides UI functionality for watching replays.
- class bauiv1lib.watch.WatchWindow(transition: str | None = 'in_right', origin_widget: Widget | None = None)[source]¶
Bases:
MainWindowWindow for watching replays.
- class TabID(*values)[source]¶
Bases:
EnumOur available tab types.
- MY_REPLAYS = 'my_replays'¶
- TEST_TAB = 'test_tab'¶
- get_main_window_state() MainWindowState[source]¶
Return a WindowState to recreate this specific window.
Used to gracefully return to a window from another window or ui system.
- main_window_should_preserve_selection() bool[source]¶
Whether this window should auto-save/restore selection.
If enabled, selection will be stored in the window’s shared state. See
get_main_window_shared_state_id()for more info about main-window shared-state.The default value of None results in a warning to explicitly override this (as the implicit default will change from False to True after api 9 support ends).