Skip to content

Commit

Permalink
fix: simplify menu
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle committed Nov 30, 2024
1 parent 14a29e7 commit c2a1a52
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 5 deletions.
Binary file modified assets/models/lamp_post_bench_trashcan/street_lamp.material
Binary file not shown.
4 changes: 4 additions & 0 deletions scenes/item/receptacle/car.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ shape = SubResource("ConcavePolygonShape3D_sgmua")
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0.83927, 0.98072, 2.62728)
light_color = Color(0.772549, 0.752941, 0.262745, 1)
light_energy = 16.0
light_indirect_energy = 16.0
light_size = 1.0
spot_range = 7.0
spot_angle = 19.6195

[node name="SpotLight3D2" type="SpotLight3D" parent="."]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.892703, 0.98072, 2.62728)
light_color = Color(0.772549, 0.752941, 0.262745, 1)
light_energy = 16.0
light_indirect_energy = 16.0
light_volumetric_fog_energy = 16.0
spot_range = 7.0
spot_angle = 19.6195

Expand Down
27 changes: 26 additions & 1 deletion scenes/main.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=18 format=3 uid="uid://bqp0n1riykqno"]
[gd_scene load_steps=19 format=3 uid="uid://bqp0n1riykqno"]

[ext_resource type="Script" path="res://scripts/main.gd" id="1_t4ric"]
[ext_resource type="PackedScene" uid="uid://bdupkh0grwy27" path="res://scenes/player/player.tscn" id="2_qs36v"]
Expand All @@ -10,6 +10,7 @@
[ext_resource type="Script" path="res://scripts/scenario.gd" id="7_7br1o"]
[ext_resource type="PackedScene" uid="uid://dh8yln8lji7v2" path="res://addons/UniversalFade/Fade.tscn" id="8_5t6vp"]
[ext_resource type="PackedScene" uid="uid://rw7gdui8lu3n" path="res://addons/EasyMenus/Scenes/pause_menu.tscn" id="8_u5nlo"]
[ext_resource type="Script" path="res://scripts/pp_controller.gd" id="9_7xk7c"]
[ext_resource type="PackedScene" uid="uid://bmkxyh5cgcbc3" path="res://scenes/ui/outro.tscn" id="9_ckaoq"]

[sub_resource type="Resource" id="Resource_u5lkw"]
Expand Down Expand Up @@ -203,6 +204,9 @@ libraries = {
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 1.395, 11)

[node name="PostProcessController" type="Node" parent="Player"]
script = ExtResource("9_7xk7c")

[node name="Fade" parent="." instance=ExtResource("8_5t6vp")]
layer = 1

Expand All @@ -223,6 +227,24 @@ offset_right = 190.0
offset_bottom = 385.0
grow_vertical = 1

[node name="HSeparator2" parent="UI/PauseMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="3"]
visible = false

[node name="FullscreenCheckButton" parent="UI/PauseMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="4"]
visible = false

[node name="VSyncCheckButton" parent="UI/PauseMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="5"]
visible = false

[node name="MarginContainer2" parent="UI/PauseMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="6"]
visible = false

[node name="MarginContainer3" parent="UI/PauseMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="7"]
visible = false

[node name="HSeparator3" parent="UI/PauseMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="8"]
visible = false

[node name="Outro" parent="UI" instance=ExtResource("9_ckaoq")]

[node name="Occluders" type="Node3D" parent="."]
Expand All @@ -236,3 +258,6 @@ transform = Transform3D(0.629537, 0, 0.77697, 0, 1, 0, -0.77697, 0, 0.629537, 21
occluder = SubResource("QuadOccluder3D_5kp36")

[editable path="UI/PauseMenu"]
[editable path="UI/PauseMenu/OptionsMenu"]
[editable path="UI/PauseMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/SFXVolumeSlider"]
[editable path="UI/PauseMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/MusicVolumeSlider"]
24 changes: 24 additions & 0 deletions scenes/menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,33 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="HSeparator2" parent="HUD/EasyMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="3"]
visible = false

[node name="FullscreenCheckButton" parent="HUD/EasyMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="4"]
visible = false

[node name="VSyncCheckButton" parent="HUD/EasyMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="5"]
visible = false

[node name="MarginContainer2" parent="HUD/EasyMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="6"]
visible = false

[node name="MarginContainer3" parent="HUD/EasyMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="7"]
visible = false

[node name="HSeparator3" parent="HUD/EasyMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="8"]
visible = false

[node name="BackButton" parent="HUD/EasyMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer" index="9"]
visible = false

[node name="MusicPlayer" parent="." instance=ExtResource("17_tb5q3")]
unique_name_in_owner = true
music_folder = "res://assets/music"
bus_name = "Music"

[editable path="HUD/EasyMenu"]
[editable path="HUD/EasyMenu/OptionsMenu"]
[editable path="HUD/EasyMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/SFXVolumeSlider"]
[editable path="HUD/EasyMenu/OptionsMenu/MarginContainer/ScrollContainer/VBoxContainer/MarginContainer/VBoxContainer/MusicVolumeSlider"]
22 changes: 21 additions & 1 deletion scenes/street_light.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[gd_scene load_steps=6 format=3 uid="uid://dsybu3fdgdwy2"]
[gd_scene load_steps=8 format=3 uid="uid://dsybu3fdgdwy2"]

[ext_resource type="Material" uid="uid://7bimbgkivbby" path="res://resources/materials/street_light.tres" id="1_2st21"]
[ext_resource type="Material" uid="uid://bj107g34ucrp2" path="res://resources/materials/glow.tres" id="2_20wut"]
[ext_resource type="Script" path="res://scripts/light.gd" id="3_vr7bq"]

[sub_resource type="BoxShape3D" id="BoxShape3D_d7vwl"]
size = Vector3(0.5, 5, 0.5)
Expand Down Expand Up @@ -62,6 +63,10 @@ _surfaces = [{
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_b1vlt")

[sub_resource type="CylinderShape3D" id="CylinderShape3D_3utlb"]
height = 61.487
radius = 41.525

[node name="StreetLight" type="StaticBody3D"]

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
Expand All @@ -77,6 +82,21 @@ skeleton = NodePath("")
transform = Transform3D(4.47401, 6.12929e-08, 2.23232, -2.23232, 8.57856e-08, 4.47401, 1.65449e-08, -5, 1.04126e-07, -3.78045, 43.2976, -2.84217e-14)
light_color = Color(0.698039, 0.709804, 0.47451, 1)
light_energy = 16.0
light_indirect_energy = 16.0
light_volumetric_fog_energy = 3.0
light_size = 1.0
spot_range = 16.8672
spot_angle = 34.3211

[node name="Light" type="Area3D" parent="StreetLightMesh/SpotLight3D"]
transform = Transform3D(0.17896, -0.0892928, 6.61797e-10, 2.45172e-09, 3.43142e-09, -0.2, 0.0892928, 0.17896, 4.16505e-09, 4.54271, -1.39304e-07, -7.41099)
collision_layer = 0
collision_mask = 2
script = ExtResource("3_vr7bq")

[node name="CollisionShape3D" type="CollisionShape3D" parent="StreetLightMesh/SpotLight3D/Light"]
transform = Transform3D(1, 9.70588e-23, -2.84217e-14, 0, 1, 0, 2.4869e-14, 2.22045e-15, 1, -35.415, 29.522, 3.71196e-07)
shape = SubResource("CylinderShape3D_3utlb")

[connection signal="body_entered" from="StreetLightMesh/SpotLight3D/Light" to="StreetLightMesh/SpotLight3D/Light" method="_on_body_entered"]
[connection signal="body_exited" from="StreetLightMesh/SpotLight3D/Light" to="StreetLightMesh/SpotLight3D/Light" method="_on_body_exited"]
9 changes: 6 additions & 3 deletions scripts/dialogue.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ func _ready():

func _process(_delta):
if GameState.state == GameState.State.DIALOGUE:
if Input.is_action_just_pressed(&"ui_accept"):
if Input.is_action_just_pressed(&"ui_accept") or Input.is_action_just_pressed(&"interact"):

if dialogue_label.active:
dialogue_label.next_message()

Expand All @@ -34,7 +35,9 @@ func start_dialogue(translation_keys: Array[String]):
dialogue_label.messages.append(tr(key))

_old_game_state = GameState.state
GameState.state = GameState.State.DIALOGUE
dialogue_label.start_dialogue()
show()
set_process(true)
dialogue_label.start_dialogue()
await get_tree().process_frame
await get_tree().process_frame
GameState.state = GameState.State.DIALOGUE
11 changes: 11 additions & 0 deletions scripts/light.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends Area3D


func _on_body_entered(body):
if body is MovementController:
GlobalSignal.trigger_signal(&"light_up", [true])


func _on_body_exited(body):
if body is MovementController:
GlobalSignal.trigger_signal(&"light_up", [false])
1 change: 1 addition & 0 deletions scripts/player/interact_ray.gd
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func _physics_process(_delta):
detected.interact()
if detected is Accessory:
icon.set_texture(null)
get_viewport().set_input_as_handled()
else:
icon.set_texture(null)
else:
Expand Down
21 changes: 21 additions & 0 deletions scripts/pp_controller.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
extends Node

@onready var player = get_parent()
@onready var tween = create_tween()


func _ready():
GlobalSignal.add_listener(&"light_up", self._on_Player_light_up)

func _on_Player_light_up(in_light: bool):
if tween:
tween.stop()
tween = create_tween()
if in_light:
if tween:
tween.tween_property($"../../Lighting/PostProcess", "configuration:VignetteIntensity", 0.0, 0.1)
tween.set_trans(Tween.TRANS_SINE)
else:
if tween:
tween.tween_property($"../../Lighting/PostProcess", "configuration:VignetteIntensity", 0.4, 0.1)
tween.set_trans(Tween.TRANS_SINE)

0 comments on commit c2a1a52

Please sign in to comment.