Compare commits
3 Commits
matt_req_f
...
1037d1343d
| Author | SHA1 | Date | |
|---|---|---|---|
| 1037d1343d | |||
| 6c4f659fd0 | |||
| 0c44b420d1 |
@@ -264,8 +264,8 @@ func _input(event: InputEvent) -> void:
|
|||||||
if event is InputEventKey and event.pressed and not event.echo:
|
if event is InputEventKey and event.pressed and not event.echo:
|
||||||
if event.keycode == KEY_T:
|
if event.keycode == KEY_T:
|
||||||
_goto_next_stop()
|
_goto_next_stop()
|
||||||
#elif event.keycode == KEY_F:
|
elif event.keycode == KEY_F:
|
||||||
#_test_manual_fireworks()
|
_test_manual_fireworks()
|
||||||
|
|
||||||
func _test_manual_fireworks() -> void:
|
func _test_manual_fireworks() -> void:
|
||||||
if fireworks_scene == null or train_instance == null: return
|
if fireworks_scene == null or train_instance == null: return
|
||||||
|
|||||||
@@ -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://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="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="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]
|
[resource]
|
||||||
script = ExtResource("9_8tdc7")
|
script = ExtResource("9_8tdc7")
|
||||||
name = "Railway Pool"
|
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")])
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ func _process(delta: float) -> void:
|
|||||||
|
|
||||||
var is_night = day_time >= 2.5
|
var is_night = day_time >= 2.5
|
||||||
if particles_fireflies:
|
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_tint: Color
|
||||||
var base_sky_top: 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_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_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 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_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_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_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_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
|
#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))
|
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
|
# We calculate the final exposure by applying snow damping directly to the camera exposure
|
||||||
var final_exposure = base_exposure * snow_light_attenuation
|
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 reflected_color = Color(0.4, 0.5, 0.6, 1.0)
|
||||||
var drops_color = final_sky_horizon.lerp(reflected_color, 0.15)
|
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
|
thunder_audio_player.volume_db = environment_config.thunder_audio_volume_db
|
||||||
add_child(thunder_audio_player)
|
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
|
#region camera
|
||||||
func _set_camera(curr_camera: Camera3D):
|
func _set_camera(curr_camera: Camera3D):
|
||||||
camera = curr_camera
|
camera = curr_camera
|
||||||
@@ -384,7 +347,7 @@ func toggle_fireflies(value: bool):
|
|||||||
thereare_fireflies = value
|
thereare_fireflies = value
|
||||||
var is_night = day_time >= 2.5
|
var is_night = day_time >= 2.5
|
||||||
if particles_fireflies:
|
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
|
#disable fireflies and set default values and materials
|
||||||
func init_fireflies():
|
func init_fireflies():
|
||||||
|
|||||||
@@ -33,24 +33,6 @@ extends Resource
|
|||||||
@export var exposure_afternoon: float = 0.95
|
@export var exposure_afternoon: float = 0.95
|
||||||
@export var exposure_night: float = 0.4
|
@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
|
#Sky top color for each time of day
|
||||||
@export_group("Sky Colors - Top")
|
@export_group("Sky Colors - Top")
|
||||||
@export var sky_top_morning: Color = Color(0.35, 0.65, 0.9, 1.0)
|
@export var sky_top_morning: Color = Color(0.35, 0.65, 0.9, 1.0)
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ extends Button
|
|||||||
if is_inside_tree() and has_node("%Texture"):
|
if is_inside_tree() and has_node("%Texture"):
|
||||||
$%Texture.texture = image
|
$%Texture.texture = image
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
if image != null and has_node("%Texture"):
|
if image != null and has_node("%Texture"):
|
||||||
$%Texture.texture = image
|
$%Texture.texture = image
|
||||||
@@ -18,6 +20,8 @@ func _ready():
|
|||||||
$%TextureRect.hide()
|
$%TextureRect.hide()
|
||||||
TweenFX.breathe(self, 1)
|
TweenFX.breathe(self, 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _on_pressed() -> void:
|
func _on_pressed() -> void:
|
||||||
if TweenFX.is_playing(self, TweenFX.Animations.PRESS_ROTATE):
|
if TweenFX.is_playing(self, TweenFX.Animations.PRESS_ROTATE):
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ layout_mode = 2
|
|||||||
stretch = true
|
stretch = true
|
||||||
|
|
||||||
[node name="SubViewport" type="SubViewport" parent="TrainViewportContainer" unique_id=1674220601]
|
[node name="SubViewport" type="SubViewport" parent="TrainViewportContainer" unique_id=1674220601]
|
||||||
|
own_world_3d = true
|
||||||
transparent_bg = true
|
transparent_bg = true
|
||||||
handle_input_locally = false
|
handle_input_locally = false
|
||||||
size = Vector2i(660, 180)
|
size = Vector2i(660, 180)
|
||||||
|
|||||||
@@ -10,6 +10,14 @@ signal on_photo_highlighted(teture: Texture)
|
|||||||
signal on_enable_photo_mode_request
|
signal on_enable_photo_mode_request
|
||||||
@warning_ignore("unused_signal")
|
@warning_ignore("unused_signal")
|
||||||
signal on_disable_photo_mode_request
|
signal on_disable_photo_mode_request
|
||||||
|
@warning_ignore("unused_signal")
|
||||||
|
signal on_photo_taken_started
|
||||||
|
@warning_ignore("unused_signal")
|
||||||
|
signal on_photo_taken_making
|
||||||
|
@warning_ignore("unused_signal")
|
||||||
|
signal on_photo_taken_finished
|
||||||
|
@warning_ignore("unused_signal")
|
||||||
|
signal on_photo_taken_prepare
|
||||||
|
|
||||||
const SAVE_PATH: String = "user://savegame.json"
|
const SAVE_PATH: String = "user://savegame.json"
|
||||||
|
|
||||||
|
|||||||
@@ -2,15 +2,19 @@ extends Control
|
|||||||
|
|
||||||
@onready var settings_menu: Control = $%SettingsMenu
|
@onready var settings_menu: Control = $%SettingsMenu
|
||||||
@onready var option_menu: Control = $%OptionMenu
|
@onready var option_menu: Control = $%OptionMenu
|
||||||
@onready var show_container_tween: ContainerTween = $%ShowContainerTween
|
|
||||||
@onready var hide_container_tween: ContainerTween = $%HideContainerTween
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
option_menu.settings_button.pressed.connect(_on_settings_button_pressed)
|
option_menu.settings_button.pressed.connect(_on_settings_button_pressed)
|
||||||
|
|
||||||
|
|
||||||
func _on_settings_button_pressed() -> void:
|
func _on_settings_button_pressed() -> void:
|
||||||
|
if TweenFX.is_playing(settings_menu, TweenFX.Animations.FOLD_IN) or TweenFX.is_playing(settings_menu, TweenFX.Animations.FOLD_OUT):
|
||||||
|
return
|
||||||
if settings_menu.visible:
|
if settings_menu.visible:
|
||||||
hide_container_tween.start_tween()
|
TweenFX.fold_out(settings_menu)
|
||||||
|
await TweenFX.fold_out(settings_menu).finished
|
||||||
|
settings_menu.hide()
|
||||||
else:
|
else:
|
||||||
show_container_tween.start_tween()
|
settings_menu.scale = Vector2(1,1)
|
||||||
|
settings_menu.show()
|
||||||
|
TweenFX.fold_in(settings_menu)
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://cxf8s80ivwj1p" path="res://core/game_menu/option_menu.tscn" id="1_uvy4f"]
|
[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="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://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]
|
[node name="MainMenu" type="Control" unique_id=889720172]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
@@ -61,16 +60,4 @@ offset_right = 552.0
|
|||||||
offset_bottom = 256.0
|
offset_bottom = 256.0
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
|
|
||||||
[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
|
|
||||||
|
|
||||||
[editable path="OptionMenu"]
|
[editable path="OptionMenu"]
|
||||||
|
|||||||
19
core/main_scene_ui/center_hole.gdshader
Normal file
19
core/main_scene_ui/center_hole.gdshader
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
shader_type canvas_item;
|
||||||
|
|
||||||
|
// Dimensione del rettangolo vuoto al centro (in proporzione allo schermo)
|
||||||
|
// Esempio: vec2(0.6, 0.6) significa che il buco occuperà il 60% dello schermo.
|
||||||
|
// Puoi modificare questi valori direttamente dall'Inspector di Godot!
|
||||||
|
uniform vec2 hole_size = vec2(0.6, 0.6);
|
||||||
|
|
||||||
|
void fragment() {
|
||||||
|
// Calcoliamo la distanza dal centro esatto dello schermo (0.5, 0.5)
|
||||||
|
vec2 center = vec2(0.5, 0.5);
|
||||||
|
vec2 d = abs(UV - center);
|
||||||
|
vec2 half_size = hole_size / 2.0;
|
||||||
|
|
||||||
|
// Se il pixel si trova all'interno delle dimensioni del buco,
|
||||||
|
// impostiamo l'Alpha a 0.0 (rendendolo totalmente trasparente).
|
||||||
|
if (d.x < half_size.x && d.y < half_size.y) {
|
||||||
|
COLOR.a = 0.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
1
core/main_scene_ui/center_hole.gdshader.uid
Normal file
1
core/main_scene_ui/center_hole.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dudbt51v33tt7
|
||||||
10
core/main_scene_ui/hole_mask.gdshader
Normal file
10
core/main_scene_ui/hole_mask.gdshader
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
shader_type canvas_item;
|
||||||
|
|
||||||
|
uniform sampler2D mask_texture;
|
||||||
|
|
||||||
|
void fragment() {
|
||||||
|
vec4 mask_color = texture(mask_texture, UV);
|
||||||
|
// Sottrae l'alpha della maschera dall'alpha del pannello.
|
||||||
|
// Dove la maschera è opaca (alpha = 1), il pannello diventerà trasparente (alpha = 0).
|
||||||
|
COLOR.a = max(COLOR.a - mask_color.a, 0.0);
|
||||||
|
}
|
||||||
1
core/main_scene_ui/hole_mask.gdshader.uid
Normal file
1
core/main_scene_ui/hole_mask.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://44y4fig1hi4y
|
||||||
@@ -8,21 +8,32 @@ enum Weather {RAIN, SNOW}
|
|||||||
@onready var photo_icon_button: Button = $%PhotoIconButton
|
@onready var photo_icon_button: Button = $%PhotoIconButton
|
||||||
@onready var collectible_icon_button: Button = $%CollectibleIconButton
|
@onready var collectible_icon_button: Button = $%CollectibleIconButton
|
||||||
@onready var resume_button: Button = $GameMenuPanel/GameMenu/Pages/Page3/OptionMenu/VBoxContainer/ResumeButton
|
@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
|
@onready var weather_row: HBoxContainer = $%WeatherRow
|
||||||
|
@onready var time_of_day_row: HBoxContainer = $%TimeOfDayRow
|
||||||
|
@onready var photo_mode_texture_panel: Panel = $%PhotoModeTexturePanel
|
||||||
|
@onready var photo_mode_texture_mask: TextureRect = $%PhotoModeTextureMask
|
||||||
|
@onready var photo_mode_black_screen: ColorRect = $%PhotoModeBlackScreen
|
||||||
|
@onready var collection_options: VBoxContainer = $%CollectionOptions
|
||||||
|
@onready var audio_player: Control = $%AudioPlayer
|
||||||
|
|
||||||
|
var cycle = false
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
GameState.on_enable_photo_mode_request.connect(_on_enable_photo_mode)
|
||||||
|
GameState.on_disable_photo_mode_request.connect(_on_disable_photo_mode)
|
||||||
|
GameState.on_photo_taken_started.connect(_on_photo_taken_started)
|
||||||
|
GameState.on_photo_taken_finished.connect(_on_photo_taken_finished)
|
||||||
|
GameState.on_photo_taken_prepare.connect(_on_photo_capture_prepare)
|
||||||
menu_icon_button.pressed.connect(_on_menu_icon_button_pressed)
|
menu_icon_button.pressed.connect(_on_menu_icon_button_pressed)
|
||||||
photo_icon_button.pressed.connect(_on_photo_icon_button_pressed)
|
photo_icon_button.pressed.connect(_on_photo_icon_button_pressed)
|
||||||
collectible_icon_button.pressed.connect(_on_collectible_icon_button_pressed)
|
collectible_icon_button.pressed.connect(_on_collectible_icon_button_pressed)
|
||||||
resume_button.pressed.connect(_on_resume_button_pressed)
|
resume_button.pressed.connect(_on_resume_button_pressed)
|
||||||
|
|
||||||
|
|
||||||
func _on_menu_icon_button_pressed() -> void:
|
func _on_menu_icon_button_pressed() -> void:
|
||||||
GameState.pause_game()
|
GameState.pause_game()
|
||||||
game_menu_panel.show()
|
game_menu_panel.show()
|
||||||
show_container_tween.start_tween()
|
game_menu.scale = Vector2(1, 1)
|
||||||
|
TweenFX.fold_in(game_menu)
|
||||||
|
|
||||||
func _on_photo_icon_button_pressed() -> void:
|
func _on_photo_icon_button_pressed() -> void:
|
||||||
GameState.on_enable_photo_mode_request.emit()
|
GameState.on_enable_photo_mode_request.emit()
|
||||||
@@ -31,11 +42,12 @@ func _on_collectible_icon_button_pressed() -> void:
|
|||||||
GameState.pause_game()
|
GameState.pause_game()
|
||||||
game_menu.on_tab_pressed(1, true)
|
game_menu.on_tab_pressed(1, true)
|
||||||
game_menu_panel.show()
|
game_menu_panel.show()
|
||||||
show_container_tween.start_tween()
|
game_menu.scale = Vector2(1, 1)
|
||||||
|
TweenFX.fold_in(game_menu)
|
||||||
|
|
||||||
func _on_resume_button_pressed() -> void:
|
func _on_resume_button_pressed() -> void:
|
||||||
hide_container_tween.start_tween()
|
var tween = TweenFX.fold_out(game_menu)
|
||||||
await hide_container_tween.finished
|
await tween.finished
|
||||||
game_menu_panel.hide()
|
game_menu_panel.hide()
|
||||||
GameState.resume_game()
|
GameState.resume_game()
|
||||||
|
|
||||||
@@ -45,10 +57,11 @@ func _on_time_of_day_row_on_option_changed(data: String) -> void:
|
|||||||
UIEvents.time_option_item_changed.emit(0)
|
UIEvents.time_option_item_changed.emit(0)
|
||||||
"Day":
|
"Day":
|
||||||
UIEvents.time_option_item_changed.emit(1)
|
UIEvents.time_option_item_changed.emit(1)
|
||||||
"Sunset":
|
|
||||||
UIEvents.time_option_item_changed.emit(2)
|
|
||||||
"Night":
|
"Night":
|
||||||
UIEvents.time_option_item_changed.emit(3)
|
UIEvents.time_option_item_changed.emit(3)
|
||||||
|
"Cycle":
|
||||||
|
cycle = !cycle
|
||||||
|
UIEvents.toggle_pause_daytime.emit(cycle)
|
||||||
_:
|
_:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -76,3 +89,73 @@ func pick_random_weather() -> void:
|
|||||||
if valid_buttons.size() > 0:
|
if valid_buttons.size() > 0:
|
||||||
var random_button = valid_buttons.pick_random()
|
var random_button = valid_buttons.pick_random()
|
||||||
weather_row.on_icon_pressed_changed(random_button)
|
weather_row.on_icon_pressed_changed(random_button)
|
||||||
|
|
||||||
|
func _on_enable_photo_mode() -> void:
|
||||||
|
hide_ui_for_photo_mode()
|
||||||
|
photo_mode_texture_mask.scale = Vector2(1,1)
|
||||||
|
photo_mode_texture_mask.modulate.a = 0.0
|
||||||
|
photo_mode_texture_panel.show()
|
||||||
|
|
||||||
|
var mat = photo_mode_texture_panel.material as ShaderMaterial
|
||||||
|
if mat:
|
||||||
|
mat.set_shader_parameter("hole_size", Vector2(0.72, 0.0))
|
||||||
|
var tween = create_tween()
|
||||||
|
tween.tween_property(mat, "shader_parameter/hole_size", Vector2(0.72, 0.806), 0.3).set_trans(Tween.TRANS_BACK).set_ease(Tween.EASE_OUT)
|
||||||
|
|
||||||
|
var alpha_tween = create_tween()
|
||||||
|
alpha_tween.tween_property(photo_mode_texture_mask, "modulate:a", 1.0, 0.3).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_OUT)
|
||||||
|
|
||||||
|
TweenFX.fold_in(photo_mode_texture_mask)
|
||||||
|
|
||||||
|
func _on_disable_photo_mode() -> void:
|
||||||
|
show_ui_for_photo_mode()
|
||||||
|
var mat = photo_mode_texture_panel.material as ShaderMaterial
|
||||||
|
if mat:
|
||||||
|
var mat_tween = create_tween()
|
||||||
|
mat_tween.tween_property(mat, "shader_parameter/hole_size", Vector2(0.72, 0.0), 0.3).set_trans(Tween.TRANS_BACK).set_ease(Tween.EASE_IN)
|
||||||
|
|
||||||
|
var alpha_tween = create_tween()
|
||||||
|
alpha_tween.tween_property(photo_mode_texture_mask, "modulate:a", 0.0, 0.3).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN)
|
||||||
|
|
||||||
|
var tween = TweenFX.fold_out(photo_mode_texture_mask)
|
||||||
|
await tween.finished
|
||||||
|
photo_mode_texture_panel.hide()
|
||||||
|
|
||||||
|
func _on_photo_capture_prepare() -> void:
|
||||||
|
photo_mode_texture_panel.hide()
|
||||||
|
photo_mode_texture_mask.hide()
|
||||||
|
|
||||||
|
func _on_photo_taken_started() -> void:
|
||||||
|
photo_mode_texture_panel.show()
|
||||||
|
photo_mode_texture_mask.show()
|
||||||
|
|
||||||
|
photo_mode_black_screen.scale = Vector2(1,1)
|
||||||
|
photo_mode_black_screen.show()
|
||||||
|
var tween = TweenFX.fade_in(photo_mode_black_screen, 0.06)
|
||||||
|
await tween.finished
|
||||||
|
await RenderingServer.frame_post_draw
|
||||||
|
GameState.on_photo_taken_making.emit()
|
||||||
|
|
||||||
|
func _on_photo_taken_finished() -> void:
|
||||||
|
var tween = TweenFX.fade_out(photo_mode_black_screen, 0.06)
|
||||||
|
await tween.finished
|
||||||
|
photo_mode_black_screen.hide()
|
||||||
|
|
||||||
|
func hide_ui_for_photo_mode() -> void:
|
||||||
|
TweenFX.fade_out(weather_row, 0.25)
|
||||||
|
TweenFX.fade_out(time_of_day_row, 0.25)
|
||||||
|
TweenFX.fade_out(menu_icon_button, 0.25)
|
||||||
|
TweenFX.fade_out(collection_options, 0.25)
|
||||||
|
TweenFX.fade_out(audio_player, 0.25)
|
||||||
|
|
||||||
|
func show_ui_for_photo_mode() -> void:
|
||||||
|
weather_row.show()
|
||||||
|
time_of_day_row.show()
|
||||||
|
menu_icon_button.show()
|
||||||
|
collection_options.show()
|
||||||
|
audio_player.show()
|
||||||
|
TweenFX.fade_in(weather_row, 0.25)
|
||||||
|
TweenFX.fade_in(time_of_day_row, 0.25)
|
||||||
|
TweenFX.fade_in(menu_icon_button, 0.25)
|
||||||
|
TweenFX.fade_in(collection_options, 0.25)
|
||||||
|
TweenFX.fade_in(audio_player, 0.25)
|
||||||
|
|||||||
@@ -7,7 +7,13 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://cpeyt1dgrtglc" path="res://core/radio/radio.tscn" id="5_nevjt"]
|
[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="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://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://cifadwamy04ko" path="res://core/main_scene_ui/photo_taken.tscn" id="8_t1xop"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dcsy5yawnlxhq" path="res://core/photo_mode/assets/reticolo.png" id="9_4cc8f"]
|
||||||
|
[ext_resource type="Shader" uid="uid://dudbt51v33tt7" path="res://core/main_scene_ui/center_hole.gdshader" id="10_shader"]
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hole"]
|
||||||
|
shader = ExtResource("10_shader")
|
||||||
|
shader_parameter/hole_size = Vector2(0.72, 0.806)
|
||||||
|
|
||||||
[node name="MainSceneUi" type="Control" unique_id=1359391222]
|
[node name="MainSceneUi" type="Control" unique_id=1359391222]
|
||||||
process_mode = 3
|
process_mode = 3
|
||||||
@@ -30,6 +36,7 @@ offset_right = 160.0
|
|||||||
grow_vertical = 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("2_4cc8f")]
|
||||||
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="IconButton2" parent="VBoxContainer/TimeOfDayRow" index="1" unique_id=638856991]
|
[node name="IconButton2" parent="VBoxContainer/TimeOfDayRow" index="1" unique_id=638856991]
|
||||||
@@ -39,10 +46,10 @@ data = "Sunrise"
|
|||||||
data = "Day"
|
data = "Day"
|
||||||
|
|
||||||
[node name="IconButton4" parent="VBoxContainer/TimeOfDayRow" index="3" unique_id=1375190490]
|
[node name="IconButton4" parent="VBoxContainer/TimeOfDayRow" index="3" unique_id=1375190490]
|
||||||
data = "Sunset"
|
data = "Night"
|
||||||
|
|
||||||
[node name="IconButton5" parent="VBoxContainer/TimeOfDayRow" index="4" unique_id=315412403]
|
[node name="IconButton5" parent="VBoxContainer/TimeOfDayRow" index="4" unique_id=315412403]
|
||||||
data = "Night"
|
data = "Cycle"
|
||||||
|
|
||||||
[node name="ShowContainerTween" parent="VBoxContainer/TimeOfDayRow" index="5" unique_id=160227524]
|
[node name="ShowContainerTween" parent="VBoxContainer/TimeOfDayRow" index="5" unique_id=160227524]
|
||||||
tween_types = Array[String](["impact_land", "fade_in"])
|
tween_types = Array[String](["impact_land", "fade_in"])
|
||||||
@@ -93,6 +100,7 @@ offset_left = -160.0
|
|||||||
grow_horizontal = 0
|
grow_horizontal = 0
|
||||||
|
|
||||||
[node name="CollectionOptions" type="VBoxContainer" parent="." unique_id=542153805]
|
[node name="CollectionOptions" type="VBoxContainer" parent="." unique_id=542153805]
|
||||||
|
unique_name_in_owner = true
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
anchors_preset = 6
|
anchors_preset = 6
|
||||||
anchor_left = 1.0
|
anchor_left = 1.0
|
||||||
@@ -114,6 +122,7 @@ unique_name_in_owner = true
|
|||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="AudioPlayer" parent="." unique_id=425192018 node_paths=PackedStringArray("radio") instance=ExtResource("7_lapqe")]
|
[node name="AudioPlayer" parent="." unique_id=425192018 node_paths=PackedStringArray("radio") instance=ExtResource("7_lapqe")]
|
||||||
|
unique_name_in_owner = true
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
anchors_preset = 3
|
anchors_preset = 3
|
||||||
anchor_left = 1.0
|
anchor_left = 1.0
|
||||||
@@ -142,21 +151,56 @@ grow_vertical = 2
|
|||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
|
|
||||||
|
[node name="PhotoModeTexturePanel" type="Panel" parent="." unique_id=901556197]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
visible = false
|
||||||
|
material = SubResource("ShaderMaterial_hole")
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
|
[node name="PhotoModeTextureMask" type="TextureRect" parent="PhotoModeTexturePanel" unique_id=1377788813]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
pivot_offset_ratio = Vector2(0.5, 0.5)
|
||||||
|
texture = ExtResource("9_4cc8f")
|
||||||
|
stretch_mode = 3
|
||||||
|
metadata/_edit_use_anchors_ = true
|
||||||
|
|
||||||
|
[node name="PhotoModeBlackScreen" type="ColorRect" parent="." unique_id=1928591477]
|
||||||
|
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
|
||||||
|
color = Color(0, 0, 0, 1)
|
||||||
|
|
||||||
|
[node name="PhotoTaken" parent="." unique_id=683693112 instance=ExtResource("8_t1xop")]
|
||||||
|
visible = false
|
||||||
|
layout_mode = 1
|
||||||
|
anchor_left = 0.465625
|
||||||
|
anchor_top = 0.4287037
|
||||||
|
anchor_right = 0.534375
|
||||||
|
anchor_bottom = 0.5712963
|
||||||
|
offset_right = 0.0
|
||||||
|
offset_bottom = 0.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
|
||||||
[node name="Radio" parent="." unique_id=1234112225 instance=ExtResource("5_nevjt")]
|
[node name="Radio" parent="." unique_id=1234112225 instance=ExtResource("5_nevjt")]
|
||||||
playlist = Array[AudioStream]([ExtResource("6_kd244")])
|
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/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_option_changed" from="VBoxContainer/WeatherRow" to="." method="_on_weather_row_on_option_changed"]
|
||||||
|
|
||||||
|
|||||||
26
core/main_scene_ui/photo_taken.gd
Normal file
26
core/main_scene_ui/photo_taken.gd
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
extends Control
|
||||||
|
|
||||||
|
@onready var photo_texture: TextureRect = $%PhotoTexture
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
GameState.on_photo_taken_prepare.connect(_hide_photo_taken)
|
||||||
|
GameState.on_photo_taken_finished.connect(_show_photo_taken)
|
||||||
|
CollectionManager.on_photo_saved.connect(_set_photo_taken)
|
||||||
|
|
||||||
|
func _hide_photo_taken() -> void:
|
||||||
|
hide()
|
||||||
|
|
||||||
|
func _set_photo_taken(file_path) -> void:
|
||||||
|
var image = Image.load_from_file(file_path)
|
||||||
|
if image:
|
||||||
|
var texture = ImageTexture.create_from_image(image)
|
||||||
|
photo_texture.texture = texture
|
||||||
|
|
||||||
|
func _show_photo_taken() -> void:
|
||||||
|
scale = Vector2(1,1)
|
||||||
|
modulate.a = 1.0
|
||||||
|
rotation_degrees = 0.0
|
||||||
|
show()
|
||||||
|
var tween = TweenFX.explode(self, 5, 3)
|
||||||
|
await tween.finished
|
||||||
|
hide()
|
||||||
1
core/main_scene_ui/photo_taken.gd.uid
Normal file
1
core/main_scene_ui/photo_taken.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dyye4efo503ih
|
||||||
48
core/main_scene_ui/photo_taken.tscn
Normal file
48
core/main_scene_ui/photo_taken.tscn
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
[gd_scene format=3 uid="uid://cifadwamy04ko"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dyye4efo503ih" path="res://core/main_scene_ui/photo_taken.gd" id="1_1n86s"]
|
||||||
|
|
||||||
|
[node name="PhotoTaken" type="Control" unique_id=683693112]
|
||||||
|
custom_minimum_size = Vector2(132, 154)
|
||||||
|
layout_mode = 3
|
||||||
|
anchor_right = 0.06875
|
||||||
|
anchor_bottom = 0.1425926
|
||||||
|
offset_right = -132.0
|
||||||
|
offset_bottom = -154.0
|
||||||
|
pivot_offset_ratio = Vector2(0.5, 0.5)
|
||||||
|
script = ExtResource("1_1n86s")
|
||||||
|
metadata/_edit_use_anchors_ = true
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="." unique_id=1876357733]
|
||||||
|
custom_minimum_size = Vector2(132, 154)
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = -1
|
||||||
|
anchor_left = 0.465625
|
||||||
|
anchor_top = 0.4287037
|
||||||
|
anchor_right = 0.534375
|
||||||
|
anchor_bottom = 0.5712963
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
pivot_offset_ratio = Vector2(0.5, 0.5)
|
||||||
|
mouse_filter = 2
|
||||||
|
metadata/_edit_use_anchors_ = true
|
||||||
|
|
||||||
|
[node name="MarginContainer" type="MarginContainer" parent="ColorRect" unique_id=405077013]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
theme_override_constants/margin_left = 14
|
||||||
|
theme_override_constants/margin_top = 15
|
||||||
|
theme_override_constants/margin_right = 14
|
||||||
|
theme_override_constants/margin_bottom = 50
|
||||||
|
|
||||||
|
[node name="PhotoTexture" type="TextureRect" parent="ColorRect/MarginContainer" unique_id=1754898569]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_vertical = 3
|
||||||
|
mouse_filter = 2
|
||||||
|
expand_mode = 1
|
||||||
|
stretch_mode = 6
|
||||||
BIN
core/photo_mode/assets/reticolo.png
Normal file
BIN
core/photo_mode/assets/reticolo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
40
core/photo_mode/assets/reticolo.png.import
Normal file
40
core/photo_mode/assets/reticolo.png.import
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dcsy5yawnlxhq"
|
||||||
|
path="res://.godot/imported/reticolo.png-dba8a0c9eb8601e74902df2dc1fc51e5.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://core/photo_mode/assets/reticolo.png"
|
||||||
|
dest_files=["res://.godot/imported/reticolo.png-dba8a0c9eb8601e74902df2dc1fc51e5.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
|
||||||
@@ -31,9 +31,10 @@ func get_all_collectibles() -> Array[CollectibleResource]:
|
|||||||
func get_unlocked_collectible_ids() -> Array[StringName]:
|
func get_unlocked_collectible_ids() -> Array[StringName]:
|
||||||
return unlocked_collectibles_ids
|
return unlocked_collectibles_ids
|
||||||
|
|
||||||
func save_photo_to_disk_async() -> void:
|
func save_photo_to_disk_async(image: Image) -> void:
|
||||||
await RenderingServer.frame_post_draw
|
if not image:
|
||||||
var image = get_viewport().get_texture().get_image()
|
return
|
||||||
|
|
||||||
|
|
||||||
if not DirAccess.dir_exists_absolute("user://photos"):
|
if not DirAccess.dir_exists_absolute("user://photos"):
|
||||||
DirAccess.make_dir_absolute("user://photos")
|
DirAccess.make_dir_absolute("user://photos")
|
||||||
|
|||||||
@@ -21,9 +21,13 @@ var previous_camera: Camera3D
|
|||||||
var initial_local_pos: Vector3
|
var initial_local_pos: Vector3
|
||||||
var initial_local_basis: Basis
|
var initial_local_basis: Basis
|
||||||
|
|
||||||
|
var is_making_photo = false
|
||||||
|
var captured_image: Image
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
GameState.on_enable_photo_mode_request.connect(enable_photo_mode)
|
GameState.on_enable_photo_mode_request.connect(enable_photo_mode)
|
||||||
GameState.on_disable_photo_mode_request.connect(disable_photo_mode)
|
GameState.on_disable_photo_mode_request.connect(disable_photo_mode)
|
||||||
|
GameState.on_photo_taken_making.connect(take_photo_async)
|
||||||
|
|
||||||
initial_local_pos = position
|
initial_local_pos = position
|
||||||
initial_local_basis = basis
|
initial_local_basis = basis
|
||||||
@@ -48,15 +52,25 @@ func disable_photo_mode() -> void:
|
|||||||
func _input(event: InputEvent) -> void:
|
func _input(event: InputEvent) -> void:
|
||||||
if event.is_action_pressed("toggle_photo_mode"):
|
if event.is_action_pressed("toggle_photo_mode"):
|
||||||
if not is_active:
|
if not is_active:
|
||||||
enable_photo_mode()
|
GameState.on_enable_photo_mode_request.emit()
|
||||||
else:
|
else:
|
||||||
disable_photo_mode()
|
if not is_making_photo:
|
||||||
|
GameState.on_disable_photo_mode_request.emit()
|
||||||
|
|
||||||
if event is InputEventMouseMotion and is_active:
|
if event is InputEventMouseMotion and is_active:
|
||||||
total_yaw -= event.relative.x * rotation_speed
|
total_yaw -= event.relative.x * rotation_speed
|
||||||
|
|
||||||
if event.is_action_pressed("take_photo"):
|
if event.is_action_pressed("take_photo"):
|
||||||
take_photo_async()
|
if !is_active or is_making_photo:
|
||||||
|
return
|
||||||
|
is_making_photo = true
|
||||||
|
|
||||||
|
GameState.on_photo_taken_prepare.emit()
|
||||||
|
|
||||||
|
await RenderingServer.frame_post_draw
|
||||||
|
captured_image = get_viewport().get_texture().get_image()
|
||||||
|
|
||||||
|
GameState.on_photo_taken_started.emit()
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
if not is_active:
|
if not is_active:
|
||||||
@@ -81,13 +95,10 @@ func _process(delta: float) -> void:
|
|||||||
basis = rotated_basis.orthonormalized()
|
basis = rotated_basis.orthonormalized()
|
||||||
|
|
||||||
func take_photo_async() -> void:
|
func take_photo_async() -> void:
|
||||||
if !is_active:
|
|
||||||
return
|
|
||||||
|
|
||||||
var targets = get_tree().get_nodes_in_group("collectible")
|
var targets = get_tree().get_nodes_in_group("collectible")
|
||||||
var space_state = get_world_3d().direct_space_state
|
var space_state = get_world_3d().direct_space_state
|
||||||
|
|
||||||
await CollectionManager.save_photo_to_disk_async()
|
await CollectionManager.save_photo_to_disk_async(captured_image)
|
||||||
|
|
||||||
for target in targets:
|
for target in targets:
|
||||||
if not target.collectible_data:
|
if not target.collectible_data:
|
||||||
@@ -104,3 +115,5 @@ func take_photo_async() -> void:
|
|||||||
CollectionManager.unlock_collectible(target.collectible_data.id)
|
CollectionManager.unlock_collectible(target.collectible_data.id)
|
||||||
|
|
||||||
GameState.save_game()
|
GameState.save_game()
|
||||||
|
GameState.on_photo_taken_finished.emit()
|
||||||
|
is_making_photo = false
|
||||||
|
|||||||
@@ -58,19 +58,19 @@ script = ExtResource("2_0bmh1")
|
|||||||
north = true
|
north = true
|
||||||
south = 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")
|
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")
|
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")
|
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")
|
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")
|
surface_material_override/0 = ExtResource("6_0bmh1")
|
||||||
|
|
||||||
[node name="grass" type="Node3D" parent="." index="5" unique_id=1540226859 groups=["weather_vegetables_node", "wind_node"]]
|
[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
|
cast_shadow = 0
|
||||||
multimesh = SubResource("MultiMesh_e417f")
|
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
|
visible = false
|
||||||
|
|
||||||
[node name="rice_plane" type="MeshInstance3D" parent="rice" index="0" unique_id=629743434]
|
[node name="rice_plane" type="MeshInstance3D" parent="rice" index="0" unique_id=629743434]
|
||||||
|
|||||||
@@ -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://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://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="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="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"]
|
[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_north = true
|
||||||
river_south = 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/0 = ExtResource("2_mic04")
|
||||||
surface_material_override/1 = 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")
|
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")
|
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")
|
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)
|
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]
|
[node name="rice_plane" type="MeshInstance3D" parent="rice" index="0" unique_id=1744988640]
|
||||||
|
|||||||
@@ -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://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="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="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"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_fuy7x"]
|
||||||
render_priority = 0
|
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
|
shader_parameter/emission_energy = 12.00000057
|
||||||
|
|
||||||
[node name="Treno" unique_id=1182090923 instance=ExtResource("1_33mei")]
|
[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/0 = ExtResource("2_bks4l")
|
||||||
surface_material_override/1 = ExtResource("3_sgpgi")
|
surface_material_override/1 = ExtResource("3_sgpgi")
|
||||||
surface_material_override/2 = ExtResource("4_gua5y")
|
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/0 = ExtResource("5_pj7tp")
|
||||||
surface_material_override/1 = ExtResource("4_gua5y")
|
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/0 = ExtResource("6_5hjh1")
|
||||||
surface_material_override/1 = ExtResource("2_5yo4e")
|
surface_material_override/1 = ExtResource("2_5yo4e")
|
||||||
surface_material_override/2 = ExtResource("2_bks4l")
|
surface_material_override/2 = ExtResource("2_bks4l")
|
||||||
|
|||||||
@@ -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)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://5frq4qrokiy2
|
|
||||||
Reference in New Issue
Block a user