WTS/game/scripts/doll/threading.rpy

24 lines
805 B
Plaintext
Raw Permalink Normal View History

2022-05-16 23:48:22 +00:00
init python:
import threading
class DollThread(threading.Thread, NoRollback):
def __init__(self, group=None, target=None, name=None, args=(), kwargs={}, Verbose=None):
super(DollThread, self).__init__(group, target, name, args, kwargs, Verbose)
self._return = None
def run(self):
try:
self._return = self._Thread__target(*self._Thread__args, **self._Thread__kwargs)
except:
import traceback
traceback.print_exc()
if config.developer:
raise Exception("Thread just pooped itself.")
renpy.restart_interaction()
def join(self, timeout=1):
threading.Thread.join(self, timeout=timeout)
return self._return