From 7e9cb030d7fd168dc64bdf81efa5fcf1737d48ec Mon Sep 17 00:00:00 2001 From: Ayush Saini <36878972+imayushsaini@users.noreply.github.com> Date: Sun, 20 Aug 2023 17:48:36 +0530 Subject: [PATCH] added dummy internal modules --- dist/dummymodules/_babase.py | 1320 ++++++++++++++++++++ dist/dummymodules/_baclassic.py | 52 + dist/dummymodules/_baplus.py | 250 ++++ dist/dummymodules/_bascenev1.py | 1803 ++++++++++++++++++++++++++++ dist/dummymodules/_batemplatefs.py | 56 + dist/dummymodules/_bauiv1.py | 644 ++++++++++ 6 files changed, 4125 insertions(+) create mode 100644 dist/dummymodules/_babase.py create mode 100644 dist/dummymodules/_baclassic.py create mode 100644 dist/dummymodules/_baplus.py create mode 100644 dist/dummymodules/_bascenev1.py create mode 100644 dist/dummymodules/_batemplatefs.py create mode 100644 dist/dummymodules/_bauiv1.py diff --git a/dist/dummymodules/_babase.py b/dist/dummymodules/_babase.py new file mode 100644 index 0000000..a9ccccc --- /dev/null +++ b/dist/dummymodules/_babase.py @@ -0,0 +1,1320 @@ +# Released under the MIT License. See LICENSE for details. +# +"""A dummy stub module for the real _babase. + +The real _babase 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, overload, Sequence, TypeVar + +if TYPE_CHECKING: + from typing import Any, Callable + from babase import App + import babase + + +_T = TypeVar('_T') + +app: App + + +def _uninferrable() -> Any: + """Get an "Any" in mypy and "uninferrable" in Pylint.""" + # pylint: disable=undefined-variable + return _not_a_real_variable # type: ignore + + +class AppTimer: + """Timers are used to run code at later points in time. + + Category: **General Utility Classes** + + This class encapsulates a timer based on app-time. + The underlying timer will be destroyed when this object is no longer + referenced. If you do not want to worry about keeping a reference to + your timer around, use the babase.apptimer() function instead to get a + one-off timer. + + ##### Arguments + ###### time + > Length of time in seconds that the timer will wait before firing. + + ###### call + > A callable Python object. Remember that the timer will retain a + strong reference to the callable for as long as it exists, so you + may want to look into concepts such as babase.WeakCall if that is not + desired. + + ###### repeat + > If True, the timer will fire repeatedly, with each successive + firing having the same delay as the first. + + ##### Example + + Use a Timer object to print repeatedly for a few seconds: + ... def say_it(): + ... babase.screenmessage('BADGER!') + ... def stop_saying_it(): + ... global g_timer + ... g_timer = None + ... babase.screenmessage('MUSHROOM MUSHROOM!') + ... # Create our timer; it will run as long as we have the self.t ref. + ... g_timer = babase.AppTimer(0.3, say_it, repeat=True) + ... # Now fire off a one-shot timer to kill it. + ... babase.apptimer(3.89, stop_saying_it) + """ + + def __init__( + self, time: float, call: Callable[[], Any], repeat: bool = False + ) -> None: + pass + + +class ContextCall: + """A context-preserving callable. + + Category: **General Utility Classes** + + A ContextCall wraps a callable object along with a reference + to the current context (see babase.ContextRef); it handles restoring + the context when run and automatically clears itself if the context + it belongs to dies. + + Generally you should not need to use this directly; all standard + Ballistica callbacks involved with timers, materials, UI functions, + etc. handle this under-the-hood so you don't have to worry about it. + The only time it may be necessary is if you are implementing your + own callbacks, such as a worker thread that does some action and then + runs some game code when done. By wrapping said callback in one of + these, you can ensure that you will not inadvertently be keeping the + current activity alive or running code in a torn-down (expired) + context_ref. + + You can also use babase.WeakCall for similar functionality, but + ContextCall has the added bonus that it will not run during context_ref + shutdown, whereas babase.WeakCall simply looks at whether the target + object instance still exists. + + ##### Examples + **Example A:** code like this can inadvertently prevent our activity + (self) from ending until the operation completes, since the bound + method we're passing (self.dosomething) contains a strong-reference + to self). + >>> start_some_long_action(callback_when_done=self.dosomething) + + **Example B:** in this case our activity (self) can still die + properly; the callback will clear itself when the activity starts + shutting down, becoming a harmless no-op and releasing the reference + to our activity. + + >>> start_long_action( + ... callback_when_done=babase.ContextCall(self.mycallback)) + """ + + def __init__(self, call: Callable) -> None: + pass + + def __call__(self) -> None: + """Support for calling.""" + pass + + +class ContextRef: + """Store or use a ballistica context. + + Category: **General Utility Classes** + + Many operations such as bascenev1.newnode() or bascenev1.gettexture() + operate implicitly on a current 'context'. A context is some sort of + state that functionality can implicitly use. Context determines, for + example, which scene nodes or textures get added to without having to + specify it explicitly in the newnode()/gettexture() call. Contexts can + also affect object lifecycles; for example a babase.ContextCall will + become a no-op when the context it was created in is destroyed. + + In general, if you are a modder, you should not need to worry about + contexts; mod code should mostly be getting run in the correct + context and timers and other callbacks will take care of saving + and restoring contexts automatically. There may be rare cases, + however, where you need to deal directly with contexts, and that is + where this class comes in. + + Creating a babase.ContextRef() will capture a reference to the current + context. Other modules may provide ways to access their contexts; for + example a bascenev1.Activity instance has a 'context' attribute. You + can also use babase.ContextRef.empty() to create a reference to *no* + context. Some code such as UI calls may expect this and may complain + if you try to use them within a context. + + ##### Usage + ContextRefs are generally used with the Python 'with' statement, which + sets the context they point to as current on entry and resets it to + the previous value on exit. + + ##### Example + Explicitly create a few UI bits with no context set. + (UI stuff may complain if called within a context): + >>> with bui.ContextRef.empty(): + ... my_container = bui.containerwidget() + """ + + def __init__( + self, + ) -> None: + pass + + def __enter__(self) -> None: + """Support for "with" statement.""" + pass + + def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> Any: + """Support for "with" statement.""" + pass + + @classmethod + def empty(cls) -> ContextRef: + """Return a ContextRef pointing to no context. + + This is useful when code should be run free of a context. + For example, UI code generally insists on being run this way. + Otherwise, callbacks set on the UI could inadvertently stop working + due to a game activity ending, which would be unintuitive behavior. + """ + return ContextRef() + + def is_empty(self) -> bool: + """Whether the context was created as empty.""" + return bool() + + def is_expired(self) -> bool: + """Whether the context has expired.""" + return bool() + + +class DisplayTimer: + """Timers are used to run code at later points in time. + + Category: **General Utility Classes** + + This class encapsulates a timer based on display-time. + The underlying timer will be destroyed when this object is no longer + referenced. If you do not want to worry about keeping a reference to + your timer around, use the babase.displaytimer() function instead to get a + one-off timer. + + Display-time is a time value intended to be used for animation and + other visual purposes. It will generally increment by a consistent + amount each frame. It will pass at an overall similar rate to AppTime, + but trades accuracy for smoothness. + + ##### Arguments + ###### time + > Length of time in seconds that the timer will wait before firing. + + ###### call + > A callable Python object. Remember that the timer will retain a + strong reference to the callable for as long as it exists, so you + may want to look into concepts such as babase.WeakCall if that is not + desired. + + ###### repeat + > If True, the timer will fire repeatedly, with each successive + firing having the same delay as the first. + + ##### Example + + Use a Timer object to print repeatedly for a few seconds: + ... def say_it(): + ... babase.screenmessage('BADGER!') + ... def stop_saying_it(): + ... global g_timer + ... g_timer = None + ... babase.screenmessage('MUSHROOM MUSHROOM!') + ... # Create our timer; it will run as long as we have the self.t ref. + ... g_timer = babase.DisplayTimer(0.3, say_it, repeat=True) + ... # Now fire off a one-shot timer to kill it. + ... babase.displaytimer(3.89, stop_saying_it) + """ + + def __init__( + self, time: float, call: Callable[[], Any], repeat: bool = False + ) -> None: + pass + + +class FeatureSetData: + """Internal.""" + + pass + + +class SimpleSound: + """A simple sound wrapper for internal use. + + Do not use for gameplay code as it will only play locally. + """ + + def play(self) -> None: + """Play the sound locally.""" + return None + + +class Vec3(Sequence[float]): + """A vector of 3 floats. + + Category: **General Utility Classes** + + These can be created the following ways (checked in this order): + - with no args, all values are set to 0 + - with a single numeric arg, all values are set to that value + - with a single three-member sequence arg, sequence values are copied + - otherwise assumes individual x/y/z args (positional or keywords) + """ + + x: float + """The vector's X component.""" + + y: float + """The vector's Y component.""" + + z: float + """The vector's Z component.""" + + # pylint: disable=function-redefined + + @overload + def __init__(self) -> None: + pass + + @overload + def __init__(self, value: float): + pass + + @overload + def __init__(self, values: Sequence[float]): + pass + + @overload + def __init__(self, x: float, y: float, z: float): + pass + + def __init__(self, *args: Any, **kwds: Any): + pass + + def __add__(self, other: Vec3) -> Vec3: + return self + + def __sub__(self, other: Vec3) -> Vec3: + return self + + @overload + def __mul__(self, other: float) -> Vec3: + return self + + @overload + def __mul__(self, other: Sequence[float]) -> Vec3: + return self + + def __mul__(self, other: Any) -> Any: + return self + + @overload + def __rmul__(self, other: float) -> Vec3: + return self + + @overload + def __rmul__(self, other: Sequence[float]) -> Vec3: + return self + + def __rmul__(self, other: Any) -> Any: + return self + + # (for index access) + def __getitem__(self, typeargs: Any) -> Any: + return 0.0 + + def __len__(self) -> int: + return 3 + + # (for iterator access) + def __iter__(self) -> Any: + return self + + def __next__(self) -> float: + return 0.0 + + def __neg__(self) -> Vec3: + return self + + def __setitem__(self, index: int, val: float) -> None: + pass + + def cross(self, other: Vec3) -> Vec3: + """Returns the cross product of this vector and another.""" + return Vec3() + + def dot(self, other: Vec3) -> float: + """Returns the dot product of this vector and another.""" + return float() + + def length(self) -> float: + """Returns the length of the vector.""" + return float() + + def normalized(self) -> Vec3: + """Returns a normalized version of the vector.""" + return Vec3() + + +def add_clean_frame_callback(call: Callable) -> None: + """(internal) + + Provide an object to be called once the next non-progress-bar-frame has + been rendered. Useful for queueing things to load in the background + without elongating any current progress-bar-load. + """ + return None + + +def android_get_external_files_dir() -> str: + """(internal) + + Returns the android external storage path, or None if there is none on + this device + """ + return str() + + +def app_instance_uuid() -> str: + """(internal)""" + return str() + + +def appname() -> str: + """(internal)""" + return str() + + +def appnameupper() -> str: + """(internal) + + Return whether this build of the game can display full unicode such as + Emoji, Asian languages, etc. + """ + return str() + + +def apptime() -> babase.AppTime: + """Return the current app-time in seconds. + + Category: **General Utility Functions** + + App-time is a monotonic time value; it starts at 0.0 when the app + launches and will never jump by large amounts or go backwards, even if + the system time changes. Its progression will pause when the app is in + a suspended state. + + Note that the AppTime returned here is simply float; it just has a + unique type in the type-checker's eyes to help prevent it from being + accidentally used with time functionality expecting other time types. + """ + import babase # pylint: disable=cyclic-import + + return babase.AppTime(0.0) + + +def apptimer(time: float, call: Callable[[], Any]) -> None: + """Schedule a callable object to run based on app-time. + + Category: **General Utility Functions** + + This function creates a one-off timer which cannot be canceled or + modified once created. If you require the ability to do so, or need + a repeating timer, use the babase.AppTimer class instead. + + ##### Arguments + ###### time (float) + > Length of time in seconds that the timer will wait before firing. + + ###### call (Callable[[], Any]) + > A callable Python object. Note that the timer will retain a + strong reference to the callable for as long as the timer exists, so you + may want to look into concepts such as babase.WeakCall if that is not + desired. + + ##### Examples + Print some stuff through time: + >>> babase.screenmessage('hello from now!') + >>> babase.apptimer(1.0, babase.Call(babase.screenmessage, + 'hello from the future!')) + >>> babase.apptimer(2.0, babase.Call(babase.screenmessage, + ... 'hello from the future 2!')) + """ + return None + + +def can_display_full_unicode() -> bool: + """(internal)""" + return bool() + + +def charstr(char_id: babase.SpecialChar) -> str: + """Get a unicode string representing a special character. + + Category: **General Utility Functions** + + Note that these utilize the private-use block of unicode characters + (U+E000-U+F8FF) and are specific to the game; exporting or rendering + them elsewhere will be meaningless. + + See babase.SpecialChar for the list of available characters. + """ + return str() + + +def clipboard_get_text() -> str: + """Return text currently on the system clipboard. + + Category: **General Utility Functions** + + Ensure that babase.clipboard_has_text() returns True before calling + this function. + """ + return str() + + +def clipboard_has_text() -> bool: + """Return whether there is currently text on the clipboard. + + Category: **General Utility Functions** + + This will return False if no system clipboard is available; no need + to call babase.clipboard_is_supported() separately. + """ + return bool() + + +def clipboard_is_supported() -> bool: + """Return whether this platform supports clipboard operations at all. + + Category: **General Utility Functions** + + If this returns False, UIs should not show 'copy to clipboard' + buttons, etc. + """ + return bool() + + +def clipboard_set_text(value: str) -> None: + """Copy a string to the system clipboard. + + Category: **General Utility Functions** + + Ensure that babase.clipboard_is_supported() returns True before adding + buttons/etc. that make use of this functionality. + """ + return None + + +def commit_config(config: str) -> None: + """(internal)""" + return None + + +def contains_python_dist() -> bool: + """(internal)""" + return bool() + + +def debug_print_py_err() -> None: + """(internal) + + Debugging func for tracking leaked Python errors in the C++ layer. + """ + return None + + +def display_log(name: str, level: str, message: str) -> None: + """(internal) + + Sends a log message to the in-game console and any per-platform + log destinations (Android log, etc.). This generally is not called + directly and should instead be fed Python logging output. + """ + return None + + +def displaytime() -> babase.DisplayTime: + """Return the current display-time in seconds. + + Category: **General Utility Functions** + + Display-time is a time value intended to be used for animation and other + visual purposes. It will generally increment by a consistent amount each + frame. It will pass at an overall similar rate to AppTime, but trades + accuracy for smoothness. + + Note that the value returned here is simply a float; it just has a + unique type in the type-checker's eyes to help prevent it from being + accidentally used with time functionality expecting other time types. + """ + import babase # pylint: disable=cyclic-import + + return babase.DisplayTime(0.0) + + +def displaytimer(time: float, call: Callable[[], Any]) -> None: + """Schedule a callable object to run based on display-time. + + Category: **General Utility Functions** + + This function creates a one-off timer which cannot be canceled or + modified once created. If you require the ability to do so, or need + a repeating timer, use the babase.DisplayTimer class instead. + + Display-time is a time value intended to be used for animation and other + visual purposes. It will generally increment by a consistent amount each + frame. It will pass at an overall similar rate to AppTime, but trades + accuracy for smoothness. + + ##### Arguments + ###### time (float) + > Length of time in seconds that the timer will wait before firing. + + ###### call (Callable[[], Any]) + > A callable Python object. Note that the timer will retain a + strong reference to the callable for as long as the timer exists, so you + may want to look into concepts such as babase.WeakCall if that is not + desired. + + ##### Examples + Print some stuff through time: + >>> babase.screenmessage('hello from now!') + >>> babase.displaytimer(1.0, babase.Call(babase.screenmessage, + ... 'hello from the future!')) + >>> babase.displaytimer(2.0, babase.Call(babase.screenmessage, + ... 'hello from the future 2!')) + """ + return None + + +def do_apply_app_config() -> None: + """(internal)""" + return None + + +def do_once() -> bool: + """Return whether this is the first time running a line of code. + + Category: **General Utility Functions** + + This is used by 'print_once()' type calls to keep from overflowing + logs. The call functions by registering the filename and line where + The call is made from. Returns True if this location has not been + registered already, and False if it has. + + ##### Example + This print will only fire for the first loop iteration: + >>> for i in range(10): + ... if babase.do_once(): + ... print('HelloWorld once from loop!') + """ + return bool() + + +def ehv() -> None: + """(internal)""" + return None + + +def empty_app_mode_activate() -> None: + """(internal)""" + return None + + +def empty_app_mode_deactivate() -> None: + """(internal)""" + return None + + +def empty_app_mode_handle_intent_default() -> None: + """(internal)""" + return None + + +def empty_app_mode_handle_intent_exec(command: str) -> None: + """(internal)""" + return None + + +def env() -> dict: + """(internal) + + Returns a dict containing general info about the operating environment + such as version, platform, etc. + This info is now exposed through babase.App; refer to those docs for + info on specific elements. + """ + return dict() + + +def evaluate_lstr(value: str) -> str: + """(internal)""" + return str() + + +def exec_arg() -> str | None: + """(internal)""" + return '' + + +def fade_screen( + to: int = 0, time: float = 0.25, endcall: Callable[[], None] | None = None +) -> None: + """(internal) + + Fade the local game screen in our out from black over a duration of + time. if "to" is 0, the screen will fade out to black. Otherwise it + will fade in from black. If endcall is provided, it will be run after a + completely faded frame is drawn. + """ + return None + + +def fatal_error(message: str) -> None: + """Trigger a fatal error. Use this in situations where it is not possible + for the engine to continue on in a useful way. This can sometimes + help provide more clear information at the exact source of a problem + as compared to raising an Exception. In the vast majority of cases, + however, Exceptions should be preferred. + """ + return None + + +def get_appconfig_builtin_keys() -> list[str]: + """(internal)""" + return ['blah', 'blah2'] + + +def get_appconfig_default_value(key: str) -> Any: + """(internal)""" + return _uninferrable() + + +def get_camera_position() -> tuple[float, ...]: + """(internal) + + WARNING: these camera controls will not apply to network clients + and may behave unpredictably in other ways. Use them only for + tinkering. + """ + return (0.0, 0.0, 0.0) + + +def get_camera_target() -> tuple[float, ...]: + """(internal) + + WARNING: these camera controls will not apply to network clients + and may behave unpredictably in other ways. Use them only for + tinkering. + """ + return (0.0, 0.0, 0.0) + + +def get_display_resolution() -> tuple[int, int] | None: + """(internal) + + Return the currently selected display resolution for fullscreen + display. Returns None if resolutions cannot be directly set. + """ + return (0, 0) + + +def get_idle_time() -> int: + """(internal) + + Returns the amount of time since any game input has been received. + """ + return int() + + +def get_immediate_return_code() -> int | None: + """(internal)""" + return 0 + + +def get_low_level_config_value(key: str, default_value: int) -> int: + """(internal)""" + return int() + + +def get_max_graphics_quality() -> str: + """(internal) + + Return the max graphics-quality supported on the current hardware. + """ + return str() + + +def get_replays_dir() -> str: + """(internal)""" + return str() + + +def get_string_height(string: str, suppress_warning: bool = False) -> float: + """(internal) + + Given a string, returns its height using the standard small app + font. + """ + return float() + + +def get_string_width(string: str, suppress_warning: bool = False) -> float: + """(internal) + + Given a string, returns its width using the standard small app + font. + """ + return float() + + +def get_thread_name() -> str: + """(internal) + + Returns the name of the current thread. + This may vary depending on platform and should not be used in logic; + only for debugging. + """ + return str() + + +def get_v1_cloud_log() -> str: + """(internal)""" + return str() + + +def get_v1_cloud_log_file_path() -> str: + """(internal) + + Return the path to the app log file. + """ + return str() + + +def get_volatile_data_directory() -> str: + """(internal) + + Return the path to the app volatile data directory. + This directory is for data generated by the app that does not + need to be backed up and can be recreated if necessary. + """ + return str() + + +def getapp() -> babase.App: + """(internal)""" + import babase # pylint: disable=cyclic-import + + return babase.App() + + +def getsimplesound(name: str) -> SimpleSound: + """(internal).""" + return SimpleSound() + + +def has_gamma_control() -> bool: + """(internal) + + Returns whether the system can adjust overall screen gamma) + """ + return bool() + + +def has_user_run_commands() -> bool: + """(internal)""" + return bool() + + +def hastouchscreen() -> bool: + """(internal) + + Return whether a touchscreen is present on the current device. + """ + return bool() + + +def have_chars(text: str) -> bool: + """(internal)""" + return bool() + + +def have_permission(permission: babase.Permission) -> bool: + """(internal)""" + return bool() + + +def in_logic_thread() -> bool: + """(internal) + + Returns whether or not the current thread is the logic thread. + """ + return bool() + + +def increment_analytics_count(name: str, increment: int = 1) -> None: + """(internal)""" + return None + + +def increment_analytics_count_raw_2( + name: str, uses_increment: bool = True, increment: int = 1 +) -> None: + """(internal)""" + return None + + +def increment_analytics_counts_raw(name: str, increment: int = 1) -> None: + """(internal)""" + return None + + +def is_log_full() -> bool: + """(internal)""" + return bool() + + +def is_os_playing_music() -> bool: + """(internal) + + Tells whether the OS is currently playing music of some sort. + + (Used to determine whether the game should avoid playing its own) + """ + return bool() + + +def is_running_on_fire_tv() -> bool: + """(internal)""" + return bool() + + +def is_running_on_ouya() -> bool: + """(internal)""" + return bool() + + +def is_xcode_build() -> bool: + """(internal)""" + return bool() + + +def lifecyclelog(message: str) -> None: + """(internal)""" + return None + + +def lock_all_input() -> None: + """(internal) + + Prevents all keyboard, mouse, and gamepad events from being processed. + """ + return None + + +def login_adapter_back_end_active_change(login_type: str, active: bool) -> None: + """(internal)""" + return None + + +def login_adapter_get_sign_in_token(login_type: str, attempt_id: int) -> None: + """(internal)""" + return None + + +def mac_music_app_get_library_source() -> None: + """(internal)""" + return None + + +def mac_music_app_get_playlists() -> list[str]: + """(internal)""" + return ['blah', 'blah2'] + + +def mac_music_app_get_volume() -> int: + """(internal)""" + return int() + + +def mac_music_app_init() -> None: + """(internal)""" + return None + + +def mac_music_app_play_playlist(playlist: str) -> bool: + """(internal)""" + return bool() + + +def mac_music_app_set_volume(volume: int) -> None: + """(internal)""" + return None + + +def mac_music_app_stop() -> None: + """(internal)""" + return None + + +def mark_log_sent() -> None: + """(internal)""" + return None + + +def music_player_play(files: Any) -> None: + """(internal) + + Starts internal music file playback (for internal use) + """ + return None + + +def music_player_set_volume(volume: float) -> None: + """(internal) + + Sets internal music player volume (for internal use) + """ + return None + + +def music_player_shutdown() -> None: + """(internal) + + Finalizes internal music file playback (for internal use) + """ + return None + + +def music_player_stop() -> None: + """(internal) + + Stops internal music file playback (for internal use) + """ + return None + + +def native_stack_trace() -> str | None: + """Return a native stack trace as a string, or None if not available. + + Category: **General Utility Functions** + + Stack traces contain different data and formatting across platforms. + Only use them for debugging. + """ + return '' + + +def on_app_running() -> None: + """(internal)""" + return None + + +def on_initial_app_mode_set() -> None: + """(internal)""" + return None + + +def open_dir_externally(path: str) -> None: + """(internal) + + Open the provided dir in the default external app. + """ + return None + + +def pre_env() -> dict: + """(internal) + + Returns a dict containing general info about the operating environment + such as version, platform, etc. + This info is now exposed through babase.App; refer to those docs for + info on specific elements. + """ + return dict() + + +def print_context() -> None: + """(internal) + + Prints info about the current context_ref state; for debugging. + """ + return None + + +def print_load_info() -> None: + """(internal) + + Category: **General Utility Functions** + """ + return None + + +def pushcall( + call: Callable, + from_other_thread: bool = False, + suppress_other_thread_warning: bool = False, + other_thread_use_fg_context: bool = False, + raw: bool = False, +) -> None: + """Push a call to the logic event-loop. + Category: **General Utility Functions** + + This call expects to be used in the logic thread, and will automatically + save and restore the babase.Context to behave seamlessly. + + If you want to push a call from outside of the logic thread, + however, you can pass 'from_other_thread' as True. In this case + the call will always run in the UI context_ref on the logic thread + or whichever context_ref is in the foreground if + other_thread_use_fg_context is True. + Passing raw=True will disable thread checks and context_ref sets/restores. + """ + return None + + +# noinspection PyShadowingBuiltins +def quit(soft: bool = False, back: bool = False) -> None: + """Quit the game. + + Category: **General Utility Functions** + + On systems like Android, 'soft' will end the activity but keep the + app running. + """ + return None + + +def reached_end_of_babase() -> None: + """A simple user-agent-string that should be used in any web requests made + on behalf of the engine. + """ + return None + + +def reload_media() -> None: + """(internal) + + Reload all currently loaded game media; useful for + development/debugging. + """ + return None + + +def request_permission(permission: babase.Permission) -> None: + """(internal)""" + return None + + +def resolve_appconfig_value(key: str) -> Any: + """(internal)""" + return _uninferrable() + + +def run_app() -> None: + """Run the app to completion. + + Note that this only works on platforms/builds where ballistica + manages its own event loop. + """ + return None + + +def safecolor( + color: Sequence[float], target_intensity: float = 0.6 +) -> tuple[float, ...]: + """Given a color tuple, return a color safe to display as text. + + Category: **General Utility Functions** + + Accepts tuples of length 3 or 4. This will slightly brighten very + dark colors, etc. + """ + return (0.0, 0.0, 0.0) + + +def screenmessage( + message: str | babase.Lstr, + color: Sequence[float] | None = None, + log: bool = False, +) -> None: + """Print a message to the local client's screen, in a given color. + + Category: **General Utility Functions** + + Note that this version of the function is purely for local display. + To broadcast screen messages in network play, look for methods such as + broadcastmessage() provided by the scene-version packages. + """ + return None + + +def set_analytics_screen(screen: str) -> None: + """Used for analytics to see where in the app players spend their time. + + Category: **General Utility Functions** + + Generally called when opening a new window or entering some UI. + 'screen' should be a string description of an app location + ('Main Menu', etc.) + """ + return None + + +def set_camera_manual(value: bool) -> None: + """(internal) + + WARNING: these camera controls will not apply to network clients + and may behave unpredictably in other ways. Use them only for + tinkering. + """ + return None + + +def set_camera_position(x: float, y: float, z: float) -> None: + """(internal) + + WARNING: these camera controls will not apply to network clients + and may behave unpredictably in other ways. Use them only for + tinkering. + """ + return None + + +def set_camera_target(x: float, y: float, z: float) -> None: + """(internal) + + WARNING: these camera controls will not apply to network clients + and may behave unpredictably in other ways. Use them only for + tinkering. + """ + return None + + +def set_internal_language_keys( + listobj: list[tuple[str, str]], random_names_list: list[tuple[str, str]] +) -> None: + """(internal)""" + return None + + +def set_low_level_config_value(key: str, value: int) -> None: + """(internal)""" + return None + + +def set_platform_misc_read_vals(mode: str) -> None: + """(internal)""" + return None + + +def set_stress_testing(testing: bool, player_count: int) -> None: + """(internal)""" + return None + + +def set_thread_name(name: str) -> None: + """(internal) + + Sets the name of the current thread (on platforms where this is + available). EventLoop names are only for debugging and should + not be used in logic, as naming behavior can vary across platforms. + """ + return None + + +def set_ui_input_device(input_device_id: int | None) -> None: + """(internal) + + Sets the input-device that currently owns the user interface. + """ + return None + + +def setup_sigint() -> None: + """(internal)""" + return None + + +def show_progress_bar() -> None: + """(internal) + + Category: **General Utility Functions** + """ + return None + + +def submit_analytics_counts() -> None: + """(internal)""" + return None + + +def unlock_all_input() -> None: + """(internal) + + Resumes normal keyboard, mouse, and gamepad event processing. + """ + return None + + +def user_agent_string() -> str: + """(internal)""" + return str() + + +def user_ran_commands() -> None: + """(internal)""" + return None + + +def v1_cloud_log(message: str) -> None: + """(internal) + + Push messages to the old v1 cloud log. + """ + return None + + +def workspaces_in_use() -> bool: + """(internal) + + Returns whether workspaces functionality has been enabled at + any point this run. + """ + return bool() diff --git a/dist/dummymodules/_baclassic.py b/dist/dummymodules/_baclassic.py new file mode 100644 index 0000000..4f185bd --- /dev/null +++ b/dist/dummymodules/_baclassic.py @@ -0,0 +1,52 @@ +# Released under the MIT License. See LICENSE for details. +# +"""A dummy stub module for the real _baclassic. + +The real _baclassic 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, TypeVar + +if TYPE_CHECKING: + from typing import Any, Callable + + +_T = TypeVar('_T') + + +def _uninferrable() -> Any: + """Get an "Any" in mypy and "uninferrable" in Pylint.""" + # pylint: disable=undefined-variable + return _not_a_real_variable # type: ignore + + +def value_test( + arg: str, change: float | None = None, absolute: float | None = None +) -> float: + """(internal)""" + return float() diff --git a/dist/dummymodules/_baplus.py b/dist/dummymodules/_baplus.py new file mode 100644 index 0000000..e24c812 --- /dev/null +++ b/dist/dummymodules/_baplus.py @@ -0,0 +1,250 @@ +# Released under the MIT License. See LICENSE for details. +# +"""A dummy stub module for the real _baplus. + +The real _baplus 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, TypeVar + +if TYPE_CHECKING: + from typing import Any, Callable + + +_T = TypeVar('_T') + + +def _uninferrable() -> Any: + """Get an "Any" in mypy and "uninferrable" in Pylint.""" + # pylint: disable=undefined-variable + return _not_a_real_variable # type: ignore + + +def add_v1_account_transaction( + transaction: dict, callback: Callable | None = None +) -> None: + """(internal)""" + return None + + +def game_service_has_leaderboard(game: str, config: str) -> bool: + """(internal) + + Given a game and config string, returns whether there is a leaderboard + for it on the game service. + """ + return bool() + + +def get_master_server_address(source: int = -1, version: int = 1) -> str: + """(internal) + + Return the address of the master server. + """ + return str() + + +def get_news_show() -> str: + """(internal)""" + return str() + + +def get_price(item: str) -> str | None: + """(internal)""" + return '' + + +def get_purchased(item: str) -> bool: + """(internal)""" + return bool() + + +def get_purchases_state() -> int: + """(internal)""" + return int() + + +def get_v1_account_display_string(full: bool = True) -> str: + """(internal)""" + return str() + + +def get_v1_account_misc_read_val(name: str, default_value: Any) -> Any: + """(internal)""" + return _uninferrable() + + +def get_v1_account_misc_read_val_2(name: str, default_value: Any) -> Any: + """(internal)""" + return _uninferrable() + + +def get_v1_account_misc_val(name: str, default_value: Any) -> Any: + """(internal)""" + return _uninferrable() + + +def get_v1_account_name() -> str: + """(internal)""" + return str() + + +def get_v1_account_public_login_id() -> str | None: + """(internal)""" + return '' + + +def get_v1_account_state() -> str: + """(internal)""" + return str() + + +def get_v1_account_state_num() -> int: + """(internal)""" + return int() + + +def get_v1_account_ticket_count() -> int: + """(internal) + + Returns the number of tickets for the current account. + """ + return int() + + +def get_v1_account_type() -> str: + """(internal)""" + return str() + + +def get_v2_fleet() -> str: + """(internal)""" + return str() + + +def have_outstanding_v1_account_transactions() -> bool: + """(internal)""" + return bool() + + +def in_game_purchase(item: str, price: int) -> None: + """(internal)""" + return None + + +def is_blessed() -> bool: + """(internal)""" + return bool() + + +def mark_config_dirty() -> None: + """(internal) + + Category: General Utility Functions + """ + return None + + +def on_app_loading() -> None: + """(internal)""" + return None + + +def power_ranking_query(callback: Callable, season: Any = None) -> None: + """(internal)""" + return None + + +def purchase(item: str) -> None: + """(internal)""" + return None + + +def report_achievement(achievement: str, pass_to_account: bool = True) -> None: + """(internal)""" + return None + + +def reset_achievements() -> None: + """(internal)""" + return None + + +def restore_purchases() -> None: + """(internal)""" + return None + + +def run_v1_account_transactions() -> None: + """(internal)""" + return None + + +def sign_in_v1(account_type: str) -> None: + """(internal) + + Category: General Utility Functions + """ + return None + + +def sign_out_v1(v2_embedded: bool = False) -> None: + """(internal) + + Category: General Utility Functions + """ + return None + + +def submit_score( + game: str, + config: str, + name: Any, + score: int | None, + callback: Callable, + order: str = 'increasing', + tournament_id: str | None = None, + score_type: str = 'points', + campaign: str | None = None, + level: str | None = None, +) -> None: + """(internal) + + Submit a score to the server; callback will be called with the results. + As a courtesy, please don't send fake scores to the server. I'd prefer + to devote my time to improving the game instead of trying to make the + score server more mischief-proof. + """ + return None + + +def tournament_query( + callback: Callable[[dict | None], None], args: dict +) -> None: + """(internal)""" + return None diff --git a/dist/dummymodules/_bascenev1.py b/dist/dummymodules/_bascenev1.py new file mode 100644 index 0000000..96749f1 --- /dev/null +++ b/dist/dummymodules/_bascenev1.py @@ -0,0 +1,1803 @@ +# Released under the MIT License. See LICENSE for details. +# +"""A dummy stub module for the real _bascenev1. + +The real _bascenev1 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, overload, TypeVar + +if TYPE_CHECKING: + from typing import Any, Callable, Literal, Sequence + import babase + import bascenev1 + + +_T = TypeVar('_T') + + +def _uninferrable() -> Any: + """Get an "Any" in mypy and "uninferrable" in Pylint.""" + # pylint: disable=undefined-variable + return _not_a_real_variable # type: ignore + + +class ActivityData: + """(internal)""" + + def context(self) -> bascenev1.ContextRef: + """Return a context-ref pointing to the activity.""" + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.ContextRef() + + def exists(self) -> bool: + """Returns whether the ActivityData still exists. + Most functionality will fail on a nonexistent instance. + """ + return bool() + + def expire(self) -> None: + """Expires the internal data for the activity""" + return None + + def make_foreground(self) -> None: + """Sets this activity as the foreground one in its session.""" + return None + + def start(self) -> None: + """Begins the activity running""" + return None + + +# noinspection PyShadowingNames +class BaseTimer: + """Timers are used to run code at later points in time. + + Category: **General Utility Classes** + + This class encapsulates a base-time timer in the current scene + context. + The underlying timer will be destroyed when either this object is + no longer referenced or when its Context (Activity, etc.) dies. If you + do not want to worry about keeping a reference to your timer around, + you should use the bascenev1.basetimer() function instead. + + ###### time (float) + > Length of time in seconds that the timer will wait + before firing. + + ###### call (Callable[[], Any]) + > A callable Python object. Remember that the timer will retain a + strong reference to the callable for as long as it exists, so you + may want to look into concepts such as babase.WeakCall if that is not + desired. + + ###### repeat (bool) + > If True, the timer will fire repeatedly, with each successive + firing having the same delay as the first. + + ##### Example + + Use a BaseTimer object to print repeatedly for a few seconds: + >>> import bascenev1 as bs + ... def say_it(): + ... bs.screenmessage('BADGER!') + ... def stop_saying_it(): + ... global g_timer + ... g_timer = None + ... bs.screenmessage('MUSHROOM MUSHROOM!') + ... # Create our timer; it will run as long as we have the self.t ref. + ... g_timer = bs.BaseTimer(0.3, say_it, repeat=True) + ... # Now fire off a one-shot timer to kill it. + ... bs.basetimer(3.89, stop_saying_it) + """ + + def __init__( + self, time: float, call: Callable[[], Any], repeat: bool = False + ) -> None: + pass + + +class CollisionMesh: + """A reference to a collision-mesh. + + Category: **Asset Classes** + + Use bascenev1.getcollisionmesh() to instantiate one. + """ + + pass + + +class Data: + """A reference to a data object. + + Category: **Asset Classes** + + Use bascenev1.getdata() to instantiate one. + """ + + def getvalue(self) -> Any: + """Return the data object's value. + + This can consist of anything representable by json (dicts, lists, + numbers, bools, None, etc). + Note that this call will block if the data has not yet been loaded, + so it can be beneficial to plan a short bit of time between when + the data object is requested and when it's value is accessed. + """ + return _uninferrable() + + +class InputDevice: + """An input-device such as a gamepad, touchscreen, or keyboard. + + Category: **Gameplay Classes** + """ + + allows_configuring: bool + """Whether the input-device can be configured.""" + + has_meaningful_button_names: bool + """Whether button names returned by this instance match labels + on the actual device. (Can be used to determine whether to show + them in controls-overlays, etc.).""" + + player: bascenev1.SessionPlayer | None + """The player associated with this input device.""" + + client_id: int + """The numeric client-id this device is associated with. + This is only meaningful for remote client inputs; for + all local devices this will be -1.""" + + name: str + """The name of the device.""" + + unique_identifier: str + """A string that can be used to persistently identify the device, + even among other devices of the same type. Used for saving + prefs, etc.""" + + id: int + """The unique numeric id of this device.""" + + instance_number: int + """The number of this device among devices of the same type.""" + + is_controller_app: bool + """Whether this input-device represents a locally-connected + controller-app.""" + + is_remote_client: bool + """Whether this input-device represents a remotely-connected + client.""" + + def __bool__(self) -> bool: + """Support for bool evaluation.""" + return bool(True) # Slight obfuscation. + + def detach_from_player(self) -> None: + """Detach the device from any player it is controlling. + + This applies both to local players and remote players. + """ + return None + + def exists(self) -> bool: + """Return whether the underlying device for this object is + still present. + """ + return bool() + + def get_axis_name(self, axis_id: int) -> str: + """Given an axis ID, return the name of the axis on this device. + + Can return an empty string if the value is not meaningful to humans. + """ + return str() + + def get_button_name(self, button_id: int) -> babase.Lstr: + """Given a button ID, return a human-readable name for that key/button. + + Can return an empty string if the value is not meaningful to humans. + """ + import babase # pylint: disable=cyclic-import + + return babase.Lstr(value='') + + def get_default_player_name(self) -> str: + """(internal) + + Returns the default player name for this device. (used for the 'random' + profile) + """ + return str() + + def get_player_profiles(self) -> dict: + """(internal)""" + return dict() + + def get_v1_account_name(self, full: bool) -> str: + """Returns the account name associated with this device. + + (can be used to get account names for remote players) + """ + return str() + + def is_attached_to_player(self) -> bool: + """Return whether this device is controlling a player of some sort. + + This can mean either a local player or a remote player. + """ + return bool() + + +class Material: + """An entity applied to game objects to modify collision behavior. + + Category: **Gameplay Classes** + + A material can affect physical characteristics, generate sounds, + or trigger callback functions when collisions occur. + + Materials are applied to 'parts', which are groups of one or more + rigid bodies created as part of a bascenev1.Node. Nodes can have any + number of parts, each with its own set of materials. Generally + materials are specified as array attributes on the Node. The `spaz` + node, for example, has various attributes such as `materials`, + `roller_materials`, and `punch_materials`, which correspond + to the various parts it creates. + + Use bascenev1.Material to instantiate a blank material, and then use + its babase.Material.add_actions() method to define what the material + does. + """ + + def __init__(self, label: str | None = None) -> None: + pass + + label: str + """A label for the material; only used for debugging.""" + + def add_actions( + self, actions: tuple, conditions: tuple | None = None + ) -> None: + """Add one or more actions to the material, optionally with conditions. + + ##### Conditions + Conditions are provided as tuples which can be combined + to form boolean logic. A single condition might look like + `('condition_name', cond_arg)`, or a more complex nested one + might look like `(('some_condition', cond_arg), 'or', + ('another_condition', cond2_arg))`. + + `'and'`, `'or'`, and `'xor'` are available to chain + together 2 conditions, as seen above. + + ##### Available Conditions + ###### `('they_have_material', material)` + > Does the part we're hitting have a given bascenev1.Material? + + ###### `('they_dont_have_material', material)` + > Does the part we're hitting not have a given bascenev1.Material? + + ###### `('eval_colliding')` + > Is `'collide'` true at this point + in material evaluation? (see the `modify_part_collision` action) + + ###### `('eval_not_colliding')` + > Is 'collide' false at this point + in material evaluation? (see the `modify_part_collision` action) + + ###### `('we_are_younger_than', age)` + > Is our part younger than `age` (in milliseconds)? + + ###### `('we_are_older_than', age)` + > Is our part older than `age` (in milliseconds)? + + ###### `('they_are_younger_than', age)` + > Is the part we're hitting younger than `age` (in milliseconds)? + + ###### `('they_are_older_than', age)` + > Is the part we're hitting older than `age` (in milliseconds)? + + ###### `('they_are_same_node_as_us')` + > Does the part we're hitting belong to the same bascenev1.Node as us? + + ###### `('they_are_different_node_than_us')` + > Does the part we're hitting belong to a different bascenev1.Node? + + ##### Actions + In a similar manner, actions are specified as tuples. + Multiple actions can be specified by providing a tuple + of tuples. + + ##### Available Actions + ###### `('call', when, callable)` + > Calls the provided callable; + `when` can be either `'at_connect'` or `'at_disconnect'`. + `'at_connect'` means to fire + when the two parts first come in contact; `'at_disconnect'` + means to fire once they cease being in contact. + + ###### `('message', who, when, message_obj)` + > Sends a message object; + `who` can be either `'our_node'` or `'their_node'`, `when` can be + `'at_connect'` or `'at_disconnect'`, and `message_obj` is the message + object to send. + This has the same effect as calling the node's + babase.Node.handlemessage() method. + + ###### `('modify_part_collision', attr, value)` + > Changes some + characteristic of the physical collision that will occur between + our part and their part. This change will remain in effect as + long as the two parts remain overlapping. This means if you have a + part with a material that turns `'collide'` off against parts + younger than 100ms, and it touches another part that is 50ms old, + it will continue to not collide with that part until they separate, + even if the 100ms threshold is passed. Options for attr/value are: + `'physical'` (boolean value; whether a *physical* response will + occur at all), `'friction'` (float value; how friction-y the + physical response will be), `'collide'` (boolean value; + whether *any* collision will occur at all, including non-physical + stuff like callbacks), `'use_node_collide'` + (boolean value; whether to honor modify_node_collision + overrides for this collision), `'stiffness'` (float value, + how springy the physical response is), `'damping'` (float + value, how damped the physical response is), `'bounce'` (float + value; how bouncy the physical response is). + + ###### `('modify_node_collision', attr, value)` + > Similar to + `modify_part_collision`, but operates at a node-level. + collision attributes set here will remain in effect as long as + *anything* from our part's node and their part's node overlap. + A key use of this functionality is to prevent new nodes from + colliding with each other if they appear overlapped; + if `modify_part_collision` is used, only the individual + parts that were overlapping would avoid contact, but other parts + could still contact leaving the two nodes 'tangled up'. Using + `modify_node_collision` ensures that the nodes must completely + separate before they can start colliding. Currently the only attr + available here is `'collide'` (a boolean value). + + ###### `('sound', sound, volume)` + > Plays a bascenev1.Sound when a collision + occurs, at a given volume, regardless of the collision speed/etc. + + ###### `('impact_sound', sound, targetImpulse, volume)` + > Plays a sound + when a collision occurs, based on the speed of impact. + Provide a bascenev1.Sound, a target-impulse, and a volume. + + ###### `('skid_sound', sound, targetImpulse, volume)` + > Plays a sound + during a collision when parts are 'scraping' against each other. + Provide a bascenev1.Sound, a target-impulse, and a volume. + + ###### `('roll_sound', sound, targetImpulse, volume)` + > Plays a sound + during a collision when parts are 'rolling' against each other. + Provide a bascenev1.Sound, a target-impulse, and a volume. + + ##### Examples + **Example 1:** create a material that lets us ignore + collisions against any nodes we touch in the first + 100 ms of our existence; handy for preventing us from + exploding outward if we spawn on top of another object: + >>> m = bascenev1.Material() + ... m.add_actions( + ... conditions=(('we_are_younger_than', 100), + ... 'or', ('they_are_younger_than', 100)), + ... actions=('modify_node_collision', 'collide', False)) + + **Example 2:** send a bascenev1.DieMessage to anything we touch, but + cause no physical response. This should cause any bascenev1.Actor to + drop dead: + >>> m = bascenev1.Material() + ... m.add_actions( + ... actions=(('modify_part_collision', 'physical', False), + ... ('message', 'their_node', 'at_connect', + ... bascenev1.DieMessage()))) + + **Example 3:** play some sounds when we're contacting the ground: + >>> m = bascenev1.Material() + ... m.add_actions( + ... conditions=('they_have_material', shared.footing_material), + ... actions=( + ('impact_sound', bascenev1.getsound('metalHit'), 2, 5), + ('skid_sound', bascenev1.getsound('metalSkid'), 2, 5))) + """ + return None + + +class Mesh: + """A reference to a mesh. + + Category: **Asset Classes** + + Meshes are used for drawing. + Use bascenev1.getmesh() to instantiate one. + """ + + pass + + +# noinspection PyShadowingBuiltins +class Node: + """Reference to a Node; the low level building block of a game. + + Category: **Gameplay Classes** + + At its core, a game is nothing more than a scene of Nodes + with attributes getting interconnected or set over time. + + A bascenev1.Node instance should be thought of as a weak-reference + to a game node; *not* the node itself. This means a Node's + lifecycle is completely independent of how many Python references + to it exist. To explicitly add a new node to the game, use + bascenev1.newnode(), and to explicitly delete one, + use bascenev1.Node.delete(). + babase.Node.exists() can be used to determine if a Node still points + to a live node in the game. + + You can use `ba.Node(None)` to instantiate an invalid + Node reference (sometimes used as attr values/etc). + """ + + # Note attributes: + # NOTE: I'm just adding *all* possible node attrs here + # now now since we have a single bascenev1.Node type; in the + # future I hope to create proper individual classes + # corresponding to different node types with correct + # attributes per node-type. + color: Sequence[float] = (0.0, 0.0, 0.0) + size: Sequence[float] = (0.0, 0.0, 0.0) + position: Sequence[float] = (0.0, 0.0, 0.0) + position_center: Sequence[float] = (0.0, 0.0, 0.0) + position_forward: Sequence[float] = (0.0, 0.0, 0.0) + punch_position: Sequence[float] = (0.0, 0.0, 0.0) + punch_velocity: Sequence[float] = (0.0, 0.0, 0.0) + velocity: Sequence[float] = (0.0, 0.0, 0.0) + name_color: Sequence[float] = (0.0, 0.0, 0.0) + tint_color: Sequence[float] = (0.0, 0.0, 0.0) + tint2_color: Sequence[float] = (0.0, 0.0, 0.0) + text: babase.Lstr | str = '' + texture: bascenev1.Texture | None = None + tint_texture: bascenev1.Texture | None = None + times: Sequence[int] = (1, 2, 3, 4, 5) + values: Sequence[float] = (1.0, 2.0, 3.0, 4.0) + offset: float = 0.0 + input0: float = 0.0 + input1: float = 0.0 + input2: float = 0.0 + input3: float = 0.0 + flashing: bool = False + scale: float | Sequence[float] = 0.0 + opacity: float = 0.0 + loop: bool = False + time1: int = 0 + time2: int = 0 + timemax: int = 0 + client_only: bool = False + materials: Sequence[bascenev1.Material] = () + roller_materials: Sequence[bascenev1.Material] = () + name: str = '' + punch_materials: Sequence[bascenev1.Material] = () + pickup_materials: Sequence[bascenev1.Material] = () + extras_material: Sequence[bascenev1.Material] = () + rotate: float = 0.0 + hold_node: bascenev1.Node | None = None + hold_body: int = 0 + host_only: bool = False + premultiplied: bool = False + source_player: bascenev1.Player | None = None + mesh_opaque: bascenev1.Mesh | None = None + mesh_transparent: bascenev1.Mesh | None = None + damage_smoothed: float = 0.0 + gravity_scale: float = 1.0 + punch_power: float = 0.0 + punch_momentum_linear: Sequence[float] = (0.0, 0.0, 0.0) + punch_momentum_angular: float = 0.0 + rate: int = 0 + vr_depth: float = 0.0 + is_area_of_interest: bool = False + jump_pressed: bool = False + pickup_pressed: bool = False + punch_pressed: bool = False + bomb_pressed: bool = False + fly_pressed: bool = False + hold_position_pressed: bool = False + knockout: float = 0.0 + invincible: bool = False + stick_to_owner: bool = False + damage: int = 0 + run: float = 0.0 + move_up_down: float = 0.0 + move_left_right: float = 0.0 + curse_death_time: int = 0 + boxing_gloves: bool = False + hockey: bool = False + use_fixed_vr_overlay: bool = False + allow_kick_idle_players: bool = False + music_continuous: bool = False + music_count: int = 0 + hurt: float = 0.0 + always_show_health_bar: bool = False + mini_billboard_1_texture: bascenev1.Texture | None = None + mini_billboard_1_start_time: int = 0 + mini_billboard_1_end_time: int = 0 + mini_billboard_2_texture: bascenev1.Texture | None = None + mini_billboard_2_start_time: int = 0 + mini_billboard_2_end_time: int = 0 + mini_billboard_3_texture: bascenev1.Texture | None = None + mini_billboard_3_start_time: int = 0 + mini_billboard_3_end_time: int = 0 + boxing_gloves_flashing: bool = False + dead: bool = False + floor_reflection: bool = False + debris_friction: float = 0.0 + debris_kill_height: float = 0.0 + vr_near_clip: float = 0.0 + shadow_ortho: bool = False + happy_thoughts_mode: bool = False + shadow_offset: Sequence[float] = (0.0, 0.0) + paused: bool = False + time: int = 0 + ambient_color: Sequence[float] = (1.0, 1.0, 1.0) + camera_mode: str = 'rotate' + frozen: bool = False + area_of_interest_bounds: Sequence[float] = (-1, -1, -1, 1, 1, 1) + shadow_range: Sequence[float] = (0, 0, 0, 0) + counter_text: str = '' + counter_texture: bascenev1.Texture | None = None + shattered: int = 0 + billboard_texture: bascenev1.Texture | None = None + billboard_cross_out: bool = False + billboard_opacity: float = 0.0 + slow_motion: bool = False + music: str = '' + vr_camera_offset: Sequence[float] = (0.0, 0.0, 0.0) + vr_overlay_center: Sequence[float] = (0.0, 0.0, 0.0) + vr_overlay_center_enabled: bool = False + vignette_outer: Sequence[float] = (0.0, 0.0) + vignette_inner: Sequence[float] = (0.0, 0.0) + tint: Sequence[float] = (1.0, 1.0, 1.0) + + def __bool__(self) -> bool: + """Support for bool evaluation.""" + return bool(True) # Slight obfuscation. + + def add_death_action(self, action: Callable[[], None]) -> None: + """Add a callable object to be called upon this node's death. + Note that these actions are run just after the node dies, not before. + """ + return None + + def changerotation(self, x: int, y: int, z: int) -> None: + """added by smoothy""" + return None + + def connectattr(self, srcattr: str, dstnode: Node, dstattr: str) -> None: + """Connect one of this node's attributes to an attribute on another + node. This will immediately set the target attribute's value to that + of the source attribute, and will continue to do so once per step + as long as the two nodes exist. The connection can be severed by + setting the target attribute to any value or connecting another + node attribute to it. + + ##### Example + Create a locator and attach a light to it: + >>> light = bascenev1.newnode('light') + ... loc = bascenev1.newnode('locator', attrs={'position': (0, 10, 0)}) + ... loc.connectattr('position', light, 'position') + """ + return None + + def delete(self, ignore_missing: bool = True) -> None: + """Delete the node. Ignores already-deleted nodes if `ignore_missing` + is True; otherwise a bascenev1.NodeNotFoundError is thrown. + """ + return None + + def exists(self) -> bool: + """Returns whether the Node still exists. + Most functionality will fail on a nonexistent Node, so it's never a bad + idea to check this. + + Note that you can also use the boolean operator for this same + functionality, so a statement such as "if mynode" will do + the right thing both for Node objects and values of None. + """ + return bool() + + # Show that ur return type varies based on "doraise" value: + @overload + def getdelegate( + self, type: type[_T], doraise: Literal[False] = False + ) -> _T | None: + ... + + @overload + def getdelegate(self, type: type[_T], doraise: Literal[True]) -> _T: + ... + + def getdelegate(self, type: Any, doraise: bool = False) -> Any: + """Return the node's current delegate object if it matches + a certain type. + + If the node has no delegate or it is not an instance of the passed + type, then None will be returned. If 'doraise' is True, then an + babase.DelegateNotFoundError will be raised instead. + """ + return None + + def getname(self) -> str: + """Return the name assigned to a Node; used mainly for debugging""" + return str() + + def getnodetype(self) -> str: + """Return the type of Node referenced by this object as a string. + (Note this is different from the Python type which is always + bascenev1.Node) + """ + return str() + + def handlemessage(self, *args: Any) -> None: + """General message handling; can be passed any message object. + + All standard message objects are forwarded along to the + bascenev1.Node's delegate for handling (generally the bascenev1.Actor + that made the node). + + bascenev1.Node-s are unique, however, in that they can be passed a + second form of message; 'node-messages'. These consist of a string + type-name as a first argument along with the args specific to that type + name as additional arguments. + Node-messages communicate directly with the low-level node layer + and are delivered simultaneously on all game clients, + acting as an alternative to setting node attributes. + """ + return None + + +class SessionData: + """(internal)""" + + def context(self) -> bascenev1.ContextRef: + """Return a context-ref pointing to the session.""" + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.ContextRef() + + def exists(self) -> bool: + """Returns whether the SessionData still exists. + Most functionality will fail on a nonexistent instance. + """ + return bool() + + +# noinspection PyShadowingBuiltins +class SessionPlayer: + """A reference to a player in the bascenev1.Session. + + Category: **Gameplay Classes** + + These are created and managed internally and + provided to your bascenev1.Session/bascenev1.Activity instances. + Be aware that, like `ba.Node`s, bascenev1.SessionPlayer objects are + 'weak' references under-the-hood; a player can leave the game at + any point. For this reason, you should make judicious use of the + babase.SessionPlayer.exists() method (or boolean operator) to ensure + that a SessionPlayer is still present if retaining references to one + for any length of time. + """ + + id: int + """The unique numeric ID of the Player. + + Note that you can also use the boolean operator for this same + functionality, so a statement such as "if player" will do + the right thing both for Player objects and values of None.""" + + in_game: bool + """This bool value will be True once the Player has completed + any lobby character/team selection.""" + + sessionteam: bascenev1.SessionTeam + """The bascenev1.SessionTeam this Player is on. If the + SessionPlayer is still in its lobby selecting a team/etc. + then a bascenev1.SessionTeamNotFoundError will be raised.""" + + inputdevice: bascenev1.InputDevice + """The input device associated with the player.""" + + color: Sequence[float] + """The base color for this Player. + In team games this will match the bascenev1.SessionTeam's + color.""" + + highlight: Sequence[float] + """A secondary color for this player. + This is used for minor highlights and accents + to allow a player to stand apart from his teammates + who may all share the same team (primary) color.""" + + character: str + """The character this player has selected in their profile.""" + + activityplayer: bascenev1.Player | None + """The current game-specific instance for this player.""" + + def __bool__(self) -> bool: + """Support for bool evaluation.""" + return bool(True) # Slight obfuscation. + + def assigninput( + self, + type: bascenev1.InputType | tuple[bascenev1.InputType, ...], + call: Callable, + ) -> None: + """Set the python callable to be run for one or more types of input.""" + return None + + def exists(self) -> bool: + """Return whether the underlying player is still in the game.""" + return bool() + + def get_icon(self) -> dict[str, Any]: + """Returns the character's icon (images, colors, etc contained + in a dict. + """ + return {'foo': 'bar'} + + def get_icon_info(self) -> dict[str, Any]: + """(internal)""" + return {'foo': 'bar'} + + def get_v1_account_id(self) -> str: + """Return the V1 Account ID this player is signed in under, if + there is one and it can be determined with relative certainty. + Returns None otherwise. Note that this may require an active + internet connection (especially for network-connected players) + and may return None for a short while after a player initially + joins (while verification occurs). + """ + return str() + + def getname(self, full: bool = False, icon: bool = True) -> str: + """Returns the player's name. If icon is True, the long version of the + name may include an icon. + """ + return str() + + def remove_from_game(self) -> None: + """Removes the player from the game.""" + return None + + def resetinput(self) -> None: + """Clears out the player's assigned input actions.""" + return None + + def set_icon_info( + self, + texture: str, + tint_texture: str, + tint_color: Sequence[float], + tint2_color: Sequence[float], + ) -> None: + """(internal)""" + return None + + def setactivity(self, activity: bascenev1.Activity | None) -> None: + """(internal)""" + return None + + def setdata( + self, + team: bascenev1.SessionTeam, + character: str, + color: Sequence[float], + highlight: Sequence[float], + ) -> None: + """(internal)""" + return None + + def setname( + self, name: str, full_name: str | None = None, real: bool = True + ) -> None: + """Set the player's name to the provided string. + A number will automatically be appended if the name is not unique from + other players. + """ + return None + + def setnode(self, node: bascenev1.Node | None) -> None: + """(internal)""" + return None + + +class Sound: + """A reference to a sound. + + Category: **Asset Classes** + + Use bascenev1.getsound() to instantiate one. + """ + + def play( + self, + volume: float = 1.0, + position: Sequence[float] | None = None, + host_only: bool = False, + ) -> None: + """Play the sound a single time. + + Category: **Gameplay Functions** + + If position is not provided, the sound will be at a constant volume + everywhere. Position should be a float tuple of size 3. + """ + return None + + +class Texture: + """A reference to a texture. + + Category: **Asset Classes** + + Use bascenev1.gettexture() to instantiate one. + """ + + pass + + +# noinspection PyShadowingNames +class Timer: + """Timers are used to run code at later points in time. + + Category: **General Utility Classes** + + This class encapsulates a scene-time timer in the current + bascenev1.Context. The underlying timer will be destroyed when either + this object is no longer referenced or when its Context (Activity, + etc.) dies. If you do not want to worry about keeping a reference to + your timer around, + you should use the bs.timer() function instead. + + Scene time maps to local simulation time in bascenev1.Activity or + bascenev1.Session Contexts. This means that it may progress slower + in slow-motion play modes, stop when the game is paused, etc. + + ###### time + > Length of time (in seconds by default) that the timer will wait + before firing. Note that the actual delay experienced may vary + depending on the timetype. (see below) + + ###### call + > A callable Python object. Note that the timer will retain a + strong reference to the callable for as long as it exists, so you + may want to look into concepts such as babase.WeakCall if that is not + desired. + + ###### repeat + > If True, the timer will fire repeatedly, with each successive + firing having the same delay as the first. + + ##### Example + + Use a Timer object to print repeatedly for a few seconds: + >>> import bascenev1 as bs + ... def say_it(): + ... bs.screenmessage('BADGER!') + ... def stop_saying_it(): + ... global g_timer + ... g_timer = None + ... bs.screenmessage('MUSHROOM MUSHROOM!') + ... # Create our timer; it will run as long as we have the self.t ref. + ... g_timer = bs.Timer(0.3, say_it, repeat=True) + ... # Now fire off a one-shot timer to kill it. + ... bs.timer(3.89, stop_saying_it) + """ + + def __init__( + self, time: float, call: Callable[[], Any], repeat: bool = False + ) -> None: + pass + + +def app_mode_activate() -> None: + """(internal)""" + return None + + +def app_mode_deactivate() -> None: + """(internal)""" + return None + + +def append_owner_ip(ip: str) -> None: + """(internal)""" + return None + + +def basetime() -> bascenev1.BaseTime: + """Return the base-time in seconds for the current scene-v1 context. + + Category: **General Utility Functions** + + Base-time is a time value that progresses at a constant rate for a scene, + even when the scene is sped up, slowed down, or paused. It may, however, + speed up or slow down due to replay speed adjustments or may slow down + if the cpu is overloaded. + Note that the value returned here is simply a float; it just has a + unique type in the type-checker's eyes to help prevent it from being + accidentally used with time functionality expecting other time types. + """ + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.BaseTime(0.0) + + +# noinspection PyShadowingNames +# noinspection PyShadowingBuiltins +def basetimer( + time: float, call: Callable[[], Any], repeat: bool = False +) -> None: + """Schedule a call to run at a later point in scene base-time. + Base-time is a value that progresses at a constant rate for a scene, + even when the scene is sped up, slowed down, or paused. It may, + however, speed up or slow down due to replay speed adjustments or may + slow down if the cpu is overloaded. + + Category: **General Utility Functions** + + This function adds a timer to the current scene context. + This timer cannot be canceled or modified once created. If you + require the ability to do so, use the bascenev1.BaseTimer class + instead. + + ##### Arguments + ###### time (float) + > Length of time in seconds that the timer will wait before firing. + + ###### call (Callable[[], Any]) + > A callable Python object. Remember that the timer will retain a + strong reference to the callable for the duration of the timer, so you + may want to look into concepts such as babase.WeakCall if that is not + desired. + + ###### repeat (bool) + > If True, the timer will fire repeatedly, with each successive + firing having the same delay as the first. + + ##### Examples + Print some stuff through time: + >>> import bascenev1 as bs + >>> bs.screenmessage('hello from now!') + >>> bs.basetimer(1.0, bs.Call(bs.screenmessage, 'hello from the future!')) + >>> bs.basetimer(2.0, bs.Call(bs.screenmessage, + ... 'hello from the future 2!')) + """ + return None + + +def broadcastmessage( + message: str | babase.Lstr, + color: Sequence[float] | None = None, + top: bool = False, + image: dict[str, Any] | None = None, + log: bool = False, + clients: Sequence[int] | None = None, + transient: bool = False, +) -> None: + """Broadcast a screen-message to clients in the current session. + + Category: **General Utility Functions** + + If 'top' is True, the message will go to the top message area. + For 'top' messages, 'image' must be a dict containing 'texture' + and 'tint_texture' textures and 'tint_color' and 'tint2_color' + colors. This defines an icon to display alongside the message. + If 'log' is True, the message will also be submitted to the log. + 'clients' can be a list of client-ids the message should be sent + to, or None to specify that everyone should receive it. + If 'transient' is True, the message will not be included in the + game-stream and thus will not show up when viewing replays. + Currently the 'clients' option only works for transient messages. + """ + return None + + +def camerashake(intensity: float = 1.0) -> None: + """Shake the camera. + + Category: **Gameplay Functions** + + Note that some cameras and/or platforms (such as VR) may not display + camera-shake, so do not rely on this always being visible to the + player as a gameplay cue. + """ + return None + + +def capture_gamepad_input(call: Callable[[dict], None]) -> None: + """(internal) + + Add a callable to be called for subsequent gamepad events. + The method is passed a dict containing info about the event. + """ + return None + + +def capture_keyboard_input(call: Callable[[dict], None]) -> None: + """(internal) + + Add a callable to be called for subsequent keyboard-game-pad events. + The method is passed a dict containing info about the event. + """ + return None + + +def chatmessage( + message: str | babase.Lstr, + clients: Sequence[int] | None = None, + sender_override: str | None = None, +) -> None: + """(internal)""" + return None + + +def client_info_query_response(token: str, response: Any) -> None: + """(internal)""" + return None + + +def connect_to_party( + address: str, port: int | None = None, print_progress: bool = True +) -> None: + """(internal)""" + return None + + +def disable_kickvote(id: str) -> None: + """(internal)id: pb-id who cant start a kick vote to anyone""" + return None + + +def disconnect_client(client_id: int, ban_time: int = 300) -> bool: + """(internal)""" + return bool() + + +def disconnect_from_host() -> None: + """(internal) + + Category: General Utility Functions + """ + return None + + +def emitfx( + position: Sequence[float], + velocity: Sequence[float] | None = None, + count: int = 10, + scale: float = 1.0, + spread: float = 1.0, + chunk_type: str = 'rock', + emit_type: str = 'chunks', + tendril_type: str = 'smoke', +) -> None: + """Emit particles, smoke, etc. into the fx sim layer. + + Category: **Gameplay Functions** + + The fx sim layer is a secondary dynamics simulation that runs in + the background and just looks pretty; it does not affect gameplay. + Note that the actual amount emitted may vary depending on graphics + settings, exiting element counts, or other factors. + """ + return None + + +def end_host_scanning() -> None: + """(internal) + + Category: General Utility Functions + """ + return None + + +def get_chat_messages() -> list[str]: + """(internal)""" + return ['blah', 'blah2'] + + +def get_client_device_uuid(client_id: float) -> str: + """(internal)""" + return str() + + +def get_client_ip(client_id: float) -> str: + """(internal)""" + return str() + + +def get_client_ping(client_id: float) -> str: + """(internal)""" + return str() + + +def get_client_public_device_uuid(client_id: int) -> str | None: + """(internal) + + Category: General Utility Functions + + Return a public device UUID for a client. If the client does not + exist or is running a version older than 1.6.10, returns None. + Public device UUID uniquely identifies the device the client is + using in a semi-permanent way. The UUID value will change + periodically with updates to the game or operating system. + """ + return '' + + +def get_collision_info(*args: Any) -> Any: + """Return collision related values + + Category: **Gameplay Functions** + + Returns a single collision value or tuple of values such as location, + depth, nodes involved, etc. Only call this in the handler of a + collision-triggered callback or message + """ + return _uninferrable() + + +def get_configurable_game_pads() -> list: + """(internal) + + Returns a list of the currently connected gamepads that can be + configured. + """ + return list() + + +def get_connection_to_host_info() -> dict: + """(internal)""" + return dict() + + +def get_foreground_host_activity() -> bascenev1.Activity | None: + """(internal) + + Returns the bascenev1.Activity currently in the foreground, + or None if there is none. + """ + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Activity(settings={}) + + +def get_foreground_host_session() -> bascenev1.Session | None: + """(internal) + + Return the bascenev1.Session currently being displayed, or None if there is + none. + """ + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Session([]) + + +def get_game_port() -> int: + """(internal) + + Return the port ballistica is hosting on. + """ + return int() + + +def get_game_roster() -> list[dict[str, Any]]: + """(internal)""" + return [{'foo': 'bar'}] + + +def get_local_active_input_devices_count() -> int: + """(internal)""" + return int() + + +def get_package_collision_mesh( + package: bascenev1.AssetPackage, name: str +) -> bascenev1.CollisionMesh: + """(internal)""" + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.CollisionMesh() + + +def get_package_data( + package: bascenev1.AssetPackage, name: str +) -> bascenev1.Data: + """(internal).""" + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Data() + + +def get_package_mesh( + package: bascenev1.AssetPackage, name: str +) -> bascenev1.Mesh: + """(internal)""" + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Mesh() + + +def get_package_sound( + package: bascenev1.AssetPackage, name: str +) -> bascenev1.Sound: + """(internal).""" + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Sound() + + +def get_package_texture( + package: bascenev1.AssetPackage, name: str +) -> bascenev1.Texture: + """(internal)""" + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Texture() + + +def get_public_party_enabled() -> bool: + """(internal)""" + return bool() + + +def get_public_party_max_size() -> int: + """(internal)""" + return int() + + +def get_random_names() -> list: + """(internal) + + Returns the random names used by the game. + """ + return list() + + +def get_replay_speed_exponent() -> int: + """(internal) + + Returns current replay speed value. Actual displayed speed is pow(2,speed). + """ + return int() + + +def get_ui_input_device() -> bascenev1.InputDevice | None: + """(internal) + + Returns the input-device that currently owns the user interface, or + None if there is none. + """ + return InputDevice() + + +# Show that our return type varies based on "doraise" value: +@overload +def getactivity(doraise: Literal[True] = True) -> bascenev1.Activity: + ... + + +@overload +def getactivity(doraise: Literal[False]) -> bascenev1.Activity | None: + ... + + +def getactivity(doraise: bool = True) -> bascenev1.Activity | None: + """Return the current bascenev1.Activity instance. + + Category: **Gameplay Functions** + + Note that this is based on context_ref; thus code run in a timer + generated in Activity 'foo' will properly return 'foo' here, even if + another Activity has since been created or is transitioning in. + If there is no current Activity, raises a babase.ActivityNotFoundError. + If doraise is False, None will be returned instead in that case. + """ + return None + + +def getcollisionmesh(name: str) -> bascenev1.CollisionMesh: + """Return a collision-mesh, loading it if necessary. + + Category: **Asset Functions** + + Collision-meshes are used in physics calculations for such things as + terrain. + + Note that this function returns immediately even if the asset has yet + to be loaded. To avoid hitches, instantiate your asset objects in + advance of when you will be using them, allowing time for them to + load in the background if necessary. + """ + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.CollisionMesh() + + +def getdata(name: str) -> bascenev1.Data: + """Return a data, loading it if necessary. + + Category: **Asset Functions** + + Note that this function returns immediately even if the asset has yet + to be loaded. To avoid hitches, instantiate your asset objects in + advance of when you will be using them, allowing time for them to + load in the background if necessary. + """ + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Data() + + +# Show that our return type varies based on "doraise" value: +@overload +def getinputdevice( + name: str, unique_id: str, doraise: Literal[True] = True +) -> bascenev1.InputDevice: + ... + + +@overload +def getinputdevice( + name: str, unique_id: str, doraise: Literal[False] +) -> bascenev1.InputDevice | None: + ... + + +def getinputdevice(name: str, unique_id: str, doraise: bool = True) -> Any: + """(internal) + + Given a type name and a unique identifier, returns an InputDevice. + Throws an Exception if the input-device is not found, or returns None + if 'doraise' is False. + """ + return None + + +def getmesh(name: str) -> bascenev1.Mesh: + """Return a mesh, loading it if necessary. + + Category: **Asset Functions** + + Note that this function returns immediately even if the asset has yet + to be loaded. To avoid hitches, instantiate your asset objects in + advance of when you will be using them, allowing time for them to + load in the background if necessary. + """ + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Mesh() + + +def getnodes() -> list: + """Return all nodes in the current bascenev1.Context. + + Category: **Gameplay Functions** + """ + return list() + + +# Show that our return type varies based on "doraise" value: +@overload +def getsession(doraise: Literal[True] = True) -> bascenev1.Session: + ... + + +@overload +def getsession(doraise: Literal[False]) -> bascenev1.Session | None: + ... + + +def getsession(doraise: bool = True) -> bascenev1.Session | None: + """Category: **Gameplay Functions** + + Returns the current bascenev1.Session instance. + Note that this is based on context_ref; thus code being run in the UI + context will return the UI context_ref here even if a game Session also + exists, etc. If there is no current Session, an Exception is raised, or + if doraise is False then None is returned instead. + """ + return None + + +def getsound(name: str) -> bascenev1.Sound: + """Return a sound, loading it if necessary. + + Category: **Asset Functions** + + Note that this function returns immediately even if the asset has yet + to be loaded. To avoid hitches, instantiate your asset objects in + advance of when you will be using them, allowing time for them to + load in the background if necessary. + """ + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Sound() + + +def gettexture(name: str) -> bascenev1.Texture: + """Return a texture, loading it if necessary. + + Category: **Asset Functions** + + Note that this function returns immediately even if the asset has yet + to be loaded. To avoid hitches, instantiate your asset objects in + advance of when you will be using them, allowing time for them to + load in the background if necessary. + """ + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Texture() + + +def handle_app_intent_default() -> None: + """(internal)""" + return None + + +def handle_app_intent_exec(command: str) -> None: + """(internal)""" + return None + + +def have_connected_clients() -> bool: + """(internal) + + Category: General Utility Functions + """ + return bool() + + +def have_touchscreen_input() -> bool: + """(internal) + + Returns whether or not a touch-screen input is present + """ + return bool() + + +def hide_player_device_id(type: bool) -> None: + """(internal)hide player device spec from roster to clients""" + return None + + +def host_scan_cycle() -> list: + """(internal)""" + return list() + + +def is_in_replay() -> bool: + """(internal)""" + return bool() + + +def ls_input_devices() -> None: + """Print debugging info about game objects. + + Category: **General Utility Functions** + + This call only functions in debug builds of the game. + It prints various info about the current object count, etc. + """ + return None + + +def ls_objects() -> None: + """Log debugging info about C++ level objects. + + Category: **General Utility Functions** + + This call only functions in debug builds of the game. + It prints various info about the current object count, etc. + """ + return None + + +def new_host_session( + sessiontype: type[bascenev1.Session], benchmark_type: str | None = None +) -> None: + """(internal)""" + return None + + +def new_replay_session(file_name: str) -> None: + """(internal)""" + return None + + +def newactivity( + activity_type: type[bascenev1.Activity], settings: dict | None = None +) -> bascenev1.Activity: + """Instantiates a bascenev1.Activity given a type object. + + Category: **General Utility Functions** + + Activities require special setup and thus cannot be directly + instantiated; you must go through this function. + """ + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Activity(settings={}) + + +# noinspection PyShadowingBuiltins +def newnode( + type: str, + owner: bascenev1.Node | None = None, + attrs: dict | None = None, + name: str | None = None, + delegate: Any = None, +) -> bascenev1.Node: + """Add a node of the given type to the game. + + Category: **Gameplay Functions** + + If a dict is provided for 'attributes', the node's initial attributes + will be set based on them. + + 'name', if provided, will be stored with the node purely for debugging + purposes. If no name is provided, an automatic one will be generated + such as 'terrain@foo.py:30'. + + If 'delegate' is provided, Python messages sent to the node will go to + that object's handlemessage() method. Note that the delegate is stored + as a weak-ref, so the node itself will not keep the object alive. + + if 'owner' is provided, the node will be automatically killed when that + object dies. 'owner' can be another node or a bascenev1.Actor + """ + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Node() + + +def printnodes() -> None: + """Print various info about existing nodes; useful for debugging. + + Category: **Gameplay Functions** + """ + return None + + +def register_activity(activity: bascenev1.Activity) -> bascenev1.ActivityData: + """(internal)""" + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.ActivityData() + + +def register_session(session: bascenev1.Session) -> bascenev1.SessionData: + """(internal)""" + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.SessionData() + + +def release_gamepad_input() -> None: + """(internal) + + Resumes normal gamepad event processing. + """ + return None + + +def release_keyboard_input() -> None: + """(internal) + + Resumes normal keyboard event processing. + """ + return None + + +def reset_random_player_names() -> None: + """(internal)""" + return None + + +def set_admins(admins: list[str]) -> None: + """(internal)""" + return None + + +def set_authenticate_clients(enable: bool) -> None: + """(internal)""" + return None + + +def set_debug_speed_exponent(speed: int) -> None: + """(internal) + + Sets the debug speed scale for the game. Actual speed is pow(2,speed). + """ + return None + + +def set_enable_default_kick_voting(enable: bool) -> None: + """(internal)""" + return None + + +def set_game_speed(speed: int) -> None: + """(internal) + + Sets the speed scale for the game. + """ + return None + + +def set_internal_music( + music: babase.SimpleSound | None, volume: float = 1.0, loop: bool = True +) -> None: + """(internal).""" + return None + + +def set_kickvote_msg_type(name: str) -> None: + """(internal)set chat to show msg in chat""" + return None + + +def set_map_bounds( + bounds: tuple[float, float, float, float, float, float] +) -> None: + """(internal) + + Set map bounds. Generally nodes that go outside of this box are killed. + """ + return None + + +def set_master_server_source(source: int) -> None: + """(internal)""" + return None + + +def set_public_party_enabled(enabled: bool) -> None: + """(internal)""" + return None + + +def set_public_party_max_size(max_size: int) -> None: + """(internal)""" + return None + + +def set_public_party_name(name: str) -> None: + """(internal)""" + return None + + +def set_public_party_queue_enabled(max_size: bool) -> None: + """(internal)""" + return None + + +def set_public_party_stats_url(url: str | None) -> None: + """(internal)""" + return None + + +def set_replay_speed_exponent(speed: int) -> None: + """(internal) + + Set replay speed. Actual displayed speed is pow(2, speed). + """ + return None + + +def set_server_name(name: str) -> None: + """(internal)set the host name""" + return None + + +def set_touchscreen_editing(editing: bool) -> None: + """(internal)""" + return None + + +def set_transparent_kickvote(type: bool) -> None: + """(internal)True to show kick vote starter name""" + return None + + +def time() -> bascenev1.Time: + """Return the current scene time in seconds. + + Category: **General Utility Functions** + + Scene time maps to local simulation time in bascenev1.Activity or + bascenev1.Session Contexts. This means that it may progress slower + in slow-motion play modes, stop when the game is paused, etc. + + Note that the value returned here is simply a float; it just has a + unique type in the type-checker's eyes to help prevent it from being + accidentally used with time functionality expecting other time types. + """ + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.Time(0.0) + + +# noinspection PyShadowingNames +def timer(time: float, call: Callable[[], Any], repeat: bool = False) -> None: + """Schedule a call to run at a later point in time. + + Category: **General Utility Functions** + + This function adds a scene-time timer to the current babase.Context. + This timer cannot be canceled or modified once created. If you + require the ability to do so, use the babase.Timer class instead. + + Scene time maps to local simulation time in bascenev1.Activity or + bascenev1.Session Contexts. This means that it may progress slower + in slow-motion play modes, stop when the game is paused, etc. + + ##### Arguments + ###### time (float) + > Length of scene time in seconds that the timer will wait + before firing. + + ###### call (Callable[[], Any]) + > A callable Python object. Note that the timer will retain a + strong reference to the callable for as long as it exists, so you + may want to look into concepts such as babase.WeakCall if that is not + desired. + + ###### repeat (bool) + > If True, the timer will fire repeatedly, with each successive + firing having the same delay as the first. + + ##### Examples + Print some stuff through time: + >>> import bascenev1 as bs + >>> bs.screenmessage('hello from now!') + >>> bs.timer(1.0, bs.Call(bs.screenmessage, 'hello from the future!')) + >>> bs.timer(2.0, bs.Call(bs.screenmessage, + ... 'hello from the future 2!')) + """ + return None diff --git a/dist/dummymodules/_batemplatefs.py b/dist/dummymodules/_batemplatefs.py new file mode 100644 index 0000000..52981bc --- /dev/null +++ b/dist/dummymodules/_batemplatefs.py @@ -0,0 +1,56 @@ +# Released under the MIT License. See LICENSE for details. +# +"""A dummy stub module for the real _batemplatefs. + +The real _batemplatefs 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, TypeVar + +if TYPE_CHECKING: + from typing import Any, Callable + + +_T = TypeVar('_T') + + +def _uninferrable() -> Any: + """Get an "Any" in mypy and "uninferrable" in Pylint.""" + # pylint: disable=undefined-variable + return _not_a_real_variable # type: ignore + + +class Hello: + """Simple example.""" + + pass + + +def hello_again_world() -> None: + """Another hello world print.""" + return None diff --git a/dist/dummymodules/_bauiv1.py b/dist/dummymodules/_bauiv1.py new file mode 100644 index 0000000..c26b8cc --- /dev/null +++ b/dist/dummymodules/_bauiv1.py @@ -0,0 +1,644 @@ +# 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, TypeVar + +if TYPE_CHECKING: + from typing import Any, Callable, Literal, Sequence + import babase + import bauiv1 + + +_T = TypeVar('_T') + + +def _uninferrable() -> Any: + """Get an "Any" in mypy and "uninferrable" in Pylint.""" + # pylint: disable=undefined-variable + return _not_a_real_variable # type: ignore + + +class Mesh: + """Category: **User Interface Classes**""" + + pass + + +class Sound: + """Category: **User Interface Classes**""" + + def play(self) -> None: + """Play the sound locally.""" + return None + + def stop(self) -> None: + """Stop the sound if it is playing.""" + return None + + +class Texture: + """Category: **User Interface Classes**""" + + pass + + +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 + babase.buttonwidget() must be used to instantiate or edit these. + """ + + def __bool__(self) -> bool: + """Support for bool evaluation.""" + return bool(True) # Slight obfuscation. + + def activate(self) -> None: + """Activates a widget; the same as if it had been clicked.""" + return None + + def add_delete_callback(self, call: Callable) -> None: + """Add a call to be run immediately after this widget is destroyed.""" + return None + + 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 + + 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() + + def get_children(self) -> list[bauiv1.Widget]: + """Returns any child Widgets of this Widget.""" + import bauiv1 + + return [bauiv1.Widget()] + + 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) + + def get_selected_child(self) -> bauiv1.Widget | None: + """Returns the selected child Widget or None if nothing is selected.""" + import bauiv1 + + return bauiv1.Widget() + + 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() + + +def back_press() -> None: + """(internal)""" + return None + + +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() + + +def can_show_ad() -> bool: + """(internal)""" + return bool() + + +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() + + +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() + + +def console_print(*args: Any) -> None: + """(internal) + + Print the provided args to the game console (using str()). + For most debugging/info purposes you should just use Python's standard + print, which will show up in the game console as well. + """ + return None + + +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() + + +def focus_window() -> None: + """(internal) + + A workaround for some unintentional backgrounding that occurs on mac + """ + return None + + +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() + + +def get_special_widget(name: str) -> bauiv1.Widget: + """(internal)""" + import bauiv1 # pylint: disable=cyclic-import + + return bauiv1.Widget() + + +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() + + +def getsound(name: str) -> bauiv1.Sound: + """Load a sound for use in the ui.""" + import bauiv1 # pylint: disable=cyclic-import + + return bauiv1.Sound() + + +def gettexture(name: str) -> bauiv1.Texture: + """Load a texture for use in the ui.""" + import bauiv1 # pylint: disable=cyclic-import + + return bauiv1.Texture() + + +def has_video_ads() -> bool: + """(internal)""" + return bool() + + +def have_incentivized_ad() -> bool: + """(internal)""" + return bool() + + +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() + + +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() + + +def is_party_icon_visible() -> bool: + """(internal)""" + return bool() + + +def open_file_externally(path: str) -> None: + """(internal) + + Open the provided file in the default external app. + """ + return None + + +def open_url(address: str, force_internal: bool = False) -> None: + """Open a provided URL. + + Category: **General Utility Functions** + + Open the provided url in a web-browser, or display the URL + string in a window if that isn't possible (or if force_internal + is True). + """ + return None + + +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() + + +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() + + +def set_party_icon_always_visible(value: bool) -> None: + """(internal)""" + return None + + +def set_party_window_open(value: bool) -> None: + """(internal)""" + return None + + +def show_ad( + purpose: str, on_completion_call: Callable[[], None] | None = None +) -> None: + """(internal)""" + return None + + +def show_ad_2( + purpose: str, on_completion_call: Callable[[bool], None] | None = None +) -> None: + """(internal)""" + return None + + +def show_app_invite( + title: str | bauiv1.Lstr, message: str | bauiv1.Lstr, code: str +) -> None: + """(internal) + + Category: **General Utility Functions** + """ + return None + + +def show_online_score_ui( + show: str = 'general', + game: str | None = None, + game_version: str | None = None, +) -> None: + """(internal)""" + return None + + +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, +) -> 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() + + +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) + + +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