add wind fade in/out + add wire movement when is windy

This commit is contained in:
2026-04-21 15:16:30 +02:00
parent 9a26a4114b
commit f5a38bd8a0
11 changed files with 130 additions and 40 deletions

View File

@@ -225,12 +225,21 @@ theme_override_colors/font_hover_pressed_color = Color(1, 1, 1, 1)
theme_override_colors/font_outline_color = Color(1, 1, 1, 1)
text = "Wind"
[node name="WindSlider" type="HSlider" parent="Control" unique_id=28050098]
layout_mode = 0
offset_left = 26.0
offset_top = 124.0
offset_right = 205.0
offset_bottom = 140.0
max_value = 1.0
step = 0.01
[node name="Fireflies" type="CheckButton" parent="Control" unique_id=1046228444]
layout_mode = 0
offset_left = 21.0
offset_top = 115.0
offset_top = 169.0
offset_right = 130.0
offset_bottom = 146.0
offset_bottom = 200.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_colors/font_focus_color = Color(1, 1, 1, 1)
theme_override_colors/font_pressed_color = Color(1, 1, 1, 1)
@@ -266,18 +275,18 @@ text = "Time 00:00"
[node name="DayTimeSlider" type="HSlider" parent="Control" unique_id=1865778345]
layout_mode = 0
offset_left = 26.0
offset_top = 174.0
offset_top = 228.0
offset_right = 205.0
offset_bottom = 190.0
offset_bottom = 244.0
max_value = 1.0
step = 0.01
[node name="Dust" type="CheckButton" parent="Control" unique_id=760281365]
layout_mode = 0
offset_left = 21.0
offset_top = 250.0
offset_top = 304.0
offset_right = 150.0
offset_bottom = 281.0
offset_bottom = 335.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_colors/font_focus_color = Color(1, 1, 1, 1)
theme_override_colors/font_pressed_color = Color(1, 1, 1, 1)
@@ -290,9 +299,9 @@ text = "Dust"
[node name="Blur" type="CheckButton" parent="Control" unique_id=1083708100]
layout_mode = 0
offset_left = 21.0
offset_top = 278.0
offset_top = 332.0
offset_right = 150.0
offset_bottom = 309.0
offset_bottom = 363.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_colors/font_focus_color = Color(1, 1, 1, 1)
theme_override_colors/font_pressed_color = Color(1, 1, 1, 1)
@@ -305,9 +314,9 @@ text = "Blur"
[node name="Pause" type="CheckButton" parent="Control" unique_id=1587043871]
layout_mode = 0
offset_left = 21.0
offset_top = 189.0
offset_top = 243.0
offset_right = 158.0
offset_bottom = 220.0
offset_bottom = 274.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_colors/font_focus_color = Color(1, 1, 1, 1)
theme_override_colors/font_pressed_color = Color(1, 1, 1, 1)
@@ -319,9 +328,9 @@ text = "Pause Time"
[node name="Shadows" type="CheckButton" parent="Control" unique_id=283354318]
layout_mode = 0
offset_left = 21.0
offset_top = 302.0
offset_top = 356.0
offset_right = 150.0
offset_bottom = 333.0
offset_bottom = 387.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_colors/font_focus_color = Color(1, 1, 1, 1)
theme_override_colors/font_pressed_color = Color(1, 1, 1, 1)
@@ -334,19 +343,22 @@ text = "Shadows"
[node name="Guide" type="Label" parent="Control" unique_id=2121474959]
layout_mode = 0
offset_left = 26.0
offset_top = 347.0
offset_right = 236.0
offset_bottom = 474.0
offset_top = 401.0
offset_right = 339.0
offset_bottom = 606.0
text = "R-> Reset isometric camera
C-> Toggle cinematic mode
Z-> soft zoom
Manual controls (1-5)
T -> go to next stop
F -> fireworks"
F -> fireworks
BACKSPACE -> stop train
ARROW UP/DOWN -> change train speed"
[connection signal="toggled" from="Control/Snow" to="Control" method="_on_snow_toggled"]
[connection signal="toggled" from="Control/Rain" to="Control" method="_on_rain_toggled"]
[connection signal="toggled" from="Control/Wind" to="Control" method="_on_wind_toggled"]
[connection signal="value_changed" from="Control/WindSlider" to="Control" method="_on_wind_slider_value_changed"]
[connection signal="toggled" from="Control/Fireflies" to="Control" method="_on_fireflies_toggled"]
[connection signal="toggled" from="Control/Storm" to="Control" method="_on_storm_toggled"]
[connection signal="value_changed" from="Control/DayTimeSlider" to="Control" method="_on_day_time_slider_value_changed"]

View File

@@ -168,6 +168,8 @@ func input_controls_management(delta: float) -> void:
train_speed += manual_acceleration * delta
elif Input.is_action_pressed("ui_down"):
train_speed -= manual_acceleration * delta
elif Input.is_action_pressed("ui_text_backspace"):
train_speed = 0
train_speed = clamp(train_speed, speed_min, speed_max)
func train_move(delta: float) -> void:

View File

@@ -3,10 +3,13 @@ extends Control
@onready var day_night: EnvironmentManagerRoot = get_node_or_null("../DayNight") as EnvironmentManagerRoot
@onready var day_time_label: Label = $DayTimeLabel
@onready var day_time_slider: HSlider = $DayTimeSlider
@onready var wind_slider: HSlider = get_node_or_null("WindSlider") as HSlider
func _ready() -> void:
UIEvents.day_time_changed.connect(_on_day_time_changed)
if day_night != null and day_night.environment_config != null and wind_slider != null:
wind_slider.set_value_no_signal(day_night.environment_config.wind_strength)
_sync_day_time_ui()
func _on_rain_toggled(toggled_on: bool) -> void:
@@ -18,6 +21,9 @@ func _on_snow_toggled(toggled_on: bool) -> void:
func _on_wind_toggled(toggled_on: bool) -> void:
UIEvents.toggle_wind.emit(toggled_on)
func _on_wind_slider_value_changed(value: float) -> void:
UIEvents.wind_change.emit(value)
func _on_fireflies_toggled(toggled_on: bool) -> void:
UIEvents.toggle_fireflies.emit(toggled_on)

View File

@@ -220,9 +220,9 @@ text = "Storm"
[node name="DayTimeLabel" type="Label" parent="Control" unique_id=1673596218]
layout_mode = 0
offset_left = 26.0
offset_top = 150.0
offset_top = 172.0
offset_right = 360.0
offset_bottom = 173.0
offset_bottom = 195.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_colors/font_outline_color = Color(1, 1, 1, 1)
text = "Time 00:00"
@@ -230,18 +230,18 @@ text = "Time 00:00"
[node name="DayTimeSlider" type="HSlider" parent="Control" unique_id=530788076]
layout_mode = 0
offset_left = 26.0
offset_top = 174.0
offset_top = 196.0
offset_right = 205.0
offset_bottom = 190.0
offset_bottom = 212.0
max_value = 1.0
step = 0.01
[node name="Dust" type="CheckButton" parent="Control" unique_id=2023312048]
layout_mode = 0
offset_left = 21.0
offset_top = 250.0
offset_top = 272.0
offset_right = 150.0
offset_bottom = 281.0
offset_bottom = 303.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_colors/font_focus_color = Color(1, 1, 1, 1)
theme_override_colors/font_pressed_color = Color(1, 1, 1, 1)
@@ -254,9 +254,9 @@ text = "Dust"
[node name="Blur" type="CheckButton" parent="Control" unique_id=1758807681]
layout_mode = 0
offset_left = 21.0
offset_top = 278.0
offset_top = 300.0
offset_right = 150.0
offset_bottom = 309.0
offset_bottom = 331.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_colors/font_focus_color = Color(1, 1, 1, 1)
theme_override_colors/font_pressed_color = Color(1, 1, 1, 1)
@@ -269,9 +269,9 @@ text = "Blur"
[node name="Pause" type="CheckButton" parent="Control" unique_id=156986934]
layout_mode = 0
offset_left = 21.0
offset_top = 189.0
offset_top = 211.0
offset_right = 158.0
offset_bottom = 220.0
offset_bottom = 242.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_colors/font_focus_color = Color(1, 1, 1, 1)
theme_override_colors/font_pressed_color = Color(1, 1, 1, 1)
@@ -283,9 +283,9 @@ text = "Pause Time"
[node name="Shadows" type="CheckButton" parent="Control" unique_id=1751516495]
layout_mode = 0
offset_left = 21.0
offset_top = 302.0
offset_top = 324.0
offset_right = 150.0
offset_bottom = 333.0
offset_bottom = 355.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_colors/font_focus_color = Color(1, 1, 1, 1)
theme_override_colors/font_pressed_color = Color(1, 1, 1, 1)
@@ -295,6 +295,15 @@ theme_override_colors/font_outline_color = Color(1, 1, 1, 1)
button_pressed = true
text = "Shadows"
[node name="WindSlider" type="HSlider" parent="Control" unique_id=25258103]
layout_mode = 0
offset_left = 26.0
offset_top = 146.0
offset_right = 205.0
offset_bottom = 162.0
max_value = 1.0
step = 0.01
[node name="Scene" type="Node" parent="." unique_id=701973010]
[node name="Grass2" parent="Scene" unique_id=838519336 instance=ExtResource("7_pd1r3")]
@@ -315,7 +324,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.039560795, 0)
[node name="House_XL_4" parent="Scene" unique_id=1350238174 instance=ExtResource("15_28c1g")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.55439, 0.2020216, -14)
[node name="Chunck_M_N-O-E-S1" parent="Scene" unique_id=515911998 groups=["weather_node"] instance=ExtResource("18_iu8wf")]
[node name="Chunck_M_N-O-E-S1" parent="Scene" unique_id=515911998 instance=ExtResource("18_iu8wf")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 29.498665, 0, 11.197407)
[node name="Chunk_C_E_1" parent="Scene" unique_id=1874739368 instance=ExtResource("19_ftvlo")]
@@ -331,3 +340,4 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 23)
[connection signal="toggled" from="Control/Blur" to="Control" method="_on_blur_toggled"]
[connection signal="toggled" from="Control/Pause" to="Control" method="_on_pause_toggled"]
[connection signal="toggled" from="Control/Shadows" to="Control" method="_on_shadows_toggled"]
[connection signal="value_changed" from="Control/WindSlider" to="Control" method="_on_wind_slider_value_changed"]