blob: 681567d8b9d165fea39989c6d91b9a3aa61f1671 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
extends Node
const my_version = "0.1.0"
var SCRIPT_generator
var SCRIPT_steady
var generator
var steady
var thread = Thread.new()
signal finished_randomizing
signal randomizer_status
func start(gen_seed = ""):
thread.start(self, "_thread_func", gen_seed)
yield(self, "finished_randomizing")
func _thread_func(gen_seed):
generator = SCRIPT_generator.new($GeneratedPuzzles)
generator.connect("generator_status", self, "statusUpdate")
generator.generate(gen_seed)
var rng = RandomNumberGenerator.new()
rng.seed = generator.gen_seed
steady = SCRIPT_steady.new()
steady.generate(rng)
emit_signal("finished_randomizing")
func statusUpdate(text):
call_deferred("emit_signal", "randomizer_status", text)
func getSaveFileName():
return "zzRN_%d" % generator.gen_seed
|