Add support for user collectibles

This commit is contained in:
Soheab
2025-08-26 09:34:18 +02:00
committed by GitHub
parent 69f06c9456
commit cbff6ddef9
8 changed files with 256 additions and 13 deletions

View File

@ -355,6 +355,16 @@ class Asset(AssetMixin):
animated=False,
)
@classmethod
def _from_user_collectible(cls, state: _State, asset: str, animated: bool = False) -> Self:
name = 'static.png' if not animated else 'asset.webm'
return cls(
state,
url=f'{cls.BASE}/assets/collectibles/{asset}{name}',
key=asset,
animated=animated,
)
def __str__(self) -> str:
return self._url