1 Commits

Author SHA1 Message Date
Matteo Sonaglioni
5421f19577 update generator chunk 2026-06-01 10:45:15 +02:00
72 changed files with 572 additions and 2325 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
uid://d2n10rw2dnx8o

View File

@@ -1,43 +0,0 @@
## Internal tracking system for TweenFX.
## [br][br]
## Manages active tweens per node, handles cleanup when nodes are freed,
## and provides stop/query methods. Not intended for direct use —
## access through [TweenFX] instead.
static var _active: Dictionary = {} # { node: { TweenFX.Animations.X: tween } }
static func track(node: CanvasItem, anim: TweenFX.Animations, tween: Tween) -> void:
if not _active.has(node):
_active[node] = {}
if not node.tree_exiting.is_connected(_on_node_exiting):
node.tree_exiting.connect(_on_node_exiting.bind(node), CONNECT_ONE_SHOT)
_active[node][anim] = tween
tween.finished.connect(_on_tween_finished.bind(node, anim), CONNECT_ONE_SHOT)
static func stop(node: CanvasItem, anim: TweenFX.Animations) -> void:
if not _active.has(node) or not _active[node].has(anim):
return
_active[node][anim].kill()
_active[node].erase(anim)
if _active[node].is_empty():
_active.erase(node)
static func stop_all(node: CanvasItem) -> void:
if not _active.has(node):
return
for tween in _active[node].values():
tween.kill()
_active.erase(node)
static func is_playing(node: CanvasItem, anim: TweenFX.Animations) -> bool:
return _active.has(node) and _active[node].has(anim)
static func _on_tween_finished(node: CanvasItem, anim: TweenFX.Animations) -> void:
if not _active.has(node):
return
_active[node].erase(anim)
if _active[node].is_empty():
_active.erase(node)
static func _on_node_exiting(node: CanvasItem) -> void:
_active.erase(node)

View File

@@ -1 +0,0 @@
uid://bc8i1qm1d8hrv

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -1,40 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://chf2ss61jydw3"
path="res://.godot/imported/icon.png-1df28cd6ae5654ad60ac96bf24b7c782.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/TweenFX/icon.png"
dest_files=["res://.godot/imported/icon.png-1df28cd6ae5654ad60ac96bf24b7c782.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -1,7 +0,0 @@
[plugin]
name="TweenFX"+
icon="res://addons/TweenFX/icon.png"
description= "A simple, juicy tween animation library for Godot"
author="EvilBunnyMan"
version="1.2"
script="plugin.gd"

View File

@@ -1,10 +0,0 @@
@tool
extends EditorPlugin
func _enable_plugin():
add_autoload_singleton("TweenFX", "res://addons/TweenFX/TweenFX.gd")
print("[TweenFX] Enabled")
func _disable_plugin():
remove_autoload_singleton("TweenFX")
print("[TweenFX] Disabled")

View File

@@ -1 +0,0 @@
uid://wu3r36bvv8u

View File

@@ -264,8 +264,8 @@ func _input(event: InputEvent) -> void:
if event is InputEventKey and event.pressed and not event.echo:
if event.keycode == KEY_T:
_goto_next_stop()
#elif event.keycode == KEY_F:
#_test_manual_fireworks()
elif event.keycode == KEY_F:
_test_manual_fireworks()
func _test_manual_fireworks() -> void:
if fireworks_scene == null or train_instance == null: return
@@ -520,15 +520,17 @@ func _update_wagon_progress_offsets() -> void:
for wagon in wagon_instances:
var wagon_length: float = _get_vehicle_length(wagon)
if wagon_spacing_override > 0.0:
accumulated_distance += wagon_spacing_override + wagon_gap
else:
var detected_spacing: float = previous_length * 0.5 + wagon_length * 0.5
accumulated_distance += detected_spacing * wagon_spacing_scale + wagon_gap
accumulated_distance += _get_wagon_spacing(previous_length, wagon_length)
wagon_progress_offsets.append(accumulated_distance)
previous_length = wagon_length
func _get_wagon_spacing(previous_length: float, wagon_length: float) -> float:
if wagon_spacing_override > 0.0:
return wagon_spacing_override + wagon_gap
var detected_spacing: float = previous_length * 0.5 + wagon_length * 0.5
return detected_spacing * wagon_spacing_scale + wagon_gap
func _snap_wagons_to_progress(total_length: float = 0.0) -> void:
if curve == null or wagon_instances.is_empty():
return
@@ -552,16 +554,18 @@ func _snap_wagons_to_progress(total_length: float = 0.0) -> void:
wagon_offset = wagon_progress_offsets[i]
var wagon_progress: float = train_progress - direction * wagon_offset
_snap_vehicle_to_progress(wagon, wagon_progress, total_length)
var vehicle_progress: float = wrapf(wagon_progress, 0.0, total_length)
func _snap_vehicle_to_progress(vehicle: Node3D, progress: float, total_length: float) -> void:
var vehicle_progress: float = wrapf(progress, 0.0, total_length)
var center_position: Vector3 = to_global(curve.sample_baked(vehicle_progress, true))
var prog_forward: float = wrapf(vehicle_progress + 2.0, 0.0, total_length)
var forward_position: Vector3 = to_global(curve.sample_baked(prog_forward, true))
wagon.global_position = center_position
vehicle.global_position = center_position
if center_position.distance_to(forward_position) > 0.01:
wagon.look_at(forward_position, Vector3.UP)
wagon.rotate_y(PI)
vehicle.look_at(forward_position, Vector3.UP)
vehicle.rotate_y(PI)
func _get_vehicle_length(vehicle: Node3D) -> float:
var bounds: AABB = _get_node_local_bounds(vehicle, vehicle)

View File

@@ -10,9 +10,8 @@
[ext_resource type="PackedScene" uid="uid://fi6faw7ag1i0" path="res://tgcc/chunk/railway/scene/chunk_railway_curve_3.tscn" id="8_r0882"]
[ext_resource type="PackedScene" uid="uid://dglpoh63x2lpy" path="res://tgcc/chunk/railway/scene/chunk_railway_curve_4.tscn" id="9_3auto"]
[ext_resource type="Script" uid="uid://c374rv220mvh1" path="res://core/biome_generator/railway_pool.gd" id="9_8tdc7"]
[ext_resource type="PackedScene" uid="uid://bup6gwlxos0w2" path="res://tgcc/chunk/railway/hero/chunk_railway_station_hero.tscn" id="10_3auto"]
[resource]
script = ExtResource("9_8tdc7")
name = "Railway Pool"
available_railways = Array[PackedScene]([ExtResource("1_86h1y"), ExtResource("3_3auto"), ExtResource("4_i1umq"), ExtResource("5_x44at"), ExtResource("6_vrrkw"), ExtResource("7_l17bw"), ExtResource("8_qcl5o"), ExtResource("8_r0882"), ExtResource("9_3auto"), ExtResource("10_3auto")])
available_railways = Array[PackedScene]([ExtResource("1_86h1y"), ExtResource("3_3auto"), ExtResource("4_i1umq"), ExtResource("5_x44at"), ExtResource("6_vrrkw"), ExtResource("7_l17bw"), ExtResource("8_qcl5o"), ExtResource("8_r0882"), ExtResource("9_3auto")])

View File

@@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="WagonPool" format=3 uid="uid://bjnytgwt8tmf4"]
[ext_resource type="PackedScene" uid="uid://bny4kv08j8j40" path="res://tgcc/train/wagon.tscn" id="1_t6q5r"]
[ext_resource type="Script" uid="uid://c3bgupfogjvv2" path="res://core/biome_generator/wagon_pool.gd" id="2_x6bmc"]
[ext_resource type="PackedScene" uid="uid://dvk3bytqn3m5s" path="res://tgcc/train/main_train.tscn" id="1_t6q5r"]
[ext_resource type="Script" uid="uid://b6xk0gtn2pwa" path="res://core/biome_generator/wagon_pool.gd" id="2_x6bmc"]
[resource]
script = ExtResource("2_x6bmc")

View File

@@ -123,7 +123,7 @@ func _process(delta: float) -> void:
var is_night = day_time >= 2.5
if particles_fireflies:
particles_fireflies.emitting = thereare_fireflies and is_night and not is_raining and not is_snowing and not is_storm
particles_fireflies.emitting = thereare_fireflies and is_night
var base_tint: Color
var base_sky_top: Color
@@ -190,22 +190,11 @@ func _process(delta: float) -> void:
var final_fog_color = base_fog_color.lerp(base_fog_color * weather_color, clamp(rain_intensity, 0.0, 1.0))
var final_fog_density = lerp(base_fog_density, base_fog_density * 4.0, clamp(rain_intensity, 0.0, 1.0))
var final_water_color = base_water_color.darkened(clamp(environment_config.water_darkening_rain, 0.0, 1.0) * clamp(rain_intensity, 0.0, 1.0))
var rain_weather_amount: float = 0.0
if is_raining:
rain_weather_amount = clamp(rain_intensity, 0.0, 1.0)
var storm_weather_amount: float = 0.0
if is_raining and is_storm:
if environment_config.storm_rain_intensity_multiplier > 1.0:
storm_weather_amount = clamp((rain_intensity - 1.0) / (environment_config.storm_rain_intensity_multiplier - 1.0), 0.0, 1.0)
else:
storm_weather_amount = rain_weather_amount
final_tint = final_tint.lerp(final_tint * environment_config.snow_mode_color, snow_weather_amount)
final_sky_top = final_sky_top.lerp(final_sky_top * environment_config.snow_mode_color, snow_weather_amount)
final_sky_horizon = final_sky_horizon.lerp(final_sky_horizon * environment_config.snow_mode_color, snow_weather_amount)
final_fog_color = final_fog_color.lerp(final_fog_color * environment_config.snow_mode_color, snow_weather_amount)
final_tint = final_tint.lerp(final_tint * _get_rain_day_color(), rain_weather_amount)
final_tint = final_tint.lerp(final_tint * _get_storm_day_color(), storm_weather_amount)
#Shader parameters for global trunk_shader
var final_grad_top = base_grad_top.lerp(base_grad_top * weather_color, clamp(rain_intensity, 0.0, 1.0))
@@ -225,8 +214,6 @@ func _process(delta: float) -> void:
# We calculate the final exposure by applying snow damping directly to the camera exposure
var final_exposure = base_exposure * snow_light_attenuation
final_exposure = lerp(final_exposure, _get_rain_day_exposure(), rain_weather_amount)
final_exposure = lerp(final_exposure, _get_storm_day_exposure(), storm_weather_amount)
var reflected_color = Color(0.4, 0.5, 0.6, 1.0)
var drops_color = final_sky_horizon.lerp(reflected_color, 0.15)
@@ -306,30 +293,6 @@ func create_sound_players():
thunder_audio_player.volume_db = environment_config.thunder_audio_volume_db
add_child(thunder_audio_player)
func _get_rain_day_color() -> Color:
if day_time <= 2.0:
return environment_config.rain_morning_color.lerp(environment_config.rain_afternoon_color, day_time - 1.0)
return environment_config.rain_afternoon_color.lerp(environment_config.rain_night_color, day_time - 2.0)
func _get_storm_day_color() -> Color:
if day_time <= 2.0:
return environment_config.storm_morning_color.lerp(environment_config.storm_afternoon_color, day_time - 1.0)
return environment_config.storm_afternoon_color.lerp(environment_config.storm_night_color, day_time - 2.0)
func _get_rain_day_exposure() -> float:
if day_time <= 2.0:
return lerp(environment_config.rain_exposure_morning, environment_config.rain_exposure_afternoon, day_time - 1.0)
return lerp(environment_config.rain_exposure_afternoon, environment_config.rain_exposure_night, day_time - 2.0)
func _get_storm_day_exposure() -> float:
if day_time <= 2.0:
return lerp(environment_config.storm_exposure_morning, environment_config.storm_exposure_afternoon, day_time - 1.0)
return lerp(environment_config.storm_exposure_afternoon, environment_config.storm_exposure_night, day_time - 2.0)
#region camera
func _set_camera(curr_camera: Camera3D):
camera = curr_camera
@@ -384,7 +347,7 @@ func toggle_fireflies(value: bool):
thereare_fireflies = value
var is_night = day_time >= 2.5
if particles_fireflies:
particles_fireflies.emitting = thereare_fireflies and is_night and not is_raining
particles_fireflies.emitting = thereare_fireflies and is_night
#disable fireflies and set default values and materials
func init_fireflies():

View File

@@ -33,24 +33,6 @@ extends Resource
@export var exposure_afternoon: float = 0.95
@export var exposure_night: float = 0.4
#Camera tonemap exposure and light tint used only while rain is active
@export_group("Rain Exposition and Colors")
@export var rain_exposure_morning: float = 0.8
@export var rain_exposure_afternoon: float = 0.7
@export var rain_exposure_night: float = 0.35
@export var rain_morning_color: Color = Color(0.85, 0.89, 0.93, 1.0)
@export var rain_afternoon_color: Color = Color(0.78, 0.83, 0.89, 1.0)
@export var rain_night_color: Color = Color(0.55, 0.6, 0.75, 1.0)
#Camera tonemap exposure and light tint used only while storm is active
@export_group("Storm Exposition and Colors")
@export var storm_exposure_morning: float = 0.65
@export var storm_exposure_afternoon: float = 0.55
@export var storm_exposure_night: float = 0.25
@export var storm_morning_color: Color = Color(0.78, 0.83, 0.89, 1.0)
@export var storm_afternoon_color: Color = Color(0.65, 0.7, 0.78, 1.0)
@export var storm_night_color: Color = Color(0.45, 0.5, 0.65, 1.0)
#Sky top color for each time of day
@export_group("Sky Colors - Top")
@export var sky_top_morning: Color = Color(0.35, 0.65, 0.9, 1.0)

View File

@@ -1,8 +1,10 @@
@tool
extends Button
extends Control
class_name ArrowButton
signal on_pressed
@export var image: Texture:
set(value):
image = value
@@ -22,18 +24,6 @@ func _ready():
$%Texture.flip_h = flip_h
func _on_pressed() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.PUNCH_IN):
return
TweenFX.punch_in(self)
func _on_mouse_entered() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.BREATHE):
return
TweenFX.breathe(self, 1)
func _on_mouse_exited() -> void:
TweenFX.stop(self, TweenFX.Animations.BREATHE)
scale = Vector2(1, 1)
func _on_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
on_pressed.emit()

View File

@@ -2,44 +2,37 @@
[ext_resource type="Texture2D" uid="uid://cm7fok7lhrano" path="res://core/game_menu/assets/page_1/freccetta.png" id="1_vbu0v"]
[ext_resource type="Script" uid="uid://3uxuhvua1036" path="res://core/game_menu/arrow_button.gd" id="2_xq7pl"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/game_menu/hoover_tween.tscn" id="3_hu4cn"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_xq7pl"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_hu4cn"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_fttf3"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_05bm2"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_kc324"]
[node name="ArrowButton" type="Button" unique_id=579258112]
[node name="ArrowButton" type="Control" unique_id=1696751730]
custom_minimum_size = Vector2(101, 124)
anchors_preset = -1
anchor_right = 0.052604165
anchor_bottom = 0.11481482
pivot_offset_ratio = Vector2(0.5, 0.5)
theme_override_styles/normal = SubResource("StyleBoxEmpty_xq7pl")
theme_override_styles/pressed = SubResource("StyleBoxEmpty_hu4cn")
theme_override_styles/hover = SubResource("StyleBoxEmpty_fttf3")
theme_override_styles/disabled = SubResource("StyleBoxEmpty_05bm2")
theme_override_styles/focus = SubResource("StyleBoxEmpty_kc324")
script = ExtResource("2_xq7pl")
image = ExtResource("1_vbu0v")
metadata/_edit_use_anchors_ = true
[node name="Texture" type="TextureRect" parent="." unique_id=91599097]
unique_name_in_owner = true
layout_mode = 1
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
pivot_offset = Vector2(0.5, 0.5)
script = ExtResource("2_xq7pl")
image = ExtResource("1_vbu0v")
[node name="Texture" type="TextureRect" parent="." unique_id=91599097]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = -1
anchor_left = 0.47369793
anchor_top = 0.4425926
anchor_right = 0.5263021
anchor_bottom = 0.5574074
grow_horizontal = 2
grow_vertical = 2
pivot_offset_ratio = Vector2(0.5, 0.5)
mouse_filter = 2
texture = ExtResource("1_vbu0v")
metadata/_edit_use_anchors_ = true
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
[connection signal="pressed" from="." to="." method="_on_pressed"]
[node name="HooverTween" parent="." unique_id=2115829120 node_paths=PackedStringArray("detector_node", "visual_node") instance=ExtResource("3_hu4cn")]
detector_node = NodePath("..")
visual_node = NodePath("../Texture")
[connection signal="gui_input" from="." to="." method="_on_gui_input"]

View File

@@ -32,7 +32,6 @@ texture = ExtResource("2_vudub")
stretch_mode = 5
[node name="HSlider" type="HSlider" parent="." unique_id=1286896253]
process_mode = 3
layout_mode = 2
theme_override_icons/grabber = ExtResource("3_vf41c")
theme_override_icons/grabber_highlight = ExtResource("3_vf41c")

View File

@@ -1,5 +1,5 @@
@tool
extends Button
extends Control
@export var locked: bool = true
@export var image: Texture:
@@ -8,17 +8,15 @@ extends Button
if is_inside_tree() and has_node("%Texture"):
$%Texture.texture = image
func _ready():
if image != null and has_node("%Texture"):
$%Texture.texture = image
if has_node("%TextureRect"):
if has_node("%TextureRect") and has_node("%HooverTween"):
if locked:
$%TextureRect.show()
$%HooverTween.queue_free()
else:
$%TextureRect.hide()
TweenFX.breathe(self, 1)
func _on_pressed() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.PRESS_ROTATE):
return
TweenFX.press_rotate(self)

View File

@@ -1,82 +1,51 @@
[gd_scene format=3 uid="uid://wckwvvnk8bt4"]
[ext_resource type="Script" uid="uid://c7q3d823b1v1h" path="res://core/game_menu/biome_picker.gd" id="1_jqji0"]
[ext_resource type="Texture2D" uid="uid://dc0sl04wem136" path="res://core/game_menu/assets/page_1/color_main_biome.png" id="2_8s4h5"]
[ext_resource type="Texture2D" uid="uid://dj6pt25w5i4jq" path="res://core/game_menu/assets/page_1/lucchetto.png" id="2_jqji0"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/game_menu/hoover_tween.tscn" id="4_8s4h5"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_jqji0"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8s4h5"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ntcky"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_aj0ly"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_sqe3j"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_0slqm"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_idpud"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7dp31"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_le5rt"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_rs8ck"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6gubq"]
[node name="BiomePicker" type="Button" unique_id=913478047]
custom_minimum_size = Vector2(161, 343)
anchors_preset = -1
anchor_right = 0.08385417
anchor_bottom = 0.3175926
offset_right = -153.0
offset_bottom = -335.0
pivot_offset_ratio = Vector2(0.5, 0.5)
theme_override_styles/normal = SubResource("StyleBoxEmpty_jqji0")
theme_override_styles/normal_mirrored = SubResource("StyleBoxEmpty_8s4h5")
theme_override_styles/pressed = SubResource("StyleBoxEmpty_ntcky")
theme_override_styles/pressed_mirrored = SubResource("StyleBoxEmpty_aj0ly")
theme_override_styles/hover = SubResource("StyleBoxEmpty_sqe3j")
theme_override_styles/hover_mirrored = SubResource("StyleBoxEmpty_0slqm")
theme_override_styles/hover_pressed = SubResource("StyleBoxEmpty_idpud")
theme_override_styles/hover_pressed_mirrored = SubResource("StyleBoxEmpty_7dp31")
theme_override_styles/disabled = SubResource("StyleBoxEmpty_le5rt")
theme_override_styles/disabled_mirrored = SubResource("StyleBoxEmpty_rs8ck")
theme_override_styles/focus = SubResource("StyleBoxEmpty_6gubq")
script = ExtResource("1_jqji0")
image = ExtResource("2_8s4h5")
metadata/_edit_use_anchors_ = true
[node name="Texture" type="TextureRect" parent="." unique_id=606844933]
unique_name_in_owner = true
custom_minimum_size = Vector2(161, 343)
layout_mode = 1
[node name="BiomePicker" type="Control" unique_id=52821564]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_jqji0")
[node name="Texture" type="TextureRect" parent="." unique_id=606844933]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = -1
anchor_left = 0.47161457
anchor_top = 0.39027777
anchor_right = 0.5283854
anchor_bottom = 0.6097222
grow_horizontal = 2
grow_vertical = 2
pivot_offset_ratio = Vector2(0.5, 0.5)
texture = ExtResource("2_8s4h5")
stretch_mode = 3
metadata/_edit_use_anchors_ = true
[node name="TextureRect" type="TextureRect" parent="Texture" unique_id=288045010]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = -1
anchor_left = 0.36645964
anchor_top = 0.41690964
anchor_right = 0.6335404
anchor_bottom = 0.58309036
offset_left = 1.5
offset_top = 8.5
offset_right = -1.5
offset_bottom = -8.5
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
texture = ExtResource("2_jqji0")
[connection signal="pressed" from="." to="." method="_on_pressed"]
[node name="HooverTween" parent="." unique_id=160227524 node_paths=PackedStringArray("detector_node", "visual_node") instance=ExtResource("4_8s4h5")]
unique_name_in_owner = true
detector_node = NodePath("..")
visual_node = NodePath("../Texture")
scale_amount = Vector2(1.05, 1.05)

View File

@@ -1,60 +1,56 @@
[gd_scene format=3 uid="uid://bc60gon7fmvbr"]
[ext_resource type="PackedScene" uid="uid://dm3skv22c60tm" path="res://core/game_menu/arrow_button.tscn" id="1_16l2d"]
[ext_resource type="Texture2D" uid="uid://dqqnfnero7ckl" path="res://core/game_menu/assets/page_1/chooseyourbiome_text.png" id="1_wyms5"]
[ext_resource type="PackedScene" uid="uid://wckwvvnk8bt4" path="res://core/game_menu/biome_picker.tscn" id="2_q1k23"]
[ext_resource type="Texture2D" uid="uid://cin3kt42e6w3u" path="res://core/game_menu/assets/page_1/color_sx_biome.png" id="2_xjika"]
[ext_resource type="Texture2D" uid="uid://dc0sl04wem136" path="res://core/game_menu/assets/page_1/color_main_biome.png" id="3_0noye"]
[ext_resource type="Texture2D" uid="uid://c3qcivnwuisju" path="res://core/game_menu/assets/page_1/color_dx_biome.png" id="4_0noye"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/tween/container_tween.tscn" id="6_hjy5b"]
[node name="VBoxContainer" type="VBoxContainer" unique_id=1692688717]
offset_right = 685.0
offset_bottom = 418.0
[node name="ChooseYourBiomeTexture" type="TextureRect" parent="." unique_id=1769445385]
layout_mode = 2
texture = ExtResource("1_wyms5")
stretch_mode = 3
[node name="Spacer" type="Control" parent="." unique_id=1648681786]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
[node name="BiomeSelector" type="HBoxContainer" parent="." unique_id=291322067]
layout_mode = 2
[node name="BiomeSelector" type="HBoxContainer" unique_id=291322067]
offset_right = 700.0
offset_bottom = 400.0
theme_override_constants/separation = 0
alignment = 1
[node name="ArrowButtonLeft" parent="BiomeSelector" unique_id=1696751730 instance=ExtResource("1_16l2d")]
[node name="ArrowButtonLeft" parent="." unique_id=1696751730 instance=ExtResource("1_16l2d")]
layout_mode = 2
size_flags_vertical = 4
flip_h = true
[node name="HBoxContainer2" type="HBoxContainer" parent="BiomeSelector" unique_id=1117886768]
[node name="HBoxContainer2" type="HBoxContainer" parent="." unique_id=1117886768]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 0
alignment = 1
[node name="BiomePicker1" parent="BiomeSelector/HBoxContainer2" unique_id=477354740 instance=ExtResource("2_q1k23")]
[node name="BiomePicker1" parent="HBoxContainer2" unique_id=477354740 instance=ExtResource("2_q1k23")]
layout_mode = 2
size_flags_horizontal = 3
image = ExtResource("2_xjika")
[node name="BiomePicker2" parent="BiomeSelector/HBoxContainer2" unique_id=52821564 instance=ExtResource("2_q1k23")]
[node name="BiomePicker2" parent="HBoxContainer2" unique_id=52821564 instance=ExtResource("2_q1k23")]
custom_minimum_size = Vector2(200, 400)
layout_mode = 2
size_flags_horizontal = 3
locked = false
image = ExtResource("3_0noye")
[node name="BiomePicker3" parent="BiomeSelector/HBoxContainer2" unique_id=1567545303 instance=ExtResource("2_q1k23")]
[node name="Texture" parent="HBoxContainer2/BiomePicker2" index="0" unique_id=606844933]
texture = ExtResource("3_0noye")
[node name="TextureRect" parent="HBoxContainer2/BiomePicker2/Texture" index="0" unique_id=288045010]
visible = false
[node name="HooverTween" parent="HBoxContainer2/BiomePicker2" index="1" unique_id=160227524]
always_active = true
[node name="BiomePicker3" parent="HBoxContainer2" unique_id=1567545303 instance=ExtResource("2_q1k23")]
layout_mode = 2
size_flags_horizontal = 3
image = ExtResource("4_0noye")
[node name="ArrowButtonRight" parent="BiomeSelector" unique_id=1741162553 instance=ExtResource("1_16l2d")]
[node name="ArrowButtonRight" parent="." unique_id=1741162553 instance=ExtResource("1_16l2d")]
layout_mode = 2
size_flags_vertical = 4
[node name="ContainerTween" parent="." unique_id=160227524 node_paths=PackedStringArray("targets") instance=ExtResource("6_hjy5b")]
unique_name_in_owner = true
targets = [NodePath("../BiomeSelector/ArrowButtonLeft"), NodePath("../BiomeSelector/HBoxContainer2/BiomePicker1"), NodePath("../BiomeSelector/HBoxContainer2/BiomePicker2"), NodePath("../BiomeSelector/HBoxContainer2/BiomePicker3"), NodePath("../BiomeSelector/ArrowButtonRight")]
[editable path="HBoxContainer2/BiomePicker2"]

View File

@@ -2,7 +2,6 @@
[ext_resource type="Script" uid="uid://dq3qtcrdnikl7" path="res://core/game_menu/collectible_gallery.gd" id="1_67tug"]
[ext_resource type="PackedScene" uid="uid://dp7dvfauh5rpx" path="res://core/game_menu/collectible_ui.tscn" id="2_or234"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/tween/container_tween.tscn" id="3_cvqb8"]
[node name="CollectibleGallery" type="Control" unique_id=354419843]
layout_mode = 3
@@ -47,6 +46,3 @@ layout_mode = 2
[node name="CollectibleUI6" parent="ScrollContainer/CollectibleGrid" unique_id=1566830281 instance=ExtResource("2_or234")]
layout_mode = 2
[node name="ContainerTween" parent="." unique_id=160227524 node_paths=PackedStringArray("runtime_target_parent") instance=ExtResource("3_cvqb8")]
runtime_target_parent = NodePath("../ScrollContainer/CollectibleGrid")

View File

@@ -1,8 +1,10 @@
@tool
extends Button
extends Control
class_name TrainColorPicker
signal on_color_selected(color_picker: TrainColorPicker)
@export var image: Texture:
set(value):
image = value
@@ -21,31 +23,18 @@ func _ready():
color = img.get_pixel(0, 0)
else:
color = Color.BLACK
$%Border.color.a = 0
func _on_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
on_color_selected.emit(self)
func select() -> void:
if selected:
return
selected = true
$%Border.color.a = 1
TweenFX.press_rotate(self)
func deselect() -> void:
if !selected:
return
selected = false
$%Border.color.a = 0
func _on_mouse_entered() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.BREATHE):
return
TweenFX.breathe(self, 1)
func _on_mouse_exited() -> void:
TweenFX.stop(self, TweenFX.Animations.BREATHE)
scale = Vector2(1, 1)

View File

@@ -2,74 +2,56 @@
[ext_resource type="Texture2D" uid="uid://cdjwvwst3f10a" path="res://core/game_menu/assets/page_1/customizecolor-1.png" id="1_us0rx"]
[ext_resource type="Script" uid="uid://crfw5whcjs0du" path="res://core/game_menu/color_picker.gd" id="2_323rd"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/game_menu/hoover_tween.tscn" id="3_264kt"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_323rd"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_264kt"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1folt"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_tcqrg"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_kbu6n"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_dk0pr"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_f16cj"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_s4jbd"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_2ocph"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5386i"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6pmjh"]
[node name="ColorPicker" type="Button" unique_id=1664685328]
custom_minimum_size = Vector2(60, 60)
anchors_preset = -1
anchor_right = 0.03125
anchor_bottom = 0.055555556
pivot_offset_ratio = Vector2(0.5, 0.5)
theme_override_styles/normal = SubResource("StyleBoxEmpty_323rd")
theme_override_styles/normal_mirrored = SubResource("StyleBoxEmpty_264kt")
theme_override_styles/pressed = SubResource("StyleBoxEmpty_1folt")
theme_override_styles/pressed_mirrored = SubResource("StyleBoxEmpty_tcqrg")
theme_override_styles/hover = SubResource("StyleBoxEmpty_kbu6n")
theme_override_styles/hover_mirrored = SubResource("StyleBoxEmpty_dk0pr")
theme_override_styles/hover_pressed = SubResource("StyleBoxEmpty_f16cj")
theme_override_styles/hover_pressed_mirrored = SubResource("StyleBoxEmpty_s4jbd")
theme_override_styles/disabled = SubResource("StyleBoxEmpty_2ocph")
theme_override_styles/disabled_mirrored = SubResource("StyleBoxEmpty_5386i")
theme_override_styles/focus = SubResource("StyleBoxEmpty_6pmjh")
script = ExtResource("2_323rd")
image = ExtResource("1_us0rx")
metadata/_edit_use_anchors_ = true
[node name="Border" type="ColorRect" parent="." unique_id=1774696864]
unique_name_in_owner = true
layout_mode = 1
[node name="ColorPicker" type="Control" unique_id=409505029]
custom_minimum_size = Vector2(53, 53)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("2_323rd")
image = ExtResource("1_us0rx")
[node name="Border" type="ColorRect" parent="." unique_id=1774696864]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -30.0
offset_top = -30.0
offset_right = 30.0
offset_bottom = 30.0
grow_horizontal = 2
grow_vertical = 2
pivot_offset_ratio = Vector2(0.5, 0.5)
mouse_filter = 2
[node name="Texture" type="TextureRect" parent="Border" unique_id=329703623]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = -1
anchor_left = 0.058333334
anchor_top = 0.058333334
anchor_right = 0.94166666
anchor_bottom = 0.94166666
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -26.5
offset_top = -26.5
offset_right = 26.5
offset_bottom = 26.5
grow_horizontal = 2
grow_vertical = 2
pivot_offset_ratio = Vector2(0.5, 0.5)
mouse_filter = 2
texture = ExtResource("1_us0rx")
metadata/_edit_use_anchors_ = true
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
[connection signal="pressed" from="." to="." method="_on_pressed"]
[node name="HooverTween" parent="." unique_id=160227524 node_paths=PackedStringArray("detector_node", "visual_node") instance=ExtResource("3_264kt")]
detector_node = NodePath("..")
visual_node = NodePath("../Border")
[connection signal="gui_input" from="." to="." method="_on_gui_input"]

View File

@@ -1,8 +1,7 @@
extends Control
@onready var tabs: Array[GameMenuTab] = [$%Tab1, $%Tab2, $%Tab3]
@onready var pages: Array[GameMenuPage] = [$%Page1, $%Page2, $%Page3]
@onready var pages: Array[Control] = [$%Page1, $%Page2, $%Page3]
func _ready() -> void:
for tab: GameMenuTab in tabs:
@@ -12,7 +11,7 @@ func _ready() -> void:
func on_tab_pressed(index: int, disable_animation: bool = false) -> void:
for page in pages:
page.hide_page()
page.hide()
for tab in tabs:
if tab.index == index:
@@ -26,4 +25,7 @@ func on_tab_pressed(index: int, disable_animation: bool = false) -> void:
else:
tab.deselect()
pages[index].show_page()
pages[index].show()
func _on_resume_button_on_button_pressed() -> void:
hide()

View File

@@ -17,10 +17,17 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
pivot_offset_ratio = Vector2(0.5, 0.5)
mouse_filter = 2
script = ExtResource("1_57vaj")
[node name="Panel" type="Panel" parent="." unique_id=992567199]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Tabs" type="HBoxContainer" parent="." unique_id=1745270897]
layout_mode = 1
offset_left = 1138.0
@@ -77,5 +84,7 @@ unique_name_in_owner = true
visible = false
layout_mode = 1
[connection signal="on_button_pressed" from="Pages/Page3/OptionMenu/VBoxContainer/ResumeButton" to="." method="_on_resume_button_on_button_pressed"]
[editable path="Pages/Page3"]
[editable path="Pages/Page3/OptionMenu"]

View File

@@ -25,8 +25,6 @@ func _ready():
func _on_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
if is_selected:
return
on_tab_selected.emit(index)
func select():

View File

@@ -3,21 +3,16 @@ extends Control
@onready var photo: Photo = $%Photo
@onready var panel: Panel = $%Panel
func _ready() -> void:
GameState.on_photo_highlighted.connect(_on_photo_highlighted)
func _on_photo_highlighted(texture: Texture) -> void:
if texture != photo.texture_rect.texture:
show()
photo.scale = Vector2.ONE
TweenFX.fold_in(photo)
photo.setup(texture)
func _on_panel_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
await TweenFX.fold_out(photo).finished
photo.texture_rect.texture = null
hide()

View File

@@ -24,14 +24,20 @@ grow_vertical = 2
[node name="Photo" parent="." unique_id=201865221 instance=ExtResource("1_x7ou0")]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = -1
anchor_left = 0.3625
anchor_top = 0.14351852
anchor_right = 0.6375
anchor_bottom = 0.8564815
mouse_filter = 2
metadata/_edit_use_anchors_ = true
[node name="ColorRect" parent="Photo" index="0" unique_id=1208008621]
anchors_preset = 15
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 0.0
offset_top = 0.0
offset_right = 0.0

View File

@@ -0,0 +1,44 @@
extends Node
@export_group("Settings")
@export var always_active: bool = false
@export var detector_node: Control
@export var visual_node: Control
@export var scale_amount: Vector2 = Vector2(1.1, 1.1)
@export var duration: float = 0.5
var hover_tween: Tween
func _ready():
if not detector_node or not visual_node:
return
if always_active:
_start_tween()
return
detector_node.mouse_entered.connect(_on_mouse_entered)
detector_node.mouse_exited.connect(_on_mouse_exited)
func _on_mouse_entered():
if hover_tween: hover_tween.kill()
_start_tween()
func _on_mouse_exited():
if hover_tween: hover_tween.kill()
_stop_tween()
func _start_tween() -> void:
hover_tween = create_tween().set_loops()
hover_tween.tween_property(visual_node, "scale", scale_amount, duration).set_trans(Tween.TRANS_SINE)
hover_tween.tween_property(visual_node, "scale", Vector2.ONE, duration).set_trans(Tween.TRANS_SINE)
func _stop_tween() -> void:
var exit_tween = create_tween()
exit_tween.tween_property(visual_node, "scale", Vector2.ONE, 0.2).set_trans(Tween.TRANS_QUAD)

View File

@@ -0,0 +1,6 @@
[gd_scene format=3 uid="uid://dxun0jk5t0n6"]
[ext_resource type="Script" uid="uid://ryxh3nm7ayvf" path="res://core/game_menu/hoover_tween.gd" id="1_gmaf4"]
[node name="HooverTween" type="Node" unique_id=160227524]
script = ExtResource("1_gmaf4")

View File

@@ -1,23 +1,16 @@
extends Control
@onready var play_button: Button = $%PlayButton
@onready var resume_button: Button = $%ResumeButton
@onready var settings_button: Button = $%SettingsButton
@onready var save_button: Button = $%SaveButton
@onready var quit_button: Button = $%QuitButton
@onready var play_button: Control = $%PlayButton
@onready var resume_button: Control = $%ResumeButton
func _ready() -> void:
play_button.pressed.connect(_on_play_button_pressed)
save_button.pressed.connect(_on_save_button_pressed)
quit_button.pressed.connect(_on_quit_button_pressed)
func _on_resume_button_on_button_pressed() -> void:
GameState.resume_game()
func _on_play_button_pressed() -> void:
SceneManager.change_scene(SceneConfig.SceneName.GAME)
func _on_save_button_pressed() -> void:
func _on_save_button_on_button_pressed() -> void:
GameState.save_game()
func _on_quit_button_pressed() -> void:
func _on_quit_button_on_button_pressed() -> void:
GameState.quit_game()

View File

@@ -6,7 +6,6 @@
[ext_resource type="Texture2D" uid="uid://cmhx3mscwrwft" path="res://core/game_menu/assets/page_3/save_button.png" id="3_vwpol"]
[ext_resource type="Texture2D" uid="uid://cu8e7pl0y4owq" path="res://core/game_menu/assets/page_3/settings_button.png" id="4_8w45m"]
[ext_resource type="Texture2D" uid="uid://v7e7467fkdec" path="res://core/game_menu/assets/page_3/quit_button.png" id="4_cd2sv"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/tween/container_tween.tscn" id="7_n7rb8"]
[node name="OptionMenu" type="Control" unique_id=1055457221]
layout_mode = 3
@@ -62,5 +61,6 @@ custom_minimum_size = Vector2(310, 100)
layout_mode = 2
image = ExtResource("4_cd2sv")
[node name="ContainerTween" parent="." unique_id=160227524 node_paths=PackedStringArray("targets") instance=ExtResource("7_n7rb8")]
targets = [NodePath("../VBoxContainer/PlayButton"), NodePath("../VBoxContainer/ResumeButton"), NodePath("../VBoxContainer/SettingsButton"), NodePath("../VBoxContainer/SaveButton"), NodePath("../VBoxContainer/QuitButton")]
[connection signal="on_button_pressed" from="VBoxContainer/ResumeButton" to="." method="_on_resume_button_on_button_pressed"]
[connection signal="on_button_pressed" from="VBoxContainer/SaveButton" to="." method="_on_save_button_on_button_pressed"]
[connection signal="on_button_pressed" from="VBoxContainer/QuitButton" to="." method="_on_quit_button_on_button_pressed"]

View File

@@ -1,5 +1,7 @@
@tool
extends Button
extends Control
signal on_button_pressed
@export var image: Texture:
set(value):
@@ -11,19 +13,6 @@ func _ready():
if image != null and has_node("%Texture"):
$%Texture.texture = image
func _on_pressed() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.PUNCH_IN):
return
TweenFX.punch_in(self)
func _on_mouse_entered() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.BREATHE):
return
TweenFX.breathe(self, 1)
func _on_mouse_exited() -> void:
TweenFX.stop(self, TweenFX.Animations.BREATHE)
scale = Vector2(1, 1)
func _on_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
on_button_pressed.emit()

View File

@@ -2,50 +2,17 @@
[ext_resource type="Texture2D" uid="uid://b4nymq3n3468g" path="res://core/game_menu/assets/page_3/play_button.png" id="1_movd1"]
[ext_resource type="Script" uid="uid://bbhe65f3517m8" path="res://core/game_menu/option_menu_button.gd" id="2_nghpi"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/game_menu/hoover_tween.tscn" id="3_am666"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_nghpi"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_am666"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_nxt2x"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_r4tfe"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1kmlt"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_51x11"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8eh6p"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_w4k7x"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_wra0p"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8dgkg"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ev2fk"]
[node name="OptionMenuButton" type="Button" unique_id=600844315]
process_mode = 3
custom_minimum_size = Vector2(302, 90)
anchors_preset = -1
anchor_right = 0.15729167
anchor_bottom = 0.083333336
pivot_offset_ratio = Vector2(0.5, 0.5)
theme_override_styles/normal = SubResource("StyleBoxEmpty_nghpi")
theme_override_styles/normal_mirrored = SubResource("StyleBoxEmpty_am666")
theme_override_styles/pressed = SubResource("StyleBoxEmpty_nxt2x")
theme_override_styles/pressed_mirrored = SubResource("StyleBoxEmpty_r4tfe")
theme_override_styles/hover = SubResource("StyleBoxEmpty_1kmlt")
theme_override_styles/hover_mirrored = SubResource("StyleBoxEmpty_51x11")
theme_override_styles/hover_pressed = SubResource("StyleBoxEmpty_8eh6p")
theme_override_styles/hover_pressed_mirrored = SubResource("StyleBoxEmpty_w4k7x")
theme_override_styles/disabled = SubResource("StyleBoxEmpty_wra0p")
theme_override_styles/disabled_mirrored = SubResource("StyleBoxEmpty_8dgkg")
theme_override_styles/focus = SubResource("StyleBoxEmpty_ev2fk")
[node name="OptionMenuButton" type="Control" unique_id=635721927]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("2_nghpi")
image = ExtResource("1_movd1")
metadata/_edit_use_anchors_ = true
[node name="Texture" type="TextureRect" parent="." unique_id=1177880405]
unique_name_in_owner = true
@@ -62,6 +29,8 @@ mouse_filter = 2
texture = ExtResource("1_movd1")
metadata/_edit_use_anchors_ = true
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
[connection signal="pressed" from="." to="." method="_on_pressed"]
[node name="HooverTween" parent="." unique_id=160227524 node_paths=PackedStringArray("detector_node", "visual_node") instance=ExtResource("3_am666")]
detector_node = NodePath("..")
visual_node = NodePath("../Texture")
[connection signal="gui_input" from="." to="." method="_on_gui_input"]

View File

@@ -1,14 +0,0 @@
extends Control
class_name GameMenuPage
func show_page() -> void:
var tweens = find_children("*", "ContainerTween", true, false)
for tween in tweens:
tween.start_tween()
show()
func hide_page() -> void:
hide()

View File

@@ -1 +0,0 @@
uid://dup0tdvb3eghp

View File

@@ -1,6 +1,5 @@
[gd_scene format=3 uid="uid://id854u4gh12f"]
[ext_resource type="Script" uid="uid://dup0tdvb3eghp" path="res://core/game_menu/page.gd" id="1_21t5y"]
[ext_resource type="Texture2D" uid="uid://bs56pdbywm4uh" path="res://core/game_menu/assets/page_1/quad_main.png" id="1_jwl25"]
[node name="Page" type="Control" unique_id=2037261222]
@@ -8,7 +7,6 @@ layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("1_21t5y")
[node name="Background" type="TextureRect" parent="." unique_id=1203110384]
visible = false

View File

@@ -2,6 +2,8 @@
[ext_resource type="PackedScene" uid="uid://id854u4gh12f" path="res://core/game_menu/page.tscn" id="1_uxih6"]
[ext_resource type="PackedScene" uid="uid://bh1kxsp5jyxfx" path="res://core/game_menu/train_selector.tscn" id="3_ijm38"]
[ext_resource type="Texture2D" uid="uid://bjqp8kmb5y7px" path="res://core/game_menu/assets/page_1/chooseyourtrain_text.png" id="3_t5hmd"]
[ext_resource type="Texture2D" uid="uid://dqqnfnero7ckl" path="res://core/game_menu/assets/page_1/chooseyourbiome_text.png" id="11_3chbu"]
[ext_resource type="PackedScene" uid="uid://bc60gon7fmvbr" path="res://core/game_menu/biome_selector.tscn" id="12_7yi8x"]
[node name="Page1" unique_id=2037261222 instance=ExtResource("1_uxih6")]
@@ -14,16 +16,33 @@ grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="TrainSelector" parent="." index="1" unique_id=1039769375 instance=ExtResource("3_ijm38")]
[node name="ChooseyourtrainText" type="TextureRect" parent="." index="1" unique_id=1883940124]
layout_mode = 0
offset_left = 350.0
offset_top = 365.0
offset_right = 758.0
offset_bottom = 445.0
texture = ExtResource("3_t5hmd")
[node name="TrainSelector" parent="." index="2" unique_id=1039769375 instance=ExtResource("3_ijm38")]
layout_mode = 0
offset_left = 211.0
offset_top = 365.0
offset_top = 469.0
offset_right = 871.0
offset_bottom = 758.0
offset_bottom = 778.0
[node name="BiomeSelector" parent="." index="2" unique_id=1957954960 instance=ExtResource("12_7yi8x")]
[node name="ChooseyourbiomeText" type="TextureRect" parent="." index="3" unique_id=1133714914]
layout_mode = 0
offset_left = 1184.0
offset_top = 365.0
offset_right = 1579.0
offset_bottom = 436.0
texture = ExtResource("11_3chbu")
stretch_mode = 3
[node name="BiomeSelector" parent="." index="4" unique_id=1957954960 instance=ExtResource("12_7yi8x")]
layout_mode = 0
offset_left = 1038.0
offset_top = 365.0
offset_top = 437.0
offset_right = 1738.0
offset_bottom = 783.0
offset_bottom = 837.0

View File

@@ -17,6 +17,9 @@ grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="Background" parent="." index="0" unique_id=1203110384]
mouse_filter = 2
[node name="PhotoCollectionText" type="TextureRect" parent="." index="1" unique_id=240014191]
layout_mode = 0
offset_left = 350.0
@@ -40,7 +43,7 @@ layout_mode = 1
offset_left = 244.0
offset_top = 410.0
offset_right = 844.0
offset_bottom = 850.0
offset_bottom = 810.0
[node name="CollectibleGallery" parent="." index="4" unique_id=708445500 instance=ExtResource("5_w0bcg")]
layout_mode = 1

View File

@@ -1,4 +1,4 @@
extends Button
extends Control
class_name Photo
@@ -11,20 +11,6 @@ func setup(texture: Texture) -> void:
texture_rect.texture = texture
func _on_pressed() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.PUNCH_IN):
return
TweenFX.punch_in(self)
func _on_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
GameState.on_photo_highlighted.emit(texture_rect.texture)
func _on_mouse_entered() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.BREATHE):
return
TweenFX.breathe(self, 1)
func _on_mouse_exited() -> void:
TweenFX.stop(self, TweenFX.Animations.BREATHE)
scale = Vector2(1, 1)

View File

@@ -1,26 +1,29 @@
[gd_scene format=3 uid="uid://cvus62qkop3qi"]
[ext_resource type="Script" uid="uid://dsey5dvc11vpq" path="res://core/game_menu/photo.gd" id="1_u0arp"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/game_menu/hoover_tween.tscn" id="2_62vvn"]
[node name="Photo" type="Button" unique_id=1451980505]
custom_minimum_size = Vector2(132, 154)
anchors_preset = -1
anchor_right = 0.06875
anchor_bottom = 0.1425926
pivot_offset_ratio = Vector2(0.5, 0.5)
[node name="Photo" type="Control" unique_id=201865221]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_u0arp")
metadata/_edit_use_anchors_ = true
[node name="ColorRect" type="ColorRect" parent="." unique_id=1208008621]
custom_minimum_size = Vector2(132, 154)
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 127.462494
offset_top = 143.02037
offset_right = -127.4625
offset_bottom = -143.02037
anchor_left = 0.465625
anchor_top = 0.4287037
anchor_right = 0.534375
anchor_bottom = 0.5712963
offset_left = 66.0
offset_top = 77.0
offset_right = -66.0
offset_bottom = -77.0
grow_horizontal = 2
grow_vertical = 2
pivot_offset_ratio = Vector2(0.5, 0.5)
@@ -47,6 +50,8 @@ mouse_filter = 2
expand_mode = 1
stretch_mode = 6
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
[connection signal="pressed" from="." to="." method="_on_pressed"]
[node name="HooverTween" parent="." unique_id=160227524 node_paths=PackedStringArray("detector_node", "visual_node") instance=ExtResource("2_62vvn")]
detector_node = NodePath("..")
visual_node = NodePath("../ColorRect")
[connection signal="gui_input" from="." to="." method="_on_gui_input"]

View File

@@ -2,13 +2,12 @@
[ext_resource type="Script" uid="uid://k4iqrlkbjppl" path="res://core/game_menu/photo_gallery.gd" id="1_bp5uf"]
[ext_resource type="PackedScene" uid="uid://cvus62qkop3qi" path="res://core/game_menu/photo.tscn" id="2_45wok"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/tween/container_tween.tscn" id="3_ht2y6"]
[node name="PhotoGallery" type="Control" unique_id=354419843]
layout_mode = 3
anchors_preset = 0
offset_right = 600.0
offset_bottom = 440.0
offset_bottom = 420.0
mouse_filter = 2
script = ExtResource("1_bp5uf")
photo_scene = ExtResource("2_45wok")
@@ -22,40 +21,35 @@ grow_horizontal = 2
grow_vertical = 2
draw_focus_border = true
[node name="MarginContainer" type="MarginContainer" parent="ScrollContainer" unique_id=934979837]
[node name="PhotoGrid" type="GridContainer" parent="ScrollContainer" unique_id=1187865988]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 6
size_flags_vertical = 6
theme_override_constants/margin_left = 32
theme_override_constants/margin_top = 32
theme_override_constants/margin_right = 32
theme_override_constants/margin_bottom = 33
[node name="PhotoGrid" type="GridContainer" parent="ScrollContainer/MarginContainer" unique_id=1187865988]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/h_separation = 44
theme_override_constants/v_separation = 54
columns = 3
[node name="Photo" parent="ScrollContainer/MarginContainer/PhotoGrid" unique_id=201865221 instance=ExtResource("2_45wok")]
[node name="Photo" parent="ScrollContainer/PhotoGrid" unique_id=201865221 instance=ExtResource("2_45wok")]
custom_minimum_size = Vector2(132, 154)
layout_mode = 2
[node name="Photo2" parent="ScrollContainer/MarginContainer/PhotoGrid" unique_id=427039285 instance=ExtResource("2_45wok")]
[node name="Photo2" parent="ScrollContainer/PhotoGrid" unique_id=427039285 instance=ExtResource("2_45wok")]
custom_minimum_size = Vector2(132, 154)
layout_mode = 2
[node name="Photo3" parent="ScrollContainer/MarginContainer/PhotoGrid" unique_id=800591401 instance=ExtResource("2_45wok")]
[node name="Photo3" parent="ScrollContainer/PhotoGrid" unique_id=800591401 instance=ExtResource("2_45wok")]
custom_minimum_size = Vector2(132, 154)
layout_mode = 2
[node name="Photo4" parent="ScrollContainer/MarginContainer/PhotoGrid" unique_id=1895298585 instance=ExtResource("2_45wok")]
[node name="Photo4" parent="ScrollContainer/PhotoGrid" unique_id=1895298585 instance=ExtResource("2_45wok")]
custom_minimum_size = Vector2(132, 154)
layout_mode = 2
[node name="Photo5" parent="ScrollContainer/MarginContainer/PhotoGrid" unique_id=2093353381 instance=ExtResource("2_45wok")]
[node name="Photo5" parent="ScrollContainer/PhotoGrid" unique_id=2093353381 instance=ExtResource("2_45wok")]
custom_minimum_size = Vector2(132, 154)
layout_mode = 2
[node name="Photo6" parent="ScrollContainer/MarginContainer/PhotoGrid" unique_id=316021755 instance=ExtResource("2_45wok")]
[node name="Photo6" parent="ScrollContainer/PhotoGrid" unique_id=316021755 instance=ExtResource("2_45wok")]
custom_minimum_size = Vector2(132, 154)
layout_mode = 2
[node name="ContainerTween" parent="." unique_id=160227524 node_paths=PackedStringArray("runtime_target_parent") instance=ExtResource("3_ht2y6")]
unique_name_in_owner = true
runtime_target_parent = NodePath("../ScrollContainer/MarginContainer/PhotoGrid")

View File

@@ -4,30 +4,20 @@
[ext_resource type="PackedScene" uid="uid://cescrovsjlwke" path="res://core/game_menu/audio_option.tscn" id="1_hwcco"]
[ext_resource type="Texture2D" uid="uid://0t00kjvrw206" path="res://core/game_menu/assets/page_3/music_volume_button.png" id="3_kgdba"]
[ext_resource type="Texture2D" uid="uid://dvergpy6qgggn" path="res://core/game_menu/assets/page_3/sfx_volume_button.png" id="4_ugk4n"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/tween/container_tween.tscn" id="5_p0gqk"]
[node name="SettingsMenu" type="Control" unique_id=1639777294]
custom_minimum_size = Vector2(327, 512)
layout_mode = 3
anchor_right = 0.1703125
anchor_bottom = 0.47407407
offset_right = -327.0
offset_bottom = -512.0
pivot_offset_ratio = Vector2(0.5, 0.5)
anchors_preset = 0
offset_right = 600.0
offset_bottom = 420.0
script = ExtResource("1_4lekq")
metadata/_edit_use_anchors_ = true
[node name="AudioOptionsContainer" type="VBoxContainer" parent="." unique_id=743642398]
unique_name_in_owner = true
custom_minimum_size = Vector2(327, 512)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
layout_mode = 0
offset_right = 327.0
offset_bottom = 512.0
theme_override_constants/separation = 12
alignment = 1
[node name="MasterVolume_AudioOption" parent="AudioOptionsContainer" unique_id=1509773712 instance=ExtResource("1_hwcco")]
layout_mode = 2
@@ -41,6 +31,3 @@ bus_name = &"Music"
layout_mode = 2
image = ExtResource("4_ugk4n")
bus_name = &"SFX"
[node name="ContainerTween" parent="." unique_id=160227524 node_paths=PackedStringArray("targets") instance=ExtResource("5_p0gqk")]
targets = [NodePath("../AudioOptionsContainer/MasterVolume_AudioOption"), NodePath("../AudioOptionsContainer/MusicVolume_AudioOption"), NodePath("../AudioOptionsContainer/SFXVolume_AudioOption")]

View File

@@ -3,50 +3,36 @@ extends VBoxContainer
@onready var color_pickers: Array[TrainColorPicker] = [$%ColorPicker1, $%ColorPicker2, $%ColorPicker3, $%ColorPicker4, $%ColorPicker5, $%ColorPicker6]
@onready var left_arrow: ArrowButton = $%ArrowButtonLeft
@onready var right_arrow: ArrowButton = $%ArrowButtonRight
@onready var treno: Node3D = $TrainViewportContainer/SubViewport/Treno
var selected_color: Color
var selected_color_index: int = 0
func _ready() -> void:
for color_picker in color_pickers:
color_picker.pressed.connect(_on_color_selected.bind(color_picker))
color_picker.on_color_selected.connect(_on_color_selected)
color_picker.deselect()
_set_selected_color(0)
selected_color = color_pickers[0].color
color_pickers[0].select()
left_arrow.pressed.connect(_select_prev_color)
right_arrow.pressed.connect(_select_next_color)
func _process(delta: float) -> void:
if treno:
treno.rotation_degrees.y += 30.0 * delta
func _set_selected_color(index: int) -> void:
for i in range(color_pickers.size()):
if i == index:
color_pickers[i].select()
selected_color_index = i
selected_color = color_pickers[i].color
_apply_train_color(selected_color)
else:
color_pickers[i].deselect()
left_arrow.on_pressed.connect(_select_prev_color)
right_arrow.on_pressed.connect(_select_next_color)
func _on_color_selected(selected_color_picker: TrainColorPicker) -> void:
for i in range(color_pickers.size()):
if color_pickers[i] == selected_color_picker:
_set_selected_color(i)
break
if color_pickers[i].color == selected_color_picker.color:
selected_color_picker.select()
selected_color_index = i
else:
color_pickers[i].deselect()
func _select_prev_color() -> void:
var next_index = (selected_color_index - 1 + color_pickers.size()) % color_pickers.size()
_set_selected_color(next_index)
for color_picker in color_pickers:
color_picker.deselect()
selected_color_index = (selected_color_index - 1 + color_pickers.size()) % color_pickers.size()
color_pickers[selected_color_index].select()
func _select_next_color() -> void:
var next_index = (selected_color_index + 1) % color_pickers.size()
_set_selected_color(next_index)
func _apply_train_color(color: Color) -> void:
var mat: ShaderMaterial = load("res://tgcc/train/Color1_train.tres")
if mat:
mat.set_shader_parameter("albedo_color", color)
for color_picker in color_pickers:
color_picker.deselect()
selected_color_index = (selected_color_index + 1) % color_pickers.size()
color_pickers[selected_color_index].select()

View File

@@ -1,7 +1,7 @@
[gd_scene format=3 uid="uid://bh1kxsp5jyxfx"]
[ext_resource type="Script" uid="uid://8k1msabobhks" path="res://core/game_menu/train_selector.gd" id="1_puip6"]
[ext_resource type="Texture2D" uid="uid://bjqp8kmb5y7px" path="res://core/game_menu/assets/page_1/chooseyourtrain_text.png" id="2_cfvtr"]
[ext_resource type="Texture2D" uid="uid://cqvani6n2h3fw" path="res://core/game_menu/assets/page_1/train_texture.png" id="1_wfiis"]
[ext_resource type="PackedScene" uid="uid://dm3skv22c60tm" path="res://core/game_menu/arrow_button.tscn" id="2_puip6"]
[ext_resource type="PackedScene" uid="uid://ch1st1oryjoio" path="res://core/game_menu/color_picker.tscn" id="3_i2rs1"]
[ext_resource type="Texture2D" uid="uid://b5arobd7gl4u4" path="res://core/game_menu/assets/page_1/customizecolor-3.png" id="4_cfvtr"]
@@ -9,47 +9,19 @@
[ext_resource type="Texture2D" uid="uid://bv07xhpe3kh0r" path="res://core/game_menu/assets/page_1/customizecolor-5.png" id="6_dxnpq"]
[ext_resource type="Texture2D" uid="uid://cryqbi1av2x1c" path="res://core/game_menu/assets/page_1/customizecolor.png" id="7_d1sdr"]
[ext_resource type="Texture2D" uid="uid://d4l5ih723j3md" path="res://core/game_menu/assets/page_1/customizecolor-2.png" id="8_tuh6m"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/tween/container_tween.tscn" id="10_i2rs1"]
[ext_resource type="PackedScene" uid="uid://otptvwer4par" path="res://tgcc/train/train.tscn" id="11_train"]
[node name="TrainSelector" type="VBoxContainer" unique_id=1039769375]
offset_right = 625.0
offset_bottom = 309.0
alignment = 1
script = ExtResource("1_puip6")
[node name="ChooseYourTrainTexture" type="TextureRect" parent="." unique_id=2095010706]
[node name="TrainTexture" type="TextureRect" parent="." unique_id=2095010706]
layout_mode = 2
texture = ExtResource("2_cfvtr")
texture = ExtResource("1_wfiis")
stretch_mode = 3
[node name="Spacer" type="Control" parent="." unique_id=685700140]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
[node name="TrainViewportContainer" type="SubViewportContainer" parent="." unique_id=1674220600]
custom_minimum_size = Vector2(0, 180)
layout_mode = 2
stretch = true
[node name="SubViewport" type="SubViewport" parent="TrainViewportContainer" unique_id=1674220601]
transparent_bg = true
handle_input_locally = false
size = Vector2i(660, 180)
render_target_update_mode = 4
[node name="Camera3D" type="Camera3D" parent="TrainViewportContainer/SubViewport" unique_id=1674220602]
transform = Transform3D(0.707107, -0.353553, 0.612372, 0, 0.866025, 0.5, -0.707107, -0.353553, 0.612372, 6, 4, 6)
current = true
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="TrainViewportContainer/SubViewport" unique_id=1674220604]
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 5, 0)
[node name="Treno" parent="TrainViewportContainer/SubViewport" unique_id=1674220603 instance=ExtResource("11_train")]
[node name="HBoxContainer2" type="HBoxContainer" parent="." unique_id=607833319]
layout_mode = 2
alignment = 1
[node name="ArrowButtonLeft" parent="HBoxContainer2" unique_id=103192648 instance=ExtResource("2_puip6")]
unique_name_in_owner = true
@@ -59,39 +31,44 @@ flip_h = true
[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer2" unique_id=1364417494]
layout_mode = 2
theme_override_constants/separation = 18
alignment = 1
[node name="ColorPicker1" parent="HBoxContainer2/HBoxContainer" unique_id=59169767 instance=ExtResource("3_i2rs1")]
unique_name_in_owner = true
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
size_flags_vertical = 4
image = ExtResource("4_cfvtr")
[node name="ColorPicker2" parent="HBoxContainer2/HBoxContainer" unique_id=584054476 instance=ExtResource("3_i2rs1")]
unique_name_in_owner = true
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
size_flags_vertical = 4
image = ExtResource("5_jnto8")
[node name="ColorPicker3" parent="HBoxContainer2/HBoxContainer" unique_id=889429149 instance=ExtResource("3_i2rs1")]
unique_name_in_owner = true
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
size_flags_vertical = 4
image = ExtResource("6_dxnpq")
[node name="ColorPicker4" parent="HBoxContainer2/HBoxContainer" unique_id=466686411 instance=ExtResource("3_i2rs1")]
unique_name_in_owner = true
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
size_flags_vertical = 4
image = ExtResource("7_d1sdr")
[node name="ColorPicker5" parent="HBoxContainer2/HBoxContainer" unique_id=675841518 instance=ExtResource("3_i2rs1")]
unique_name_in_owner = true
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
size_flags_vertical = 4
[node name="ColorPicker6" parent="HBoxContainer2/HBoxContainer" unique_id=1698412911 instance=ExtResource("3_i2rs1")]
unique_name_in_owner = true
custom_minimum_size = Vector2(60, 60)
layout_mode = 2
size_flags_vertical = 4
image = ExtResource("8_tuh6m")
@@ -99,7 +76,3 @@ image = ExtResource("8_tuh6m")
[node name="ArrowButtonRight" parent="HBoxContainer2" unique_id=68298624 instance=ExtResource("2_puip6")]
unique_name_in_owner = true
layout_mode = 2
[node name="ContainerTween" parent="." unique_id=160227524 node_paths=PackedStringArray("targets") instance=ExtResource("10_i2rs1")]
unique_name_in_owner = true
targets = [NodePath("../HBoxContainer2/ArrowButtonLeft"), NodePath("../HBoxContainer2/HBoxContainer/ColorPicker1"), NodePath("../HBoxContainer2/HBoxContainer/ColorPicker2"), NodePath("../HBoxContainer2/HBoxContainer/ColorPicker3"), NodePath("../HBoxContainer2/HBoxContainer/ColorPicker4"), NodePath("../HBoxContainer2/HBoxContainer/ColorPicker5"), NodePath("../HBoxContainer2/HBoxContainer/ColorPicker6"), NodePath("../HBoxContainer2/ArrowButtonRight")]

View File

@@ -1,16 +1,10 @@
extends Control
@onready var settings_menu: Control = $%SettingsMenu
@onready var option_menu: Control = $%OptionMenu
@onready var show_container_tween: ContainerTween = $%ShowContainerTween
@onready var hide_container_tween: ContainerTween = $%HideContainerTween
func _ready() -> void:
option_menu.settings_button.pressed.connect(_on_settings_button_pressed)
func _on_play_button_on_button_pressed() -> void:
SceneManager.change_scene(SceneConfig.SceneName.GAME)
func _on_settings_button_pressed() -> void:
if settings_menu.visible:
hide_container_tween.start_tween()
else:
show_container_tween.start_tween()
func _on_settings_button_on_button_pressed() -> void:
$%SettingsMenu.visible = !$%SettingsMenu.visible

View File

@@ -1,10 +1,9 @@
[gd_scene format=3 uid="uid://btcpge7cj2041"]
[ext_resource type="Script" uid="uid://csqxuftsnv1br" path="res://core/main_menu/main_menu.gd" id="1_jy6on"]
[ext_resource type="Script" uid="uid://csqxuftsnv1br" path="res://core/main_menu/main_menu.gd" id="1_g1whv"]
[ext_resource type="PackedScene" uid="uid://cxf8s80ivwj1p" path="res://core/game_menu/option_menu.tscn" id="1_uvy4f"]
[ext_resource type="Texture2D" uid="uid://buy4x63u237np" path="res://core/main_menu/assets/main_menu_background.png" id="2_mloc8"]
[ext_resource type="PackedScene" uid="uid://caqf471x0kttc" path="res://core/game_menu/settings_menu.tscn" id="3_26agx"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/tween/container_tween.tscn" id="4_mloc8"]
[node name="MainMenu" type="Control" unique_id=889720172]
layout_mode = 3
@@ -13,7 +12,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_jy6on")
script = ExtResource("1_g1whv")
[node name="TextureRect" type="TextureRect" parent="." unique_id=11805511]
layout_mode = 1
@@ -25,15 +24,16 @@ grow_vertical = 2
texture = ExtResource("2_mloc8")
[node name="OptionMenu" parent="." unique_id=1055457221 instance=ExtResource("1_uvy4f")]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -294.0
offset_right = -294.0
grow_horizontal = 0
offset_left = 492.0
offset_top = 274.0
offset_right = 492.0
offset_bottom = 274.0
[node name="VBoxContainer" parent="OptionMenu" index="0" unique_id=508055524]
anchor_top = 0.3037037
@@ -51,26 +51,12 @@ visible = false
unique_name_in_owner = true
visible = false
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_right = 0.0
anchor_bottom = 0.5
offset_left = 225.0
offset_top = -256.0
offset_right = 552.0
offset_bottom = 256.0
grow_vertical = 2
offset_left = 639.0
offset_top = 566.0
offset_right = 639.0
offset_bottom = 566.0
[node name="ShowContainerTween" parent="." unique_id=160227524 node_paths=PackedStringArray("targets") instance=ExtResource("4_mloc8")]
unique_name_in_owner = true
targets = [NodePath("../SettingsMenu")]
tween_types = Array[String](["fold_in"])
show_on_start = true
[node name="HideContainerTween" parent="." unique_id=570405239 node_paths=PackedStringArray("targets") instance=ExtResource("4_mloc8")]
unique_name_in_owner = true
targets = [NodePath("../SettingsMenu")]
tween_types = Array[String](["fold_out"])
hide_on_finish = true
[connection signal="on_button_pressed" from="OptionMenu/VBoxContainer/PlayButton" to="." method="_on_play_button_on_button_pressed"]
[connection signal="on_button_pressed" from="OptionMenu/VBoxContainer/SettingsButton" to="." method="_on_settings_button_on_button_pressed"]
[editable path="OptionMenu"]

View File

@@ -3,18 +3,8 @@ extends Control
@export var radio: Radio
@onready var track_label: Label = $%TrackLabel
@onready var prev_track_icon_button: Button = $%PrevTrackIconButton
@onready var play_pause_icon_button: Button = $%PlayPauseIconButton
@onready var next_track_icon_button: Button = $%NextTrackIconButton
@onready var increase_volume_icon_button: Button = $%IncreaseVolumeIconButton
@onready var decrease_volume_icon_button: Button = $%DecreaseVolumeIconButton
func _ready() -> void:
prev_track_icon_button.pressed.connect(_on_prev_track_icon_button_pressed)
play_pause_icon_button.pressed.connect(_on_play_pause_icon_button_pressed)
next_track_icon_button.pressed.connect(_on_next_track_icon_button_pressed)
increase_volume_icon_button.pressed.connect(_on_increase_volume_icon_button_pressed)
decrease_volume_icon_button.pressed.connect(_on_decrease_volume_icon_button_pressed)
if radio:
radio.track_changed.connect(_on_radio_track_changed)
if radio.stream and radio.stream.resource_path:
@@ -25,25 +15,29 @@ func _ready() -> void:
func _on_radio_track_changed(track_name: String) -> void:
track_label.text = track_name
func _on_prev_track_icon_button_pressed() -> void:
func _on_prev_track_icon_button_on_pressed() -> void:
if radio:
radio.prev_track()
func _on_play_pause_icon_button_pressed() -> void:
func _on_play_pause_icon_button_on_pressed() -> void:
radio.toggle_pause()
#if radio.stream_paused:
#button_pause_resume.text = "Resume"
#else:
#button_pause_resume.text = "Pause"
func _on_next_track_icon_button_pressed() -> void:
func _on_next_track_icon_button_on_pressed() -> void:
if radio:
radio.next_track()
func _on_increase_volume_icon_button_pressed() -> void:
func _on_increase_volume_icon_button_on_pressed() -> void:
var current_vol = AudioManager.get_audio_bus_volume("Music", 1.0)
AudioManager.set_audio_bus_volume("Music", current_vol + 0.1)
func _on_decrease_volume_icon_button_pressed() -> void:
func _on_decrease_volume_icon_button_on_pressed() -> void:
var current_vol = AudioManager.get_audio_bus_volume("Music", 1.0)
AudioManager.set_audio_bus_volume("Music", current_vol - 0.1)

View File

@@ -89,7 +89,6 @@ layout_mode = 2
size_flags_vertical = 4
[node name="IncreaseVolumeIconButton" parent="HBoxContainer/VBoxContainer2" unique_id=1788399963 instance=ExtResource("1_ucnyb")]
unique_name_in_owner = true
custom_minimum_size = Vector2(40, 40)
layout_mode = 2
size_flags_horizontal = 0
@@ -107,7 +106,6 @@ offset_right = -96.666664
offset_bottom = -92.64813
[node name="DecreaseVolumeIconButton" parent="HBoxContainer/VBoxContainer2" unique_id=399629327 instance=ExtResource("1_ucnyb")]
unique_name_in_owner = true
custom_minimum_size = Vector2(40, 40)
layout_mode = 2
size_flags_horizontal = 0
@@ -124,6 +122,12 @@ offset_top = 92.64813
offset_right = -96.666664
offset_bottom = -92.64813
[connection signal="on_pressed" from="HBoxContainer/VBoxContainer/IconButtonsRow/PrevTrackIconButton" to="." method="_on_prev_track_icon_button_on_pressed"]
[connection signal="on_pressed" from="HBoxContainer/VBoxContainer/IconButtonsRow/PlayPauseIconButton" to="." method="_on_play_pause_icon_button_on_pressed"]
[connection signal="on_pressed" from="HBoxContainer/VBoxContainer/IconButtonsRow/NextTrackIconButton" to="." method="_on_next_track_icon_button_on_pressed"]
[connection signal="on_pressed" from="HBoxContainer/VBoxContainer2/IncreaseVolumeIconButton" to="." method="_on_increase_volume_icon_button_on_pressed"]
[connection signal="on_pressed" from="HBoxContainer/VBoxContainer2/DecreaseVolumeIconButton" to="." method="_on_decrease_volume_icon_button_on_pressed"]
[editable path="HBoxContainer/VBoxContainer/IconButtonsRow/PrevTrackIconButton"]
[editable path="HBoxContainer/VBoxContainer/IconButtonsRow/PlayPauseIconButton"]
[editable path="HBoxContainer/VBoxContainer/IconButtonsRow/NextTrackIconButton"]

View File

@@ -1,8 +1,9 @@
@tool
extends Button
extends Control
class_name IconButton
signal on_pressed
@export var data: String
@export var image: Texture:
@@ -11,22 +12,12 @@ class_name IconButton
if is_inside_tree() and has_node("%Texture"):
$%Texture.texture = image
@onready var mini_texture: TextureRect = $%MiniTexture
func _ready():
if image != null and has_node("%Texture"):
$%Texture.texture = image
func _on_mouse_entered() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.BREATHE):
return
TweenFX.breathe(self, 1)
func _on_mouse_exited() -> void:
TweenFX.stop(self, TweenFX.Animations.BREATHE)
scale = Vector2(1, 1)
func _on_pressed() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.PRESS_ROTATE):
return
TweenFX.press_rotate(self)
func _on_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
on_pressed.emit()

View File

@@ -3,78 +3,34 @@
[ext_resource type="Script" uid="uid://bpbgecvan0a5k" path="res://core/main_scene_ui/icon_button.gd" id="1_r8gxt"]
[ext_resource type="Texture2D" uid="uid://dldg826x1kkoe" path="res://core/main_scene_ui/assets/weather_test.png" id="1_upldh"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_r8gxt"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6q6an"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_60w2f"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4xtsh"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_305hl"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_jurvi"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_xxros"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3kui7"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ogiom"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4beq1"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_cxhgx"]
[node name="IconButton" type="Button" unique_id=1621140689]
[node name="IconButton" type="Control" unique_id=1750448019]
custom_minimum_size = Vector2(160, 160)
anchors_preset = -1
anchor_right = 0.083333336
anchor_bottom = 0.14814815
pivot_offset_ratio = Vector2(0.5, 0.5)
theme_override_styles/normal = SubResource("StyleBoxEmpty_r8gxt")
theme_override_styles/normal_mirrored = SubResource("StyleBoxEmpty_6q6an")
theme_override_styles/pressed = SubResource("StyleBoxEmpty_60w2f")
theme_override_styles/pressed_mirrored = SubResource("StyleBoxEmpty_4xtsh")
theme_override_styles/hover = SubResource("StyleBoxEmpty_305hl")
theme_override_styles/hover_mirrored = SubResource("StyleBoxEmpty_jurvi")
theme_override_styles/hover_pressed = SubResource("StyleBoxEmpty_xxros")
theme_override_styles/hover_pressed_mirrored = SubResource("StyleBoxEmpty_3kui7")
theme_override_styles/disabled = SubResource("StyleBoxEmpty_ogiom")
theme_override_styles/disabled_mirrored = SubResource("StyleBoxEmpty_4beq1")
theme_override_styles/focus = SubResource("StyleBoxEmpty_cxhgx")
script = ExtResource("1_r8gxt")
image = ExtResource("1_upldh")
metadata/_edit_use_anchors_ = true
[node name="Texture" type="TextureRect" parent="." unique_id=1071359322]
unique_name_in_owner = true
custom_minimum_size = Vector2(160, 160)
layout_mode = 1
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("1_upldh")
expand_mode = 1
script = ExtResource("1_r8gxt")
image = ExtResource("1_upldh")
[node name="MiniTexture" type="TextureRect" parent="." unique_id=65158044]
[node name="Texture" type="TextureRect" parent="." unique_id=1071359322]
unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(32, 32)
custom_minimum_size = Vector2(160, 160)
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -32.0
offset_top = -32.0
grow_horizontal = 0
grow_vertical = 0
anchors_preset = -1
anchor_left = 0.45833334
anchor_top = 0.42592594
anchor_right = 0.5416667
anchor_bottom = 0.5740741
offset_left = 80.0
offset_top = 79.99997
offset_right = -80.0
offset_bottom = -80.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("1_upldh")
expand_mode = 1
metadata/_edit_use_anchors_ = true
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
[connection signal="pressed" from="." to="." method="_on_pressed"]
[connection signal="gui_input" from="." to="." method="_on_gui_input"]

View File

@@ -2,50 +2,47 @@ extends HBoxContainer
signal on_option_changed(data: String)
@onready var category_icon_button: IconButton
@onready var options_icon_buttons: Array[IconButton]
@onready var show_container_tween: ContainerTween = $%ShowContainerTween
@onready var hide_container_tween: ContainerTween = $%HideContainerTween
@onready var current_icon_button: IconButton
@onready var icon_buttons_options: Array[IconButton]
var is_menu_open: bool = false
func _ready() -> void:
for i in range(get_child_count()):
if get_child(i) is not Control:
continue
var icon_button: IconButton = get_child(i)
if i == 0:
category_icon_button = icon_button
icon_button.pressed.connect(on_category_icon_button_pressed)
icon_button.mini_texture.visible = true
current_icon_button = icon_button
icon_button.on_pressed.connect(on_current_icon_button_pressed)
else:
options_icon_buttons.append(icon_button)
icon_button.pressed.connect(on_icon_pressed_changed.bind(icon_button))
icon_button.mini_texture.visible = false
icon_buttons_options.append(icon_button)
icon_button.on_pressed.connect(_on_icon_pressed_changed.bind(icon_button))
func on_icon_pressed_changed(in_icon_button: IconButton):
for icon_button in options_icon_buttons:
func _on_icon_pressed_changed(in_icon_button: IconButton):
for icon_button in icon_buttons_options:
if icon_button == in_icon_button:
category_icon_button.mini_texture.texture = in_icon_button.image
category_icon_button.data = in_icon_button.data
current_icon_button.image = in_icon_button.image
current_icon_button.data = in_icon_button.data
on_option_changed.emit(icon_button.data)
break
hide_options()
func on_category_icon_button_pressed() -> void:
if show_container_tween.is_running or hide_container_tween.is_running:
return
func on_current_icon_button_pressed() -> void:
if is_menu_open:
hide_options()
else:
show_options()
func show_options() -> void:
show_container_tween.start_tween()
for icon_button in icon_buttons_options:
icon_button.show()
is_menu_open = true
func hide_options() -> void:
hide_container_tween.start_tween()
await hide_container_tween.finished
for icon_button in icon_buttons_options:
icon_button.hide()
is_menu_open = false

View File

@@ -2,7 +2,6 @@
[ext_resource type="PackedScene" uid="uid://2tqofxxxnvhv" path="res://core/main_scene_ui/icon_button.tscn" id="1_lnxme"]
[ext_resource type="Script" uid="uid://cpf5rwmd0kaa6" path="res://core/main_scene_ui/icon_buttons_row.gd" id="1_xq3mw"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/tween/container_tween.tscn" id="3_58qdb"]
[node name="IconButtonsRow" type="HBoxContainer" unique_id=1734127019]
custom_minimum_size = Vector2(800, 0)
@@ -42,15 +41,3 @@ visible = false
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 3
[node name="ShowContainerTween" parent="." unique_id=160227524 node_paths=PackedStringArray("targets") instance=ExtResource("3_58qdb")]
unique_name_in_owner = true
targets = [NodePath("../IconButton2"), NodePath("../IconButton3"), NodePath("../IconButton4"), NodePath("../IconButton5")]
tween_types = Array[String](["impact_land"])
show_on_start = true
[node name="HideContainerTween" parent="." unique_id=1169748375 node_paths=PackedStringArray("targets") instance=ExtResource("3_58qdb")]
unique_name_in_owner = true
targets = [NodePath("../IconButton5"), NodePath("../IconButton4"), NodePath("../IconButton3"), NodePath("../IconButton2")]
tween_types = Array[String](["impact_land"])
hide_on_finish = true

View File

@@ -0,0 +1,49 @@
extends Control
enum Weather {RAIN, SNOW}
@onready var game_menu: Control = $%GameMenu
func _on_menu_icon_button_on_pressed() -> void:
GameState.pause_game()
game_menu.show()
func _on_photo_icon_button_on_pressed() -> void:
GameState.on_enable_photo_mode_request.emit()
func _on_collectible_icon_button_on_pressed() -> void:
GameState.pause_game()
game_menu.on_tab_pressed(1, true)
game_menu.show()
func _on_time_of_day_row_on_option_changed(data: String) -> void:
match data:
"Sunrise":
UIEvents.time_option_item_changed.emit(0)
"Day":
UIEvents.time_option_item_changed.emit(1)
"Sunset":
UIEvents.time_option_item_changed.emit(2)
"Night":
UIEvents.time_option_item_changed.emit(3)
_:
pass
func _on_weather_row_on_option_changed(data: String) -> void:
match data:
"Snow":
UIEvents.toggle_snow.emit(true)
"Rain":
UIEvents.toggle_rain.emit(true)
"Storm":
UIEvents.toggle_storm.emit(true)
"Wind":
UIEvents.toggle_wind.emit(true)
"Random":
pass
_:
pass

View File

@@ -1,23 +1,21 @@
[gd_scene format=3 uid="uid://bei7fscn77p1p"]
[ext_resource type="Script" uid="uid://bhad1id8jr8jw" path="res://core/main_scene_ui/main_scene_ui.gd" id="1_h43jo"]
[ext_resource type="PackedScene" uid="uid://ir8nke8o6ssm" path="res://core/main_scene_ui/icon_buttons_row.tscn" id="2_4cc8f"]
[ext_resource type="PackedScene" uid="uid://2tqofxxxnvhv" path="res://core/main_scene_ui/icon_button.tscn" id="3_t1xop"]
[ext_resource type="PackedScene" uid="uid://dqqm4o8j45tr6" path="res://core/game_menu/game_menu.tscn" id="4_jh36j"]
[ext_resource type="PackedScene" uid="uid://cpeyt1dgrtglc" path="res://core/radio/radio.tscn" id="5_nevjt"]
[ext_resource type="AudioStream" uid="uid://70cc8she43re" path="res://docs/gyms/radio/lofi_01.ogg" id="6_kd244"]
[ext_resource type="PackedScene" uid="uid://dg4f3v0ukpmay" path="res://core/main_scene_ui/audio_player.tscn" id="7_lapqe"]
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/tween/container_tween.tscn" id="8_msh61"]
[ext_resource type="PackedScene" uid="uid://ir8nke8o6ssm" path="res://core/main_scene_ui/icon_buttons_row.tscn" id="1_87dkt"]
[ext_resource type="Script" uid="uid://bhad1id8jr8jw" path="res://core/main_scene_ui/main_menu_ui.gd" id="1_aurcl"]
[ext_resource type="PackedScene" uid="uid://2tqofxxxnvhv" path="res://core/main_scene_ui/icon_button.tscn" id="1_fjauj"]
[ext_resource type="PackedScene" uid="uid://dqqm4o8j45tr6" path="res://core/game_menu/game_menu.tscn" id="4_7q818"]
[ext_resource type="PackedScene" uid="uid://cpeyt1dgrtglc" path="res://core/radio/radio.tscn" id="5_21kh1"]
[ext_resource type="PackedScene" uid="uid://dg4f3v0ukpmay" path="res://core/main_scene_ui/audio_player.tscn" id="6_1h1a0"]
[ext_resource type="AudioStream" uid="uid://70cc8she43re" path="res://docs/gyms/radio/lofi_01.ogg" id="6_vhlrw"]
[node name="MainSceneUi" type="Control" unique_id=1359391222]
process_mode = 3
[node name="MainMenuUi" type="Control" unique_id=1359391222]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_h43jo")
script = ExtResource("1_aurcl")
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=2071886807]
custom_minimum_size = Vector2(160, 320)
@@ -29,7 +27,7 @@ offset_top = -320.0
offset_right = 160.0
grow_vertical = 0
[node name="TimeOfDayRow" parent="VBoxContainer" unique_id=1734127019 instance=ExtResource("2_4cc8f")]
[node name="TimeOfDayRow" parent="VBoxContainer" unique_id=1734127019 instance=ExtResource("1_87dkt")]
layout_mode = 2
[node name="IconButton2" parent="VBoxContainer/TimeOfDayRow" index="1" unique_id=638856991]
@@ -44,14 +42,7 @@ data = "Sunset"
[node name="IconButton5" parent="VBoxContainer/TimeOfDayRow" index="4" unique_id=315412403]
data = "Night"
[node name="ShowContainerTween" parent="VBoxContainer/TimeOfDayRow" index="5" unique_id=160227524]
tween_types = Array[String](["impact_land", "fade_in"])
[node name="HideContainerTween" parent="VBoxContainer/TimeOfDayRow" index="6" unique_id=1169748375]
tween_types = Array[String](["impact_land", "fade_out"])
[node name="WeatherRow" parent="VBoxContainer" unique_id=1803637359 instance=ExtResource("2_4cc8f")]
unique_name_in_owner = true
[node name="WeatherRow" parent="VBoxContainer" unique_id=1803637359 instance=ExtResource("1_87dkt")]
layout_mode = 2
[node name="IconButton2" parent="VBoxContainer/WeatherRow" index="1" unique_id=638856991]
@@ -66,15 +57,7 @@ data = "Storm"
[node name="IconButton5" parent="VBoxContainer/WeatherRow" index="4" unique_id=315412403]
data = "Wind"
[node name="ShowContainerTween" parent="VBoxContainer/WeatherRow" index="5" unique_id=160227524 node_paths=PackedStringArray("targets")]
targets = [NodePath("../IconButton2"), NodePath("../IconButton3"), NodePath("../IconButton4"), NodePath("../IconButton5"), NodePath("../IconButton6")]
tween_types = Array[String](["impact_land", "fade_in"])
[node name="HideContainerTween" parent="VBoxContainer/WeatherRow" index="6" unique_id=1169748375 node_paths=PackedStringArray("targets")]
targets = [NodePath("../IconButton6"), NodePath("../IconButton5"), NodePath("../IconButton4"), NodePath("../IconButton3"), NodePath("../IconButton2")]
tween_types = Array[String](["impact_land", "fade_out"])
[node name="IconButton6" parent="VBoxContainer/WeatherRow" unique_id=218253485 instance=ExtResource("3_t1xop")]
[node name="IconButton6" parent="VBoxContainer/WeatherRow" unique_id=218253485 instance=ExtResource("1_fjauj")]
unique_name_in_owner = true
visible = false
layout_mode = 2
@@ -82,15 +65,15 @@ size_flags_horizontal = 0
size_flags_vertical = 3
data = "Random"
[node name="MenuIconButton" parent="." unique_id=707872474 instance=ExtResource("3_t1xop")]
unique_name_in_owner = true
[node name="MenuIconButton" parent="." unique_id=707872474 instance=ExtResource("1_fjauj")]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
anchor_bottom = 0.0
offset_left = -160.0
offset_bottom = 160.0
grow_horizontal = 0
grow_vertical = 1
[node name="CollectionOptions" type="VBoxContainer" parent="." unique_id=542153805]
layout_mode = 1
@@ -105,15 +88,21 @@ offset_bottom = 20.0
grow_horizontal = 0
grow_vertical = 2
[node name="PhotoIconButton" parent="CollectionOptions" unique_id=1863476241 instance=ExtResource("3_t1xop")]
unique_name_in_owner = true
[node name="PhotoIconButton" parent="CollectionOptions" unique_id=1863476241 instance=ExtResource("1_fjauj")]
layout_mode = 2
[node name="CollectibleIconButton" parent="CollectionOptions" unique_id=520235552 instance=ExtResource("3_t1xop")]
unique_name_in_owner = true
[node name="CollectibleIconButton" parent="CollectionOptions" unique_id=520235552 instance=ExtResource("1_fjauj")]
layout_mode = 2
[node name="AudioPlayer" parent="." unique_id=425192018 node_paths=PackedStringArray("radio") instance=ExtResource("7_lapqe")]
[node name="GameMenu" parent="." unique_id=2124096517 instance=ExtResource("4_7q818")]
unique_name_in_owner = true
visible = false
layout_mode = 1
[node name="Radio" parent="." unique_id=1234112225 instance=ExtResource("5_21kh1")]
playlist = Array[AudioStream]([ExtResource("6_vhlrw")])
[node name="AudioPlayer" parent="." unique_id=425192018 node_paths=PackedStringArray("radio") instance=ExtResource("6_1h1a0")]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
@@ -128,40 +117,11 @@ grow_horizontal = 0
grow_vertical = 0
radio = NodePath("../Radio")
[node name="GameMenuPanel" type="Panel" parent="." unique_id=846120687]
unique_name_in_owner = true
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="GameMenu" parent="GameMenuPanel" unique_id=2124096517 instance=ExtResource("4_jh36j")]
unique_name_in_owner = true
layout_mode = 1
[node name="Radio" parent="." unique_id=1234112225 instance=ExtResource("5_nevjt")]
playlist = Array[AudioStream]([ExtResource("6_kd244")])
[node name="ShowContainerTween" parent="." unique_id=902285649 node_paths=PackedStringArray("targets") instance=ExtResource("8_msh61")]
unique_name_in_owner = true
targets = [NodePath("../GameMenuPanel/GameMenu")]
tween_types = Array[String](["fold_in"])
show_on_start = true
[node name="HideContainerTween" parent="." unique_id=1041880010 node_paths=PackedStringArray("targets") instance=ExtResource("8_msh61")]
unique_name_in_owner = true
targets = [NodePath("../GameMenuPanel/GameMenu")]
tween_types = Array[String](["fold_out"])
hide_on_finish = true
[connection signal="on_option_changed" from="VBoxContainer/TimeOfDayRow" to="." method="_on_time_of_day_row_on_option_changed"]
[connection signal="on_option_changed" from="VBoxContainer/WeatherRow" to="." method="_on_weather_row_on_option_changed"]
[connection signal="on_pressed" from="MenuIconButton" to="." method="_on_menu_icon_button_on_pressed"]
[connection signal="on_pressed" from="CollectionOptions/PhotoIconButton" to="." method="_on_photo_icon_button_on_pressed"]
[connection signal="on_pressed" from="CollectionOptions/CollectibleIconButton" to="." method="_on_collectible_icon_button_on_pressed"]
[editable path="VBoxContainer/TimeOfDayRow"]
[editable path="VBoxContainer/WeatherRow"]
[editable path="GameMenuPanel/GameMenu"]
[editable path="GameMenuPanel/GameMenu/Pages/Page3"]
[editable path="GameMenuPanel/GameMenu/Pages/Page3/OptionMenu"]

View File

@@ -1,78 +0,0 @@
extends Control
enum Weather {RAIN, SNOW}
@onready var game_menu: Control = $%GameMenu
@onready var game_menu_panel: Control = $%GameMenuPanel
@onready var menu_icon_button: Button = $%MenuIconButton
@onready var photo_icon_button: Button = $%PhotoIconButton
@onready var collectible_icon_button: Button = $%CollectibleIconButton
@onready var resume_button: Button = $GameMenuPanel/GameMenu/Pages/Page3/OptionMenu/VBoxContainer/ResumeButton
@onready var show_container_tween: ContainerTween = $%ShowContainerTween
@onready var hide_container_tween: ContainerTween = $%HideContainerTween
@onready var weather_row: HBoxContainer = $%WeatherRow
func _ready() -> void:
menu_icon_button.pressed.connect(_on_menu_icon_button_pressed)
photo_icon_button.pressed.connect(_on_photo_icon_button_pressed)
collectible_icon_button.pressed.connect(_on_collectible_icon_button_pressed)
resume_button.pressed.connect(_on_resume_button_pressed)
func _on_menu_icon_button_pressed() -> void:
GameState.pause_game()
game_menu_panel.show()
show_container_tween.start_tween()
func _on_photo_icon_button_pressed() -> void:
GameState.on_enable_photo_mode_request.emit()
func _on_collectible_icon_button_pressed() -> void:
GameState.pause_game()
game_menu.on_tab_pressed(1, true)
game_menu_panel.show()
show_container_tween.start_tween()
func _on_resume_button_pressed() -> void:
hide_container_tween.start_tween()
await hide_container_tween.finished
game_menu_panel.hide()
GameState.resume_game()
func _on_time_of_day_row_on_option_changed(data: String) -> void:
match data:
"Sunrise":
UIEvents.time_option_item_changed.emit(0)
"Day":
UIEvents.time_option_item_changed.emit(1)
"Sunset":
UIEvents.time_option_item_changed.emit(2)
"Night":
UIEvents.time_option_item_changed.emit(3)
_:
pass
func _on_weather_row_on_option_changed(data: String) -> void:
match data:
"Snow":
UIEvents.toggle_snow.emit(true)
"Rain":
UIEvents.toggle_rain.emit(true)
"Storm":
UIEvents.toggle_storm.emit(true)
"Wind":
UIEvents.toggle_wind.emit(true)
"Random":
pick_random_weather()
_:
pass
func pick_random_weather() -> void:
var valid_buttons = []
for child in weather_row.options_icon_buttons:
if child.data.to_lower() != "random":
valid_buttons.append(child)
if valid_buttons.size() > 0:
var random_button = valid_buttons.pick_random()
weather_row.on_icon_pressed_changed(random_button)

View File

@@ -4,7 +4,6 @@
[ext_resource type="Resource" uid="uid://dr612tmciq8pg" path="res://core/scene_manager/scene_config.tres" id="2_vtdwt"]
[node name="SceneManager" type="CanvasLayer" unique_id=399843239]
process_mode = 3
layer = 100
script = ExtResource("1_7resu")
config = ExtResource("2_vtdwt")

View File

@@ -1,86 +0,0 @@
extends Node
class_name ContainerTween
signal finished
enum AnimateOrder {
AS_IS,
TOP_TO_BOTTOM,
BOTTOM_TO_TOP,
LEFT_TO_RIGHT,
RIGHT_TO_LEFT
}
@export_group("Settings")
@export var targets: Array[Control]
@export var runtime_target_parent: Control
@export var tween_types: Array[String] = ["punch_in"]
@export var order: AnimateOrder = AnimateOrder.AS_IS
@export var stagger_delay: float = 0.05
@export var show_on_start: bool = false
@export var hide_on_finish: bool = false
@export var reset_state_on_start: bool = true
var _tween_generation: int = 0
var is_running: bool = false
func start_tween() -> void:
if is_running:
return
is_running = true
_tween_generation += 1
var current_gen = _tween_generation
var sorted_targets = targets.duplicate() if !targets.is_empty() else runtime_target_parent.get_children().duplicate()
match order:
AnimateOrder.TOP_TO_BOTTOM:
sorted_targets.sort_custom(func(a, b): return a.global_position.y < b.global_position.y)
AnimateOrder.BOTTOM_TO_TOP:
sorted_targets.sort_custom(func(a, b): return a.global_position.y > b.global_position.y)
AnimateOrder.LEFT_TO_RIGHT:
sorted_targets.sort_custom(func(a, b): return a.global_position.x < b.global_position.x)
AnimateOrder.RIGHT_TO_LEFT:
sorted_targets.sort_custom(func(a, b): return a.global_position.x > b.global_position.x)
var last_tween: Tween = null
for target in sorted_targets:
if current_gen != _tween_generation:
return
if is_instance_valid(target):
if reset_state_on_start:
target.scale = Vector2.ONE
target.modulate.a = 1.0
if show_on_start:
target.show()
for type in tween_types:
var tween = TweenFX.call(type, target)
if tween is Tween:
last_tween = tween
if hide_on_finish and tween is Tween:
tween.tween_callback(target.hide)
if stagger_delay > 0.0:
await get_tree().create_timer(stagger_delay).timeout
if is_instance_valid(last_tween) and last_tween.is_running():
await last_tween.finished
if current_gen == _tween_generation:
is_running = false
finished.emit()
func stop_tween() -> void:
is_running = false
_tween_generation += 1
var current_targets = targets if !targets.is_empty() else runtime_target_parent.get_children()
for target in current_targets:
if is_instance_valid(target):
TweenFX.stop_all(target)

View File

@@ -1,7 +0,0 @@
[gd_scene format=3 uid="uid://dxun0jk5t0n6"]
[ext_resource type="Script" uid="uid://ryxh3nm7ayvf" path="res://core/tween/container_tween.gd" id="1_qfild"]
[node name="ContainerTween" type="Node" unique_id=160227524]
process_mode = 3
script = ExtResource("1_qfild")

View File

@@ -24,7 +24,6 @@ CollectionManager="*uid://22orqdm34hfm"
AudioManager="*uid://dcttbbavtwtsg"
SceneManager="*uid://bw8hwkw55j675"
ShaderWarmup="res://core/shader_warmup.gd"
TweenFX="*uid://d2n10rw2dnx8o"
[display]
@@ -35,7 +34,7 @@ window/stretch/aspect="expand"
[editor_plugins]
enabled=PackedStringArray("res://addons/TweenFX/plugin.cfg")
enabled=PackedStringArray()
[global_group]

View File

@@ -58,19 +58,19 @@ script = ExtResource("2_0bmh1")
north = true
south = true
[node name="Argini_003" parent="." index="0" unique_id=509439881]
[node name="Argini_003" parent="." index="0" unique_id=1178813592]
surface_material_override/0 = ExtResource("3_c4jie")
[node name="Grass_005" parent="." index="1" unique_id=188609017 groups=["weather_vegetables_node", "wind_node"]]
[node name="Grass_005" parent="." index="1" unique_id=1427965126 groups=["weather_vegetables_node", "wind_node"]]
surface_material_override/0 = ExtResource("3_c4jie")
[node name="MSH_Staccioanta_1_002" parent="." index="2" unique_id=746941179]
[node name="MSH_Staccioanta_1_002" parent="." index="2" unique_id=562234307]
surface_material_override/0 = ExtResource("4_lr7xw")
[node name="Strada_004" parent="." index="3" unique_id=604168900 groups=["weather_node"]]
[node name="Strada_004" parent="." index="3" unique_id=387203009 groups=["weather_node"]]
surface_material_override/0 = ExtResource("5_5jc2f")
[node name="Water_004" parent="." index="4" unique_id=244513747]
[node name="Water_004" parent="." index="4" unique_id=1258756459]
surface_material_override/0 = ExtResource("6_0bmh1")
[node name="grass" type="Node3D" parent="." index="5" unique_id=1540226859 groups=["weather_vegetables_node", "wind_node"]]
@@ -104,7 +104,7 @@ material_override = ExtResource("10_tbcfd")
cast_shadow = 0
multimesh = SubResource("MultiMesh_e417f")
[node name="rice" type="Node3D" parent="." index="6" unique_id=1524870522 groups=["weather_vegetables_node"]]
[node name="rice" type="Node3D" parent="." index="6" unique_id=1524870522 groups=["weather_vegetables_node", "wind_node"]]
visible = false
[node name="rice_plane" type="MeshInstance3D" parent="rice" index="0" unique_id=629743434]

View File

@@ -9,7 +9,7 @@
[ext_resource type="Material" uid="uid://jygb1hcokks5" path="res://tgcc/chunk/prop/grass/grass_bank.tres" id="6_cxqsi"]
[ext_resource type="Material" uid="uid://fnjxocmx16b7" path="res://tgcc/chunk/prop/grass/grass_chunk.tres" id="7_vkypx"]
[ext_resource type="Material" uid="uid://0x17mj2v807r" path="res://tgcc/chunk/prop/grass/grass_chunk_weeds2.tres" id="8_k7yf4"]
[ext_resource type="ArrayMesh" uid="uid://bg5rfu7tyl3p8" path="res://tgcc/chunk/prop/tree/bambù/Bambu.res" id="11_fy14c"]
[ext_resource type="ArrayMesh" uid="uid://doophefr873pt" path="res://tgcc/chunk/prop/tree/bambù/Bambu.res" id="11_fy14c"]
[ext_resource type="PackedScene" uid="uid://d12t04rs47jq3" path="res://tgcc/chunk/prop/tree/tree_01/tree_01.tscn" id="12_fqf4n"]
[ext_resource type="Script" uid="uid://cp1pb5dnuojg3" path="res://tgcc/chunk/prop/tree/bambù/bambu.gd" id="12_s2jc4"]
@@ -60,20 +60,20 @@ script = ExtResource("2_vkypx")
river_north = true
river_south = true
[node name="Argini_011" parent="." index="0" unique_id=1103166467]
[node name="Argini_011" parent="." index="0" unique_id=895986402]
surface_material_override/0 = ExtResource("2_mic04")
surface_material_override/1 = ExtResource("2_mic04")
[node name="Grass_019" parent="." index="1" unique_id=163702648]
[node name="Grass_019" parent="." index="1" unique_id=1784106582]
surface_material_override/0 = ExtResource("2_mic04")
[node name="Water_012" parent="." index="2" unique_id=183333409]
[node name="Water_012" parent="." index="2" unique_id=1865739867]
surface_material_override/0 = ExtResource("3_5p1m2")
[node name="Water_F_015" parent="." index="3" unique_id=1691016237]
[node name="Water_F_015" parent="." index="3" unique_id=147107428]
surface_material_override/0 = ExtResource("4_532mt")
[node name="rice" type="Node3D" parent="." index="4" unique_id=1336289627 groups=["weather_vegetables_node"]]
[node name="rice" type="Node3D" parent="." index="4" unique_id=1336289627 groups=["weather_vegetables_node", "wind_node"]]
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 21.006079, 0, 0)
[node name="rice_plane" type="MeshInstance3D" parent="rice" index="0" unique_id=1744988640]

View File

@@ -7,85 +7,82 @@
[ext_resource type="PackedScene" uid="uid://ujv2f1l4d2ps" path="res://core/biome_generator/biome_generator.tscn" id="5_islkt"]
[ext_resource type="Script" uid="uid://wv6kcqkibium" path="res://core/biome_generator/biome.gd" id="6_jfe74"]
[ext_resource type="PackedScene" uid="uid://b8blm6bwintf7" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_empty_01.tscn" id="7_5lqbd"]
[ext_resource type="PackedScene" uid="uid://dgobym7krbqdr" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_fields_corner_01.tscn" id="7_lrm81"]
[ext_resource type="PackedScene" uid="uid://cgbjvjvtlulyu" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_cross_3_02.tscn" id="8_1iysf"]
[ext_resource type="PackedScene" uid="uid://cjv1e8pc6gde1" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_corner_01.tscn" id="8_aiwf5"]
[ext_resource type="PackedScene" uid="uid://dqoai3665vb0a" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_corner_02.tscn" id="9_0gakq"]
[ext_resource type="PackedScene" uid="uid://chs64ggbvy28i" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_end_01.tscn" id="9_qulo6"]
[ext_resource type="PackedScene" uid="uid://crlk31ecl480n" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_corner_03.tscn" id="10_8taq1"]
[ext_resource type="PackedScene" uid="uid://buiqa2mofucer" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_straight_02.tscn" id="10_s8w8r"]
[ext_resource type="PackedScene" uid="uid://brpp7fe5noq8v" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_cross_3_01.tscn" id="11_bx28o"]
[ext_resource type="PackedScene" uid="uid://btwjdnho1cyav" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_straight_03.tscn" id="11_qgu6k"]
[ext_resource type="PackedScene" uid="uid://qmt8bkiksgj3" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_cross_3_02.tscn" id="12_e3o1y"]
[ext_resource type="PackedScene" uid="uid://cmxsc74ebqnju" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_straight_04.tscn" id="12_ouhay"]
[ext_resource type="PackedScene" uid="uid://by3c73s5g5n53" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_curve_3.tscn" id="13_no2mr"]
[ext_resource type="PackedScene" uid="uid://d1tfkhuktwthn" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_cross_3_03.tscn" id="13_pesa5"]
[ext_resource type="PackedScene" uid="uid://djbish323kvt" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_end_1.tscn" id="14_civl4"]
[ext_resource type="PackedScene" uid="uid://b002wu5ltuqi4" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_end_01.tscn" id="14_d5byn"]
[ext_resource type="PackedScene" uid="uid://b4r0j5os1tka4" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_mix1_1.tscn" id="15_q1p61"]
[ext_resource type="PackedScene" uid="uid://dtfmvcbninrcu" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_end_02.tscn" id="15_vk128"]
[ext_resource type="PackedScene" uid="uid://h6xj43vo84uf" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_straight_01.tscn" id="16_0l4fn"]
[ext_resource type="PackedScene" uid="uid://cpfsxacr75b5u" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_mix3_1.tscn" id="16_n6l0c"]
[ext_resource type="PackedScene" uid="uid://cu2chsjh8wuvp" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_straight_02.tscn" id="17_0l3s0"]
[ext_resource type="PackedScene" uid="uid://bwrp04hg0h0wo" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_mix4_1.tscn" id="17_j3l3o"]
[ext_resource type="PackedScene" uid="uid://pxmcy0lhne5d" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_straight_03.tscn" id="18_0mfe6"]
[ext_resource type="PackedScene" uid="uid://mlmtsppo4esq" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_mix6_1.tscn" id="18_6r6jj"]
[ext_resource type="PackedScene" uid="uid://ck0y8s6aj7t0n" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_straight_1.tscn" id="19_1bb1l"]
[ext_resource type="PackedScene" uid="uid://bs3dkwcc8w2uk" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_curve_1.tscn" id="19_8ws46"]
[ext_resource type="PackedScene" uid="uid://btipd6wev016d" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_straight_1.tscn" id="20_fv7f0"]
[ext_resource type="PackedScene" uid="uid://deaxxlxdipqvx" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_end_1.tscn" id="21_psqnm"]
[ext_resource type="PackedScene" uid="uid://ct3084nflycla" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_mix1_1.tscn" id="22_j4kwo"]
[ext_resource type="PackedScene" uid="uid://bhvmmw8d8vns5" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_mix2_1.tscn" id="23_53r6v"]
[ext_resource type="PackedScene" uid="uid://cqe4t842io22i" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_cross_1.tscn" id="24_esnpb"]
[ext_resource type="PackedScene" uid="uid://rjvefmcd4bpo" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_mix3_1.tscn" id="25_6ik1i"]
[ext_resource type="PackedScene" uid="uid://c73yk6858dmwn" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_cross_4_01.tscn" id="26_cuni5"]
[ext_resource type="PackedScene" uid="uid://c6vpwol3k384y" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_mix4_1.tscn" id="26_x7bpo"]
[ext_resource type="PackedScene" uid="uid://cd3iyj71hkgcr" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_mix5_1.tscn" id="27_e6m8d"]
[ext_resource type="PackedScene" uid="uid://c73yk6858dmwn" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_cross_4_01.tscn" id="27_ylk36"]
[ext_resource type="PackedScene" uid="uid://bh8kbw07bsu6n" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_mix6_1.tscn" id="28_jdvk1"]
[ext_resource type="PackedScene" uid="uid://ce6qvpb27fdpo" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_curve_2.tscn" id="29_otsi4"]
[ext_resource type="PackedScene" uid="uid://7063xk3bwboc" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_straight_4.tscn" id="30_pvks6"]
[ext_resource type="PackedScene" uid="uid://ccgd3uy68r88h" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_curve_3.tscn" id="31_36ld5"]
[ext_resource type="PackedScene" uid="uid://mpgyaho52lii" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_straight_5.tscn" id="32_4i5nu"]
[ext_resource type="PackedScene" uid="uid://q26mkh3cupic" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_cross_2.tscn" id="33_3gjue"]
[ext_resource type="PackedScene" uid="uid://c5rcq82mn1vv7" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_straight_04.tscn" id="33_hv7ul"]
[ext_resource type="PackedScene" uid="uid://c5rcq82mn1vv7" path="res://tgcc/chunk/countryside/scene/rice/chunk_country_straight_04.tscn" id="34_2sxl3"]
[ext_resource type="Resource" uid="uid://cmd6s6thq4f7r" path="res://core/biome_generator/entities_pool.tres" id="34_a2cst"]
[ext_resource type="PackedScene" uid="uid://cv5xmnow451kl" path="res://core/camera.tscn" id="35_f2l8p"]
[ext_resource type="PackedScene" uid="uid://by3c73s5g5n53" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_curve_3.tscn" id="35_wmmw3"]
[ext_resource type="PackedScene" uid="uid://djbish323kvt" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_end_1.tscn" id="36_lrm81"]
[ext_resource type="PackedScene" uid="uid://cmuvmmp7xam4o" path="res://core/daynight/environment_management.tscn" id="36_qwsp8"]
[ext_resource type="PackedScene" uid="uid://b4r0j5os1tka4" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_mix1_1.tscn" id="37_1iysf"]
[ext_resource type="AudioStream" uid="uid://dvabvoqyya0g5" path="res://core/daynight/sounds/thunder_3.mp3" id="37_pdfkp"]
[ext_resource type="AudioStream" uid="uid://creenugno7hm" path="res://core/daynight/sounds/thunder_4.mp3" id="38_fpbvh"]
[ext_resource type="PackedScene" uid="uid://cpfsxacr75b5u" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_mix3_1.tscn" id="38_qulo6"]
[ext_resource type="AudioStream" uid="uid://bm6dq4jwsbxf6" path="res://core/daynight/sounds/thunder_5.mp3" id="39_hxtdl"]
[ext_resource type="PackedScene" uid="uid://bwrp04hg0h0wo" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_mix4_1.tscn" id="39_s8w8r"]
[ext_resource type="AudioStream" uid="uid://byuxpukhy72n8" path="res://core/daynight/sounds/rain_1.mp3" id="40_abet4"]
[ext_resource type="PackedScene" uid="uid://mlmtsppo4esq" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_mix6_1.tscn" id="40_qgu6k"]
[ext_resource type="AudioStream" uid="uid://h5yhjn1x3f4j" path="res://core/daynight/sounds/rain_2.mp3" id="41_60fdo"]
[ext_resource type="PackedScene" uid="uid://ck0y8s6aj7t0n" path="res://tgcc/chunk/countryside/scene/fields/river/chunk_river_tea_straight_1.tscn" id="41_ouhay"]
[ext_resource type="AudioStream" uid="uid://elrjw0smm0cj" path="res://core/daynight/sounds/rain_3.mp3" id="42_mh642"]
[ext_resource type="PackedScene" uid="uid://dgobym7krbqdr" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_fields_corner_01.tscn" id="42_no2mr"]
[ext_resource type="PackedScene" uid="uid://cgbjvjvtlulyu" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_cross_3_02.tscn" id="43_civl4"]
[ext_resource type="PackedScene" uid="uid://1c1ion0qnho4" path="res://tgcc/map/map_1/map_1.tscn" id="43_ysd85"]
[ext_resource type="PackedScene" uid="uid://chs64ggbvy28i" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_end_01.tscn" id="44_q1p61"]
[ext_resource type="Script" uid="uid://dboerd4a6dwj7" path="res://core/biome_generator/rails.gd" id="44_rcqo0"]
[ext_resource type="PackedScene" uid="uid://otptvwer4par" path="res://tgcc/train/train.tscn" id="46_8w5ju"]
[ext_resource type="PackedScene" uid="uid://dvk3bytqn3m5s" path="res://tgcc/train/test/Train_test.tscn" id="45_c0jxs"]
[ext_resource type="PackedScene" uid="uid://buiqa2mofucer" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_straight_02.tscn" id="45_n6l0c"]
[ext_resource type="Resource" uid="uid://bjnytgwt8tmf4" path="res://core/biome_generator/wagon_pool.tres" id="46_exdk1"]
[ext_resource type="PackedScene" uid="uid://btwjdnho1cyav" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_straight_03.tscn" id="46_j3l3o"]
[ext_resource type="PackedScene" uid="uid://0kgjaqijaqku" path="res://docs/museums/biome_generator/rails.tscn" id="46_lbmv2"]
[ext_resource type="PackedScene" uid="uid://c2mnl5l0c3o8t" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_straight_2.tscn" id="47_i22ig"]
[ext_resource type="PackedScene" uid="uid://cmxsc74ebqnju" path="res://tgcc/chunk/countryside/scene/fields/chunk_country_tea_straight_04.tscn" id="47_6r6jj"]
[ext_resource type="PackedScene" uid="uid://dn1btv0e0ses7" path="res://core/fireworks.tscn" id="47_q7p65"]
[ext_resource type="PackedScene" uid="uid://ccg8aaxoghjpq" path="res://tgcc/chunk/countryside/scene/rice/river/scene/chunk_river_straight_3.tscn" id="48_ihpv1"]
[ext_resource type="PackedScene" uid="uid://bw8dg3705vl07" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_curve_3.tscn" id="48_1bb1l"]
[ext_resource type="Script" uid="uid://cx2tlvxhvatj5" path="res://docs/museums/daynight/control.gd" id="48_r5xyi"]
[ext_resource type="PackedScene" uid="uid://bei7fscn77p1p" path="res://core/main_scene_ui/main_scene_ui.tscn" id="49_exdk1"]
[ext_resource type="PackedScene" uid="uid://blco6nv1806fh" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_end_1.tscn" id="49_cuni5"]
[ext_resource type="PackedScene" uid="uid://bei7fscn77p1p" path="res://core/main_scene_ui/main_menu_ui.tscn" id="49_exdk1"]
[ext_resource type="PackedScene" uid="uid://vni5kjalum6d" path="res://core/photo_mode/runtime/photo_mode_controller.tscn" id="50_57hhv"]
[ext_resource type="PackedScene" uid="uid://bujym3ai10i7q" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_corner_01.tscn" id="51_lxncq"]
[ext_resource type="PackedScene" uid="uid://bdfosig4g14vt" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_corner_02.tscn" id="52_317hq"]
[ext_resource type="PackedScene" uid="uid://ffblnqib7fry" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_cross_3_01.tscn" id="53_0ur37"]
[ext_resource type="PackedScene" uid="uid://b785qpoxbrovj" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_cross_3_02.tscn" id="54_vbb0s"]
[ext_resource type="PackedScene" uid="uid://c0bgxecgl4qav" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_end_01.tscn" id="55_qmm8e"]
[ext_resource type="PackedScene" uid="uid://cn1fr8wkb4k2w" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_end_02.tscn" id="56_gklva"]
[ext_resource type="PackedScene" uid="uid://bfbd7kvcd6uf6" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_end_03.tscn" id="57_tbumt"]
[ext_resource type="PackedScene" uid="uid://che0eemntxhwf" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_straight_02.tscn" id="58_qn3jn"]
[ext_resource type="PackedScene" uid="uid://dvl8dae0u2abx" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_straight_03.tscn" id="59_auq23"]
[ext_resource type="PackedScene" uid="uid://c7f64uvjdoq65" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_straight_04.tscn" id="60_kwioe"]
[ext_resource type="PackedScene" uid="uid://bw8dg3705vl07" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_curve_3.tscn" id="61_5hspt"]
[ext_resource type="PackedScene" uid="uid://blco6nv1806fh" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_end_1.tscn" id="62_jn0vv"]
[ext_resource type="PackedScene" uid="uid://51pjkj11tyg0" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_mix1_1.tscn" id="63_m2lii"]
[ext_resource type="PackedScene" uid="uid://dvqsjv10xymt0" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_mix3_1.tscn" id="64_uix1h"]
[ext_resource type="PackedScene" uid="uid://c1x1ymwqgv6kn" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_mix4_1.tscn" id="65_1oect"]
[ext_resource type="PackedScene" uid="uid://bngs7h05fppfy" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_mix6_1.tscn" id="66_he4of"]
[ext_resource type="PackedScene" uid="uid://dn4jmmit4td1d" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_straight_1.tscn" id="67_v37u7"]
[ext_resource type="PackedScene" uid="uid://cykkwpsq7d3ex" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_straight_5.tscn" id="68_f365j"]
[ext_resource type="PackedScene" uid="uid://51pjkj11tyg0" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_mix1_1.tscn" id="50_hv7ul"]
[ext_resource type="PackedScene" uid="uid://dvqsjv10xymt0" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_mix3_1.tscn" id="51_i22ig"]
[ext_resource type="PackedScene" uid="uid://c1x1ymwqgv6kn" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_mix4_1.tscn" id="52_ihpv1"]
[ext_resource type="PackedScene" uid="uid://bngs7h05fppfy" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_mix6_1.tscn" id="53_lxncq"]
[ext_resource type="PackedScene" uid="uid://dn4jmmit4td1d" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_straight_1.tscn" id="54_317hq"]
[ext_resource type="PackedScene" uid="uid://cykkwpsq7d3ex" path="res://tgcc/chunk/countryside/scene/tea/river/chunk_river_tea_straight_5.tscn" id="55_0ur37"]
[ext_resource type="PackedScene" uid="uid://bujym3ai10i7q" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_corner_01.tscn" id="56_vbb0s"]
[ext_resource type="PackedScene" uid="uid://bdfosig4g14vt" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_corner_02.tscn" id="57_qmm8e"]
[ext_resource type="PackedScene" uid="uid://ffblnqib7fry" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_cross_3_01.tscn" id="58_gklva"]
[ext_resource type="PackedScene" uid="uid://b785qpoxbrovj" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_cross_3_02.tscn" id="59_tbumt"]
[ext_resource type="PackedScene" uid="uid://c0bgxecgl4qav" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_end_01.tscn" id="60_qn3jn"]
[ext_resource type="PackedScene" uid="uid://cn1fr8wkb4k2w" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_end_02.tscn" id="61_auq23"]
[ext_resource type="PackedScene" uid="uid://bfbd7kvcd6uf6" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_end_03.tscn" id="62_kwioe"]
[ext_resource type="PackedScene" uid="uid://che0eemntxhwf" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_straight_02.tscn" id="63_5hspt"]
[ext_resource type="PackedScene" uid="uid://dvl8dae0u2abx" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_straight_03.tscn" id="64_jn0vv"]
[ext_resource type="PackedScene" uid="uid://c7f64uvjdoq65" path="res://tgcc/chunk/countryside/scene/tea/chunk_country_tea_straight_04.tscn" id="65_m2lii"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_wjpfq"]
fractal_lacunarity = 1.915
@@ -165,7 +162,7 @@ compositor_effects = Array[CompositorEffect]([SubResource("CompositorEffect_q52t
[sub_resource type="Resource" id="Resource_3qrd0"]
script = ExtResource("6_jfe74")
name = "countryside"
available_chunks = Array[PackedScene]([ExtResource("7_lrm81"), ExtResource("8_1iysf"), ExtResource("9_qulo6"), ExtResource("10_s8w8r"), ExtResource("11_qgu6k"), ExtResource("12_ouhay"), ExtResource("13_no2mr"), ExtResource("14_civl4"), ExtResource("15_q1p61"), ExtResource("16_n6l0c"), ExtResource("17_j3l3o"), ExtResource("18_6r6jj"), ExtResource("19_1bb1l"), ExtResource("8_aiwf5"), ExtResource("9_0gakq"), ExtResource("10_8taq1"), ExtResource("11_bx28o"), ExtResource("12_e3o1y"), ExtResource("13_pesa5"), ExtResource("26_cuni5"), ExtResource("7_5lqbd"), ExtResource("14_d5byn"), ExtResource("15_vk128"), ExtResource("16_0l4fn"), ExtResource("17_0l3s0"), ExtResource("18_0mfe6"), ExtResource("33_hv7ul"), ExtResource("24_esnpb"), ExtResource("33_3gjue"), ExtResource("19_8ws46"), ExtResource("29_otsi4"), ExtResource("31_36ld5"), ExtResource("21_psqnm"), ExtResource("22_j4kwo"), ExtResource("23_53r6v"), ExtResource("25_6ik1i"), ExtResource("26_x7bpo"), ExtResource("27_e6m8d"), ExtResource("28_jdvk1"), ExtResource("20_fv7f0"), ExtResource("47_i22ig"), ExtResource("48_ihpv1"), ExtResource("30_pvks6"), ExtResource("32_4i5nu"), ExtResource("51_lxncq"), ExtResource("52_317hq"), ExtResource("53_0ur37"), ExtResource("54_vbb0s"), ExtResource("55_qmm8e"), ExtResource("56_gklva"), ExtResource("57_tbumt"), ExtResource("58_qn3jn"), ExtResource("59_auq23"), ExtResource("60_kwioe"), ExtResource("61_5hspt"), ExtResource("62_jn0vv"), ExtResource("63_m2lii"), ExtResource("64_uix1h"), ExtResource("65_1oect"), ExtResource("66_he4of"), ExtResource("67_v37u7"), ExtResource("68_f365j")])
available_chunks = Array[PackedScene]([ExtResource("24_esnpb"), ExtResource("33_3gjue"), ExtResource("29_otsi4"), ExtResource("31_36ld5"), ExtResource("21_psqnm"), ExtResource("22_j4kwo"), ExtResource("23_53r6v"), ExtResource("25_6ik1i"), ExtResource("26_x7bpo"), ExtResource("27_e6m8d"), ExtResource("28_jdvk1"), ExtResource("20_fv7f0"), ExtResource("30_pvks6"), ExtResource("32_4i5nu"), ExtResource("8_aiwf5"), ExtResource("9_0gakq"), ExtResource("10_8taq1"), ExtResource("11_bx28o"), ExtResource("12_e3o1y"), ExtResource("13_pesa5"), ExtResource("27_ylk36"), ExtResource("7_5lqbd"), ExtResource("14_d5byn"), ExtResource("15_vk128"), ExtResource("16_0l4fn"), ExtResource("17_0l3s0"), ExtResource("18_0mfe6"), ExtResource("34_2sxl3"), ExtResource("35_wmmw3"), ExtResource("36_lrm81"), ExtResource("37_1iysf"), ExtResource("38_qulo6"), ExtResource("39_s8w8r"), ExtResource("40_qgu6k"), ExtResource("41_ouhay"), ExtResource("42_no2mr"), ExtResource("43_civl4"), ExtResource("44_q1p61"), ExtResource("45_n6l0c"), ExtResource("46_j3l3o"), ExtResource("47_6r6jj"), ExtResource("48_1bb1l"), ExtResource("49_cuni5"), ExtResource("50_hv7ul"), ExtResource("51_i22ig"), ExtResource("52_ihpv1"), ExtResource("53_lxncq"), ExtResource("54_317hq"), ExtResource("55_0ur37"), ExtResource("56_vbb0s"), ExtResource("57_qmm8e"), ExtResource("58_gklva"), ExtResource("59_tbumt"), ExtResource("60_qn3jn"), ExtResource("61_auq23"), ExtResource("62_kwioe"), ExtResource("63_5hspt"), ExtResource("64_jn0vv"), ExtResource("65_m2lii")])
metadata/_custom_type_script = "uid://wv6kcqkibium"
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pypsn"]
@@ -237,11 +234,11 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 280, 0, 0)
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 270, 2, -0.101)
curve = SubResource("Curve3D_ndco5")
script = ExtResource("44_rcqo0")
train_model = ExtResource("46_8w5ju")
train_model = ExtResource("45_c0jxs")
wagon_pool = ExtResource("46_exdk1")
wagon_count = 5
wagon_gap = 0.8
wagon_spacing_scale = 0.9
wagon_count = 4
wagon_gap = 0.5
wagon_spacing_scale = 0.7999999999999999
cameras = NodePath("../cameras")
sleepers_model = ExtResource("46_lbmv2")
fireworks_scene = ExtResource("47_q7p65")
@@ -489,7 +486,7 @@ theme_override_colors/font_hover_pressed_color = Color(1, 1, 1, 1)
theme_override_colors/font_outline_color = Color(1, 1, 1, 1)
text = "Update Rails"
[node name="MainSceneUi" parent="." unique_id=1359391222 instance=ExtResource("49_exdk1")]
[node name="MainMenuUi" parent="." unique_id=1359391222 instance=ExtResource("49_exdk1")]
mouse_filter = 2
[connection signal="toggled" from="Control/Snow" to="Control" method="_on_snow_toggled"]

Binary file not shown.

View File

@@ -8,7 +8,6 @@
[ext_resource type="Material" uid="uid://o31kp0jm07q3" path="res://tgcc/chunk/material/rocks.tres" id="5_pj7tp"]
[ext_resource type="Material" uid="uid://d4vsl672lwv7" path="res://tgcc/chunk/material/rocks2.tres" id="6_5hjh1"]
[ext_resource type="Shader" uid="uid://d0ch5ofrgf7y6" path="res://core/daynight/trunk_shader.gdshader" id="8_d3e7a"]
[ext_resource type="Script" uid="uid://5frq4qrokiy2" path="res://tgcc/train/train_glass_emission.gd" id="9_4qk3b"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_fuy7x"]
render_priority = 0
@@ -32,18 +31,17 @@ shader_parameter/emission_color = Color(0.3875077, 0.16205889, 0.035861596, 1)
shader_parameter/emission_energy = 12.00000057
[node name="Treno" unique_id=1182090923 instance=ExtResource("1_33mei")]
script = ExtResource("9_4qk3b")
[node name="Finestrini" parent="." index="0" unique_id=271431519]
[node name="Finestrini" parent="." index="0" unique_id=1797001001]
surface_material_override/0 = ExtResource("2_bks4l")
surface_material_override/1 = ExtResource("3_sgpgi")
surface_material_override/2 = ExtResource("4_gua5y")
[node name="Ruote" parent="." index="1" unique_id=1570760095]
[node name="Ruote" parent="." index="1" unique_id=226016697]
surface_material_override/0 = ExtResource("5_pj7tp")
surface_material_override/1 = ExtResource("4_gua5y")
[node name="Train" parent="." index="2" unique_id=301191703]
[node name="Train" parent="." index="2" unique_id=1876679965]
surface_material_override/0 = ExtResource("6_5hjh1")
surface_material_override/1 = ExtResource("2_5yo4e")
surface_material_override/2 = ExtResource("2_bks4l")

View File

@@ -1,100 +0,0 @@
## Updates the train window emission during the day/night cycle.
extends Node3D
@export_group("Windows")
@export var glass_surface_index: int = 1
@export var morning_emissive_intensity: float = 0.0
@export var night_emissive_intensity: float = 8.0
var _glass_material: ShaderMaterial
var _sunrise_time: float = 0.0
var _night_time: float = 0.0
@onready var _finestrini: MeshInstance3D = $Finestrini
func _ready() -> void:
var environment_manager: EnvironmentManagerRoot = _get_environment_manager()
if environment_manager == null or environment_manager.environment_config == null:
return
_sunrise_time = environment_manager.environment_config.sunrise
_night_time = environment_manager.environment_config.night
if _finestrini != null:
_glass_material = _finestrini.get_surface_override_material(glass_surface_index) as ShaderMaterial
_apply_emissive_intensity(_get_current_normalized_time())
if not UIEvents.day_time_changed.is_connected(_on_day_time_changed):
UIEvents.day_time_changed.connect(_on_day_time_changed)
func _exit_tree() -> void:
if UIEvents.day_time_changed.is_connected(_on_day_time_changed):
UIEvents.day_time_changed.disconnect(_on_day_time_changed)
func _get_current_normalized_time() -> float:
var environment_manager: EnvironmentManagerRoot = _get_environment_manager()
if environment_manager == null:
return _sunrise_time
if environment_manager.day_night_controller != null:
return environment_manager.day_night_controller.current_time
if environment_manager.environment_config != null:
return environment_manager.environment_config.start_time
return _sunrise_time
func _get_environment_manager() -> EnvironmentManagerRoot:
var current_scene: Node = get_tree().current_scene
if current_scene == null:
return null
for child in current_scene.get_children():
var environment_manager := child as EnvironmentManagerRoot
if environment_manager != null:
return environment_manager
return null
func _apply_emissive_intensity(normalized_time: float) -> void:
if _glass_material == null:
return
_glass_material.set_shader_parameter(
"intensita_emissiva",
_calculate_emissive_intensity(normalized_time)
)
func _calculate_emissive_intensity(normalized_time: float) -> float:
var wrapped_time: float = wrapf(normalized_time, 0.0, 1.0)
var sunrise_time: float = clampf(_sunrise_time, 0.0, 1.0)
var night_time: float = clampf(_night_time, sunrise_time, 1.0)
if sunrise_time > 0.0 and wrapped_time < sunrise_time:
var night_to_morning_t: float = wrapped_time / sunrise_time
return lerpf(
night_emissive_intensity,
morning_emissive_intensity,
night_to_morning_t
)
if is_equal_approx(night_time, sunrise_time):
return morning_emissive_intensity
var morning_to_night_t: float = inverse_lerp(sunrise_time, night_time, wrapped_time)
return lerpf(
morning_emissive_intensity,
night_emissive_intensity,
clampf(morning_to_night_t, 0.0, 1.0)
)
func _on_day_time_changed(value: float, _time_string: String) -> void:
_apply_emissive_intensity(value)

View File

@@ -1 +0,0 @@
uid://5frq4qrokiy2