def __init__(self, screen: T.Any) -> None: super().__init__(screen) self.on_create = EventHandler() self.on_play = EventHandler() self.on_delete = EventHandler() self.on_quit = EventHandler() self.choices: T.List[Choice] = [ Choice( keys=list(map(ord, "cC")), desc="[C] Create new character", callback=self.on_create, ), Choice( keys=list(map(ord, "pP")), desc="[P] Play", callback=self.on_play, ), Choice( keys=list(map(ord, "dD")), desc="[D] Delete character", callback=self.on_delete, ), Choice( keys=list(KEYS_CANCEL), desc="[Q] Quit", callback=self.on_quit ), ]
def __init__(self, screen: T.Any, title: str, active_choice: int = 0) -> None: super().__init__(screen) self.on_cancel = EventHandler() self.on_confirm = EventHandler() self._title = f"{title}:" self._choices: T.List[Choice] = [] self._active_choice = active_choice
def __init__(self, screen: T.Any) -> None: super().__init__(screen) self.on_cancel = EventHandler() self.on_confirm = EventHandler() self._active_widget = 0 self._win: T.Optional[T.Any] = None self._stats_win: T.Optional[T.Any] = None self._stats_builder = StatsBuilder() self._stats = self._stats_builder.roll()
def __init__(self, screen: T.Any, character_name: T.Optional[str] = None) -> None: super().__init__(screen) self.on_cancel = EventHandler() self.on_confirm = EventHandler() self._active_widget = 0 self._win: T.Optional[T.Any] = None self._text_win: T.Optional[T.Any] = None self._text = character_name or generate_name()
def __init__(self, screen: T.Any, title: str) -> None: super().__init__(screen) self.title = f"{title}:" self.on_cancel = EventHandler() self.on_confirm = EventHandler() self.choices: T.List[Choice] = [ Choice( keys=list(map(ord, "yY")), desc=f"[Y] Yes", callback=self.on_confirm, ), Choice( keys=list(map(ord, "nNqQ\N{ESC}")), desc="[N] No", callback=self.on_cancel, ), ]
def __init__( self, screen: T.Any, roster: Roster, player: Player, args: argparse.Namespace, ) -> None: super().__init__(screen) self.on_exit = EventHandler() self._roster = roster self._player = player self._args = args self._simulation = Simulation(player) self._last_tick = datetime.datetime.now()
def __init__(self, *args: T.Any, **kwargs: T.Any) -> None: self._focused = False self._on_focus_change = EventHandler() super().__init__(*args, **kwargs)