def OnRedeem(self, msg: JSON) -> None: """ Callback function called whenever someone redeems the reward associated with this effect. This implementation adds messages to the queue - if you need to overwrite it make sure to call this function from your's. """ def _RunFront() -> None: self.OnRun(self._Queue[0]) AsyncUtil.RunIn(self._IntervalOption.CurrentValue, _Loop) def _Loop() -> None: self._Queue.pop(0) if len(self._Queue) > 0: AsyncUtil.RunWhen(self.Condition, _RunFront) self._Queue.append(msg) if len(self._Queue) == 1: AsyncUtil.RunWhen(self.Condition, _RunFront)
def _Loop() -> None: self._Queue.pop(0) if len(self._Queue) > 0: AsyncUtil.RunWhen(self.Condition, _RunFront)
def OnRun(self, msg: JSON) -> None: self.ShowRedemption(msg) AsyncUtil.RunIn(self.TIME_BEFORE_ACTIVATE, lambda: AsyncUtil.RunWhen(IsInGame, self.Activate))