diff options
Diffstat (limited to 'randomizer')
-rw-r--r-- | randomizer/randomizer.gd | 8 |
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" | |||
5 | var SCRIPT_generator | 5 | var SCRIPT_generator |
6 | 6 | ||
7 | var generator | 7 | var generator |
8 | var thread = Thread.new() | ||
8 | 9 | ||
9 | signal finished_randomizing | 10 | signal finished_randomizing |
10 | signal randomizer_status | 11 | signal randomizer_status |
11 | 12 | ||
12 | 13 | ||
13 | func start(gen_seed = ""): | 14 | func start(gen_seed = ""): |
15 | thread.start(self, "_thread_func", gen_seed) | ||
16 | yield(self, "finished_randomizing") | ||
17 | |||
18 | |||
19 | func _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 | ||
21 | func statusUpdate(text): | 27 | func statusUpdate(text): |
22 | emit_signal("randomizer_status", text) | 28 | call_deferred("emit_signal", "randomizer_status", text) |
23 | 29 | ||
24 | 30 | ||
25 | func getSaveFileName(): | 31 | func getSaveFileName(): |