Generation Textures now shown optionally.

WorldChunkRefactoring
Martin Felis 2023-07-07 17:20:07 +02:00
parent 469391c7ed
commit 8010fb3d87
2 changed files with 26 additions and 10 deletions

View File

@ -248,11 +248,11 @@ margin_bottom = 258.0
script = ExtResource( 12 )
[node name="HBoxContainer" type="HBoxContainer" parent="Generator Container/WorldGeneratorContainer"]
margin_right = 100.0
margin_right = 135.0
margin_bottom = 16.0
[node name="WorldSizeSlider" type="HSlider" parent="Generator Container/WorldGeneratorContainer/HBoxContainer"]
margin_right = 88.0
margin_right = 123.0
margin_bottom = 16.0
size_flags_horizontal = 3
min_value = 1.0
@ -260,9 +260,9 @@ max_value = 512.0
value = 1.0
[node name="WorldSizeLabel" type="Label" parent="Generator Container/WorldGeneratorContainer/HBoxContainer"]
margin_left = 92.0
margin_left = 127.0
margin_top = 1.0
margin_right = 100.0
margin_right = 135.0
margin_bottom = 15.0
text = "4"
@ -272,18 +272,26 @@ margin_right = 100.0
margin_bottom = 40.0
text = "Generate"
[node name="WorldTextureRect" type="TextureRect" parent="Generator Container/WorldGeneratorContainer"]
[node name="ShowTexturesCheckButton" type="CheckButton" parent="Generator Container/WorldGeneratorContainer"]
margin_top = 44.0
margin_right = 100.0
margin_bottom = 144.0
margin_right = 135.0
margin_bottom = 84.0
text = "Textures"
[node name="WorldTextureRect" type="TextureRect" parent="Generator Container/WorldGeneratorContainer"]
visible = false
margin_top = 88.0
margin_right = 135.0
margin_bottom = 188.0
rect_min_size = Vector2( 100, 100 )
stretch_mode = 1
flip_v = true
[node name="HeightTextureRect" type="TextureRect" parent="Generator Container/WorldGeneratorContainer"]
margin_top = 148.0
margin_right = 100.0
margin_bottom = 248.0
visible = false
margin_top = 88.0
margin_right = 135.0
margin_bottom = 188.0
rect_min_size = Vector2( 100, 100 )
stretch_mode = 1
flip_v = true
@ -372,5 +380,6 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.79762, 0, 0 )
input_ray_pickable = false
[connection signal="value_changed" from="Generator Container/WorldGeneratorContainer/HBoxContainer/WorldSizeSlider" to="Generator Container/WorldGeneratorContainer" method="_on_HSlider_value_changed"]
[connection signal="toggled" from="Generator Container/WorldGeneratorContainer/ShowTexturesCheckButton" to="Generator Container/WorldGeneratorContainer" method="_on_ShowTexturesCheckButton_toggled"]
[editable path="Entities/Chest"]

View File

@ -3,6 +3,9 @@ extends VBoxContainer
var world_size_label = null
var world_size_slider = null
onready var WorldTextureRect = $WorldTextureRect
onready var HeightTextureRect = $HeightTextureRect
# Called when the node enters the scene tree for the first time.
func _ready():
world_size_label = find_node("WorldSizeLabel")
@ -12,3 +15,7 @@ func _ready():
func _on_HSlider_value_changed(value):
world_size_label.text = str(value)
func _on_ShowTexturesCheckButton_toggled(button_pressed):
WorldTextureRect.visible = button_pressed
HeightTextureRect.visible = button_pressed