Source code for bauiv1lib.league

# Released under the MIT License. See LICENSE for details.
#
"""League related UI functionality."""

from __future__ import annotations  # Docs-generation hack.

from typing import TYPE_CHECKING

from bauiv1 import classicassets

if TYPE_CHECKING:
    import bauiv1 as bui


[docs] def league_display_name(name: str) -> str | bui.LangStr: """Return a displayable name for a league tier. ``name`` is the raw league id as it arrives from the server. Known tiers resolve to their authored entry; anything else (a tier this build predates, say) degrades honestly to its own untranslated text rather than being silently mistranslated. """ strs = classicassets.strings.league return { 'Bronze': strs.bronze, 'Silver': strs.silver, 'Gold': strs.gold, 'Diamond': strs.diamond, }.get(name, name)
# 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