From 45cf54fda9427b69bc7e3a5ca65eee67b112cbc6 Mon Sep 17 00:00:00 2001 From: Roman Trapeznikov Date: Sat, 12 Feb 2022 15:54:20 +0300 Subject: [PATCH] update dummymodule.py --- assets/src/ba_data/python/._ba_sources_hash | 2 +- assets/src/ba_data/python/_ba.py | 1510 ++++------------- .../python/class/python_class_input_device.cc | 3 +- .../python/class/python_class_node.cc | 15 +- .../class/python_class_session_player.cc | 3 +- .../python/class/python_class_widget.cc | 16 +- tools/batools/dummymodule.py | 19 +- 7 files changed, 334 insertions(+), 1234 deletions(-) diff --git a/assets/src/ba_data/python/._ba_sources_hash b/assets/src/ba_data/python/._ba_sources_hash index 8fc7c329..1b6ebb63 100644 --- a/assets/src/ba_data/python/._ba_sources_hash +++ b/assets/src/ba_data/python/._ba_sources_hash @@ -1 +1 @@ -144616568017325747730083301686242056706 \ No newline at end of file +191473689765959071642564573343309028448 \ No newline at end of file diff --git a/assets/src/ba_data/python/_ba.py b/assets/src/ba_data/python/_ba.py index d655f62d..811ac366 100644 --- a/assets/src/ba_data/python/_ba.py +++ b/assets/src/ba_data/python/_ba.py @@ -56,32 +56,21 @@ class ActivityData: """(internal)""" def exists(self) -> bool: - """exists() -> bool - - Returns whether the ActivityData still exists. + """Returns whether the ActivityData still exists. Most functionality will fail on a nonexistent instance. """ return bool() def expire(self) -> None: - """expire() -> None - - Expires the internal data for the activity - """ + """Expires the internal data for the activity""" return None def make_foreground(self) -> None: - """make_foreground() -> None - - Sets this activity as the foreground one in its session. - """ + """Sets this activity as the foreground one in its session.""" return None def start(self) -> None: - """start() -> None - - Begins the activity running - """ + """Begins the activity running""" return None @@ -96,9 +85,7 @@ class CollideModel: class Context: - """Context(source: Any) - - A game context state. + """A game context state. Category: General Utility Classes @@ -165,9 +152,7 @@ class Context: class ContextCall: - """ContextCall(call: Callable) - - A context-preserving callable. + """A context-preserving callable. Category: General Utility Classes @@ -221,9 +206,7 @@ class Data: """ def getvalue(self) -> Any: - """getvalue() -> Any - - Return the data object's value. + """Return the data object's value. This can consist of anything representable by json (dicts, lists, numbers, bools, None, etc). @@ -292,34 +275,27 @@ class InputDevice: is_remote_client: bool def exists(self) -> bool: - """exists() -> bool - - Return whether the underlying device for this object is still present. + """Return whether the underlying device for this object is + still present. """ return bool() def get_account_name(self, full: bool) -> str: - """get_account_name(full: bool) -> str - - Returns the account name associated with this device. + """Returns the account name associated with this device. (can be used to get account names for remote players) """ return str() def get_axis_name(self, axis_id: int) -> str: - """get_axis_name(axis_id: int) -> str - - Given an axis ID, return the name of the axis on this device. + """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) -> ba.Lstr: - """get_button_name(button_id: int) -> ba.Lstr - - Given a button ID, return a human-readable name for that key/button. + """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. """ @@ -327,9 +303,7 @@ class InputDevice: return ba.Lstr(value='') def get_default_player_name(self) -> str: - """get_default_player_name() -> str - - (internal) + """(internal) Returns the default player name for this device. (used for the 'random' profile) @@ -337,31 +311,20 @@ class InputDevice: return str() def get_player_profiles(self) -> dict: - """get_player_profiles() -> dict - - (internal) - """ + """(internal)""" return dict() def is_connected_to_remote_player(self) -> bool: - """is_connected_to_remote_player() -> bool - - (internal) - """ + """(internal)""" return bool() def remove_remote_player_from_game(self) -> None: - """remove_remote_player_from_game() -> None - - (internal) - """ + """(internal)""" return None class Material: - """Material(label: str = None) - - An entity applied to game objects to modify collision behavior. + """An entity applied to game objects to modify collision behavior. Category: Gameplay Classes @@ -373,8 +336,8 @@ class Material: 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. + ``'roller_materials'``, and ``'punch_materials'``, which correspond + to the various parts it creates. Use ba.Material to instantiate a blank material, and then use its ba.Material.add_actions method to define what the material does. @@ -393,10 +356,7 @@ class Material: def add_actions(self, actions: tuple, conditions: Optional[tuple] = None) -> None: - """add_actions(actions: tuple, conditions: Optional[tuple] = None) - -> None - - Add one or more actions to the material, optionally with conditions. + """Add one or more actions to the material, optionally with conditions. Conditions: Conditions are provided as tuples which can be combined @@ -692,22 +652,18 @@ class Node: tint: Sequence[float] = (1.0, 1.0, 1.0) def add_death_action(self, action: Callable[[], None]) -> None: - """add_death_action(action: Callable[[], None]) -> None - - Add a callable object to be called upon this node's death. + """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 connectattr(self, srcattr: str, dstnode: Node, dstattr: str) -> None: - """connectattr(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. + """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: @@ -720,17 +676,13 @@ class Node: return None def delete(self, ignore_missing: bool = True) -> None: - """delete(ignore_missing: bool = True) -> None - - Delete the node. Ignores already-deleted nodes if ignore_missing + """Delete the node. Ignores already-deleted nodes if ignore_missing is True; otherwise a ba.NodeNotFoundError is thrown. """ return None def exists(self) -> bool: - """exists() -> bool - - Returns whether the Node still exists. + """Returns whether the Node still exists. Most functionality will fail on a nonexistent Node, so it's never a bad idea to check this. @@ -752,9 +704,8 @@ class Node: ... def getdelegate(self, type: Any, doraise: bool = False) -> Any: - """getdelegate(type: type, doraise: bool = False) -> - - Return the node's current delegate object if it matches a certain type. + """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 @@ -763,24 +714,17 @@ class Node: return None def getname(self) -> str: - """getname() -> str - - Return the name assigned to a Node; used mainly for debugging - """ + """Return the name assigned to a Node; used mainly for debugging""" return str() def getnodetype(self) -> str: - """getnodetype() -> str - - Return the type of Node referenced by this object as a string. + """Return the type of Node referenced by this object as a string. (Note this is different from the Python type which is always ba.Node) """ return str() def handlemessage(self, *args: Any) -> None: - """handlemessage(*args: Any) -> None - - General message handling; can be passed any message object. + """General message handling; can be passed any message object. All standard message objects are forwarded along to the ba.Node's delegate for handling (generally the ba.Actor that made the node). @@ -800,9 +744,7 @@ class SessionData: """(internal)""" def exists(self) -> bool: - """exists() -> bool - - Returns whether the SessionData still exists. + """Returns whether the SessionData still exists. Most functionality will fail on a nonexistent instance. """ return bool() @@ -869,24 +811,15 @@ class SessionPlayer: def assigninput(self, type: Union[ba.InputType, tuple[ba.InputType, ...]], call: Callable) -> None: - """assigninput(type: Union[ba.InputType, tuple[ba.InputType, ...]], - call: Callable) -> None - - Set the python callable to be run for one or more types of input. - """ + """Set the python callable to be run for one or more types of input.""" return None def exists(self) -> bool: - """exists() -> bool - - Return whether the underlying player is still in the game. - """ + """Return whether the underlying player is still in the game.""" return bool() def get_account_id(self) -> str: - """get_account_id() -> str - - Return the Account ID this player is signed in under, if + """Return the 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) @@ -896,85 +829,56 @@ class SessionPlayer: return str() def get_icon(self) -> dict[str, Any]: - """get_icon() -> dict[str, Any] - - Returns the character's icon (images, colors, etc contained in a dict) + """Returns the character's icon (images, colors, etc contained + in a dict. """ return {'foo': 'bar'} def get_icon_info(self) -> dict[str, Any]: - """get_icon_info() -> dict[str, Any] - - (internal) - """ + """(internal)""" return {'foo': 'bar'} def getname(self, full: bool = False, icon: bool = True) -> str: - """getname(full: bool = False, icon: bool = True) -> str - - Returns the player's name. If icon is True, the long version of the + """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: - """remove_from_game() -> None - - Removes the player from the game. - """ + """Removes the player from the game.""" return None def resetinput(self) -> None: - """resetinput() -> None - - Clears out the player's assigned input actions. - """ + """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: - """set_icon_info(texture: str, tint_texture: str, - tint_color: Sequence[float], tint2_color: Sequence[float]) -> None - - (internal) - """ + """(internal)""" return None def setactivity(self, activity: Optional[ba.Activity]) -> None: - """setactivity(activity: Optional[ba.Activity]) -> None - - (internal) - """ + """(internal)""" return None def setdata(self, team: ba.SessionTeam, character: str, color: Sequence[float], highlight: Sequence[float]) -> None: - """setdata(team: ba.SessionTeam, character: str, - color: Sequence[float], highlight: Sequence[float]) -> None - - (internal) - """ + """(internal)""" return None def setname(self, name: str, full_name: str = None, real: bool = True) -> None: - """setname(name: str, full_name: str = None, real: bool = True) - -> None - - Set the player's name to the provided string. + """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: Optional[Node]) -> None: - """setnode(node: Optional[Node]) -> None - - (internal) - """ + """(internal)""" return None @@ -999,12 +903,7 @@ class Texture: class Timer: - """Timer(time: float, call: Callable[[], Any], repeat: bool = False, - timetype: ba.TimeType = TimeType.SIM, - timeformat: ba.TimeFormat = TimeFormat.SECONDS, - suppress_format_warning: bool = False) - - Timers are used to run code at later points in time. + """Timers are used to run code at later points in time. Category: General Utility Classes @@ -1151,31 +1050,19 @@ class Vec3(Sequence[float]): pass def cross(self, other: Vec3) -> Vec3: - """cross(other: Vec3) -> Vec3 - - Returns the cross product of this vector and another. - """ + """Returns the cross product of this vector and another.""" return Vec3() def dot(self, other: Vec3) -> float: - """dot(other: Vec3) -> float - - Returns the dot product of this vector and another. - """ + """Returns the dot product of this vector and another.""" return float() def length(self) -> float: - """length() -> float - - Returns the length of the vector. - """ + """Returns the length of the vector.""" return float() def normalized(self) -> Vec3: - """normalized() -> Vec3 - - Returns a normalized version of the vector. - """ + """Returns a normalized version of the vector.""" return Vec3() @@ -1190,31 +1077,21 @@ class Widget: """ def activate(self) -> None: - """activate() -> None - - Activates a widget; the same as if it had been clicked. - """ + """Activates a widget; the same as if it had been clicked.""" return None def add_delete_callback(self, call: Callable) -> None: - """add_delete_callback(call: Callable) -> None - - Add a call to be run immediately after this widget is destroyed. - """ + """Add a call to be run immediately after this widget is destroyed.""" return None def delete(self, ignore_missing: bool = True) -> None: - """delete(ignore_missing: bool = True) -> None - - Delete the Widget. Ignores already-deleted Widgets if ignore_missing - is True; otherwise an Exception is thrown. + """Delete the Widget. Ignores already-deleted Widgets if ignore_missing + is True; otherwise an Exception is thrown. """ return None def exists(self) -> bool: - """exists() -> bool - - Returns whether the Widget still exists. + """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 @@ -1224,59 +1101,41 @@ class Widget: return bool() def get_children(self) -> list[ba.Widget]: - """get_children() -> list[ba.Widget] - - Returns any child Widgets of this Widget. - """ + """Returns any child Widgets of this Widget.""" return [Widget()] def get_screen_space_center(self) -> tuple[float, float]: - """get_screen_space_center() -> tuple[float, float] - - Returns the coords of the Widget center relative to the center of the - screen. This can be useful for placing pop-up windows and other special - cases. + """Returns the coords of the ba.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) -> Optional[ba.Widget]: - """get_selected_child() -> Optional[ba.Widget] - - Returns the selected child Widget or None if nothing is selected. - """ + """Returns the selected child Widget or None if nothing is selected.""" return Widget() def get_widget_type(self) -> str: - """get_widget_type() -> str - - Return the internal type of the Widget as a string. Note that this is - different from the Python ba.Widget type, which is the same for all - widgets. + """Return the internal type of the Widget as a string. Note that this + is different from the Python ba.Widget type, which is the same for + all widgets. """ return str() def _app() -> ba.App: - """_app() -> ba.App - - (internal) - """ + """(internal)""" import ba # pylint: disable=cyclic-import return ba.App() def accept_party_invitation(invite_id: str) -> None: - """accept_party_invitation(invite_id: str) -> None - - (internal) - """ + """(internal)""" return None def add_clean_frame_callback(call: Callable) -> None: - """add_clean_frame_callback(call: Callable) -> None - - (internal) + """(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 @@ -1286,17 +1145,12 @@ def add_clean_frame_callback(call: Callable) -> None: def add_transaction(transaction: dict, callback: Callable = None) -> None: - """add_transaction(transaction: dict, callback: Callable = None) -> None - - (internal) - """ + """(internal)""" return None def android_get_external_storage_path() -> str: - """android_get_external_storage_path() -> str - - (internal) + """(internal) Returns the android external storage path, or None if there is none on this device @@ -1305,9 +1159,7 @@ def android_get_external_storage_path() -> str: def android_media_scan_file(file_name: str) -> None: - """android_media_scan_file(file_name: str) -> None - - (internal) + """(internal) Refreshes Android MTP Index for a file; use this to get file modifications to be reflected in Android File Transfer. @@ -1316,33 +1168,22 @@ def android_media_scan_file(file_name: str) -> None: def android_show_wifi_settings() -> None: - """android_show_wifi_settings() -> None - - (internal) - """ + """(internal)""" return None def apply_config() -> None: - """apply_config() -> None - - (internal) - """ + """(internal)""" return None def appname() -> str: - """appname() -> str - - (internal) - """ + """(internal)""" return str() def appnameupper() -> str: - """appnameupper() -> str - - (internal) + """(internal) Return whether this build of the game can display full unicode such as Emoji, Asian languages, etc. @@ -1351,18 +1192,12 @@ def appnameupper() -> str: def back_press() -> None: - """back_press() -> None - - (internal) - """ + """(internal)""" return None def bless() -> None: - """bless() -> None - - (internal) - """ + """(internal)""" return None @@ -1403,45 +1238,7 @@ def buttonwidget(edit: ba.Widget = None, text_flatness: float = None, text_res_scale: float = None, enabled: bool = None) -> ba.Widget: - """buttonwidget(edit: ba.Widget = None, - parent: ba.Widget = None, - size: Sequence[float] = None, - position: Sequence[float] = None, - on_activate_call: Callable = None, - label: Union[str, ba.Lstr] = None, - color: Sequence[float] = None, - down_widget: ba.Widget = None, - up_widget: ba.Widget = None, - left_widget: ba.Widget = None, - right_widget: ba.Widget = None, - texture: ba.Texture = None, - text_scale: float = None, - textcolor: Sequence[float] = None, - enable_sound: bool = None, - model_transparent: ba.Model = None, - model_opaque: ba.Model = None, - repeat: bool = None, - scale: float = None, - transition_delay: float = None, - on_select_call: Callable = None, - button_type: str = None, - extra_touch_border_scale: float = None, - selectable: bool = None, - show_buffer_top: float = None, - icon: ba.Texture = None, - iconscale: float = None, - icon_tint: float = None, - icon_color: Sequence[float] = None, - autoselect: bool = None, - mask_texture: ba.Texture = None, - tint_texture: ba.Texture = None, - tint_color: Sequence[float] = None, - tint2_color: Sequence[float] = None, - text_flatness: float = None, - text_res_scale: float = None, - enabled: bool = None) -> ba.Widget - - Create or edit a button widget. + """Create or edit a button widget. Category: User Interface Functions @@ -1454,9 +1251,7 @@ def buttonwidget(edit: ba.Widget = None, def camerashake(intensity: float = 1.0) -> None: - """camerashake(intensity: float = 1.0) -> None - - Shake the camera. + """Shake the camera. Category: Gameplay Functions @@ -1468,25 +1263,17 @@ def camerashake(intensity: float = 1.0) -> None: def can_display_full_unicode() -> bool: - """can_display_full_unicode() -> bool - - (internal) - """ + """(internal)""" return bool() def can_show_ad() -> bool: - """can_show_ad() -> bool - - (internal) - """ + """(internal)""" return bool() def capture_gamepad_input(call: Callable[[dict], None]) -> None: - """capture_gamepad_input(call: Callable[[dict], None]) -> None - - (internal) + """(internal) Add a callable to be called for subsequent gamepad events. The method is passed a dict containing info about the event. @@ -1495,9 +1282,7 @@ def capture_gamepad_input(call: Callable[[dict], None]) -> None: def capture_keyboard_input(call: Callable[[dict], None]) -> None: - """capture_keyboard_input(call: Callable[[dict], None]) -> None - - (internal) + """(internal) Add a callable to be called for subsequent keyboard-game-pad events. The method is passed a dict containing info about the event. @@ -1506,9 +1291,7 @@ def capture_keyboard_input(call: Callable[[dict], None]) -> None: def charstr(char_id: ba.SpecialChar) -> str: - """charstr(char_id: ba.SpecialChar) -> str - - Get a unicode string representing a special character. + """Get a unicode string representing a special character. Category: General Utility Functions @@ -1524,12 +1307,7 @@ def charstr(char_id: ba.SpecialChar) -> str: def chatmessage(message: Union[str, ba.Lstr], clients: Sequence[int] = None, sender_override: str = None) -> None: - """chatmessage(message: Union[str, ba.Lstr], - clients: Sequence[int] = None, - sender_override: str = None) -> None - - (internal) - """ + """(internal)""" return None @@ -1548,23 +1326,7 @@ def checkboxwidget(edit: ba.Widget = None, maxwidth: float = None, autoselect: bool = None, color: Sequence[float] = None) -> ba.Widget: - """checkboxwidget(edit: ba.Widget = None, - parent: ba.Widget = None, - size: Sequence[float] = None, - position: Sequence[float] = None, - text: Union[ba.Lstr, str] = None, - value: bool = None, - on_value_change_call: Callable[[bool], None] = None, - on_select_call: Callable[[], None] = None, - text_scale: float = None, - textcolor: Sequence[float] = None, - scale: float = None, - is_radio_button: bool = None, - maxwidth: float = None, - autoselect: bool = None, - color: Sequence[float] = None) -> ba.Widget - - Create or edit a check-box widget. + """Create or edit a check-box widget. Category: User Interface Functions @@ -1577,17 +1339,12 @@ def checkboxwidget(edit: ba.Widget = None, def client_info_query_response(token: str, response: Any) -> None: - """client_info_query_response(token: str, response: Any) -> None - - (internal) - """ + """(internal)""" return None def clipboard_get_text() -> str: - """clipboard_get_text() -> str - - Return text currently on the system clipboard. + """Return text currently on the system clipboard. Category: General Utility Functions @@ -1598,9 +1355,7 @@ def clipboard_get_text() -> str: def clipboard_has_text() -> bool: - """clipboard_has_text() -> bool - - Return whether there is currently text on the clipboard. + """Return whether there is currently text on the clipboard. Category: General Utility Functions @@ -1611,9 +1366,7 @@ def clipboard_has_text() -> bool: def clipboard_is_supported() -> bool: - """clipboard_is_supported() -> bool - - Return whether this platform supports clipboard operations at all. + """Return whether this platform supports clipboard operations at all. Category: General Utility Functions @@ -1624,9 +1377,7 @@ def clipboard_is_supported() -> bool: def clipboard_set_text(value: str) -> None: - """clipboard_set_text(value: str) -> None - - Copy a string to the system clipboard. + """Copy a string to the system clipboard. Category: General Utility Functions @@ -1653,25 +1404,7 @@ def columnwidget(edit: ba.Widget = None, margin: float = None, claims_left_right: bool = None, claims_tab: bool = None) -> ba.Widget: - """columnwidget(edit: ba.Widget = None, - parent: ba.Widget = None, - size: Sequence[float] = None, - position: Sequence[float] = None, - background: bool = None, - selected_child: ba.Widget = None, - visible_child: ba.Widget = None, - single_depth: bool = None, - print_list_exit_instructions: bool = None, - left_border: float = None, - top_border: float = None, - bottom_border: float = None, - selection_loops_to_parent: bool = None, - border: float = None, - margin: float = None, - claims_left_right: bool = None, - claims_tab: bool = None) -> ba.Widget - - Create or edit a column widget. + """Create or edit a column widget. Category: User Interface Functions @@ -1684,28 +1417,19 @@ def columnwidget(edit: ba.Widget = None, def commit_config(config: str) -> None: - """commit_config(config: str) -> None - - (internal) - """ + """(internal)""" return None def connect_to_party(address: str, port: int = None, print_progress: bool = True) -> None: - """connect_to_party(address: str, port: int = None, - print_progress: bool = True) -> None - - (internal) - """ + """(internal)""" return None def console_print(*args: Any) -> None: - """console_print(*args: Any) -> None - - (internal) + """(internal) Print the provided args to the game console (using str()). For most debugging/info purposes you should just use Python's standard @@ -1745,39 +1469,7 @@ def containerwidget(edit: ba.Widget = None, on_select_call: Callable[[], None] = None, claim_outside_clicks: bool = None, claims_up_down: bool = None) -> ba.Widget: - """containerwidget(edit: ba.Widget = None, - parent: ba.Widget = None, - size: Sequence[float] = None, - position: Sequence[float] = None, - background: bool = None, - selected_child: ba.Widget = None, - transition: str = None, - cancel_button: ba.Widget = None, - start_button: ba.Widget = None, - root_selectable: bool = None, - on_activate_call: Callable[[], None] = None, - claims_left_right: bool = None, - claims_tab: bool = None, - selection_loops: bool = None, - selection_loops_to_parent: bool = None, - scale: float = None, - on_outside_click_call: Callable[[], None] = None, - single_depth: bool = None, - visible_child: ba.Widget = None, - stack_offset: Sequence[float] = None, - color: Sequence[float] = None, - on_cancel_call: Callable[[], None] = None, - print_list_exit_instructions: bool = None, - click_activate: bool = None, - always_highlight: bool = None, - selectable: bool = None, - scale_origin_stack_offset: Sequence[float] = None, - toolbar_visibility: str = None, - on_select_call: Callable[[], None] = None, - claim_outside_clicks: bool = None, - claims_up_down: bool = None) -> ba.Widget - - Create or edit a container widget. + """Create or edit a container widget. Category: User Interface Functions @@ -1790,9 +1482,7 @@ def containerwidget(edit: ba.Widget = None, def debug_print_py_err() -> None: - """debug_print_py_err() -> None - - (internal) + """(internal) Debugging func for tracking leaked Python errors in the C++ layer.. """ @@ -1800,17 +1490,12 @@ def debug_print_py_err() -> None: def disconnect_client(client_id: int, ban_time: int = 300) -> bool: - """disconnect_client(client_id: int, ban_time: int = 300) -> bool - - (internal) - """ + """(internal)""" return bool() def disconnect_from_host() -> None: - """disconnect_from_host() -> None - - (internal) + """(internal) Category: General Utility Functions """ @@ -1818,9 +1503,7 @@ def disconnect_from_host() -> None: def do_once() -> bool: - """do_once() -> bool - - Return whether this is the first time running a line of code. + """Return whether this is the first time running a line of code. Category: General Utility Functions @@ -1841,10 +1524,7 @@ def do_once() -> bool: def ehv() -> None: - """ehv() -> None - - (internal) - """ + """(internal)""" return None @@ -1856,13 +1536,7 @@ def emitfx(position: Sequence[float], chunk_type: str = 'rock', emit_type: str = 'chunks', tendril_type: str = 'smoke') -> None: - """emitfx(position: Sequence[float], - velocity: Optional[Sequence[float]] = 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. + """Emit particles, smoke, etc. into the fx sim layer. Category: Gameplay Functions @@ -1875,9 +1549,7 @@ def emitfx(position: Sequence[float], def end_host_scanning() -> None: - """end_host_scanning() -> None - - (internal) + """(internal) Category: General Utility Functions """ @@ -1885,9 +1557,7 @@ def end_host_scanning() -> None: def env() -> dict: - """env() -> dict - - (internal) + """(internal) Returns a dict containing general info about the operating environment such as version, platform, etc. @@ -1898,20 +1568,14 @@ def env() -> dict: def evaluate_lstr(value: str) -> str: - """evaluate_lstr(value: str) -> str - - (internal) - """ + """(internal)""" return str() def fade_screen(to: int = 0, time: float = 0.25, endcall: Optional[Callable[[], None]] = None) -> None: - """fade_screen(to: int = 0, time: float = 0.25, - endcall: Optional[Callable[[], None]] = None) -> None - - (internal) + """(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 @@ -1922,9 +1586,7 @@ def fade_screen(to: int = 0, def focus_window() -> None: - """focus_window() -> None - - (internal) + """(internal) A workaround for some unintentional backgrounding that occurs on mac """ @@ -1932,9 +1594,7 @@ def focus_window() -> None: def game_service_has_leaderboard(game: str, config: str) -> bool: - """game_service_has_leaderboard(game: str, config: str) -> bool - - (internal) + """(internal) Given a game and config string, returns whether there is a leaderboard for it on the game service. @@ -1943,65 +1603,42 @@ def game_service_has_leaderboard(game: str, config: str) -> bool: def get_account_display_string(full: bool = True) -> str: - """get_account_display_string(full: bool = True) -> str - - (internal) - """ + """(internal)""" return str() def get_account_misc_read_val(name: str, default_value: Any) -> Any: - """get_account_misc_read_val(name: str, default_value: Any) -> Any - - (internal) - """ + """(internal)""" return _uninferrable() def get_account_misc_read_val_2(name: str, default_value: Any) -> Any: - """get_account_misc_read_val_2(name: str, default_value: Any) -> Any - - (internal) - """ + """(internal)""" return _uninferrable() def get_account_misc_val(name: str, default_value: Any) -> Any: - """get_account_misc_val(name: str, default_value: Any) -> Any - - (internal) - """ + """(internal)""" return _uninferrable() def get_account_name() -> str: - """get_account_name() -> str - - (internal) - """ + """(internal)""" return str() def get_account_state() -> str: - """get_account_state() -> str - - (internal) - """ + """(internal)""" return str() def get_account_state_num() -> int: - """get_account_state_num() -> int - - (internal) - """ + """(internal)""" return int() def get_account_ticket_count() -> int: - """get_account_ticket_count() -> int - - (internal) + """(internal) Returns the number of tickets for the current account. """ @@ -2009,33 +1646,22 @@ def get_account_ticket_count() -> int: def get_account_type() -> str: - """get_account_type() -> str - - (internal) - """ + """(internal)""" return str() def get_appconfig_builtin_keys() -> list[str]: - """get_appconfig_builtin_keys() -> list[str] - - (internal) - """ + """(internal)""" return ['blah', 'blah2'] def get_appconfig_default_value(key: str) -> Any: - """get_appconfig_default_value(key: str) -> Any - - (internal) - """ + """(internal)""" return _uninferrable() def get_camera_position() -> tuple[float, ...]: - """get_camera_position() -> tuple[float, ...] - - (internal) + """(internal) WARNING: these camera controls will not apply to network clients and may behave unpredictably in other ways. Use them only for @@ -2045,9 +1671,7 @@ def get_camera_position() -> tuple[float, ...]: def get_camera_target() -> tuple[float, ...]: - """get_camera_target() -> tuple[float, ...] - - (internal) + """(internal) WARNING: these camera controls will not apply to network clients and may behave unpredictably in other ways. Use them only for @@ -2057,17 +1681,12 @@ def get_camera_target() -> tuple[float, ...]: def get_chat_messages() -> list[str]: - """get_chat_messages() -> list[str] - - (internal) - """ + """(internal)""" return ['blah', 'blah2'] def get_collision_info(*args: Any) -> Any: - """get_collision_info(*args: Any) -> Any - - Return collision related values + """Return collision related values Category: Gameplay Functions @@ -2079,9 +1698,7 @@ def get_collision_info(*args: Any) -> Any: def get_configurable_game_pads() -> list: - """get_configurable_game_pads() -> list - - (internal) + """(internal) Returns a list of the currently connected gamepads that can be configured. @@ -2090,17 +1707,12 @@ def get_configurable_game_pads() -> list: def get_connection_to_host_info() -> dict: - """get_connection_to_host_info() -> dict - - (internal) - """ + """(internal)""" return dict() def get_display_resolution() -> Optional[tuple[int, int]]: - """get_display_resolution() -> Optional[tuple[int, int]] - - (internal) + """(internal) Return the currently selected display resolution for fullscreen display. Returns None if resolutions cannot be directly set. @@ -2109,9 +1721,7 @@ def get_display_resolution() -> Optional[tuple[int, int]]: def get_foreground_host_activity() -> Optional[ba.Activity]: - """get_foreground_host_activity() -> Optional[ba.Activity] - - (internal) + """(internal) Returns the ba.Activity currently in the foreground, or None if there is none. @@ -2121,9 +1731,7 @@ def get_foreground_host_activity() -> Optional[ba.Activity]: def get_foreground_host_session() -> Optional[ba.Session]: - """get_foreground_host_session() -> Optional[ba.Session] - - (internal) + """(internal) Return the ba.Session currently being displayed, or None if there is none. @@ -2133,9 +1741,7 @@ def get_foreground_host_session() -> Optional[ba.Session]: def get_game_port() -> int: - """get_game_port() -> int - - (internal) + """(internal) Return the port ballistica is hosting on. """ @@ -2143,25 +1749,17 @@ def get_game_port() -> int: def get_game_roster() -> list[dict[str, Any]]: - """get_game_roster() -> list[dict[str, Any]] - - (internal) - """ + """(internal)""" return [{'foo': 'bar'}] def get_google_play_party_client_count() -> int: - """get_google_play_party_client_count() -> int - - (internal) - """ + """(internal)""" return int() def get_idle_time() -> int: - """get_idle_time() -> int - - (internal) + """(internal) Returns the amount of time since any game input has been received. """ @@ -2169,17 +1767,12 @@ def get_idle_time() -> int: def get_local_active_input_devices_count() -> int: - """get_local_active_input_devices_count() -> int - - (internal) - """ + """(internal)""" return int() def get_log_file_path() -> str: - """get_log_file_path() -> str - - (internal) + """(internal) Return the path to the app log file. """ @@ -2187,20 +1780,14 @@ def get_log_file_path() -> str: def get_low_level_config_value(key: str, default_value: int) -> int: - """get_low_level_config_value(key: str, default_value: int) -> int - - (internal) - """ + """(internal)""" return int() def get_master_server_address(source: int = -1, version: int = 1, internal: bool = False) -> str: - """get_master_server_address(source: int = -1, version: int = 1, - internal: bool = False) -> str - - (internal) + """(internal) Return the address of the master server. """ @@ -2208,9 +1795,7 @@ def get_master_server_address(source: int = -1, def get_max_graphics_quality() -> str: - """get_max_graphics_quality() -> str - - (internal) + """(internal) Return the max graphics-quality supported on the current hardware. """ @@ -2218,121 +1803,79 @@ def get_max_graphics_quality() -> str: def get_news_show() -> str: - """get_news_show() -> str - - (internal) - """ + """(internal)""" return str() def get_package_collide_model(package: ba.AssetPackage, name: str) -> ba.CollideModel: - """get_package_collide_model(package: ba.AssetPackage, name: str) - -> ba.CollideModel - - (internal) - """ + """(internal)""" import ba # pylint: disable=cyclic-import return ba.CollideModel() def get_package_data(package: ba.AssetPackage, name: str) -> ba.Data: - """get_package_data(package: ba.AssetPackage, name: str) -> ba.Data - - (internal). - """ + """(internal).""" import ba # pylint: disable=cyclic-import return ba.Data() def get_package_model(package: ba.AssetPackage, name: str) -> ba.Model: - """get_package_model(package: ba.AssetPackage, name: str) -> ba.Model - - (internal) - """ + """(internal)""" import ba # pylint: disable=cyclic-import return ba.Model() def get_package_sound(package: ba.AssetPackage, name: str) -> ba.Sound: - """get_package_sound(package: ba.AssetPackage, name: str) -> ba.Sound - - (internal). - """ + """(internal).""" import ba # pylint: disable=cyclic-import return ba.Sound() def get_package_texture(package: ba.AssetPackage, name: str) -> ba.Texture: - """get_package_texture(package: ba.AssetPackage, name: str) -> ba.Texture - - (internal) - """ + """(internal)""" import ba # pylint: disable=cyclic-import return ba.Texture() def get_price(item: str) -> Optional[str]: - """get_price(item: str) -> Optional[str] - - (internal) - """ + """(internal)""" return '' def get_public_login_id() -> Optional[str]: - """get_public_login_id() -> Optional[str] - - (internal) - """ + """(internal)""" return '' def get_public_party_enabled() -> bool: - """get_public_party_enabled() -> bool - - (internal) - """ + """(internal)""" return bool() def get_public_party_max_size() -> int: - """get_public_party_max_size() -> int - - (internal) - """ + """(internal)""" return int() def get_purchased(item: str) -> bool: - """get_purchased(item: str) -> bool - - (internal) - """ + """(internal)""" return bool() def get_purchases_state() -> int: - """get_purchases_state() -> int - - (internal) - """ + """(internal)""" return int() def get_qrcode_texture(url: str) -> ba.Texture: - """get_qrcode_texture(url: str) -> ba.Texture - - (internal) - """ + """(internal)""" import ba # pylint: disable=cyclic-import return ba.Texture() def get_random_names() -> list: - """get_random_names() -> list - - (internal) + """(internal) Returns the random names used by the game. """ @@ -2340,9 +1883,7 @@ def get_random_names() -> list: def get_replay_speed_exponent() -> int: - """get_replay_speed_exponent() -> int - - (internal) + """(internal) Returns current replay speed value. Actual displayed speed is pow(2,speed). """ @@ -2350,33 +1891,22 @@ def get_replay_speed_exponent() -> int: def get_replays_dir() -> str: - """get_replays_dir() -> str - - (internal) - """ + """(internal)""" return str() def get_scores_to_beat(level: str, config: str, callback: Callable) -> None: - """get_scores_to_beat(level: str, config: str, callback: Callable) -> None - - (internal) - """ + """(internal)""" return None def get_special_widget(name: str) -> Widget: - """get_special_widget(name: str) -> Widget - - (internal) - """ + """(internal)""" return Widget() def get_string_height(string: str, suppress_warning: bool = False) -> float: - """get_string_height(string: str, suppress_warning: bool = False) -> float - - (internal) + """(internal) Given a string, returns its height using the standard small app font. @@ -2385,9 +1915,7 @@ def get_string_height(string: str, suppress_warning: bool = False) -> float: def get_string_width(string: str, suppress_warning: bool = False) -> float: - """get_string_width(string: str, suppress_warning: bool = False) -> float - - (internal) + """(internal) Given a string, returns its width using the standard small app font. @@ -2396,9 +1924,7 @@ def get_string_width(string: str, suppress_warning: bool = False) -> float: def get_thread_name() -> str: - """get_thread_name() -> str - - (internal) + """(internal) Returns the name of the current thread. This may vary depending on platform and should not be used in logic; @@ -2408,9 +1934,7 @@ def get_thread_name() -> str: def get_ui_input_device() -> ba.InputDevice: - """get_ui_input_device() -> ba.InputDevice - - (internal) + """(internal) Returns the input-device that currently owns the user interface, or None if there is none. @@ -2420,10 +1944,7 @@ def get_ui_input_device() -> ba.InputDevice: def get_v2_fleet() -> str: - """get_v2_fleet() -> str - - (internal) - """ + """(internal)""" return str() @@ -2439,9 +1960,7 @@ def getactivity(doraise: Literal[False]) -> Optional[ba.Activity]: def getactivity(doraise: bool = True) -> Optional[ba.Activity]: - """getactivity(doraise: bool = True) -> - - Return the current ba.Activity instance. + """Return the current ba.Activity instance. Category: Gameplay Functions @@ -2455,9 +1974,7 @@ def getactivity(doraise: bool = True) -> Optional[ba.Activity]: def getcollidemodel(name: str) -> ba.CollideModel: - """getcollidemodel(name: str) -> ba.CollideModel - - Return a collide-model, loading it if necessary. + """Return a collide-model, loading it if necessary. Category: Asset Functions @@ -2474,9 +1991,7 @@ def getcollidemodel(name: str) -> ba.CollideModel: def getdata(name: str) -> ba.Data: - """getdata(name: str) -> ba.Data - - Return a data, loading it if necessary. + """Return a data, loading it if necessary. Category: Asset Functions @@ -2504,10 +2019,7 @@ def getinputdevice(name: str, unique_id: str, def getinputdevice(name: str, unique_id: str, doraise: bool = True) -> Any: - """getinputdevice(name: str, unique_id: str, doraise: bool = True) - -> - - (internal) + """(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 @@ -2517,17 +2029,12 @@ def getinputdevice(name: str, unique_id: str, doraise: bool = True) -> Any: def getlog() -> str: - """getlog() -> str - - (internal) - """ + """(internal)""" return str() def getmodel(name: str) -> ba.Model: - """getmodel(name: str) -> ba.Model - - Return a model, loading it if necessary. + """Return a model, loading it if necessary. Category: Asset Functions @@ -2541,9 +2048,7 @@ def getmodel(name: str) -> ba.Model: def getnodes() -> list: - """getnodes() -> list - - Return all nodes in the current ba.Context. + """Return all nodes in the current ba.Context. Category: Gameplay Functions """ return list() @@ -2561,9 +2066,7 @@ def getsession(doraise: Literal[False]) -> Optional[ba.Session]: def getsession(doraise: bool = True) -> Optional[ba.Session]: - """getsession(doraise: bool = True) -> - - Category: Gameplay Functions + """Category: Gameplay Functions Returns the current ba.Session instance. Note that this is based on context; thus code being run in the UI @@ -2575,9 +2078,7 @@ def getsession(doraise: bool = True) -> Optional[ba.Session]: def getsound(name: str) -> ba.Sound: - """getsound(name: str) -> ba.Sound - - Return a sound, loading it if necessary. + """Return a sound, loading it if necessary. Category: Asset Functions @@ -2591,9 +2092,7 @@ def getsound(name: str) -> ba.Sound: def gettexture(name: str) -> ba.Texture: - """gettexture(name: str) -> ba.Texture - - Return a texture, loading it if necessary. + """Return a texture, loading it if necessary. Category: Asset Functions @@ -2607,9 +2106,7 @@ def gettexture(name: str) -> ba.Texture: def has_gamma_control() -> bool: - """has_gamma_control() -> bool - - (internal) + """(internal) Returns whether the system can adjust overall screen gamma) """ @@ -2617,9 +2114,7 @@ def has_gamma_control() -> bool: def has_user_mods() -> bool: - """has_user_mods() -> bool - - (internal) + """(internal) Returns whether the system varies from default configuration (by user mods, etc) @@ -2628,33 +2123,22 @@ def has_user_mods() -> bool: def has_user_run_commands() -> bool: - """has_user_run_commands() -> bool - - (internal) - """ + """(internal)""" return bool() def has_video_ads() -> bool: - """has_video_ads() -> bool - - (internal) - """ + """(internal)""" return bool() def have_chars(text: str) -> bool: - """have_chars(text: str) -> bool - - (internal) - """ + """(internal)""" return bool() def have_connected_clients() -> bool: - """have_connected_clients() -> bool - - (internal) + """(internal) Category: General Utility Functions """ @@ -2662,33 +2146,22 @@ def have_connected_clients() -> bool: def have_incentivized_ad() -> bool: - """have_incentivized_ad() -> bool - - (internal) - """ + """(internal)""" return bool() def have_outstanding_transactions() -> bool: - """have_outstanding_transactions() -> bool - - (internal) - """ + """(internal)""" return bool() def have_permission(permission: ba.Permission) -> bool: - """have_permission(permission: ba.Permission) -> bool - - (internal) - """ + """(internal)""" return bool() def have_touchscreen_input() -> bool: - """have_touchscreen_input() -> bool - - (internal) + """(internal) Returns whether or not a touch-screen input is present """ @@ -2696,10 +2169,7 @@ def have_touchscreen_input() -> bool: def host_scan_cycle() -> list: - """host_scan_cycle() -> list - - (internal) - """ + """(internal)""" return list() @@ -2719,19 +2189,7 @@ def hscrollwidget(edit: ba.Widget = None, claims_left_right: bool = None, claims_up_down: bool = None, claims_tab: bool = None) -> ba.Widget: - """hscrollwidget(edit: ba.Widget = None, parent: ba.Widget = None, - size: Sequence[float] = None, position: Sequence[float] = None, - background: bool = None, selected_child: ba.Widget = None, - capture_arrows: bool = None, - on_select_call: Callable[[], None] = None, - center_small_content: bool = None, color: Sequence[float] = None, - highlight: bool = None, border_opacity: float = None, - simple_culling_h: float = None, - claims_left_right: bool = None, - claims_up_down: bool = None, - claims_tab: bool = None) -> ba.Widget - - Create or edit a horizontal scroll widget. + """Create or edit a horizontal scroll widget. Category: User Interface Functions @@ -2761,18 +2219,7 @@ def imagewidget(edit: ba.Widget = None, tilt_scale: float = None, mask_texture: ba.Texture = None, radial_amount: float = None) -> ba.Widget: - """imagewidget(edit: ba.Widget = None, parent: ba.Widget = None, - size: Sequence[float] = None, position: Sequence[float] = None, - color: Sequence[float] = None, texture: ba.Texture = None, - opacity: float = None, model_transparent: ba.Model = None, - model_opaque: ba.Model = None, has_alpha_channel: bool = True, - tint_texture: ba.Texture = None, tint_color: Sequence[float] = None, - transition_delay: float = None, draw_controller: ba.Widget = None, - tint2_color: Sequence[float] = None, tilt_scale: float = None, - mask_texture: ba.Texture = None, radial_amount: float = None) - -> ba.Widget - - Create or edit an image widget. + """Create or edit an image widget. Category: User Interface Functions @@ -2785,17 +2232,12 @@ def imagewidget(edit: ba.Widget = None, def in_game_purchase(item: str, price: int) -> None: - """in_game_purchase(item: str, price: int) -> None - - (internal) - """ + """(internal)""" return None def in_game_thread() -> bool: - """in_game_thread() -> bool - - (internal) + """(internal) Returns whether or not the current thread is the game thread. """ @@ -2803,69 +2245,46 @@ def in_game_thread() -> bool: def increment_analytics_count(name: str, increment: int = 1) -> None: - """increment_analytics_count(name: str, increment: int = 1) -> None - - (internal) - """ + """(internal)""" return None def increment_analytics_count_raw_2(name: str, uses_increment: bool = True, increment: int = 1) -> None: - """increment_analytics_count_raw_2(name: str, - uses_increment: bool = True, increment: int = 1) -> None - - (internal) - """ + """(internal)""" return None def increment_analytics_counts_raw(name: str, increment: int = 1) -> None: - """increment_analytics_counts_raw(name: str, increment: int = 1) -> None - - (internal) - """ + """(internal)""" return None def invite_players() -> None: - """invite_players() -> None - - (internal) + """(internal) Category: General Utility Functions """ return None def is_blessed() -> bool: - """is_blessed() -> bool - - (internal) - """ + """(internal)""" return bool() def is_in_replay() -> bool: - """is_in_replay() -> bool - - (internal) - """ + """(internal)""" return bool() def is_log_full() -> bool: - """is_log_full() -> bool - - (internal) - """ + """(internal)""" return bool() def is_os_playing_music() -> bool: - """is_os_playing_music() -> bool - - (internal) + """(internal) Tells whether the OS is currently playing music of some sort. @@ -2875,9 +2294,7 @@ def is_os_playing_music() -> bool: def is_ouya_build() -> bool: - """is_ouya_build() -> bool - - (internal) + """(internal) Returns whether we're running the ouya-specific version """ @@ -2885,41 +2302,27 @@ def is_ouya_build() -> bool: def is_party_icon_visible() -> bool: - """is_party_icon_visible() -> bool - - (internal) - """ + """(internal)""" return bool() def is_running_on_fire_tv() -> bool: - """is_running_on_fire_tv() -> bool - - (internal) - """ + """(internal)""" return bool() def is_running_on_ouya() -> bool: - """is_running_on_ouya() -> bool - - (internal) - """ + """(internal)""" return bool() def is_xcode_build() -> bool: - """is_xcode_build() -> bool - - (internal) - """ + """(internal)""" return bool() def lock_all_input() -> None: - """lock_all_input() -> None - - (internal) + """(internal) Prevents all keyboard, mouse, and gamepad events from being processed. """ @@ -2927,10 +2330,7 @@ def lock_all_input() -> None: def log(message: str, to_stdout: bool = True, to_server: bool = True) -> None: - """log(message: str, to_stdout: bool = True, - to_server: bool = True) -> None - - Category: General Utility Functions + """Category: General Utility Functions Log a message. This goes to the default logging mechanism depending on the platform (stdout on mac, android log on android, etc). @@ -2946,65 +2346,42 @@ def log(message: str, to_stdout: bool = True, to_server: bool = True) -> None: def mac_music_app_get_library_source() -> None: - """mac_music_app_get_library_source() -> None - - (internal) - """ + """(internal)""" return None def mac_music_app_get_playlists() -> list[str]: - """mac_music_app_get_playlists() -> list[str] - - (internal) - """ + """(internal)""" return ['blah', 'blah2'] def mac_music_app_get_volume() -> int: - """mac_music_app_get_volume() -> int - - (internal) - """ + """(internal)""" return int() def mac_music_app_init() -> None: - """mac_music_app_init() -> None - - (internal) - """ + """(internal)""" return None def mac_music_app_play_playlist(playlist: str) -> bool: - """mac_music_app_play_playlist(playlist: str) -> bool - - (internal) - """ + """(internal)""" return bool() def mac_music_app_set_volume(volume: int) -> None: - """mac_music_app_set_volume(volume: int) -> None - - (internal) - """ + """(internal)""" return None def mac_music_app_stop() -> None: - """mac_music_app_stop() -> None - - (internal) - """ + """(internal)""" return None def mark_config_dirty() -> None: - """mark_config_dirty() -> None - - (internal) + """(internal) Category: General Utility Functions """ @@ -3012,17 +2389,12 @@ def mark_config_dirty() -> None: def mark_log_sent() -> None: - """mark_log_sent() -> None - - (internal) - """ + """(internal)""" return None def music_player_play(files: Any) -> None: - """music_player_play(files: Any) -> None - - (internal) + """(internal) Starts internal music file playback (for internal use) """ @@ -3030,9 +2402,7 @@ def music_player_play(files: Any) -> None: def music_player_set_volume(volume: float) -> None: - """music_player_set_volume(volume: float) -> None - - (internal) + """(internal) Sets internal music player volume (for internal use) """ @@ -3040,9 +2410,7 @@ def music_player_set_volume(volume: float) -> None: def music_player_shutdown() -> None: - """music_player_shutdown() -> None - - (internal) + """(internal) Finalizes internal music file playback (for internal use) """ @@ -3050,9 +2418,7 @@ def music_player_shutdown() -> None: def music_player_stop() -> None: - """music_player_stop() -> None - - (internal) + """(internal) Stops internal music file playback (for internal use) """ @@ -3061,28 +2427,18 @@ def music_player_stop() -> None: def new_host_session(sessiontype: type[ba.Session], benchmark_type: str = None) -> None: - """new_host_session(sessiontype: type[ba.Session], - benchmark_type: str = None) -> None - - (internal) - """ + """(internal)""" return None def new_replay_session(file_name: str) -> None: - """new_replay_session(file_name: str) -> None - - (internal) - """ + """(internal)""" return None def newactivity(activity_type: type[ba.Activity], settings: dict = None) -> ba.Activity: - """newactivity(activity_type: type[ba.Activity], - settings: dict = None) -> ba.Activity - - Instantiates a ba.Activity given a type object. + """Instantiates a ba.Activity given a type object. Category: General Utility Functions @@ -3098,11 +2454,7 @@ def newnode(type: str, attrs: dict = None, name: str = None, delegate: Any = None) -> Node: - """newnode(type: str, owner: ba.Node = None, - attrs: dict = None, name: str = None, delegate: Any = None) - -> Node - - Add a node of the given type to the game. + """Add a node of the given type to the game. Category: Gameplay Functions @@ -3124,9 +2476,7 @@ def newnode(type: str, def open_dir_externally(path: str) -> None: - """open_dir_externally(path: str) -> None - - (internal) + """(internal) Open the provided dir in the default external app. """ @@ -3134,9 +2484,7 @@ def open_dir_externally(path: str) -> None: def open_file_externally(path: str) -> None: - """open_file_externally(path: str) -> None - - (internal) + """(internal) Open the provided file in the default external app. """ @@ -3144,9 +2492,7 @@ def open_file_externally(path: str) -> None: def open_url(address: str) -> None: - """open_url(address: str) -> None - - Open a provided URL. + """Open a provided URL. Category: General Utility Functions @@ -3160,10 +2506,7 @@ def playsound(sound: Sound, volume: float = 1.0, position: Sequence[float] = None, host_only: bool = False) -> None: - """playsound(sound: Sound, volume: float = 1.0, - position: Sequence[float] = None, host_only: bool = False) -> None - - Play a ba.Sound a single time. + """Play a ba.Sound a single time. Category: Gameplay Functions @@ -3174,17 +2517,12 @@ def playsound(sound: Sound, def power_ranking_query(callback: Callable, season: Any = None) -> None: - """power_ranking_query(callback: Callable, season: Any = None) -> None - - (internal) - """ + """(internal)""" return None def print_context() -> None: - """print_context() -> None - - (internal) + """(internal) Prints info about the current context state; for debugging. """ @@ -3192,9 +2530,7 @@ def print_context() -> None: def print_load_info() -> None: - """print_load_info() -> None - - (internal) + """(internal) Category: General Utility Functions """ @@ -3202,25 +2538,17 @@ def print_load_info() -> None: def print_stderr(message: str) -> None: - """print_stderr(message: str) -> None - - (internal) - """ + """(internal)""" return None def print_stdout(message: str) -> None: - """print_stdout(message: str) -> None - - (internal) - """ + """(internal)""" return None def printnodes() -> None: - """printnodes() -> None - - Print various info about existing nodes; useful for debugging. + """Print various info about existing nodes; useful for debugging. Category: Gameplay Functions """ @@ -3228,9 +2556,7 @@ def printnodes() -> None: def printobjects() -> None: - """printobjects() -> None - - Print debugging info about game objects. + """Print debugging info about game objects. Category: General Utility Functions @@ -3241,20 +2567,14 @@ def printobjects() -> None: def purchase(item: str) -> None: - """purchase(item: str) -> None - - (internal) - """ + """(internal)""" return None def pushcall(call: Callable, from_other_thread: bool = False, suppress_other_thread_warning: bool = False) -> None: - """pushcall(call: Callable, from_other_thread: bool = False, - suppress_other_thread_warning: bool = False ) -> None - - Pushes a call onto the event loop to be run during the next cycle. + """Pushes a call onto the event loop to be run during the next cycle. Category: General Utility Functions @@ -3272,9 +2592,7 @@ def pushcall(call: Callable, def quit(soft: bool = False, back: bool = False) -> None: - """quit(soft: bool = False, back: bool = False) -> None - - Quit the game. + """Quit the game. Category: General Utility Functions @@ -3285,25 +2603,17 @@ def quit(soft: bool = False, back: bool = False) -> None: def register_activity(activity: ba.Activity) -> ActivityData: - """register_activity(activity: ba.Activity) -> ActivityData - - (internal) - """ + """(internal)""" return ActivityData() def register_session(session: ba.Session) -> SessionData: - """register_session(session: ba.Session) -> SessionData - - (internal) - """ + """(internal)""" return SessionData() def release_gamepad_input() -> None: - """release_gamepad_input() -> None - - (internal) + """(internal) Resumes normal gamepad event processing. """ @@ -3311,9 +2621,7 @@ def release_gamepad_input() -> None: def release_keyboard_input() -> None: - """release_keyboard_input() -> None - - (internal) + """(internal) Resumes normal keyboard event processing. """ @@ -3321,9 +2629,7 @@ def release_keyboard_input() -> None: def reload_media() -> None: - """reload_media() -> None - - (internal) + """(internal) Reload all currently loaded game media; useful for development/debugging. @@ -3332,59 +2638,37 @@ def reload_media() -> None: def report_achievement(achievement: str, pass_to_account: bool = True) -> None: - """report_achievement(achievement: str, pass_to_account: bool = True) - -> None - - (internal) - """ + """(internal)""" return None def request_permission(permission: ba.Permission) -> None: - """request_permission(permission: ba.Permission) -> None - - (internal) - """ + """(internal)""" return None def reset_achievements() -> None: - """reset_achievements() -> None - - (internal) - """ + """(internal)""" return None def reset_game_activity_tracking() -> None: - """reset_game_activity_tracking() -> None - - (internal) - """ + """(internal)""" return None def reset_random_player_names() -> None: - """reset_random_player_names() -> None - - (internal) - """ + """(internal)""" return None def resolve_appconfig_value(key: str) -> Any: - """resolve_appconfig_value(key: str) -> Any - - (internal) - """ + """(internal)""" return _uninferrable() def restore_purchases() -> None: - """restore_purchases() -> None - - (internal) - """ + """(internal)""" return None @@ -3398,16 +2682,7 @@ def rowwidget(edit: ba.Widget = None, claims_left_right: bool = None, claims_tab: bool = None, selection_loops_to_parent: bool = None) -> ba.Widget: - """rowwidget(edit: ba.Widget = None, parent: ba.Widget = None, - size: Sequence[float] = None, - position: Sequence[float] = None, - background: bool = None, selected_child: ba.Widget = None, - visible_child: ba.Widget = None, - claims_left_right: bool = None, - claims_tab: bool = None, - selection_loops_to_parent: bool = None) -> ba.Widget - - Create or edit a row widget. + """Create or edit a row widget. Category: User Interface Functions @@ -3420,19 +2695,13 @@ def rowwidget(edit: ba.Widget = None, def run_transactions() -> None: - """run_transactions() -> None - - (internal) - """ + """(internal)""" return None def safecolor(color: Sequence[float], target_intensity: float = 0.6) -> tuple[float, ...]: - """safecolor(color: Sequence[float], target_intensity: float = 0.6) - -> tuple[float, ...] - - Given a color tuple, return a color safe to display as text. + """Given a color tuple, return a color safe to display as text. Category: General Utility Functions @@ -3449,12 +2718,7 @@ def screenmessage(message: Union[str, ba.Lstr], log: bool = False, clients: Sequence[int] = None, transient: bool = False) -> None: - """screenmessage(message: Union[str, ba.Lstr], - color: Sequence[float] = None, top: bool = False, - image: dict[str, Any] = None, log: bool = False, - clients: Sequence[int] = None, transient: bool = False) -> None - - Print a message to the local client's screen, in a given color. + """Print a message to the local client's screen, in a given color. Category: General Utility Functions @@ -3489,20 +2753,7 @@ def scrollwidget(edit: ba.Widget = None, claims_up_down: bool = None, claims_tab: bool = None, autoselect: bool = None) -> ba.Widget: - """scrollwidget(edit: ba.Widget = None, parent: ba.Widget = None, - size: Sequence[float] = None, position: Sequence[float] = None, - background: bool = None, selected_child: ba.Widget = None, - capture_arrows: bool = False, on_select_call: Callable = None, - center_small_content: bool = None, color: Sequence[float] = None, - highlight: bool = None, border_opacity: float = None, - simple_culling_v: float = None, - selection_loops_to_parent: bool = None, - claims_left_right: bool = None, - claims_up_down: bool = None, - claims_tab: bool = None, - autoselect: bool = None) -> ba.Widget - - Create or edit a scroll widget. + """Create or edit a scroll widget. Category: User Interface Functions @@ -3515,17 +2766,12 @@ def scrollwidget(edit: ba.Widget = None, def set_admins(admins: list[str]) -> None: - """set_admins(admins: list[str]) -> None - - (internal) - """ + """(internal)""" return None def set_analytics_screen(screen: str) -> None: - """set_analytics_screen(screen: str) -> None - - Used for analytics to see where in the app players spend their time. + """Used for analytics to see where in the app players spend their time. Category: General Utility Functions @@ -3537,17 +2783,12 @@ def set_analytics_screen(screen: str) -> None: def set_authenticate_clients(enable: bool) -> None: - """set_authenticate_clients(enable: bool) -> None - - (internal) - """ + """(internal)""" return None def set_camera_manual(value: bool) -> None: - """set_camera_manual(value: bool) -> None - - (internal) + """(internal) WARNING: these camera controls will not apply to network clients and may behave unpredictably in other ways. Use them only for @@ -3557,9 +2798,7 @@ def set_camera_manual(value: bool) -> None: def set_camera_position(x: float, y: float, z: float) -> None: - """set_camera_position(x: float, y: float, z: float) -> None - - (internal) + """(internal) WARNING: these camera controls will not apply to network clients and may behave unpredictably in other ways. Use them only for @@ -3569,9 +2808,7 @@ def set_camera_position(x: float, y: float, z: float) -> None: def set_camera_target(x: float, y: float, z: float) -> None: - """set_camera_target(x: float, y: float, z: float) -> None - - (internal) + """(internal) WARNING: these camera controls will not apply to network clients and may behave unpredictably in other ways. Use them only for @@ -3581,9 +2818,7 @@ def set_camera_target(x: float, y: float, z: float) -> None: def set_debug_speed_exponent(speed: int) -> None: - """set_debug_speed_exponent(speed: int) -> None - - (internal) + """(internal) Sets the debug speed scale for the game. Actual speed is pow(2,speed). """ @@ -3591,46 +2826,30 @@ def set_debug_speed_exponent(speed: int) -> None: def set_enable_default_kick_voting(enable: bool) -> None: - """set_enable_default_kick_voting(enable: bool) -> None - - (internal) - """ + """(internal)""" return None def set_have_mods(have_mods: bool) -> None: - """set_have_mods(have_mods: bool) -> None - - (internal) - """ + """(internal)""" return None def set_internal_language_keys( listobj: list[tuple[str, str]], random_names_list: list[tuple[str, str]]) -> None: - """set_internal_language_keys(listobj: list[tuple[str, str]], - random_names_list: list[tuple[str, str]]) -> None - - (internal) - """ + """(internal)""" return None def set_low_level_config_value(key: str, value: int) -> None: - """set_low_level_config_value(key: str, value: int) -> None - - (internal) - """ + """(internal)""" return None def set_map_bounds( bounds: tuple[float, float, float, float, float, float]) -> None: - """set_map_bounds(bounds: tuple[float, float, float, float, float, float]) - -> None - - (internal) + """(internal) Set map bounds. Generally nodes that go outside of this box are killed. """ @@ -3638,73 +2857,47 @@ def set_map_bounds( def set_master_server_source(source: int) -> None: - """set_master_server_source(source: int) -> None - - (internal) - """ + """(internal)""" return None def set_party_icon_always_visible(value: bool) -> None: - """set_party_icon_always_visible(value: bool) -> None - - (internal) - """ + """(internal)""" return None def set_party_window_open(value: bool) -> None: - """set_party_window_open(value: bool) -> None - - (internal) - """ + """(internal)""" return None def set_platform_misc_read_vals(mode: str) -> None: - """set_platform_misc_read_vals(mode: str) -> None - - (internal) - """ + """(internal)""" return None def set_public_party_enabled(enabled: bool) -> None: - """set_public_party_enabled(enabled: bool) -> None - - (internal) - """ + """(internal)""" return None def set_public_party_max_size(max_size: int) -> None: - """set_public_party_max_size(max_size: int) -> None - - (internal) - """ + """(internal)""" return None def set_public_party_name(name: str) -> None: - """set_public_party_name(name: str) -> None - - (internal) - """ + """(internal)""" return None def set_public_party_stats_url(url: Optional[str]) -> None: - """set_public_party_stats_url(url: Optional[str]) -> None - - (internal) - """ + """(internal)""" return None def set_replay_speed_exponent(speed: int) -> None: - """set_replay_speed_exponent(speed: int) -> None - - (internal) + """(internal) Set replay speed. Actual displayed speed is pow(2, speed). """ @@ -3712,26 +2905,17 @@ def set_replay_speed_exponent(speed: int) -> None: def set_stress_testing(testing: bool, player_count: int) -> None: - """set_stress_testing(testing: bool, player_count: int) -> None - - (internal) - """ + """(internal)""" return None def set_telnet_access_enabled(enable: bool) -> None: - """set_telnet_access_enabled(enable: bool) - -> None - - (internal) - """ + """(internal)""" return None def set_thread_name(name: str) -> None: - """set_thread_name(name: str) -> None - - (internal) + """(internal) Sets the name of the current thread (on platforms where this is available). Thread names are only for debugging and should not be @@ -3741,17 +2925,12 @@ def set_thread_name(name: str) -> None: def set_touchscreen_editing(editing: bool) -> None: - """set_touchscreen_editing(editing: bool) -> None - - (internal) - """ + """(internal)""" return None def set_ui_input_device(input_device: Optional[ba.InputDevice]) -> None: - """set_ui_input_device(input_device: Optional[ba.InputDevice]) -> None - - (internal) + """(internal) Sets the input-device that currently owns the user interface. """ @@ -3759,41 +2938,25 @@ def set_ui_input_device(input_device: Optional[ba.InputDevice]) -> None: def setup_sigint() -> None: - """setup_sigint() -> None - - (internal) - """ + """(internal)""" return None def show_ad(purpose: str, on_completion_call: Callable[[], None] = None) -> None: - """show_ad(purpose: str, on_completion_call: Callable[[], None] = None) - -> None - - (internal) - """ + """(internal)""" return None def show_ad_2(purpose: str, on_completion_call: Callable[[bool], None] = None) -> None: - """show_ad_2(purpose: str, - on_completion_call: Callable[[bool], None] = None) - -> None - - (internal) - """ + """(internal)""" return None def show_app_invite(title: Union[str, ba.Lstr], message: Union[str, ba.Lstr], code: str) -> None: - """show_app_invite(title: Union[str, ba.Lstr], - message: Union[str, ba.Lstr], - code: str) -> None - - (internal) + """(internal) Category: General Utility Functions """ @@ -3801,9 +2964,7 @@ def show_app_invite(title: Union[str, ba.Lstr], message: Union[str, ba.Lstr], def show_invites_ui() -> None: - """show_invites_ui() -> None - - (internal) + """(internal) Category: General Utility Functions """ @@ -3813,18 +2974,12 @@ def show_invites_ui() -> None: def show_online_score_ui(show: str = 'general', game: str = None, game_version: str = None) -> None: - """show_online_score_ui(show: str = 'general', game: str = None, - game_version: str = None) -> None - - (internal) - """ + """(internal)""" return None def show_progress_bar() -> None: - """show_progress_bar() -> None - - (internal) + """(internal) Category: General Utility Functions """ @@ -3832,9 +2987,7 @@ def show_progress_bar() -> None: def sign_in(account_type: str) -> None: - """sign_in(account_type: str) -> None - - (internal) + """(internal) Category: General Utility Functions """ @@ -3842,9 +2995,7 @@ def sign_in(account_type: str) -> None: def sign_out() -> None: - """sign_out() -> None - - (internal) + """(internal) Category: General Utility Functions """ @@ -3852,9 +3003,7 @@ def sign_out() -> None: def start_listening_for_wii_remotes() -> None: - """start_listening_for_wii_remotes() -> None - - (internal) + """(internal) Start listening for connections from wii remotes. """ @@ -3862,9 +3011,7 @@ def start_listening_for_wii_remotes() -> None: def stop_listening_for_wii_remotes() -> None: - """stop_listening_for_wii_remotes() -> None - - (internal) + """(internal) Stop listening for connections from wii remotes. """ @@ -3872,10 +3019,7 @@ def stop_listening_for_wii_remotes() -> None: def submit_analytics_counts() -> None: - """submit_analytics_counts() -> None - - (internal) - """ + """(internal)""" return None @@ -3890,14 +3034,7 @@ def submit_score(game: str, score_type: str = 'points', campaign: Optional[str] = None, level: Optional[str] = None) -> None: - """submit_score(game: str, config: str, name: Any, score: Optional[int], - callback: Callable, friend_callback: Optional[Callable], - order: str = 'increasing', tournament_id: Optional[str] = None, - score_type: str = 'points', - campaign: Optional[str] = None, - level: Optional[str] = None) -> None - - (internal) + """(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 @@ -3942,27 +3079,7 @@ def textwidget(edit: ba.Widget = None, big: bool = None, extra_touch_border_scale: float = None, res_scale: float = None) -> Widget: - """textwidget(edit: ba.Widget = None, parent: ba.Widget = None, - size: Sequence[float] = None, position: Sequence[float] = None, - text: Union[str, ba.Lstr] = None, v_align: str = None, - h_align: str = None, editable: bool = None, padding: float = None, - on_return_press_call: Callable[[], None] = None, - on_activate_call: Callable[[], None] = None, - selectable: bool = None, query: ba.Widget = None, max_chars: int = None, - color: Sequence[float] = None, click_activate: bool = None, - on_select_call: Callable[[], None] = None, - always_highlight: bool = None, draw_controller: ba.Widget = None, - scale: float = None, corner_scale: float = None, - description: Union[str, ba.Lstr] = None, - transition_delay: float = None, maxwidth: float = None, - max_height: float = None, flatness: float = None, - shadow: float = None, autoselect: bool = None, rotate: float = None, - enabled: bool = None, force_internal_editing: bool = None, - always_show_carat: bool = None, big: bool = None, - extra_touch_border_scale: float = None, res_scale: float = None) - -> Widget - - Create or edit a text widget. + """Create or edit a text widget. Category: User Interface Functions @@ -3999,11 +3116,7 @@ def time(timetype: ba.TimeType, def time(timetype: ba.TimeType = TimeType.SIM, timeformat: ba.TimeFormat = TimeFormat.SECONDS) -> Any: - """time(timetype: ba.TimeType = TimeType.SIM, - timeformat: ba.TimeFormat = TimeFormat.SECONDS) - -> - - Return the current time. + """Return the current time. Category: General Utility Functions @@ -4039,10 +3152,7 @@ def time(timetype: ba.TimeType = TimeType.SIM, def time_format_check(time_format: ba.TimeFormat, length: Union[float, int]) -> None: - """time_format_check(time_format: ba.TimeFormat, length: Union[float, int]) - -> None - - (internal) + """(internal) Logs suspicious time values for timers or animate calls. @@ -4058,13 +3168,7 @@ def timer(time: float, timetype: ba.TimeType = TimeType.SIM, timeformat: ba.TimeFormat = TimeFormat.SECONDS, suppress_format_warning: bool = False) -> None: - """timer(time: float, call: Callable[[], Any], repeat: bool = False, - timetype: ba.TimeType = TimeType.SIM, - timeformat: ba.TimeFormat = TimeFormat.SECONDS, - suppress_format_warning: bool = False) - -> None - - Schedule a call to run at a later point in time. + """Schedule a call to run at a later point in time. Category: General Utility Functions @@ -4125,18 +3229,12 @@ def timer(time: float, def tournament_query(callback: Callable[[Optional[dict]], None], args: dict) -> None: - """tournament_query(callback: Callable[[Optional[dict]], None], - args: dict) -> None - - (internal) - """ + """(internal)""" return None def uibounds() -> tuple[float, float, float, float]: - """uibounds() -> tuple[float, float, float, float] - - (internal) + """(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 @@ -4147,9 +3245,7 @@ def uibounds() -> tuple[float, float, float, float]: def unlock_all_input() -> None: - """unlock_all_input() -> None - - (internal) + """(internal) Resumes normal keyboard, mouse, and gamepad event processing. """ @@ -4159,11 +3255,7 @@ def unlock_all_input() -> None: def value_test(arg: str, change: float = None, absolute: float = None) -> float: - """value_test(arg: str, change: float = None, absolute: float = None) - -> float - - (internal) - """ + """(internal)""" return float() @@ -4177,13 +3269,7 @@ def widget(edit: ba.Widget = None, show_buffer_left: float = None, show_buffer_right: float = None, autoselect: bool = None) -> None: - """widget(edit: ba.Widget = None, up_widget: ba.Widget = None, - down_widget: ba.Widget = None, left_widget: ba.Widget = None, - right_widget: ba.Widget = None, show_buffer_top: float = None, - show_buffer_bottom: float = None, show_buffer_left: float = None, - show_buffer_right: float = None, autoselect: bool = None) -> None - - Edit common attributes of any widget. + """Edit common attributes of any widget. Category: User Interface Functions diff --git a/src/ballistica/python/class/python_class_input_device.cc b/src/ballistica/python/class/python_class_input_device.cc index c6840e7c..d4c46d91 100644 --- a/src/ballistica/python/class/python_class_input_device.cc +++ b/src/ballistica/python/class/python_class_input_device.cc @@ -417,7 +417,8 @@ PyMethodDef PythonClassInputDevice::tp_methods[] = { {"exists", (PyCFunction)Exists, METH_NOARGS, "exists() -> bool\n" "\n" - "Return whether the underlying device for this object is still present."}, + "Return whether the underlying device for this object is\n" + "still present.\n"}, {"get_button_name", (PyCFunction)GetButtonName, METH_VARARGS | METH_KEYWORDS, // NOLINT (signed bitwise ops) "get_button_name(button_id: int) -> ba.Lstr\n" diff --git a/src/ballistica/python/class/python_class_node.cc b/src/ballistica/python/class/python_class_node.cc index a1f69cbf..0479ad15 100644 --- a/src/ballistica/python/class/python_class_node.cc +++ b/src/ballistica/python/class/python_class_node.cc @@ -404,7 +404,8 @@ PyMethodDef PythonClassNode::tp_methods[] = { {"getdelegate", (PyCFunction)GetDelegate, METH_VARARGS | METH_KEYWORDS, "getdelegate(type: type, doraise: bool = False) -> \n" "\n" - "Return the node's current delegate object if it matches a certain type.\n" + "Return the node's current delegate object if it matches\n" + "a certain type.\n" "\n" "If the node has no delegate or it is not an instance of the passed\n" "type, then None will be returned. If 'doraise' is True, then an\n" @@ -437,12 +438,12 @@ PyMethodDef PythonClassNode::tp_methods[] = { {"connectattr", (PyCFunction)ConnectAttr, METH_VARARGS, "connectattr(srcattr: str, dstnode: Node, dstattr: str) -> None\n" "\n" - "Connect one of this node's attributes to an attribute on another node.\n" - "This will immediately set the target attribute's value to that of the\n" - "source attribute, and will continue to do so once per step as long as\n" - "the two nodes exist. The connection can be severed by setting the\n" - "target attribute to any value or connecting another node attribute\n" - "to it.\n" + "Connect one of this node's attributes to an attribute on another\n" + "node. This will immediately set the target attribute's value to that\n" + "of the source attribute, and will continue to do so once per step\n" + "as long as the two nodes exist. The connection can be severed by\n" + "setting the target attribute to any value or connecting another\n" + "node attribute to it.\n" "\n" "Example:\n" " Create a locator and attach a light to it:\n" diff --git a/src/ballistica/python/class/python_class_session_player.cc b/src/ballistica/python/class/python_class_session_player.cc index 25d549e1..dec924be 100644 --- a/src/ballistica/python/class/python_class_session_player.cc +++ b/src/ballistica/python/class/python_class_session_player.cc @@ -733,7 +733,8 @@ PyMethodDef PythonClassSessionPlayer::tp_methods[] = { {"get_icon", (PyCFunction)GetIcon, METH_NOARGS, "get_icon() -> dict[str, Any]\n" "\n" - "Returns the character's icon (images, colors, etc contained in a dict)"}, + "Returns the character's icon (images, colors, etc contained\n" + "in a dict."}, {"get_icon_info", (PyCFunction)GetIconInfo, METH_NOARGS, "get_icon_info() -> dict[str, Any]\n" "\n" diff --git a/src/ballistica/python/class/python_class_widget.cc b/src/ballistica/python/class/python_class_widget.cc index 5f834091..c9c3a1e8 100644 --- a/src/ballistica/python/class/python_class_widget.cc +++ b/src/ballistica/python/class/python_class_widget.cc @@ -260,9 +260,9 @@ PyMethodDef PythonClassWidget::tp_methods[] = { {"get_widget_type", (PyCFunction)GetWidgetType, METH_NOARGS, "get_widget_type() -> str\n" "\n" - "Return the internal type of the Widget as a string. Note that this is\n" - "different from the Python ba.Widget type, which is the same for all\n" - "widgets."}, + "Return the internal type of the Widget as a string. Note that this\n" + "is different from the Python ba.Widget type, which is the same for\n" + "all widgets."}, {"activate", (PyCFunction)Activate, METH_NOARGS, "activate() -> None\n" "\n" @@ -274,9 +274,9 @@ PyMethodDef PythonClassWidget::tp_methods[] = { {"get_screen_space_center", (PyCFunction)GetScreenSpaceCenter, METH_NOARGS, "get_screen_space_center() -> tuple[float, float]\n" "\n" - "Returns the coords of the Widget center relative to the center of the\n" - "screen. This can be useful for placing pop-up windows and other special\n" - "cases."}, + "Returns the coords of the ba.Widget center relative to the center\n" + "of the screen. This can be useful for placing pop-up windows and other\n" + "special cases."}, {"get_selected_child", (PyCFunction)GetSelectedChild, METH_NOARGS, "get_selected_child() -> Optional[ba.Widget]\n" "\n" @@ -285,8 +285,8 @@ PyMethodDef PythonClassWidget::tp_methods[] = { {"delete", (PyCFunction)Delete, METH_VARARGS | METH_KEYWORDS, "delete(ignore_missing: bool = True) -> None\n" "\n" - "Delete the Widget. Ignores already-deleted Widgets if ignore_missing\n" - " is True; otherwise an Exception is thrown."}, + "Delete the Widget. Ignores already-deleted Widgets if ignore_missing\n" + "is True; otherwise an Exception is thrown."}, {"add_delete_callback", (PyCFunction)AddDeleteCallback, METH_VARARGS | METH_KEYWORDS, // NOLINT (signed bitwise stuff) "add_delete_callback(call: Callable) -> None\n" diff --git a/tools/batools/dummymodule.py b/tools/batools/dummymodule.py index 786e2fe1..1ac9cba3 100755 --- a/tools/batools/dummymodule.py +++ b/tools/batools/dummymodule.py @@ -21,7 +21,7 @@ from efrotools import get_files_hash if TYPE_CHECKING: from types import ModuleType - from typing import Sequence, Any + from typing import Sequence, Any, Optional from batools.docs import AttributeInfo @@ -252,7 +252,7 @@ def _writefuncs(parent: Any, funcnames: Sequence[str], indent: int, f'unknown returns value: {returns} for {funcname}') returnspc = indstr + ' ' returnstr = ('\n' + returnspc).join(returnstr.strip().splitlines()) - docstr_out = _formatdoc(docstr, indent + 4) + docstr_out = _formatdoc(docstr, indent + 4, funcname=funcname) out += spcstr + defsline + docstr_out + f'{returnspc}{returnstr}\n' return out @@ -470,10 +470,20 @@ def _special_class_cases(classname: str) -> str: return out -def _formatdoc(docstr: str, indent: int) -> str: +def _formatdoc(docstr: str, + indent: int, + funcname: Optional[str] = None) -> str: out = '' indentstr = indent * ' ' docslines = docstr.splitlines() + + if (funcname and docslines and docslines[0] + and docslines[0].startswith(funcname)): + # Remove this signature from python docstring + # as not to repeat ourselves. + _, docstr = docstr.split('\n\n', maxsplit=1) + docslines = docstr.splitlines() + if len(docslines) == 1: out += '\n' + indentstr + '"""' + docslines[0] + '"""\n' else: @@ -503,7 +513,8 @@ def _writeclasses(module: ModuleType, classnames: Sequence[str]) -> str: out += f'class {classname}:\n' docstr = cls.__doc__ - out += _formatdoc(docstr, 4) + # classname is constructor name + out += _formatdoc(docstr, 4, funcname=classname) # Create a public constructor if it has one. # If the first docs line appears to be a function signature