diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-01-04 23:03:37 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-01-04 23:03:37 -0500 |
commit | 77220e6e19d367227b4e69f2994ed90e13f33be3 (patch) | |
tree | 1588415f17aac32e0fb0a8c5c1d01e0bb6a94bee /randomizer/randomizer.gd | |
parent | 35f3bd5342fb1096ab5a636af9d18f2af9d9ee11 (diff) | |
download | lingo-randomizer-77220e6e19d367227b4e69f2994ed90e13f33be3.tar.gz lingo-randomizer-77220e6e19d367227b4e69f2994ed90e13f33be3.tar.bz2 lingo-randomizer-77220e6e19d367227b4e69f2994ed90e13f33be3.zip |
Randomization progress is displayed now
Diffstat (limited to 'randomizer/randomizer.gd')
-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(): |