Source code for bascenev1._generated.scene_asset_set

# Released under the MIT License. See LICENSE for details.
#
# AUTO-GENERATED by `tools/pcommand gen_scene_asset_set_py`.
# DO NOT EDIT BY HAND.
#
# Generated from src/codegen/bascenev1codegen/scene_assets.py.
"""Supplying scene_v1 with the assets it draws itself with."""

from __future__ import annotations  # Docs-generation hack.

from typing import TYPE_CHECKING

import _bascenev1

from bascenev1 import _scenev1assets

if TYPE_CHECKING:
    from bascenev1._assetref import (
        MeshHandle,
        SoundHandle,
        TextureHandle,
    )


[docs] class SceneV1AssetSet: """The assets the scene_v1 node layer draws itself with. An app-mode using scene_v1 carries one of these on its app-mode config and hands it to :func:`bascenev1.set_scene_asset_set` when activating, which is what lets an app-mode (or a plugin amending its config) reskin the art scene_v1 nodes draw themselves with. Slots hold asset *handles*, not loaded assets; nothing loads until the set is applied at activation, so art that gets replaced is never loaded at all. Every slot defaults to scene_v1's own art, so a bare ``SceneV1AssetSet()`` is complete and a supplier names only what it changes. """ # One attr per slot is the whole point of this class; the # complexity limits are aimed at hand-written code where # this shape signals trouble. # pylint: disable=too-many-instance-attributes # -- Art and sounds scene_v1 nodes draw and play themselves with -- # character features, flag poles, shields, locators and effects. #: Opaque filled circle (locator fills). circle_no_alpha: TextureHandle #: Circle outline (locators). circle_outline: TextureHandle #: Opaque circle outline (locators). circle_outline_no_alpha: TextureHandle #: Explosion flash billboard. explosion: TextureHandle #: Character eyeball color map. eye_color: TextureHandle #: Tint mask for character eye color. eye_color_tint_mask: TextureHandle #: RGB stripe pattern used by character billboards. rgb_stripes: TextureHandle #: Ground scorch mark. scorch: TextureHandle #: Large ground scorch mark. scorch_big: TextureHandle #: Energy shield surface. shield: TextureHandle #: Character wings color map. wings: TextureHandle #: Cross-out marker mesh. cross_out: MeshHandle #: Character eyeball. eye_ball: MeshHandle #: Character eyeball iris. eye_ball_iris: MeshHandle #: Character eye lid. eye_lid: MeshHandle #: Flag pole. flag_pole: MeshHandle #: Billboard flash burst. flash: MeshHandle #: Character hair tuft (style 1). hair_tuft1: MeshHandle #: Character hair tuft (style 1b). hair_tuft1b: MeshHandle #: Character hair tuft (style 2). hair_tuft2: MeshHandle #: Character hair tuft (style 3). hair_tuft3: MeshHandle #: Character hair tuft (style 4). hair_tuft4: MeshHandle #: Full-screen square image sheet. image1x1_full_screen: MeshHandle #: Full-screen square image sheet (VR variant). image1x1_vrfull_screen: MeshHandle #: Ground locator marker. locator: MeshHandle #: Box-shaped ground locator. locator_box: MeshHandle #: Circular ground locator. locator_circle: MeshHandle #: Circular ground locator outline. locator_circle_outline: MeshHandle #: Ground scorch decal sheet. scorch_mesh: MeshHandle #: Energy shield dome. shield_mesh: MeshHandle #: Explosion shock-wave ring. shock_wave: MeshHandle #: Character wing. wing: MeshHandle #: Character sparkle effect 1. sparkle01: SoundHandle #: Character sparkle effect 2. sparkle02: SoundHandle #: Character sparkle effect 3. sparkle03: SoundHandle #: Frantic bomb-ticking loop. ticking_crazy: SoundHandle def __init__(self) -> None: # All slots start at scene_v1's own art (handles only; # nothing is loaded here). self.circle_no_alpha = _scenev1assets.textures.circle_no_alpha self.circle_outline = _scenev1assets.textures.circle_outline self.circle_outline_no_alpha = ( _scenev1assets.textures.circle_outline_no_alpha ) self.explosion = _scenev1assets.textures.explosion self.eye_color = _scenev1assets.textures.eye_color self.eye_color_tint_mask = _scenev1assets.textures.eye_color_tint_mask self.rgb_stripes = _scenev1assets.textures.rgb_stripes self.scorch = _scenev1assets.textures.scorch self.scorch_big = _scenev1assets.textures.scorch_big self.shield = _scenev1assets.textures.shield self.wings = _scenev1assets.textures.wings self.cross_out = _scenev1assets.meshes.cross_out self.eye_ball = _scenev1assets.meshes.eye_ball self.eye_ball_iris = _scenev1assets.meshes.eye_ball_iris self.eye_lid = _scenev1assets.meshes.eye_lid self.flag_pole = _scenev1assets.meshes.flag_pole self.flash = _scenev1assets.meshes.flash self.hair_tuft1 = _scenev1assets.meshes.hair_tuft1 self.hair_tuft1b = _scenev1assets.meshes.hair_tuft1b self.hair_tuft2 = _scenev1assets.meshes.hair_tuft2 self.hair_tuft3 = _scenev1assets.meshes.hair_tuft3 self.hair_tuft4 = _scenev1assets.meshes.hair_tuft4 self.image1x1_full_screen = _scenev1assets.meshes.image1x1_full_screen self.image1x1_vrfull_screen = ( _scenev1assets.meshes.image1x1_vrfull_screen ) self.locator = _scenev1assets.meshes.locator self.locator_box = _scenev1assets.meshes.locator_box self.locator_circle = _scenev1assets.meshes.locator_circle self.locator_circle_outline = ( _scenev1assets.meshes.locator_circle_outline ) self.scorch_mesh = _scenev1assets.meshes.scorch self.shield_mesh = _scenev1assets.meshes.shield self.shock_wave = _scenev1assets.meshes.shock_wave self.wing = _scenev1assets.meshes.wing self.sparkle01 = _scenev1assets.audio.sparkle01 self.sparkle02 = _scenev1assets.audio.sparkle02 self.sparkle03 = _scenev1assets.audio.sparkle03 self.ticking_crazy = _scenev1assets.audio.ticking_crazy
[docs] def set_scene_asset_set(assets: SceneV1AssetSet) -> None: """Supply the assets the scene_v1 node layer draws with. Called by an app-mode during activation (normally from :meth:`~babase.AppMode.on_activate`, with the :class:`SceneV1AssetSet` carried by its app-mode config), before any scene sessions exist. Unlike the ui set this is supplied on headless builds too -- servers run scenes. Loading happens native-side as the set is applied, so replaced defaults are never loaded. The supplied art is wiped by scene_v1's app-subsystem :meth:`~babase.AppSubsystem.reset` at every app-mode switch, so a mode can never inherit a previous mode's art. """ # Positional, in spec order -- the native side is generated # from the same spec, so the two cannot drift. _bascenev1.set_scene_asset_set_native( assets.circle_no_alpha, assets.circle_outline, assets.circle_outline_no_alpha, assets.explosion, assets.eye_color, assets.eye_color_tint_mask, assets.rgb_stripes, assets.scorch, assets.scorch_big, assets.shield, assets.wings, assets.cross_out, assets.eye_ball, assets.eye_ball_iris, assets.eye_lid, assets.flag_pole, assets.flash, assets.hair_tuft1, assets.hair_tuft1b, assets.hair_tuft2, assets.hair_tuft3, assets.hair_tuft4, assets.image1x1_full_screen, assets.image1x1_vrfull_screen, assets.locator, assets.locator_box, assets.locator_circle, assets.locator_circle_outline, assets.scorch_mesh, assets.shield_mesh, assets.shock_wave, assets.wing, assets.sparkle01, assets.sparkle02, assets.sparkle03, assets.ticking_crazy, )
# Docs-generation hack; import some stuff that we likely only forward-declared # in our actual source code so that docs tools can find it. from typing import (Coroutine, Any, Literal, Callable, Generator, Awaitable, Sequence, Self) import asyncio from concurrent.futures import Future from pathlib import Path from enum import Enum