diff --git a/dist/dummymodules/_babase.py b/dist/dummymodules/_babase.py index a9ccccc..c2b1dd5 100644 --- a/dist/dummymodules/_babase.py +++ b/dist/dummymodules/_babase.py @@ -267,6 +267,112 @@ class DisplayTimer: pass +class Env: + """Unchanging values for the current running app instance. + Access the single shared instance of this class at `babase.app.env`. + """ + + android: bool + """Is this build targeting an Android based OS?""" + + api_version: int + """The app's api version. + + Only Python modules and packages associated with the current API + version number will be detected by the game (see the ba_meta tag). + This value will change whenever substantial backward-incompatible + changes are introduced to Ballistica APIs. When that happens, + modules/packages should be updated accordingly and set to target + the newer API version number.""" + + arcade: bool + """Whether the app is targeting an arcade-centric experience.""" + + build_number: int + """Integer build number for the engine. + + This value increases by at least 1 with each release of the engine. + It is independent of the human readable `version` string.""" + + config_file_path: str + """Where the app's config file is stored on disk.""" + + data_directory: str + """Where bundled static app data lives.""" + + debug: bool + """Whether the app is running in debug mode. + + Debug builds generally run substantially slower than non-debug + builds due to compiler optimizations being disabled and extra + checks being run.""" + + demo: bool + """Whether the app is targeting a demo experience.""" + + device_name: str + """Human readable name of the device running this app.""" + + gui: bool + """Whether the app is running with a gui. + + This is the opposite of `headless`.""" + + headless: bool + """Whether the app is running headlessly (without a gui). + + This is the opposite of `gui`.""" + + python_directory_app: str | None + """Path where the app expects its bundled modules to live. + + Be aware that this value may be None if Ballistica is running in + a non-standard environment, and that python-path modifications may + cause modules to be loaded from other locations.""" + + python_directory_app_site: str | None + """Path where the app expects its bundled pip modules to live. + + Be aware that this value may be None if Ballistica is running in + a non-standard environment, and that python-path modifications may + cause modules to be loaded from other locations.""" + + python_directory_user: str | None + """Path where the app expects its user scripts (mods) to live. + + Be aware that this value may be None if Ballistica is running in + a non-standard environment, and that python-path modifications may + cause modules to be loaded from other locations.""" + + supports_soft_quit: bool + """Whether the running app supports 'soft' quit options. + + This generally applies to mobile derived OSs, where an act of + 'quitting' may leave the app running in the background waiting + in case it is used again.""" + + test: bool + """Whether the app is running in test mode. + + Test mode enables extra checks and features that are useful for + release testing but which do not slow the game down significantly.""" + + tv: bool + """Whether the app is targeting a TV-centric experience.""" + + version: str + """Human-readable version string for the engine; something like '1.3.24'. + + This should not be interpreted as a number; it may contain + string elements such as 'alpha', 'beta', 'test', etc. + If a numeric version is needed, use `build_number`.""" + + vr: bool + """Whether the app is currently running in VR.""" + + pass + + class FeatureSetData: """Internal.""" @@ -415,6 +521,11 @@ def app_instance_uuid() -> str: return str() +def app_is_active() -> bool: + """(internal)""" + return bool() + + def appname() -> str: """(internal)""" return str() @@ -478,6 +589,21 @@ def apptimer(time: float, call: Callable[[], Any]) -> None: return None +def asset_loads_allowed() -> bool: + """(internal)""" + return bool() + + +def audio_shutdown_begin() -> None: + """(internal)""" + return None + + +def audio_shutdown_is_complete() -> bool: + """(internal)""" + return bool() + + def can_display_full_unicode() -> bool: """(internal)""" return bool() @@ -546,6 +672,11 @@ def commit_config(config: str) -> None: return None +def complete_shutdown() -> None: + """Complete the shutdown process, triggering the app to exit.""" + return None + + def contains_python_dist() -> bool: """(internal)""" return bool() @@ -559,16 +690,65 @@ def debug_print_py_err() -> None: 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. - """ +def dev_console_add_button( + label: str, + x: float, + y: float, + width: float, + height: float, + call: Callable[[], Any] | None, + h_anchor: str, + label_scale: float, + corner_radius: float, + style: str, +) -> None: + """(internal)""" return None +def dev_console_add_python_terminal() -> None: + """(internal)""" + return None + + +def dev_console_add_text( + text: str, + x: float, + y: float, + h_anchor: str, + h_align: str, + v_align: str, + scale: float, +) -> None: + """(internal)""" + return None + + +def dev_console_base_scale() -> float: + """(internal)""" + return float() + + +def dev_console_input_adapter_finish() -> None: + """(internal)""" + return None + + +def dev_console_request_refresh() -> None: + """(internal)""" + return None + + +def dev_console_tab_height() -> float: + """(internal)""" + return float() + + +def dev_console_tab_width() -> float: + """(internal)""" + return float() + + def displaytime() -> babase.DisplayTime: """Return the current display-time in seconds. @@ -652,13 +832,13 @@ def ehv() -> None: return None -def empty_app_mode_activate() -> None: - """(internal)""" - return None +def emit_log(name: str, level: str, message: str) -> None: + """(internal) - -def empty_app_mode_deactivate() -> None: - """(internal)""" + Sends a log message to the in-app 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 @@ -716,6 +896,26 @@ def fatal_error(message: str) -> None: return None +def fullscreen_control_available() -> bool: + """(internal)""" + return bool() + + +def fullscreen_control_get() -> bool: + """(internal)""" + return bool() + + +def fullscreen_control_key_shortcut() -> str | None: + """(internal)""" + return '' + + +def fullscreen_control_set(val: bool) -> None: + """(internal)""" + return None + + def get_appconfig_builtin_keys() -> list[str]: """(internal)""" return ['blah', 'blah2'] @@ -746,6 +946,11 @@ def get_camera_target() -> tuple[float, ...]: return (0.0, 0.0, 0.0) +def get_dev_console_input_text() -> str: + """(internal)""" + return str() + + def get_display_resolution() -> tuple[int, int] | None: """(internal) @@ -849,11 +1054,13 @@ def getsimplesound(name: str) -> SimpleSound: return SimpleSound() -def has_gamma_control() -> bool: - """(internal) +def graphics_shutdown_begin() -> None: + """(internal)""" + return None - Returns whether the system can adjust overall screen gamma) - """ + +def graphics_shutdown_is_complete() -> bool: + """(internal)""" return bool() @@ -915,21 +1122,11 @@ def is_os_playing_music() -> bool: Tells whether the OS is currently playing music of some sort. - (Used to determine whether the game should avoid playing its own) + (Used to determine whether the app 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() @@ -958,11 +1155,6 @@ def login_adapter_get_sign_in_token(login_type: str, attempt_id: int) -> None: 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'] @@ -1030,6 +1222,16 @@ def music_player_stop() -> None: return None +def native_review_request() -> None: + """(internal)""" + return None + + +def native_review_request_supported() -> bool: + """(internal)""" + return bool() + + def native_stack_trace() -> str | None: """Return a native stack trace as a string, or None if not available. @@ -1046,6 +1248,16 @@ def on_app_running() -> None: return None +def on_empty_app_mode_activate() -> None: + """(internal)""" + return None + + +def on_empty_app_mode_deactivate() -> None: + """(internal)""" + return None + + def on_initial_app_mode_set() -> None: """(internal)""" return None @@ -1059,6 +1271,14 @@ def open_dir_externally(path: str) -> None: return None +def open_file_externally(path: str) -> None: + """(internal) + + Open the provided file in the default external app. + """ + return None + + def pre_env() -> dict: """(internal) @@ -1110,13 +1330,17 @@ def pushcall( # noinspection PyShadowingBuiltins -def quit(soft: bool = False, back: bool = False) -> None: - """Quit the game. +def quit( + confirm: bool = False, quit_type: babase.QuitType | None = None +) -> None: + """Quit the app. Category: **General Utility Functions** - On systems like Android, 'soft' will end the activity but keep the - app running. + If 'confirm' is True, a confirm dialog will be presented if conditions + allow; otherwise the quit will still be immediate. + See docs for babase.QuitType for explanations of the optional + 'quit_type' arg. """ return None @@ -1227,6 +1451,11 @@ def set_camera_target(x: float, y: float, z: float) -> None: return None +def set_dev_console_input_text(val: str) -> None: + """(internal)""" + return None + + def set_internal_language_keys( listobj: list[tuple[str, str]], random_names_list: list[tuple[str, str]] ) -> None: @@ -1244,11 +1473,6 @@ def set_platform_misc_read_vals(mode: str) -> None: return None -def set_stress_testing(testing: bool, player_count: int) -> None: - """(internal)""" - return None - - def set_thread_name(name: str) -> None: """(internal) @@ -1280,11 +1504,50 @@ def show_progress_bar() -> None: return None +def shutdown_suppress_begin() -> bool: + """(internal)""" + return bool() + + +def shutdown_suppress_count() -> int: + """(internal)""" + return int() + + +def shutdown_suppress_end() -> None: + """(internal)""" + return None + + def submit_analytics_counts() -> None: """(internal)""" return None +def supports_max_fps() -> bool: + """(internal)""" + return bool() + + +def supports_open_dir_externally() -> bool: + """(internal) + + Return whether the current app/platform supports opening dirs externally + (in the Mac Finder, Windows Explorer, etc.). + """ + return bool() + + +def supports_vsync() -> bool: + """(internal)""" + return bool() + + +def temp_testing() -> bool: + """(internal)""" + return bool() + + def unlock_all_input() -> None: """(internal) @@ -1303,6 +1566,16 @@ def user_ran_commands() -> None: return None +def using_game_center() -> bool: + """(internal)""" + return bool() + + +def using_google_play_game_services() -> bool: + """(internal)""" + return bool() + + def v1_cloud_log(message: str) -> None: """(internal) diff --git a/dist/dummymodules/_baclassic.py b/dist/dummymodules/_baclassic.py index 4f185bd..742e20b 100644 --- a/dist/dummymodules/_baclassic.py +++ b/dist/dummymodules/_baclassic.py @@ -45,6 +45,11 @@ def _uninferrable() -> Any: return _not_a_real_variable # type: ignore +def set_stress_testing(testing: bool, player_count: int) -> None: + """(internal)""" + return None + + def value_test( arg: str, change: float | None = None, absolute: float | None = None ) -> float: diff --git a/dist/dummymodules/_baplus.py b/dist/dummymodules/_baplus.py index e24c812..a464993 100644 --- a/dist/dummymodules/_baplus.py +++ b/dist/dummymodules/_baplus.py @@ -52,6 +52,11 @@ def add_v1_account_transaction( return None +def can_show_ad() -> bool: + """(internal)""" + return bool() + + def game_service_has_leaderboard(game: str, config: str) -> bool: """(internal) @@ -147,6 +152,16 @@ def get_v2_fleet() -> str: return str() +def has_video_ads() -> bool: + """(internal)""" + return bool() + + +def have_incentivized_ad() -> bool: + """(internal)""" + return bool() + + def have_outstanding_v1_account_transactions() -> bool: """(internal)""" return bool() @@ -205,6 +220,29 @@ def run_v1_account_transactions() -> None: 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_game_service_ui( + show: str = 'general', + game: str | None = None, + game_version: str | None = None, +) -> None: + """(internal)""" + return None + + def sign_in_v1(account_type: str) -> None: """(internal) diff --git a/dist/dummymodules/_bascenev1.py b/dist/dummymodules/_bascenev1.py index 96749f1..53ca148 100644 --- a/dist/dummymodules/_bascenev1.py +++ b/dist/dummymodules/_bascenev1.py @@ -162,7 +162,12 @@ class InputDevice: """ allows_configuring: bool - """Whether the input-device can be configured.""" + """Whether the input-device can be configured in the app.""" + + allows_configuring_in_system_settings: bool + """Whether the input-device can be configured in the system. + setings app. This can be used to redirect the user to go there + if they attempt to configure the device.""" has_meaningful_button_names: bool """Whether button names returned by this instance match labels @@ -602,10 +607,6 @@ class Node: """ 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 @@ -934,21 +935,6 @@ class Timer: 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. @@ -1088,11 +1074,6 @@ def connect_to_party( 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() @@ -1141,21 +1122,6 @@ def get_chat_messages() -> list[str]: 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) @@ -1196,6 +1162,13 @@ def get_connection_to_host_info() -> dict: return dict() +def get_connection_to_host_info_2() -> bascenev1.HostInfo | None: + """Return info about the host we are currently connected to.""" + import bascenev1 # pylint: disable=cyclic-import + + return bascenev1.HostInfo('dummyname', -1, 'dummy_addr', -1) + + def get_foreground_host_activity() -> bascenev1.Activity | None: """(internal) @@ -1501,11 +1474,6 @@ def have_touchscreen_input() -> bool: 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() @@ -1596,6 +1564,16 @@ def newnode( return bascenev1.Node() +def on_app_mode_activate() -> None: + """(internal)""" + return None + + +def on_app_mode_deactivate() -> None: + """(internal)""" + return None + + def printnodes() -> None: """Print various info about existing nodes; useful for debugging. @@ -1604,6 +1582,11 @@ def printnodes() -> None: return None +def protocol_version() -> int: + """(internal)""" + return int() + + def register_activity(activity: bascenev1.Activity) -> bascenev1.ActivityData: """(internal)""" import bascenev1 # pylint: disable=cyclic-import @@ -1662,14 +1645,6 @@ def set_enable_default_kick_voting(enable: bool) -> None: 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: @@ -1677,11 +1652,6 @@ def set_internal_music( 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: @@ -1730,21 +1700,11 @@ def set_replay_speed_exponent(speed: int) -> None: 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. diff --git a/dist/dummymodules/_batemplatefs.py b/dist/dummymodules/_batemplatefs.py index 52981bc..af3d1f4 100644 --- a/dist/dummymodules/_batemplatefs.py +++ b/dist/dummymodules/_batemplatefs.py @@ -48,7 +48,9 @@ def _uninferrable() -> Any: class Hello: """Simple example.""" - pass + def testmethod(self, val: int = 0) -> None: + """Just testing.""" + return None def hello_again_world() -> None: diff --git a/dist/dummymodules/_bauiv1.py b/dist/dummymodules/_bauiv1.py index c26b8cc..6ae666e 100644 --- a/dist/dummymodules/_bauiv1.py +++ b/dist/dummymodules/_bauiv1.py @@ -78,9 +78,16 @@ class Widget: 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. + bauiv1.buttonwidget() must be used to instantiate or edit these. """ + transitioning_out: bool + """Whether this widget is in the process of dying (read only). + + It can be useful to check this on a window's root widget to + prevent multiple window actions from firing simultaneously, + potentially leaving the UI in a broken state.""" + def __bool__(self) -> bool: """Support for bool evaluation.""" return bool(True) # Slight obfuscation. @@ -193,11 +200,6 @@ def buttonwidget( return bauiv1.Widget() -def can_show_ad() -> bool: - """(internal)""" - return bool() - - def checkboxwidget( edit: bauiv1.Widget | None = None, parent: bauiv1.Widget | None = None, @@ -260,16 +262,6 @@ def columnwidget( 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, @@ -316,14 +308,6 @@ def containerwidget( 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. @@ -362,16 +346,6 @@ def gettexture(name: str) -> bauiv1.Texture: 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, @@ -436,17 +410,14 @@ def imagewidget( return bauiv1.Widget() -def is_party_icon_visible() -> bool: +def is_available() -> bool: """(internal)""" return bool() -def open_file_externally(path: str) -> None: - """(internal) - - Open the provided file in the default external app. - """ - return None +def is_party_icon_visible() -> bool: + """(internal)""" + return bool() def open_url(address: str, force_internal: bool = False) -> None: @@ -529,39 +500,6 @@ def set_party_window_open(value: bool) -> None: 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, @@ -598,6 +536,10 @@ def textwidget( big: bool | None = None, extra_touch_border_scale: float | None = None, res_scale: float | None = None, + query_max_chars: bauiv1.Widget | None = None, + query_description: bauiv1.Widget | None = None, + adapter_finished: bool | None = None, + glow_type: str | None = None, ) -> bauiv1.Widget: """Create or edit a text widget. @@ -612,6 +554,11 @@ def textwidget( return bauiv1.Widget() +def toolbar_test() -> bool: + """(internal)""" + return bool() + + def uibounds() -> tuple[float, float, float, float]: """(internal)