WTS/game/scripts/doll/threading.rpy

19 lines
620 B
Plaintext
Raw Normal View History

2022-05-16 23:48:22 +00:00
init python:
import threading
class DollThread(threading.Thread, NoRollback):
2022-09-21 20:57:04 +00:00
def __init__(self, group=None, target=None, name=None, args=(), kwargs=None, *, daemon=None):
threading.Thread.__init__(self, group, target, name, args, kwargs, daemon=daemon)
2022-05-16 23:48:22 +00:00
self._return = None
def run(self):
2022-09-21 20:57:04 +00:00
if self._target is not None:
self._return = self._target(*self._args, **self._kwargs)
2022-05-16 23:48:22 +00:00
renpy.restart_interaction()
def join(self, timeout=1):
threading.Thread.join(self, timeout=timeout)
return self._return