summary refs log tree commit diff stats
path: root/randomizer
diff options
context:
space:
mode:
Diffstat (limited to 'randomizer')
-rw-r--r--randomizer/randomizer.gd8
1 files changed, 7 insertions, 1 deletions
diff --git a/randomizer/randomizer.gd b/randomizer/randomizer.gd index ff558a3..0738cb6 100644 --- a/randomizer/randomizer.gd +++ b/randomizer/randomizer.gd
@@ -5,12 +5,18 @@ const my_version = "0.1.0"
5var SCRIPT_generator 5var SCRIPT_generator
6 6
7var generator 7var generator
8var thread = Thread.new()
8 9
9signal finished_randomizing 10signal finished_randomizing
10signal randomizer_status 11signal randomizer_status
11 12
12 13
13func start(gen_seed = ""): 14func start(gen_seed = ""):
15 thread.start(self, "_thread_func", gen_seed)
16 yield(self, "finished_randomizing")
17
18
19func _thread_func(gen_seed):
14 generator = SCRIPT_generator.new($GeneratedPuzzles) 20 generator = SCRIPT_generator.new($GeneratedPuzzles)
15 generator.connect("generator_status", self, "statusUpdate") 21 generator.connect("generator_status", self, "statusUpdate")
16 generator.generate(gen_seed) 22 generator.generate(gen_seed)
@@ -19,7 +25,7 @@ func start(gen_seed = ""):
19 25
20 26
21func statusUpdate(text): 27func statusUpdate(text):
22 emit_signal("randomizer_status", text) 28 call_deferred("emit_signal", "randomizer_status", text)
23 29
24 30
25func getSaveFileName(): 31func getSaveFileName():