Source code for _bauiv1

# Released under the MIT License. See LICENSE for details.
#
"""A dummy stub module for the real _bauiv1.

The real _bauiv1 is a compiled extension module and only available
in the live engine. This dummy-module allows Pylint/Mypy/etc. to
function reasonably well outside of that environment.

Make sure this file is never included in dirs seen by the engine!

In the future perhaps this can be a stub (.pyi) file, but we will need
to make sure that it works with all our tools (mypy, pylint, pycharm).

NOTE: This file was autogenerated by batools.dummymodule; do not edit by hand.
"""

# I'm sorry Pylint. I know this file saddens you. Be strong.
# pylint: disable=useless-suppression
# pylint: disable=unnecessary-pass
# pylint: disable=use-dict-literal
# pylint: disable=use-list-literal
# pylint: disable=unused-argument
# pylint: disable=missing-docstring
# pylint: disable=too-many-locals
# pylint: disable=redefined-builtin
# pylint: disable=too-many-lines
# pylint: disable=redefined-outer-name
# pylint: disable=invalid-name
# pylint: disable=no-value-for-parameter

from __future__ import annotations

from typing import TYPE_CHECKING, override, TypeVar

if TYPE_CHECKING:
    from typing import Any, Callable, Literal, Sequence
    import babase
    import bauiv1


_T = TypeVar('_T')


[docs] def _uninferrable() -> Any: """Get an "Any" in mypy and "uninferrable" in Pylint.""" # pylint: disable=undefined-variable return _not_a_real_variable # type: ignore
[docs] class Mesh: """Category: **User Interface Classes**""" pass
[docs] class Sound: """Category: **User Interface Classes**"""
[docs] def play(self) -> None: """Play the sound locally.""" return None
[docs] def stop(self) -> None: """Stop the sound if it is playing.""" return None
[docs] class Texture: """Category: **User Interface Classes**""" pass
[docs] class Widget: """Internal type for low level UI elements; buttons, windows, etc. Category: **User Interface Classes** This class represents a weak reference to a widget object in the internal C++ layer. Currently, functions such as bauiv1.buttonwidget() must be used to instantiate or edit these. """ transitioning_out: bool """Whether this widget is in the process of dying (read only). It can be useful to check this on a window's root widget to prevent multiple window actions from firing simultaneously, potentially leaving the UI in a broken state.""" def __bool__(self) -> bool: """Support for bool evaluation.""" return bool(True) # Slight obfuscation.
[docs] def activate(self) -> None: """Activates a widget; the same as if it had been clicked.""" return None
[docs] def add_delete_callback(self, call: Callable) -> None: """Add a call to be run immediately after this widget is destroyed.""" return None
[docs] def delete(self, ignore_missing: bool = True) -> None: """Delete the Widget. Ignores already-deleted Widgets if ignore_missing is True; otherwise an Exception is thrown. """ return None
[docs] def exists(self) -> bool: """Returns whether the Widget still exists. Most functionality will fail on a nonexistent widget. Note that you can also use the boolean operator for this same functionality, so a statement such as "if mywidget" will do the right thing both for Widget objects and values of None. """ return bool()
[docs] def get_children(self) -> list[bauiv1.Widget]: """Returns any child Widgets of this Widget.""" import bauiv1 return [bauiv1.Widget()]
[docs] def get_screen_space_center(self) -> tuple[float, float]: """Returns the coords of the bauiv1.Widget center relative to the center of the screen. This can be useful for placing pop-up windows and other special cases. """ return (0.0, 0.0)
[docs] def get_selected_child(self) -> bauiv1.Widget | None: """Returns the selected child Widget or None if nothing is selected.""" import bauiv1 return bauiv1.Widget()
[docs] def get_widget_type(self) -> str: """Return the internal type of the Widget as a string. Note that this is different from the Python bauiv1.Widget type, which is the same for all widgets. """ return str()
[docs] def back_press() -> None: """(internal)""" return None
[docs] def buttonwidget( edit: bauiv1.Widget | None = None, parent: bauiv1.Widget | None = None, size: Sequence[float] | None = None, position: Sequence[float] | None = None, on_activate_call: Callable | None = None, label: str | bauiv1.Lstr | None = None, color: Sequence[float] | None = None, down_widget: bauiv1.Widget | None = None, up_widget: bauiv1.Widget | None = None, left_widget: bauiv1.Widget | None = None, right_widget: bauiv1.Widget | None = None, texture: bauiv1.Texture | None = None, text_scale: float | None = None, textcolor: Sequence[float] | None = None, enable_sound: bool | None = None, mesh_transparent: bauiv1.Mesh | None = None, mesh_opaque: bauiv1.Mesh | None = None, repeat: bool | None = None, scale: float | None = None, transition_delay: float | None = None, on_select_call: Callable | None = None, button_type: str | None = None, extra_touch_border_scale: float | None = None, selectable: bool | None = None, show_buffer_top: float | None = None, icon: bauiv1.Texture | None = None, iconscale: float | None = None, icon_tint: float | None = None, icon_color: Sequence[float] | None = None, autoselect: bool | None = None, mask_texture: bauiv1.Texture | None = None, tint_texture: bauiv1.Texture | None = None, tint_color: Sequence[float] | None = None, tint2_color: Sequence[float] | None = None, text_flatness: float | None = None, text_res_scale: float | None = None, enabled: bool | None = None, ) -> bauiv1.Widget: """Create or edit a button widget. Category: **User Interface Functions** Pass a valid existing bauiv1.Widget as 'edit' to modify it; otherwise a new one is created and returned. Arguments that are not set to None are applied to the Widget. """ import bauiv1 # pylint: disable=cyclic-import return bauiv1.Widget()
[docs] def checkboxwidget( edit: bauiv1.Widget | None = None, parent: bauiv1.Widget | None = None, size: Sequence[float] | None = None, position: Sequence[float] | None = None, text: str | bauiv1.Lstr | None = None, value: bool | None = None, on_value_change_call: Callable[[bool], None] | None = None, on_select_call: Callable[[], None] | None = None, text_scale: float | None = None, textcolor: Sequence[float] | None = None, scale: float | None = None, is_radio_button: bool | None = None, maxwidth: float | None = None, autoselect: bool | None = None, color: Sequence[float] | None = None, ) -> bauiv1.Widget: """Create or edit a check-box widget. Category: **User Interface Functions** Pass a valid existing bauiv1.Widget as 'edit' to modify it; otherwise a new one is created and returned. Arguments that are not set to None are applied to the Widget. """ import bauiv1 # pylint: disable=cyclic-import return bauiv1.Widget()
[docs] def columnwidget( edit: bauiv1.Widget | None = None, parent: bauiv1.Widget | None = None, size: Sequence[float] | None = None, position: Sequence[float] | None = None, background: bool | None = None, selected_child: bauiv1.Widget | None = None, visible_child: bauiv1.Widget | None = None, single_depth: bool | None = None, print_list_exit_instructions: bool | None = None, left_border: float | None = None, top_border: float | None = None, bottom_border: float | None = None, selection_loops_to_parent: bool | None = None, border: float | None = None, margin: float | None = None, claims_left_right: bool | None = None, claims_tab: bool | None = None, ) -> bauiv1.Widget: """Create or edit a column widget. Category: **User Interface Functions** Pass a valid existing bauiv1.Widget as 'edit' to modify it; otherwise a new one is created and returned. Arguments that are not set to None are applied to the Widget. """ import bauiv1 # pylint: disable=cyclic-import return bauiv1.Widget()
[docs] def containerwidget( edit: bauiv1.Widget | None = None, parent: bauiv1.Widget | None = None, size: Sequence[float] | None = None, position: Sequence[float] | None = None, background: bool | None = None, selected_child: bauiv1.Widget | None = None, transition: str | None = None, cancel_button: bauiv1.Widget | None = None, start_button: bauiv1.Widget | None = None, root_selectable: bool | None = None, on_activate_call: Callable[[], None] | None = None, claims_left_right: bool | None = None, claims_tab: bool | None = None, selection_loops: bool | None = None, selection_loops_to_parent: bool | None = None, scale: float | None = None, on_outside_click_call: Callable[[], None] | None = None, single_depth: bool | None = None, visible_child: bauiv1.Widget | None = None, stack_offset: Sequence[float] | None = None, color: Sequence[float] | None = None, on_cancel_call: Callable[[], None] | None = None, print_list_exit_instructions: bool | None = None, click_activate: bool | None = None, always_highlight: bool | None = None, selectable: bool | None = None, scale_origin_stack_offset: Sequence[float] | None = None, toolbar_visibility: str | None = None, on_select_call: Callable[[], None] | None = None, claim_outside_clicks: bool | None = None, claims_up_down: bool | None = None, ) -> bauiv1.Widget: """Create or edit a container widget. Category: **User Interface Functions** Pass a valid existing bauiv1.Widget as 'edit' to modify it; otherwise a new one is created and returned. Arguments that are not set to None are applied to the Widget. """ import bauiv1 # pylint: disable=cyclic-import return bauiv1.Widget()
[docs] def get_qrcode_texture(url: str) -> bauiv1.Texture: """Return a QR code texture. The provided url must be 64 bytes or less. """ import bauiv1 # pylint: disable=cyclic-import return bauiv1.Texture()
[docs] def get_special_widget(name: str) -> bauiv1.Widget: """(internal)""" import bauiv1 # pylint: disable=cyclic-import return bauiv1.Widget()
[docs] def getmesh(name: str) -> bauiv1.Mesh: """Load a mesh for use solely in the local user interface.""" import bauiv1 # pylint: disable=cyclic-import return bauiv1.Mesh()
[docs] def getsound(name: str) -> bauiv1.Sound: """Load a sound for use in the ui.""" import bauiv1 # pylint: disable=cyclic-import return bauiv1.Sound()
[docs] def gettexture(name: str) -> bauiv1.Texture: """Load a texture for use in the ui.""" import bauiv1 # pylint: disable=cyclic-import return bauiv1.Texture()
[docs] def hscrollwidget( edit: bauiv1.Widget | None = None, parent: bauiv1.Widget | None = None, size: Sequence[float] | None = None, position: Sequence[float] | None = None, background: bool | None = None, selected_child: bauiv1.Widget | None = None, capture_arrows: bool | None = None, on_select_call: Callable[[], None] | None = None, center_small_content: bool | None = None, color: Sequence[float] | None = None, highlight: bool | None = None, border_opacity: float | None = None, simple_culling_h: float | None = None, claims_left_right: bool | None = None, claims_up_down: bool | None = None, claims_tab: bool | None = None, ) -> bauiv1.Widget: """Create or edit a horizontal scroll widget. Category: **User Interface Functions** Pass a valid existing bauiv1.Widget as 'edit' to modify it; otherwise a new one is created and returned. Arguments that are not set to None are applied to the Widget. """ import bauiv1 # pylint: disable=cyclic-import return bauiv1.Widget()
[docs] def imagewidget( edit: bauiv1.Widget | None = None, parent: bauiv1.Widget | None = None, size: Sequence[float] | None = None, position: Sequence[float] | None = None, color: Sequence[float] | None = None, texture: bauiv1.Texture | None = None, opacity: float | None = None, mesh_transparent: bauiv1.Mesh | None = None, mesh_opaque: bauiv1.Mesh | None = None, has_alpha_channel: bool = True, tint_texture: bauiv1.Texture | None = None, tint_color: Sequence[float] | None = None, transition_delay: float | None = None, draw_controller: bauiv1.Widget | None = None, tint2_color: Sequence[float] | None = None, tilt_scale: float | None = None, mask_texture: bauiv1.Texture | None = None, radial_amount: float | None = None, ) -> bauiv1.Widget: """Create or edit an image widget. Category: **User Interface Functions** Pass a valid existing bauiv1.Widget as 'edit' to modify it; otherwise a new one is created and returned. Arguments that are not set to None are applied to the Widget. """ import bauiv1 # pylint: disable=cyclic-import return bauiv1.Widget()
[docs] def is_available() -> bool: """(internal)""" return bool()
[docs] def is_party_icon_visible() -> bool: """(internal)""" return bool()
[docs] def rowwidget( edit: bauiv1.Widget | None = None, parent: bauiv1.Widget | None = None, size: Sequence[float] | None = None, position: Sequence[float] | None = None, background: bool | None = None, selected_child: bauiv1.Widget | None = None, visible_child: bauiv1.Widget | None = None, claims_left_right: bool | None = None, claims_tab: bool | None = None, selection_loops_to_parent: bool | None = None, ) -> bauiv1.Widget: """Create or edit a row widget. Category: **User Interface Functions** Pass a valid existing bauiv1.Widget as 'edit' to modify it; otherwise a new one is created and returned. Arguments that are not set to None are applied to the Widget. """ import bauiv1 # pylint: disable=cyclic-import return bauiv1.Widget()
[docs] def scrollwidget( edit: bauiv1.Widget | None = None, parent: bauiv1.Widget | None = None, size: Sequence[float] | None = None, position: Sequence[float] | None = None, background: bool | None = None, selected_child: bauiv1.Widget | None = None, capture_arrows: bool = False, on_select_call: Callable | None = None, center_small_content: bool | None = None, color: Sequence[float] | None = None, highlight: bool | None = None, border_opacity: float | None = None, simple_culling_v: float | None = None, selection_loops_to_parent: bool | None = None, claims_left_right: bool | None = None, claims_up_down: bool | None = None, claims_tab: bool | None = None, autoselect: bool | None = None, ) -> bauiv1.Widget: """Create or edit a scroll widget. Category: **User Interface Functions** Pass a valid existing bauiv1.Widget as 'edit' to modify it; otherwise a new one is created and returned. Arguments that are not set to None are applied to the Widget. """ import bauiv1 # pylint: disable=cyclic-import return bauiv1.Widget()
[docs] def set_party_icon_always_visible(value: bool) -> None: """(internal)""" return None
[docs] def set_party_window_open(value: bool) -> None: """(internal)""" return None
[docs] def textwidget( edit: bauiv1.Widget | None = None, parent: bauiv1.Widget | None = None, size: Sequence[float] | None = None, position: Sequence[float] | None = None, text: str | bauiv1.Lstr | None = None, v_align: str | None = None, h_align: str | None = None, editable: bool | None = None, padding: float | None = None, on_return_press_call: Callable[[], None] | None = None, on_activate_call: Callable[[], None] | None = None, selectable: bool | None = None, query: bauiv1.Widget | None = None, max_chars: int | None = None, color: Sequence[float] | None = None, click_activate: bool | None = None, on_select_call: Callable[[], None] | None = None, always_highlight: bool | None = None, draw_controller: bauiv1.Widget | None = None, scale: float | None = None, corner_scale: float | None = None, description: str | bauiv1.Lstr | None = None, transition_delay: float | None = None, maxwidth: float | None = None, max_height: float | None = None, flatness: float | None = None, shadow: float | None = None, autoselect: bool | None = None, rotate: float | None = None, enabled: bool | None = None, force_internal_editing: bool | None = None, always_show_carat: bool | None = None, big: bool | None = None, extra_touch_border_scale: float | None = None, res_scale: float | None = None, query_max_chars: bauiv1.Widget | None = None, query_description: bauiv1.Widget | None = None, adapter_finished: bool | None = None, glow_type: str | None = None, allow_clear_button: bool | None = None, ) -> bauiv1.Widget: """Create or edit a text widget. Category: **User Interface Functions** Pass a valid existing bauiv1.Widget as 'edit' to modify it; otherwise a new one is created and returned. Arguments that are not set to None are applied to the Widget. """ import bauiv1 # pylint: disable=cyclic-import return bauiv1.Widget()
[docs] def toolbar_test() -> bool: """(internal)""" return bool()
[docs] def uibounds() -> tuple[float, float, float, float]: """(internal) Returns a tuple of 4 values: (x-min, x-max, y-min, y-max) representing the range of values that can be plugged into a root level bauiv1.ContainerWidget's stack_offset value while guaranteeing that its center remains onscreen. """ return (0.0, 0.0, 0.0, 0.0)
[docs] def widget( edit: bauiv1.Widget | None = None, up_widget: bauiv1.Widget | None = None, down_widget: bauiv1.Widget | None = None, left_widget: bauiv1.Widget | None = None, right_widget: bauiv1.Widget | None = None, show_buffer_top: float | None = None, show_buffer_bottom: float | None = None, show_buffer_left: float | None = None, show_buffer_right: float | None = None, autoselect: bool | None = None, ) -> None: """Edit common attributes of any widget. Category: **User Interface Functions** Unlike other UI calls, this can only be used to edit, not to create. """ return None