summary refs log tree commit diff stats
path: root/randomizer
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-01-04 23:03:37 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-01-04 23:03:37 -0500
commit77220e6e19d367227b4e69f2994ed90e13f33be3 (patch)
tree1588415f17aac32e0fb0a8c5c1d01e0bb6a94bee /randomizer
parent35f3bd5342fb1096ab5a636af9d18f2af9d9ee11 (diff)
downloadlingo-randomizer-77220e6e19d367227b4e69f2994ed90e13f33be3.tar.gz
lingo-randomizer-77220e6e19d367227b4e69f2994ed90e13f33be3.tar.bz2
lingo-randomizer-77220e6e19d367227b4e69f2994ed90e13f33be3.zip
Randomization progress is displayed now
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():