CI fix I think...

This commit is contained in:
3alTemp 2024-03-01 21:34:38 -06:00
parent d6cce8e3fb
commit 020aa8829a

View File

@ -20,11 +20,11 @@ class RespawnIcon:
_MASKTEXSTORENAME = bs.storagename('masktex') _MASKTEXSTORENAME = bs.storagename('masktex')
_ICONSSTORENAME = bs.storagename('icons') _ICONSSTORENAME = bs.storagename('icons')
steps_epic_only: bool = False
def __init__(self, player: bs.Player, respawn_time: float): def __init__(self, player: bs.Player, respawn_time: float):
"""Instantiate with a Player and respawn_time (in seconds).""" """Instantiate with a Player and respawn_time (in seconds)."""
# pylint: disable=too-many-locals
self._visible = True self._visible = True
self._dots_epic_only = False
on_right, offs_extra, respawn_icons = self._get_context(player) on_right, offs_extra, respawn_icons = self._get_context(player)
@ -114,9 +114,9 @@ class RespawnIcon:
dpos = [ipos[0] + (7 if on_right else -7), ipos[1] - 16] dpos = [ipos[0] + (7 if on_right else -7), ipos[1] - 16]
self._dec_text: bs.NodeActor | None = None self._dec_text: bs.NodeActor | None = None
if ( if (
self.steps_epic_only self._dots_epic_only
and bs.getactivity().globalsnode.slow_motion and bs.getactivity().globalsnode.slow_motion
or not self.steps_epic_only or not self._dots_epic_only
): ):
self._dec_text = bs.NodeActor( self._dec_text = bs.NodeActor(
bs.newnode( bs.newnode(
@ -141,6 +141,7 @@ class RespawnIcon:
bs.animate(self._dec_text.node, 'scale', {0: 0, 0.1: 0.65}) bs.animate(self._dec_text.node, 'scale', {0: 0, 0.1: 0.65})
self._respawn_time = bs.time() + respawn_time self._respawn_time = bs.time() + respawn_time
self._dec_timer: bs.Timer | None = None
self._update() self._update()
self._timer: bs.Timer | None = bs.Timer( self._timer: bs.Timer | None = bs.Timer(
1.0, bs.WeakCall(self._update), repeat=True 1.0, bs.WeakCall(self._update), repeat=True
@ -180,21 +181,25 @@ class RespawnIcon:
offs_extra = -20 offs_extra = -20
return on_right, offs_extra, icons return on_right, offs_extra, icons
def _dec_step(self):
self._dec_text.node.text = self._dec_text.node.text[:-1]
# Kill our timer if the string is nothing.
if self._dec_text.node.text == '':
self._dec_timer = None
def _update(self) -> None: def _update(self) -> None:
remaining = int(round(self._respawn_time - bs.time())) remaining = int(round(self._respawn_time - bs.time()))
def dec_step():
self._dec_text.node.text = self._dec_text.node.text[:-1]
if remaining > 0: if remaining > 0:
assert self._text is not None assert self._text is not None
if self._text.node: if self._text.node:
self._text.node.text = str(remaining) self._text.node.text = str(remaining)
if self._dec_text: if self._dec_text:
self._dec_text.node.text = '...' self._dec_text.node.text = '...'
bs.timer(0.25, dec_step) # Start our decimals timer
bs.timer(0.5, dec_step) self._dec_timer = bs.Timer(
bs.timer(0.75, dec_step) 0.25, bs.WeakCall(self._dec_step), repeat=True
)
else: else:
self._visible = False self._visible = False
self._image = ( self._image = (