small racing game im working on
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
[gd_scene load_steps=4 format=3 uid="uid://6p50mntqmyvq"]

[ext_resource type="Script" path="res://ui/tracks.gd" id="1_iaor8"]

[sub_resource type="GDScript" id="GDScript_wg2h5"]
script/source = "extends ScrollContainer

signal cfg(c) # bubbles up

func _on_cfg(c) -> void:
	cfg.emit(c) # the emit_signal connection only works for argless
"

[sub_resource type="GDScript" id="GDScript_5bpiw"]
script/source = "extends Button

var mp := preload(\"res://ui/multi-config.tscn\")
var window: MultiConfig

signal cfg(c: PackedInt32Array)

func _pressed() -> void:
	if is_instance_valid(window):
		window.grab_focus()
		return
	window = mp.instantiate()
	window.close_requested.connect(func():
		cfg.emit(window.get_config())
		window.queue_free()
		window = null
	)
	window.visible = true
	add_child(window)
"

[node name="play" type="ScrollContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
horizontal_scroll_mode = 0
script = SubResource("GDScript_wg2h5")

[node name="cont" type="VBoxContainer" parent="."]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="cfg" type="Button" parent="cont"]
layout_mode = 2
size_flags_horizontal = 0
text = "configure mp"
script = SubResource("GDScript_5bpiw")

[node name="tracks" type="HFlowContainer" parent="cont"]
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/h_separation = 15
theme_override_constants/v_separation = 15
script = ExtResource("1_iaor8")
editable = null
metadata/_edit_pinned_properties_ = [&"editable"]

[connection signal="cfg" from="cont/cfg" to="." method="_on_cfg"]
[connection signal="cfg" from="cont/cfg" to="cont/tracks" method="_on_cfg"]