begin redo maps
This commit is contained in:
17
map_select/Button.gd
Normal file
17
map_select/Button.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends Button
|
||||
|
||||
@export_file var map_path
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
func _on_pressed():
|
||||
if map_path==null:
|
||||
return
|
||||
|
||||
var sim = load("res://sim.tscn").instantiate()
|
||||
var map = load(map_path).new()
|
||||
map.create_map(sim)
|
||||
get_tree().root.add_child(sim)
|
||||
get_node("/root/MapSelect").queue_free()
|
12
map_select/map_select.gd
Normal file
12
map_select/map_select.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
extends Node2D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
if Input.is_action_just_pressed("escape"):
|
||||
get_tree().quit() # default behavior
|
99
map_select/map_select.tscn
Normal file
99
map_select/map_select.tscn
Normal file
@@ -0,0 +1,99 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://iskh4m3ltqul"]
|
||||
|
||||
[ext_resource type="Script" path="res://map_select/map_select.gd" id="1_w7uu4"]
|
||||
[ext_resource type="Script" path="res://map_select/Button.gd" id="2_ykkpr"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_kd1xo"]
|
||||
font_size = 32
|
||||
|
||||
[node name="MapSelect" type="Node2D"]
|
||||
script = ExtResource("1_w7uu4")
|
||||
|
||||
[node name="Title" type="Label" parent="."]
|
||||
offset_left = 29.0
|
||||
offset_top = 17.0
|
||||
offset_right = 198.0
|
||||
offset_bottom = 65.0
|
||||
text = "Map Select"
|
||||
label_settings = SubResource("LabelSettings_kd1xo")
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
offset_left = 24.0
|
||||
offset_top = 261.0
|
||||
offset_right = 199.0
|
||||
offset_bottom = 324.0
|
||||
text = "RGB"
|
||||
script = ExtResource("2_ykkpr")
|
||||
map_path = "res://maps/rgb.tscn"
|
||||
|
||||
[node name="Button2" type="Button" parent="."]
|
||||
offset_left = 29.0
|
||||
offset_top = 186.0
|
||||
offset_right = 204.0
|
||||
offset_bottom = 249.0
|
||||
text = "Source"
|
||||
script = ExtResource("2_ykkpr")
|
||||
map_path = "res://maps/source.tscn"
|
||||
|
||||
[node name="Button3" type="Button" parent="."]
|
||||
offset_left = 25.0
|
||||
offset_top = 332.0
|
||||
offset_right = 200.0
|
||||
offset_bottom = 395.0
|
||||
text = "CMY"
|
||||
script = ExtResource("2_ykkpr")
|
||||
map_path = "res://maps/cmy.tscn"
|
||||
|
||||
[node name="Button4" type="Button" parent="."]
|
||||
offset_left = 397.0
|
||||
offset_top = 188.0
|
||||
offset_right = 572.0
|
||||
offset_bottom = 251.0
|
||||
text = "Rare"
|
||||
script = ExtResource("2_ykkpr")
|
||||
map_path = "res://maps/rare.tscn"
|
||||
|
||||
[node name="Button5" type="Button" parent="."]
|
||||
offset_left = 213.0
|
||||
offset_top = 185.0
|
||||
offset_right = 388.0
|
||||
offset_bottom = 248.0
|
||||
text = "Seperated"
|
||||
script = ExtResource("2_ykkpr")
|
||||
map_path = "res://maps/seperated.tscn"
|
||||
|
||||
[node name="Button6" type="Button" parent="."]
|
||||
offset_left = 208.0
|
||||
offset_top = 260.0
|
||||
offset_right = 383.0
|
||||
offset_bottom = 323.0
|
||||
text = "RGB Sections"
|
||||
script = ExtResource("2_ykkpr")
|
||||
map_path = "res://maps/rgb_sections.tscn"
|
||||
|
||||
[node name="Button7" type="Button" parent="."]
|
||||
offset_left = 35.0
|
||||
offset_top = 71.0
|
||||
offset_right = 210.0
|
||||
offset_bottom = 134.0
|
||||
text = "Sections"
|
||||
script = ExtResource("2_ykkpr")
|
||||
map_path = "res://maps/sections.gd"
|
||||
|
||||
[node name="Button8" type="Button" parent="."]
|
||||
offset_left = 227.0
|
||||
offset_top = 70.0
|
||||
offset_right = 402.0
|
||||
offset_bottom = 133.0
|
||||
text = "Small"
|
||||
script = ExtResource("2_ykkpr")
|
||||
map_path = "res://maps/small.gd"
|
||||
|
||||
[connection signal="pressed" from="Button" to="Button" method="_on_pressed"]
|
||||
[connection signal="pressed" from="Button2" to="Button2" method="_on_pressed"]
|
||||
[connection signal="pressed" from="Button3" to="Button3" method="_on_pressed"]
|
||||
[connection signal="pressed" from="Button4" to="Button4" method="_on_pressed"]
|
||||
[connection signal="pressed" from="Button5" to="Button5" method="_on_pressed"]
|
||||
[connection signal="pressed" from="Button6" to="Button6" method="_on_pressed"]
|
||||
[connection signal="pressed" from="Button7" to="Button7" method="_on_pressed"]
|
||||
[connection signal="pressed" from="Button8" to="Button8" method="_on_pressed"]
|
Reference in New Issue
Block a user