Browse Source

Adding a generate button to the UI

pull/1/head
Ryan Reed 1 year ago
parent
commit
44f9b025d5
2 changed files with 11 additions and 1 deletions
  1. +3
    -0
      world.gd
  2. +8
    -1
      world.tscn

+ 3
- 0
world.gd View File

@ -210,3 +210,6 @@ func _on_generation_submit_pressed() -> void:
seed(world_seed)
start_conway()
func _on_world_seed_generate_pressed() -> void:
generation_seed.text = str(randi())

+ 8
- 1
world.tscn View File

@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://d3twfk56sjf2m"]
[gd_scene load_steps=5 format=3 uid="uid://d3twfk56sjf2m"]
[ext_resource type="Script" path="res://world.gd" id="1_wavft"]
[ext_resource type="Texture2D" uid="uid://c2vm5pfsamed4" path="res://icon.svg" id="2_8r6bn"]
[ext_resource type="PackedScene" uid="uid://cy6vsgu8o0rad" path="res://scenes/fps_counter/fps_counter.tscn" id="3_ves6s"]
[ext_resource type="Texture2D" uid="uid://b8gggrriib8n" path="res://assets/refresh.png" id="4_fcljs"]
[node name="World" type="Node2D"]
position = Vector2(-152, 0)
@ -95,6 +96,11 @@ custom_minimum_size = Vector2(200, 0)
layout_mode = 2
placeholder_text = "Empty for Random"
[node name="Generate" type="Button" parent="UI/WorldGeneration/VBoxContainer/Seed"]
self_modulate = Color(0.501961, 0.501961, 0.501961, 1)
layout_mode = 2
icon = ExtResource("4_fcljs")
[node name="WorldSize" type="HBoxContainer" parent="UI/WorldGeneration/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 6
@ -161,4 +167,5 @@ layout_mode = 2
text = "Start"
[connection signal="timeout" from="GenerationTimer" to="." method="_on_generation_timer_timeout"]
[connection signal="pressed" from="UI/WorldGeneration/VBoxContainer/Seed/Generate" to="." method="_on_world_seed_generate_pressed"]
[connection signal="pressed" from="UI/WorldGeneration/VBoxContainer/Submit/Button" to="." method="_on_generation_submit_pressed"]

Loading…
Cancel
Save