bauiv1lib.store package

Submodules

bauiv1lib.store.browser module

UI for browsing the store.

class bauiv1lib.store.browser.StoreBrowserWindow(transition: str | None = 'in_right', origin_widget: Widget | None = None, *, show_tab: TabID | None = None, minimal_toolbars: bool = False, auxiliary_style: bool = True)[source]

Bases: MainWindow

Window for browsing the store.

class TabID(*values)[source]

Bases: Enum

Our available tab types.

CHARACTERS = 'characters'
ICONS = 'icons'
MAPS = 'maps'
MINIGAMES = 'minigames'
buy(item: str) None[source]

Attempt to purchase the provided item.

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).

update_buttons() None[source]

Update our buttons.

bauiv1lib.store.item module

UI functionality related to UI items.

bauiv1lib.store.item.instantiate_store_item_display(item_name: str, item: dict[str, Any], *, parent_widget: Widget, b_pos: tuple[float, float], b_width: float, b_height: float, idprefix: str, boffs_h: float = 0.0, boffs_h2: float = 0.0, boffs_v2: float = 0, delay: float = 0.0, button: bool = True) None[source]

(internal)

bauiv1lib.store.newstore module

Shiny new doc-ui based store.

class bauiv1lib.store.newstore.StoreUIController[source]

Bases: DocUIController

DocUI setup for store.

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.CleanError exception. This can be raised as a quick and dirty way to show custom error messages. The code raise CleanError('Something broke.') will have the same effect as return self.error_response(custom_message='Something broke.').

local_action(action: DocUILocalAction) None[source]

Do something locally on behalf of the doc-ui.

Controller classes can override this to expose named actions that can be triggered by doc-ui button presses, responses, etc.

Of course controllers can also perform arbitrary local actions alongside their normal request fulfillment; this is simply a way to do so without needing to provide actual ui pages alongside.

Be very careful and focused with what you expose here, especially if your doc-ui pages are coming from untrusted sources. Generally things like launching or joining games are good candidates for local actions.