bauiv1lib.settings package¶
Submodules¶
bauiv1lib.settings.advanced module¶
Advanced settings, as a doc-ui page.
A client-local doc-ui domain like the audio settings: the page is authored here, its controls keep their values in typed page state mirroring the config, and each change is a typed local action that writes the config. Buttons leading elsewhere are local actions too, opening the existing (non-doc-ui) windows.
- class bauiv1lib.settings.advanced.AdvancedLocalAction[source]¶
Bases:
DocUILocalActionBaseFamily class for the advanced settings 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.settings.advanced.AdvancedRoute[source]¶
Bases:
DocUIRouteFamily class for the advanced settings 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.settings.advanced.AdvancedSettingsController[source]¶
Bases:
TypedDocUIController[Root,SetLanguage|ApplySetting|Open|SendTranslationFeedback]Doc-ui controller for the advanced settings page.
- fulfill_route(route: AnyAdvancedRoute) 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[AdvancedLocalAction][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[AdvancedRoute][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: AnyAdvancedLocalAction, 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.settings.advanced.AdvancedState(language: str = 'Auto', kick_idle_players: bool = False, show_ping: bool = False, show_demos_when_idle: bool = False, disable_camera_shake: bool = False, disable_camera_gyro: bool = False, insecure_connections: InsecureConnections = InsecureConnections.AUTO, always_use_internal_keyboard: bool = False, allow_extreme_aspect_ratios: bool = False, legacy_character_physics: bool = False)[source]¶
Bases:
DocUIStateThe page’s values, mirroring the config.
- insecure_connections: InsecureConnections = 'auto'¶
- class bauiv1lib.settings.advanced.ApplySetting[source]¶
Bases:
AdvancedLocalActionWrite the setting that changed (the trigger) to the config.
- class bauiv1lib.settings.advanced.InsecureConnections(*values)[source]¶
Bases:
EnumThe tri-state
Insecure Connectionssetting (its config values).- ALWAYS = 'always'¶
- AUTO = 'auto'¶
- NEVER = 'never'¶
- class bauiv1lib.settings.advanced.Open(target: Target)[source]¶
Bases:
AdvancedLocalActionGo 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.settings.advanced.Root[source]¶
Bases:
AdvancedRouteThe advanced settings page.
- class bauiv1lib.settings.advanced.SendTranslationFeedback[source]¶
Bases:
AdvancedLocalActionReport a translation that could be improved.
- class bauiv1lib.settings.advanced.SetLanguage[source]¶
Bases:
AdvancedLocalActionSwitch to the language the page’s state holds.
- class bauiv1lib.settings.advanced.Target(*values)[source]¶
Bases:
EnumWindows the page’s buttons lead to.
- BENCHMARKS = 'benchmarks'¶
- DEV_TOOLS = 'dev_tools'¶
- MODDING_GUIDE = 'modding_guide'¶
- MODS_FOLDER = 'mods_folder'¶
- NET_TEST = 'net_test'¶
- PLUGINS = 'plugins'¶
- SEND_INFO = 'send_info'¶
- VR_TEST = 'vr_test'¶
bauiv1lib.settings.allsettingsdocui module¶
The top level settings window, as a doc-ui page.
A client-local doc-ui domain: one centered row of big buttons leading
to the controls, graphics, audio and advanced settings pages; opened
by the toolbar’s settings button. (Replaces the legacy
AllSettingsWindow.)
- class bauiv1lib.settings.allsettingsdocui.AllSettingsController[source]¶
Bases:
TypedDocUIController[Root,Open]Doc-ui controller for the top level settings page.
- fulfill_route(route: AnySettingsRoute) 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[SettingsLocalAction][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[SettingsRoute][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: AnySettingsLocalAction, 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.settings.allsettingsdocui.Open(target: Target)[source]¶
Bases:
SettingsLocalActionGo to a settings category.
- 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.settings.allsettingsdocui.Root[source]¶
Bases:
SettingsRouteThe top level settings page.
- class bauiv1lib.settings.allsettingsdocui.SettingsLocalAction[source]¶
Bases:
DocUILocalActionBaseFamily class for the settings 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.settings.allsettingsdocui.SettingsRoute[source]¶
Bases:
DocUIRouteFamily class for the settings 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.
bauiv1lib.settings.audio module¶
Audio settings, as a doc-ui page.
A client-local doc-ui domain: the page is authored here, its volume sliders keep their values in typed page state, and everything that must happen live – the volume being set as a slider is dragged, the test blip – is a typed local action reading that state. No requests leave the device.
- class bauiv1lib.settings.audio.ApplyVolume[source]¶
Bases:
AudioLocalActionApply a slider’s volume live (its on_drag): the running app hears it, plus whatever accompanies an apply – the sound slider’s blip, the music player’s level.
- class bauiv1lib.settings.audio.AudioLocalAction[source]¶
Bases:
DocUILocalActionBaseFamily class for the audio settings 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.settings.audio.AudioRoute[source]¶
Bases:
DocUIRouteFamily class for the audio settings 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.settings.audio.AudioSettingsController[source]¶
Bases:
TypedDocUIController[Root,ApplyVolume|CommitVolume|OpenSoundtracks]Doc-ui controller for the audio settings page.
- fulfill_route(route: AnyAudioRoute) 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[AudioLocalAction][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[AudioRoute][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: AnyAudioLocalAction, 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.settings.audio.AudioState(sound_volume: float = 1.0, music_volume: float = 1.0)[source]¶
Bases:
DocUIStateThe page’s volumes, mirroring the config values.
- class bauiv1lib.settings.audio.CommitVolume[source]¶
Bases:
AudioLocalActionSave a settled volume (its on_change).
- class bauiv1lib.settings.audio.OpenSoundtracks[source]¶
Bases:
AudioLocalActionOpen the soundtrack browser.
- 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.settings.audio.Root[source]¶
Bases:
AudioRouteThe audio settings page.
bauiv1lib.settings.benchmarks module¶
Benchmarks and stress tests, as a doc-ui page.
A client-local doc-ui domain like the other settings pages: the page is authored here, the stress-test options live in typed page state, and each button is a typed local action.
- class bauiv1lib.settings.benchmarks.BenchmarksController[source]¶
Bases:
TypedDocUIController[Root,RunCpuBenchmark|RunMediaReloadBenchmark|RunStressTest]Doc-ui controller for the benchmarks page.
- fulfill_route(route: AnyBenchmarksRoute) 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[BenchmarksLocalAction][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[BenchmarksRoute][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: AnyBenchmarksLocalAction, 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.settings.benchmarks.BenchmarksLocalAction[source]¶
Bases:
DocUILocalActionBaseFamily class for the benchmarks 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.settings.benchmarks.BenchmarksRoute[source]¶
Bases:
DocUIRouteFamily class for the benchmarks 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.settings.benchmarks.BenchmarksState(playlist_type: StressPlaylistType = StressPlaylistType.RANDOM, playlist_name: str = '__default__', player_count: float = 8.0, round_duration: float = 30.0)[source]¶
Bases:
DocUIStateThe stress-test options.
- playlist_type: StressPlaylistType = 'Random'¶
- class bauiv1lib.settings.benchmarks.Root[source]¶
Bases:
BenchmarksRouteThe benchmarks page.
- class bauiv1lib.settings.benchmarks.RunCpuBenchmark[source]¶
Bases:
BenchmarksLocalActionRun the cpu benchmark.
- class bauiv1lib.settings.benchmarks.RunMediaReloadBenchmark[source]¶
Bases:
BenchmarksLocalActionRun the media-reload benchmark.
- class bauiv1lib.settings.benchmarks.RunStressTest[source]¶
Bases:
BenchmarksLocalActionRun a stress test with the options in page state.
bauiv1lib.settings.controls module¶
The top level controls settings, as a doc-ui page.
A client-local doc-ui domain like the other settings pages: a stack of buttons leading to the per-kind controller settings (which are still legacy windows), plus a Windows-only XInput toggle in typed page state.
- class bauiv1lib.settings.controls.ApplyXInput[source]¶
Bases:
ControlsLocalActionWrite the disable-xinput setting to the config.
- class bauiv1lib.settings.controls.ControlsLocalAction[source]¶
Bases:
DocUILocalActionBaseFamily class for the controls settings 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.settings.controls.ControlsRoute[source]¶
Bases:
DocUIRouteFamily class for the controls settings 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.settings.controls.ControlsSettingsController[source]¶
Bases:
TypedDocUIController[Root,Open|ApplyXInput]Doc-ui controller for the controls settings page.
- fulfill_route(route: AnyControlsRoute) 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[ControlsLocalAction][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[ControlsRoute][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: AnyControlsLocalAction, 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.settings.controls.ControlsState(disable_xinput: bool = False)[source]¶
Bases:
DocUIStateThe page’s values, mirroring the config.
- class bauiv1lib.settings.controls.Open(target: Target)[source]¶
Bases:
ControlsLocalActionGo 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.settings.controls.Root[source]¶
Bases:
ControlsRouteThe controls settings page.
bauiv1lib.settings.devtools module¶
Dev tools settings, as a doc-ui page.
A client-local doc-ui domain like the other settings pages: the page is authored here, its controls mirror the config in typed page state, and every control is a typed local action.
- class bauiv1lib.settings.devtools.ApplyButtonSetting(commit: bool = True)[source]¶
Bases:
DevToolsLocalActionWrite the dev-console-button setting that changed to the config.
- class bauiv1lib.settings.devtools.ApplyShowButton[source]¶
Bases:
DevToolsLocalActionWrite the show-dev-console-button setting to the config.
- class bauiv1lib.settings.devtools.CreateUserSystemScripts[source]¶
Bases:
DevToolsLocalActionCopy the system scripts out to the user dir for editing.
- class bauiv1lib.settings.devtools.DeleteUserSystemScripts[source]¶
Bases:
DevToolsLocalActionRemove the user copy of the system scripts (after confirming).
- 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.settings.devtools.DevConsoleButtonStyle(*values)[source]¶
Bases:
EnumColor scheme for the dev console button (config values).
- GREEN = 'green'¶
- GREY = 'grey'¶
- HOWDY = 'howdy'¶
- PURPLE = 'purple'¶
- class bauiv1lib.settings.devtools.DevToolsController[source]¶
Bases:
TypedDocUIController[Root,ApplyShowButton|ApplyButtonSetting|ResetButton|CreateUserSystemScripts|DeleteUserSystemScripts]Doc-ui controller for the dev tools page.
- fulfill_route(route: AnyDevToolsRoute) 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[DevToolsLocalAction][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[DevToolsRoute][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: AnyDevToolsLocalAction, 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.settings.devtools.DevToolsLocalAction[source]¶
Bases:
DocUILocalActionBaseFamily class for the dev tools 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.settings.devtools.DevToolsRoute[source]¶
Bases:
DocUIRouteFamily class for the dev tools 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.settings.devtools.DevToolsState(show_dev_console_button: bool = False, dev_console_button_size: float = 1.0, dev_console_button_opacity: float = 1.0, dev_console_button_style: DevConsoleButtonStyle = DevConsoleButtonStyle.GREY)[source]¶
Bases:
DocUIStateThe page’s values, mirroring the config.
- dev_console_button_style: DevConsoleButtonStyle = 'grey'¶
- class bauiv1lib.settings.devtools.ResetButton[source]¶
Bases:
DevToolsLocalActionPut the dev console button back to its default look and spot.
- class bauiv1lib.settings.devtools.Root[source]¶
Bases:
DevToolsRouteThe dev tools page.
bauiv1lib.settings.gamepad module¶
Settings UI functionality related to gamepads.
- class bauiv1lib.settings.gamepad.AwaitGamepadInputWindow(gamepad: InputDevice, button: str, callback: Callable[[str, dict[str, Any], AwaitGamepadInputWindow], Any], message: Lstr | LangStr | None = None, message2: Lstr | LangStr | None = None)[source]¶
Bases:
WindowWindow for capturing a gamepad button press.
- class bauiv1lib.settings.gamepad.GamepadSettingsWindow(inputdevice: InputDevice, *, modal: bool = False, transition: str | None = 'in_right', transition_out: str = 'out_right', origin_widget: Widget | None = None, settings: dict | None = None)[source]¶
Bases:
MainWindowWindow for configuring a gamepad.
- get_input() InputDevice[source]¶
(internal)
- 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).
Called when the popup is closing.
Called when a choice is selected in the popup.
bauiv1lib.settings.gamepadadvanced module¶
UI functionality related to advanced gamepad configuring.
- class bauiv1lib.settings.gamepadadvanced.GamepadAdvancedSettingsWindow(parent_window: GamepadSettingsWindow)[source]¶
Bases:
WindowWindow for advanced gamepad configuration.
bauiv1lib.settings.gamepadselect module¶
Settings UI related to gamepad functionality.
- class bauiv1lib.settings.gamepadselect.GamepadSelectWindow(transition: str | None = 'in_right', origin_widget: Widget | None = None)[source]¶
Bases:
MainWindowWindow for selecting a gamepad to configure.
- gamepad_configure_callback(event: dict[str, Any]) None[source]¶
Respond to a gamepad button press during config selection.
- 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.settings.graphics module¶
Graphics settings, as a doc-ui page.
A client-local doc-ui domain like the audio and advanced settings: the page is authored here, its controls keep their values in typed page state mirroring the config, and each change is a typed local action that writes the config.
Fullscreen is the odd one out: it can change behind the page’s back (a
hotkey, the OS window controls), so the controller polls it (see
GraphicsSettingsController.poll_page_state()). Its native calls
are logic-thread-only while pages are built in the background, so the
controller keeps what the page build needs cached.
- class bauiv1lib.settings.graphics.ApplyFullscreen[source]¶
Bases:
GraphicsLocalActionSet fullscreen to what the page’s state holds.
- class bauiv1lib.settings.graphics.ApplyMaxFps[source]¶
Bases:
GraphicsLocalActionClean up and write the typed max-fps value.
- class bauiv1lib.settings.graphics.ApplyResolution[source]¶
Bases:
GraphicsLocalActionWrite the resolution setting in its platform’s form.
- class bauiv1lib.settings.graphics.ApplyScreenInsets[source]¶
Bases:
GraphicsLocalActionWrite the screen-insets settings (mode and custom amount).
Switching modes either way resets the custom amount to what automatic uses, so switching to custom doesn’t jump and switching to automatic shows its amount. The custom-amount slider is disabled under automatic, so the page rebuilds on each mode switch.
- class bauiv1lib.settings.graphics.ApplySetting[source]¶
Bases:
GraphicsLocalActionWrite the setting that changed (the trigger) to the config.
- class bauiv1lib.settings.graphics.AssetQuality(*values)[source]¶
Bases:
EnumAsset quality tiers.
Display-only for now: the popup shows what’s coming, with ultra disabled, and writes nothing to the config.
- REGULAR = 'Regular'¶
- ULTRA = 'Ultra'¶
- class bauiv1lib.settings.graphics.GraphicsLocalAction[source]¶
Bases:
DocUILocalActionBaseFamily class for the graphics settings 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.settings.graphics.GraphicsRoute[source]¶
Bases:
DocUIRouteFamily class for the graphics settings 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.settings.graphics.GraphicsSettingsController[source]¶
Bases:
TypedDocUIController[Root,ApplySetting|ApplyFullscreen|ApplyResolution|ApplyMaxFps|ApplyScreenInsets]Doc-ui controller for the graphics settings page.
- fulfill_route(route: AnyGraphicsRoute) 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[GraphicsLocalAction][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.
- get_page_state_poll_interval() float | None[source]¶
How often to call
poll_page_state()(None = never).For client-local pages mirroring values that can change behind their back (fullscreen toggled by a hotkey, say). Polling runs while a window shows a page that has state and isn’t waiting on a request.
- classmethod get_route_type() type[GraphicsRoute][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.
- poll_page_state(window: DocUIWindow) dict[source]¶
Current values for (some of) a window’s page state.
Called every
get_page_state_poll_interval()seconds. Return wire-form values keyed as in the state (seebacommon.docui.routes.DocUIState.key()); any differing from what the page holds are pushed into it, updating the controls showing them without rebuilding anything.
- run_local_action(action: AnyGraphicsLocalAction, 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.settings.graphics.GraphicsState(fullscreen: bool = False, visuals: Quality = Quality.AUTO, asset_quality: AssetQuality = AssetQuality.REGULAR, resolution: str = '', resolution_scale: float = 1.0, vsync: VSync = VSync.AUTO, msaa: str = 'Auto', max_fps: str = '', show_fps: bool = False, screen_insets: ScreenInsets = ScreenInsets.AUTO, custom_screen_insets: float = 0.0, thermal_throttling: bool = True)[source]¶
Bases:
DocUIStateThe page’s values, mirroring the config.
- asset_quality: AssetQuality = 'Regular'¶
- msaa: str = 'Auto'¶
One of the MSAA popup’s choice values (see _msaa_choices()): ‘Auto’, ‘Off’, or a sample count such as ‘4’.
- resolution: str = ''¶
One of the Android resolution popup’s choice values (see _resolution_choices()).
- resolution_scale: float = 1.0¶
The resolution slider’s scale, for the scale-based modes (see _scale_range()).
- screen_insets: ScreenInsets = 'Auto'¶
- class bauiv1lib.settings.graphics.Quality(*values)[source]¶
Bases:
EnumGraphics quality settings (their config values).
- AUTO = 'Auto'¶
- HIGH = 'High'¶
- HIGHER = 'Higher'¶
- LOW = 'Low'¶
- MEDIUM = 'Medium'¶
- class bauiv1lib.settings.graphics.ResolutionMode(*values)[source]¶
Bases:
EnumWhat the resolution control sets on this platform.
- ANDROID = 'android'¶
Sets
Resolution (Android)to Auto, Native, or an HD standard.
- CARDBOARD = 'cardboard'¶
Sets
GVR Render Target Scale(cardboard VR) on a slider.
- PIXEL_SCALE = 'pixel_scale'¶
Sets
Screen Pixel Scaleon a slider (for systems that can’t set a resolution directly).
- class bauiv1lib.settings.graphics.Root[source]¶
Bases:
GraphicsRouteThe graphics settings page.
bauiv1lib.settings.keyboard module¶
Keyboard settings related UI functionality.
- class bauiv1lib.settings.keyboard.AwaitKeyboardInputWindow(button: str, ui: Widget, settings: dict)[source]¶
Bases:
WindowWindow for capturing a keypress.
- class bauiv1lib.settings.keyboard.ConfigKeyboardWindow(c: InputDevice, transition: str | None = 'in_right', origin_widget: Widget | None = None)[source]¶
Bases:
MainWindowWindow for configuring keyboards.
- 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).
Called when the popup is closing.
Called when a choice is selected in the popup.
bauiv1lib.settings.nettesting module¶
Provides ui for network related testing.
- class bauiv1lib.settings.nettesting.NetTestingWindow(transition: str | None = 'in_right', origin_widget: Widget | None = None)[source]¶
Bases:
MainWindowWindow that runs a networking test suite to help diagnose issues.
- 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.settings.nettesting.get_net_val_testing_window() TestingWindow[source]¶
Create a window for testing net values.
bauiv1lib.settings.plugins module¶
Plugin Window UI.
- class bauiv1lib.settings.plugins.Category(*values)[source]¶
Bases:
EnumCategories we can display.
- ALL = 'all'¶
- DISABLED = 'disabled'¶
- ENABLED = 'enabled'¶
- class bauiv1lib.settings.plugins.PluginWindow(transition: str | None = 'in_right', origin_widget: Widget | None = None)[source]¶
Bases:
MainWindowWindow for configuring plugins.
- 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).
Called when the popup is closing.
Called when a choice is selected in the popup.
bauiv1lib.settings.pluginsettings module¶
Plugin Settings UI.
- class bauiv1lib.settings.pluginsettings.PluginSettingsWindow(transition: str | None = 'in_right', origin_widget: Widget | None = None)[source]¶
Bases:
MainWindowPlugin Settings 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.settings.remoteapp module¶
Settings UI functionality related to the remote app.
- class bauiv1lib.settings.remoteapp.RemoteAppSettingsWindow(transition: str | None = 'in_right', origin_widget: Widget | None = None)[source]¶
Bases:
MainWindowWindow showing info/settings related to the remote 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.settings.testing module¶
Provides UI for test settings.
- class bauiv1lib.settings.testing.TestingWindow(title: Lstr | LangStr, entries: list[dict[str, Any]], transition: str | None = 'in_right', origin_widget: Widget | None = None)[source]¶
Bases:
MainWindowWindow for conveniently testing various settings.
- 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.
bauiv1lib.settings.touchscreen module¶
Touchscreen control settings, as a doc-ui page.
A client-local doc-ui domain like the other settings pages: the settings live in typed page state mirroring the config, and each change is a typed local action writing it. While a window showing the page is up, the touch controls themselves are in editing mode, so they can be dragged around behind it.
- class bauiv1lib.settings.touchscreen.ActionType(*values)[source]¶
Bases:
EnumHow actions are triggered (the config’s values).
- BUTTONS = 'buttons'¶
- SWIPE = 'swipe'¶
- class bauiv1lib.settings.touchscreen.ApplySetting(commit: bool = True)[source]¶
Bases:
TouchscreenLocalActionWrite the setting that changed (the trigger) to the config.
- class bauiv1lib.settings.touchscreen.MovementType(*values)[source]¶
Bases:
EnumHow movement is controlled (the config’s values).
- JOYSTICK = 'joystick'¶
- SWIPE = 'swipe'¶
- class bauiv1lib.settings.touchscreen.Reset[source]¶
Bases:
TouchscreenLocalActionPut every touch control setting (and position) back to default.
- class bauiv1lib.settings.touchscreen.Root[source]¶
Bases:
TouchscreenRouteThe touchscreen settings page.
- class bauiv1lib.settings.touchscreen.TouchscreenLocalAction[source]¶
Bases:
DocUILocalActionBaseFamily class for the touchscreen settings 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.settings.touchscreen.TouchscreenRoute[source]¶
Bases:
DocUIRouteFamily class for the touchscreen settings 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.settings.touchscreen.TouchscreenSettingsController[source]¶
Bases:
TypedDocUIController[Root,ApplySetting|Reset]Doc-ui controller for the touchscreen settings page.
- create_window(request: DocUIRequest | DocUIRoute, *, transition: str | None = 'in_right', origin_widget: bui.Widget | None = None, auxiliary_style: bool = True, uiopenstateid: str | None = None, suppress_win_extra_type_warning: bool = False, options: WindowOptions | None = None) DocUIWindow[source]¶
Create a new window to handle a request.
The window opens as
optionssay; anything they leave unset comes from a route’s own defaults (itsget_window_layout()and such), or else the general defaults (seeWindowOptions).
- fulfill_route(route: AnyTouchscreenRoute) 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[TouchscreenLocalAction][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[TouchscreenRoute][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.
- restore(win: DocUIWindow, *, last_response: DocUIResponse | None, has_had_response: bool) DocUIWindow[source]¶
Restore a window from previous state.
May immediately display old results or may kick off a new request.
- run_local_action(action: AnyTouchscreenLocalAction, 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.settings.touchscreen.TouchscreenState(movement: MovementType = MovementType.SWIPE, movement_scale: float = 1.0, actions: ActionType = ActionType.BUTTONS, actions_scale: float = 1.0, swipe_hidden: bool = False, haptics: bool = True)[source]¶
Bases:
DocUIStateThe page’s values, mirroring the config.
- actions: ActionType = 'buttons'¶
- movement: MovementType = 'swipe'¶
bauiv1lib.settings.vrtesting module¶
Provides UI for testing vr settings.
- class bauiv1lib.settings.vrtesting.VRTestingWindow(transition: str = 'in_right')[source]¶
Bases:
TestingWindowWindow for testing vr settings.