Compare commits

...

2 Commits

25 changed files with 71 additions and 1634 deletions

View File

@ -4,8 +4,8 @@ class_name SubwaySequence
@export var all_stations: Dictionary[Station.id, Station] @export var all_stations: Dictionary[Station.id, Station]
@export var all_lines: Dictionary[TrainLine.id, TrainLine] @export var all_lines: Dictionary[TrainLine.id, TrainLine]
func _ready() -> void: func _ready() -> void:
super._ready()
id = State.rooms.TRANSITION id = State.rooms.TRANSITION
super._ready()
func start_room(): func start_room():
@ -18,9 +18,7 @@ func start_room():
func pull_save_state(save: SaveGame) -> void: func pull_save_state(save: SaveGame) -> void:
#FIXME
save.sequences_enabled = Scenes.enabled_sequences save.sequences_enabled = Scenes.enabled_sequences
save.current_room = State.rooms.ADULTHOOD
save_game = save save_game = save
# Call parent to restore player position # Call parent to restore player position

View File

@ -4,8 +4,8 @@ extends RoomTemplate
@onready var player: PlayerController = %PlayerController @onready var player: PlayerController = %PlayerController
func _ready(): func _ready():
super._ready()
id = State.rooms.ADULTHOOD id = State.rooms.ADULTHOOD
super._ready()
func get_ready() -> void: func get_ready() -> void:
@ -14,7 +14,6 @@ func get_ready() -> void:
Scenes.scene_finished.connect(_on_scene_finished) Scenes.scene_finished.connect(_on_scene_finished)
card_picker.cards_picked.connect(card_board.populate_board) card_picker.cards_picked.connect(card_board.populate_board)
save_game = State.save_game save_game = State.save_game
save_game.current_room = State.rooms.ADULTHOOD
Scenes.completed_sequences = save_game.mementos_complete Scenes.completed_sequences = save_game.mementos_complete
Scenes.started_sequences = save_game.mementos_complete Scenes.started_sequences = save_game.mementos_complete
Scenes.enabled_sequences = save_game.sequences_enabled Scenes.enabled_sequences = save_game.sequences_enabled

View File

@ -230,43 +230,43 @@ transform = Transform3D(-0.999999, 0, 8.742269e-08, 0, 1, 0, -8.742269e-08, 0, -
interaction = ExtResource("12_6rb4d") interaction = ExtResource("12_6rb4d")
[node name="BurnoutInteractable" parent="Collectables" instance=ExtResource("5_my8p4")] [node name="BurnoutInteractable" parent="Collectables" instance=ExtResource("5_my8p4")]
transform = Transform3D(1.3113409e-07, 0, 0.999999, 0, 1, 0, -0.999999, 0, 1.3113409e-07, -2.1812932, 0.8092947, 5.313688) transform = Transform3D(0.32358676, 0, -0.94619733, 0, 1, 0, 0.94619733, 0, 0.32358676, -2.1812932, 0.8092947, 5.313688)
interaction = ExtResource("11_kmoh8") interaction = ExtResource("11_kmoh8")
[node name="DiceInteractable" parent="Collectables" instance=ExtResource("5_my8p4")] [node name="DiceInteractable" parent="Collectables" instance=ExtResource("5_my8p4")]
transform = Transform3D(-0.70710593, 0, 0.70710605, 0, 1, 0, -0.70710605, 0, -0.70710593, -2.07945, 0.5828748, 3.3940656) transform = Transform3D(0.7071059, 0, -0.7071061, 0, 1, 0, 0.7071061, 0, 0.7071059, -2.07945, 0.5828748, 3.3940656)
interaction = ExtResource("16_e1uao") interaction = ExtResource("16_e1uao")
[node name="VoluntaryInteractable" parent="Collectables" instance=ExtResource("5_my8p4")] [node name="VoluntaryInteractable" parent="Collectables" instance=ExtResource("5_my8p4")]
transform = Transform3D(-4.3711392e-08, 0, -0.999999, 0, 1, 0, 0.999999, 0, -4.3711392e-08, 0.36332494, 1.2541859, 4.9624853) transform = Transform3D(-4.3711346e-08, 0, 0.999999, 0, 1, 0, -0.999999, 0, -4.3711346e-08, 0.36332494, 1.2541859, 4.9624853)
interaction = ExtResource("17_my8p4") interaction = ExtResource("17_my8p4")
billboard = false billboard = false
[node name="TherapyVoluntaryInteractable" parent="Collectables" instance=ExtResource("5_my8p4")] [node name="TherapyVoluntaryInteractable" parent="Collectables" instance=ExtResource("5_my8p4")]
transform = Transform3D(-0.999999, 0, 8.742269e-08, 0, 1, 0, -8.742269e-08, 0, -0.999999, 0.399901, 1.21835, 1.29166) transform = Transform3D(0.999999, 0, 0, 0, 1, 0, 0, 0, 0.999999, 0.399901, 1.21835, 1.29166)
interaction = ExtResource("15_ci4rn") interaction = ExtResource("15_ci4rn")
billboard = false billboard = false
[node name="TherapyUniInteractable" parent="Collectables" instance=ExtResource("5_my8p4")] [node name="TherapyUniInteractable" parent="Collectables" instance=ExtResource("5_my8p4")]
transform = Transform3D(-0.999999, 0, 8.742269e-08, 0, 1, 0, -8.742269e-08, 0, -0.999999, 0.399901, 1.21835, 1.29166) transform = Transform3D(0.999999, 0, 0, 0, 1, 0, 0, 0, 0.999999, 0.399901, 1.21835, 1.29166)
interaction = ExtResource("14_upyac") interaction = ExtResource("14_upyac")
billboard = false billboard = false
[node name="UniversityInteractable" parent="Collectables" instance=ExtResource("5_my8p4")] [node name="UniversityInteractable" parent="Collectables" instance=ExtResource("5_my8p4")]
transform = Transform3D(-4.371135e-08, 0, 0.9999991, 0, 1, 0, -0.9999991, 0, -4.371135e-08, -2.7745893, 1.593935, -3.0279322) transform = Transform3D(-4.371135e-08, 0, -0.9999991, 0, 1, 0, 0.9999991, 0, -4.371135e-08, -2.7745893, 1.593935, -3.0279322)
interaction = ExtResource("13_5s6pb") interaction = ExtResource("13_5s6pb")
billboard = false billboard = false
[node name="OldThougtsInteractable" parent="Collectables" instance=ExtResource("5_my8p4")] [node name="OldThougtsInteractable" parent="Collectables" instance=ExtResource("5_my8p4")]
transform = Transform3D(1.3113399e-07, 0, 0.999999, 0, 1, 0, -0.999999, 0, 1.3113399e-07, -2.40979, 0.41340256, 0.403546) transform = Transform3D(-4.3711346e-08, 0, -0.999999, 0, 1, 0, 0.999999, 0, -4.3711346e-08, -2.40979, 0.41340256, 0.403546)
interaction = ExtResource("17_my8p4") interaction = ExtResource("17_my8p4")
[node name="AutismInteractable" parent="Collectables" instance=ExtResource("5_my8p4")] [node name="AutismInteractable" parent="Collectables" instance=ExtResource("5_my8p4")]
transform = Transform3D(0.49999908, 0, 0.86602396, 0, 1, 0, -0.86602396, 0, 0.49999908, -1.8407239, 1.0439266, -3.8908288) transform = Transform3D(-0.75470823, 0, -0.65605795, 0, 1, 0, 0.65605795, 0, -0.75470823, -1.8407239, 1.0439266, -3.8908288)
interaction = ExtResource("10_gcdra") interaction = ExtResource("10_gcdra")
[node name="Board" parent="Collectables" instance=ExtResource("5_my8p4")] [node name="Board" parent="Collectables" instance=ExtResource("5_my8p4")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -2.6904116, 1.240494, 4.441236) transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, -2.7652016, 1.2894461, 4.522677)
interaction = ExtResource("19_ci4rn") interaction = ExtResource("19_ci4rn")
billboard = false billboard = false

View File

@ -1,85 +0,0 @@
class_name InteractiveSprite extends Area3D
@export var interaction_ui: PackedScene = null
@onready var pass_to_actor: = $UiWrapper/UiSprite/SubViewport/CollectableUi
@onready var wrapper := $UiWrapper
@onready var ui: CollectableUi = $UiWrapper/UiSprite/SubViewport.get_child(0)
@onready var viewport:= $UiWrapper/UiSprite/SubViewport
@onready var distance_tween: Tween
var revealed: bool = false:
set(reveal):
revealed = reveal
if reveal:
wrapper.show()
if distance_tween != null:
if distance_tween.is_running(): distance_tween.stop()
distance_tween = get_tree().create_tween()
distance_tween.tween_property($UiWrapper/Frame, ^":visibility_range_end", 3.0, 1.0)
else:
wrapper.hide()
ui.vanish()
if distance_tween != null:
if distance_tween.is_running(): distance_tween.stop()
distance_tween = get_tree().create_tween()
distance_tween.tween_property($UiWrapper/Frame, ^":visibility_range_end", 0.6, 1.0)
await get_tree().create_timer(1).timeout
if not ui.visible:
wrapper.hide()
var has_mouse: bool = false
# Automatically triggered story playback - e.g. for Intro in Youth Room
func play_story() -> void:
await ui.collect_memento()
# Called when the node enters the scene tree for the first time.
func _ready():
if interaction_ui:
%CanvasLayer.add_child(interaction_ui.instantiate())
ui.canvas_layer = %CanvasLayer
# Find and wire the interaction UI (StoryPlayable or CardBoard)
for child in %CanvasLayer.get_children():
if child is CardBoard:
ui.interaction_ui = child
break
elif child is Control:
ui.interaction_ui = child
break
# Connect playback_finished to restore player control
ui.playback_finished.connect(_on_playback_finished)
func _on_mouse_entered():
if not Scenes.is_playing:
input_ray_pickable = false
has_mouse = true
func _on_mouse_exited():
input_ray_pickable = true
has_mouse = false
func try_reveal(for_player: PlayerController) -> bool:
print_debug("reveal ui!")
revealed = ui.try_reveal()
if revealed:
call_deferred("wait_for_ui_exit", for_player)
return revealed
func wait_for_ui_exit(for_player: PlayerController):
await for_player.ui_exited
collapse()
func collapse():
_on_mouse_exited()
revealed = false
func _on_playback_finished():
# Restore player control via central signal
Scenes.player_enable.emit(true)
func handle(event: InputEvent):
viewport.push_input(event)

View File

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

View File

@ -7,6 +7,11 @@ extends RoomTemplate
@onready var card_picker: CardPicker = %Picker @onready var card_picker: CardPicker = %Picker
@onready var ui: Control = %UI @onready var ui: Control = %UI
func _ready() -> void:
id = State.rooms.YOUTH
super._ready() # UwU, superclass _ready is not called by Godot automatically...
func start_room(): func start_room():
super.start_room() super.start_room()

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=96 format=4 uid="uid://b3b0gyvklqn50"] [gd_scene load_steps=95 format=4 uid="uid://b3b0gyvklqn50"]
[ext_resource type="Script" uid="uid://bsop46tqngddc" path="res://base-environments/youth_room/youth_room.gd" id="1_aitp0"] [ext_resource type="Script" uid="uid://bsop46tqngddc" path="res://base-environments/youth_room/youth_room.gd" id="1_aitp0"]
[ext_resource type="AudioStream" uid="uid://1h6k2d8q1kw3" path="res://base-environments/youth_room/import/sounds/rain_on_window.mp3" id="2_3haaq"] [ext_resource type="AudioStream" uid="uid://1h6k2d8q1kw3" path="res://base-environments/youth_room/import/sounds/rain_on_window.mp3" id="2_3haaq"]
@ -177,10 +177,6 @@ _surfaces = [{
blend_shape_mode = 0 blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_lag5h") shadow_mesh = SubResource("ArrayMesh_lag5h")
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_dqyng"]
radius = 0.5600586
height = 1.2539063
[sub_resource type="GDScript" id="GDScript_35dmj"] [sub_resource type="GDScript" id="GDScript_35dmj"]
script/source = "extends SpotLight3D script/source = "extends SpotLight3D
@ -778,33 +774,30 @@ light_size = 20.0
omni_range = 16.8518 omni_range = 16.8518
[node name="MaskInteractable" parent="logic" instance=ExtResource("22_ks23q")] [node name="MaskInteractable" parent="logic" instance=ExtResource("22_ks23q")]
transform = Transform3D(-0.8827416, 0, 0.4698562, 0, 1, 0, -0.4698562, 0, -0.8827416, -0.032227404, 0.58693635, 2.5655098) transform = Transform3D(0.8829465, 0, -0.4694709, 0, 1, 0, 0.4694709, 0, 0.8829465, -0.032227404, 0.58693635, 2.5655098)
interaction = ExtResource("12_viwxf") interaction = ExtResource("12_viwxf")
[node name="MindBoardInteractable" parent="logic" instance=ExtResource("22_ks23q")] [node name="MindBoardInteractable" parent="logic" instance=ExtResource("22_ks23q")]
transform = Transform3D(-4.371126e-08, 0, -0.9999984, 0, 1, 0, 0.9999984, 0, -4.371126e-08, -0.907206, 1.17661, 1.74337) transform = Transform3D(-4.3711317e-08, 0, 0.9999984, 0, 1, 0, -0.9999984, 0, -4.3711317e-08, -0.907206, 1.1721482, 1.6486336)
interaction = ExtResource("4_gyjxx") interaction = ExtResource("4_gyjxx")
billboard = false billboard = false
[node name="Frame" parent="logic/MindBoardInteractable" index="0"] [node name="Frame" parent="logic/MindBoardInteractable" index="1"]
transform = Transform3D(0.99999994, 0, 3.5527137e-15, 0, 1, 0, -3.5527137e-15, 0, 0.99999994, -0.08004689, -0.023632765, 0) transform = Transform3D(0.99999994, 0, 3.5527137e-15, 0, 1, 0, -3.5527137e-15, 0, 0.99999994, -0.08004689, -0.023632765, 0)
[node name="View" parent="logic/MindBoardInteractable" index="1"] [node name="View" parent="logic/MindBoardInteractable" index="2"]
transform = Transform3D(-0.9999999, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -0.9999999, -0.08611119, 0.040526867, -0.06492537) transform = Transform3D(0.9999999, 0, 0, 0, 1, 0, 0, 0, 0.9999999, -0.08611119, 0.040526867, -0.06492537)
[node name="CeilingInteractable" parent="logic" instance=ExtResource("22_ks23q")] [node name="CeilingInteractable" parent="logic" instance=ExtResource("22_ks23q")]
transform = Transform3D(0.78626597, 0, 0.6178859, 0, 1, 0, -0.6178859, 0, 0.78626597, -0.13478619, 2.0720484, -0.42032808) transform = Transform3D(-0.7858558, 0, -0.6184074, 0, 1, 0, 0.6184074, 0, -0.7858558, -0.13478619, 2.0720484, -0.42032808)
interaction = ExtResource("19_d3c7p") interaction = ExtResource("19_d3c7p")
[node name="ComicInteractable" parent="logic" instance=ExtResource("22_ks23q")] [node name="ComicInteractable" parent="logic" instance=ExtResource("22_ks23q")]
transform = Transform3D(0.9797145, 0, 0.20039362, 0, 1, 0, -0.20039362, 0, 0.9797145, 2.8945682, 0.2537475, -0.88938636) transform = Transform3D(-0.86689585, 0, -0.49848735, 0, 1, 0, 0.49848735, 0, -0.86689585, 3.2500308, 0.23531717, -0.7766681)
interaction = ExtResource("13_v3447") interaction = ExtResource("13_v3447")
[node name="View" parent="logic/ComicInteractable" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.36574292, 0.099999994, 0.032779038)
[node name="ClothesInteractable" parent="logic" instance=ExtResource("22_ks23q")] [node name="ClothesInteractable" parent="logic" instance=ExtResource("22_ks23q")]
transform = Transform3D(0.7935111, 0, -0.60855323, 0, 1, 0, 0.60855323, 0, 0.7935111, 1.6334484, 1.1331886, -0.8914416) transform = Transform3D(-0.79335207, 0, 0.6087605, 0, 1, 0, -0.6087605, 0, -0.79335207, 1.6334484, 1.1331886, -0.8914416)
interaction = ExtResource("12_x3dlb") interaction = ExtResource("12_x3dlb")
[node name="Sprite3D" parent="logic/ClothesInteractable/View" index="0"] [node name="Sprite3D" parent="logic/ClothesInteractable/View" index="0"]
@ -820,16 +813,9 @@ visible = false
interaction = ExtResource("11_5bsh1") interaction = ExtResource("11_5bsh1")
billboard = false billboard = false
[node name="View" parent="logic/DoorInteractable" index="1"] [node name="View" parent="logic/DoorInteractable" index="2"]
transform = Transform3D(-0.99999964, 0, -8.7422755e-08, 0, 1, 0, 8.7422755e-08, 0, -0.99999964, 0.30241805, 0.49012983, -5.9604645e-08) transform = Transform3D(-0.99999964, 0, -8.7422755e-08, 0, 1, 0, 8.7422755e-08, 0, -0.99999964, 0.30241805, 0.49012983, -5.9604645e-08)
[node name="Area3D" parent="logic/DoorInteractable" index="2"]
transform = Transform3D(0.9999998, 0, 2.1316282e-14, 0, 1, 0, -2.1316282e-14, 0, 0.9999998, 0.5580833, 0.16355383, 0)
[node name="CollisionShape3D" parent="logic/DoorInteractable/Area3D" index="0"]
transform = Transform3D(-4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, 0, 1, -0.2322388, 0, 0)
shape = SubResource("CapsuleShape3D_dqyng")
[node name="RoomAnimationPlayer" type="AnimationPlayer" parent="."] [node name="RoomAnimationPlayer" type="AnimationPlayer" parent="."]
libraries = { libraries = {
&"": ExtResource("23_corra") &"": ExtResource("23_corra")
@ -1091,6 +1077,5 @@ data = ExtResource("40_ea6x8")
[connection signal="pressed" from="logic/UI/ending_button" to="logic/UI/ending" method="show"] [connection signal="pressed" from="logic/UI/ending_button" to="logic/UI/ending" method="show"]
[editable path="logic/MindBoardInteractable"] [editable path="logic/MindBoardInteractable"]
[editable path="logic/ComicInteractable"]
[editable path="logic/ClothesInteractable"] [editable path="logic/ClothesInteractable"]
[editable path="logic/DoorInteractable"] [editable path="logic/DoorInteractable"]

View File

@ -16,10 +16,9 @@ func create_bug_report():
OS: %s OS: %s
GPU: %s GPU: %s
Current Focus: %s
Current Scene: %s Current Scene: %s
Mementos: %s Mementos: %s
""" % [OS.get_name(), OS.get_video_adapter_driver_info(), Scenes.current_sequence, State.current_room, Scenes.completed_sequences] """ % [OS.get_name(), OS.get_video_adapter_driver_info(), State.room, Scenes.completed_sequences]
#debug_text = debug_text.replace(" ", "%20").replace("\n", "%0A").replace("\t", "") #debug_text = debug_text.replace(" ", "%20").replace("\n", "%0A").replace("\t", "")

View File

@ -12,24 +12,18 @@ signal proceed(next_scene_path: String)
func _ready() -> void: func _ready() -> void:
State.room = self State.room = self
State.current_room = id
if not State.save_game: if not State.save_game:
push_warning("Room initialised without a SaveGame. Creating proxy save.") push_warning("Room initialised without a SaveGame. Creating proxy save.")
State.save_game = ResourceLoader.load("res://dev-util/debug_save.tres") State.save_game = ResourceLoader.load("res://dev-util/debug_save.tres")
save_game = State.save_game save_game = State.save_game
save_game.current_room = id
save_game.player_position = %PlayerController.global_position
if not Main.normal_boot: if not Main.normal_boot:
push_warning("------- DEBUG MODE --------") push_warning("------- DEBUG MODE --------")
play.call_deferred() play.call_deferred()
func disable()-> void:
push_warning("Room disabling is deprecated / unter reconstruction")
func get_ready(): func get_ready():
prints("----------", "GET_READY", self.name, "--------------") prints("----------", "GET_READY", self.name, "--------------")
pass pass

View File

@ -134,11 +134,15 @@ func save_to_file(screen_shot: Texture2D) -> void:
push_warning("SaveGame: DEBUG save skipped (intentional).") push_warning("SaveGame: DEBUG save skipped (intentional).")
return return
if current_room == State.rooms.NULL: assert(State.room, "Trying to save while not in a room.")
push_warning("SaveGame: Not saving empty savegame.") assert(State.room.id != State.rooms.NULL, "Trying to save in a room that's not correctly initialized.")
return
print_debug("SaveGame: Saving to file: %s" % file_name) # Save game can track the room it is in by itself;
# and we should never save before having successfully entered a room.
current_room = State.room.id
prints("-----------", "SAVE POINT", State.room, "-----------")
print("SaveGame: Saving to file: %s" % file_name)
# Capture current state # Capture current state
capture_player_state() capture_player_state()

View File

@ -230,6 +230,4 @@ func pick_cards(id: Scenes.id):
await cards_picked await cards_picked
hide() hide()
await get_tree().process_frame
State.room.save_room()

View File

@ -1,166 +0,0 @@
extends Sprite3D
# The size of the quad mesh itself.
var render_size: Vector2
# Used for checking if the mouse is inside the Area
var is_mouse_inside = false
# Used for checking if the mouse was pressed inside the Area
var is_mouse_held = false
# The last non-empty mouse position. Used when dragging outside of the box.
var last_mouse_pos3D = null
# The last processed input touch/mouse event. To calculate relative movement.
var last_mouse_pos2D = null
@onready var node_viewport:SubViewport = $SubViewport
@onready var node_area:Area3D = $Area3D
func _ready():
node_area.connect("mouse_entered", Callable(self, "_mouse_entered_area"))
# If the material is NOT set to use billboard settings, then avoid running billboard specific code
if billboard == 0:
set_process(false)
func _process(_delta):
# NOTE: Remove this function if you don't plan on using billboard settings.
rotate_area_to_billboard()
func _mouse_entered_area():
is_mouse_inside = true
func _unhandled_input(event):
# Check if the event is a non-mouse/non-touch event
var is_mouse_event = false
for mouse_event in [InputEventMouseButton, InputEventMouseMotion, InputEventScreenDrag, InputEventScreenTouch]:
if event is InputEventMouse:
is_mouse_event = true
break
# If the event is a mouse/touch event and/or the mouse is either held or inside the area, then
# we need to do some additional processing in the handle_mouse function before passing the event to the viewport.
# If the event is not a mouse/touch event, then we can just pass the event directly to the viewport.
if is_mouse_event and (is_mouse_inside or is_mouse_held):
handle_mouse(event)
elif not is_mouse_event:
node_viewport.push_input(event)
# Handle mouse events inside Area. (Area.input_event had many issues with dragging)
func handle_mouse(event):
# Get mesh size to detect edges and make conversions. This code only support PlaneMesh and QuadMesh.
render_size = pixel_size * node_viewport.size
# Detect mouse being held to mantain event while outside of bounds. Avoid orphan clicks
if event is InputEventMouseButton or event is InputEventScreenTouch:
is_mouse_held = event.pressed
# Find mouse position in Area
var mouse_pos3D = find_mouse(event.global_position)
# Check if the mouse is outside of bounds, use last position to avoid errors
# NOTE: mouse_exited signal was unrealiable in this situation
is_mouse_inside = mouse_pos3D != null
if is_mouse_inside:
# Convert click_pos from world coordinate space to a coordinate space relative to the Area node.
# NOTE: affine_inverse accounts for the Area node's scale, rotation, and translation in the scene!
mouse_pos3D = node_area.global_transform.affine_inverse() * mouse_pos3D
last_mouse_pos3D = mouse_pos3D
else:
mouse_pos3D = last_mouse_pos3D
if mouse_pos3D == null:
mouse_pos3D = Vector3.ZERO
# TODO: adapt to bilboard mode or avoid completely
# convert the relative event position from 3D to 2D
var mouse_pos2D = Vector2(mouse_pos3D.x, -mouse_pos3D.y)
# Right now the event position's range is the following: (-quad_size/2) -> (quad_size/2)
# We need to convert it into the following range: 0 -> quad_size
mouse_pos2D += render_size / 2
# Then we need to convert it into the following range: 0 -> 1
mouse_pos2D = mouse_pos2D / render_size.x
# Finally, we convert the position to the following range: 0 -> viewport.size
mouse_pos2D.x = mouse_pos2D.x * node_viewport.size.x
mouse_pos2D.y = mouse_pos2D.y * node_viewport.size.y
# We need to do these conversions so the event's position is in the viewport's coordinate system.
# Set the event's position and global position.
event.position = mouse_pos2D
event.global_position = mouse_pos2D
# If the event is a mouse motion event...
if event is InputEventMouseMotion:
# If there is not a stored previous position, then we'll assume there is no relative motion.
if last_mouse_pos2D == null:
event.relative = Vector2(0, 0)
# If there is a stored previous position, then we'll calculate the relative position by subtracting
# the previous position from the new position. This will give us the distance the event traveled from prev_pos
else:
event.relative = mouse_pos2D - last_mouse_pos2D
# Update last_mouse_pos2D with the position we just calculated.
last_mouse_pos2D = mouse_pos2D
# Finally, send the processed input event to the viewport.
node_viewport.push_input(event)
func find_mouse(global_position):
var camera = get_viewport().get_camera_3d()
# From camera center to the mouse position in the Area
var from = camera.project_ray_origin(global_position)
var dist = find_further_distance_to(camera.transform.origin)
var to = from + camera.project_ray_normal(global_position) * dist
# Manually raycasts the are to find the mouse position
var result = get_world_3d().direct_space_state.intersect_ray(PhysicsRayQueryParameters3D.create(from, to, node_area.collision_layer)) #for 3.1 changes
if result.size() > 0:
return result.position
else:
return null
func find_further_distance_to(origin):
# Find edges of collision and change to global positions
var edges = []
edges.append(node_area.to_global(Vector3(render_size.x / 2, render_size.y / 2, 0)))
edges.append(node_area.to_global(Vector3(render_size.x / 2, -render_size.y / 2, 0)))
edges.append(node_area.to_global(Vector3(-render_size.x / 2, render_size.y / 2, 0)))
edges.append(node_area.to_global(Vector3(-render_size.x / 2, -render_size.y / 2, 0)))
# Get the furthest distance between the camera and collision to avoid raycasting too far or too short
var far_dist = 0
var temp_dist
for edge in edges:
temp_dist = origin.distance_to(edge)
if temp_dist > far_dist:
far_dist = temp_dist
return far_dist
func rotate_area_to_billboard():
# Try to match the area with the material's billboard setting, if enabled
if billboard > 0:
# Get the camera
var camera = get_viewport().get_camera_3d()
# Look in the same direction as the camera
var look = camera.to_global(Vector3(0, 0, -100)) - camera.global_transform.origin
look = node_area.position + look
# Y-Billboard: Lock Y rotation, but gives bad results if the camera is tilted.
if billboard == 2:
look = Vector3(look.x, 0, look.z)
node_area.look_at(look, Vector3.UP)
# Rotate in the Z axis to compensate camera tilt
node_area.rotate_object_local(Vector3.BACK, camera.rotation.z)

View File

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

View File

@ -1,14 +0,0 @@
shader_type spatial;
render_mode depth_test_disabled;
uniform sampler2D default_texture: hint_default_white;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
ALBEDO = texture(default_texture, UV).xyz;
ALPHA = texture(default_texture, UV).w;
EMISSION = COLOR.xyz * pow(ALBEDO, vec3(2.2));
}

View File

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

View File

@ -1,211 +0,0 @@
extends CenterContainer
class_name CollectableUi
@onready var canvas_layer: CanvasLayer = %CanvasLayer
signal exit_room
signal playback_finished
#TODO implement proper scene skipping
signal scene_skipped(i: int)
## STATE VARIABLES
## The StoryPlayable to play when this memento is collected.
## Auto-discovered from the owner's %CanvasLayer, or can be set manually.
var interaction_ui: Control
@export var scene: Scenes.id = Scenes.id.YOUTH_DRAVEN:
set(id):
scene = id
if is_inside_tree():
match id:
Scenes.id.YOUTH_DRAVEN:
# FIXME: this explicit translation should not be nessecary
if title_override == "": title_label.text = TranslationServer.translate("Starlight")
if subtitle_override == "": cn_label.text = "[b]%s[/b]: %s" % [TranslationServer.translate("MementoLabel_CN"), TranslationServer.translate("MementoLabel_DravenCN")]
Scenes.id.YOUTH_CHILDHOOD:
if title_override == "": title_label.text = TranslationServer.translate("crafted Mask")
if subtitle_override == "": cn_label.text = "[b]%s[/b]: %s" % [TranslationServer.translate("MementoLabel_CN"), TranslationServer.translate("MementoLabel_ChildhoodCN")]
Scenes.id.YOUTH_VOICE_TRAINING:
if title_override == "": title_label.text = TranslationServer.translate("Comic Stash")
if subtitle_override == "": cn_label.text = "[b]%s[/b]: %s" % [TranslationServer.translate("MementoLabel_CN"), TranslationServer.translate("MementoLabel_VoiceCN")]
Scenes.id.YOUTH_JUI_JUTSU:
if title_override == "": title_label.text = TranslationServer.translate("Sports Clothes")
if subtitle_override == "": cn_label.text = "[b]%s[/b]: %s" % [TranslationServer.translate("MementoLabel_CN"), TranslationServer.translate("MementoLabel_Jui_JutsuCN")]
Scenes.id.TRANSITION:
if title_override == "": title_label.text = TranslationServer.translate("Move on")
if subtitle_override == "": cn_label.text = ""
Scenes.id.ADULT_DND:
if title_override == "": title_label.text = TranslationServer.translate("colorful Dice")
if subtitle_override == "": cn_label.text = ""
Scenes.id.ADULT_VOLUNTARY:
if title_override == "": title_label.text = TranslationServer.translate("Gemstone Art")
if subtitle_override == "": cn_label.text = ""
Scenes.id.ADULT_AUTISM:
if title_override == "": title_label.text = TranslationServer.translate("Chat Messages")
if subtitle_override == "": cn_label.text = ""
Scenes.id.ADULT_EATING:
if title_override == "": title_label.text = TranslationServer.translate("Dishes")
if subtitle_override == "": cn_label.text = ""
Scenes.id.ADULT_SELF_ADVOCACY:
if title_override == "": title_label.text = TranslationServer.translate("Science Poster")
if subtitle_override == "": cn_label.text = ""
Scenes.id.ADULT_THERAPY_UNI:
if title_override == "": title_label.text = TranslationServer.translate("Doctors Note")
if subtitle_override == "": cn_label.text = ""
Scenes.id.ADULT_THERAPY_VOLUNTEER:
if title_override == "": title_label.text = TranslationServer.translate("Doctors Note")
if subtitle_override == "": cn_label.text = ""
Scenes.id.ADULT_BURNOUT:
if title_override == "": title_label.text = TranslationServer.translate("Paperwork")
if subtitle_override == "": cn_label.text = ""
if not Engine.is_editor_hint():
is_collected = Scenes.is_sequence_repeating(scene)
@export var is_collected: bool = false:
set(value):
is_collected = value
if is_inside_tree():
collected_box.button_pressed = value
if is_collected:
%CollectLabel.text = "listen again"
else:
%CollectLabel.text = "MementoLabel_collect"
@onready var collected_box: CheckBox = %CheckBox
@export var title_override: String = "":
set(value):
title_override = value
if is_inside_tree():
title_label.text = value
@onready var title_label: Label = %TitleLabel
@export var subtitle_override: String = "":
set(value):
subtitle_override = value
if is_inside_tree():
cn_label.text = value
@onready var cn_label: RichTextLabel = %ContentNoteLabel
@onready var animation_player: AnimationPlayer = %AnimationPlayer
@export var is_expanded: bool = false:
set(expanded):
if expanded != is_expanded:
is_expanded = expanded
if is_inside_tree():
animation_player.play("expand")
await animation_player.animation_finished
for button:Button in [%ReadStory, %CollectButton, %SummaryButton, %SkipButton]:
if button.visible:
button.grab_focus()
return
@export var was_skipped: bool = false
@export var is_exit:bool = false:
set(exit):
is_exit = exit
if is_inside_tree():
if exit:
if title_override == "": title_label.text = "Move on"
if subtitle_override == "": %CollectLabel.text = "Leave room"
collected_box.hide()
else:
scene = scene
collected_box.show()
func _ready() -> void:
State.settings_changed.connect(_on_context_updated)
%CollectButton.pressed.connect(collect_memento)
##TODO: add functions for remaining buttons
update_state()
func _on_context_updated() -> void:
%SkipButton.visible = State.allow_skipping
%SummaryButton.visible = State.provide_summaries
%ReadStory.visible = is_collected
%OptionPrompt.visible = State.allow_skipping or State.provide_summaries or is_collected
%OptionsLabel.visible = State.allow_skipping or State.provide_summaries or is_collected
cn_label.visible = true if State.show_content_notes else false
func update_state() -> void:
scene = scene
is_exit = is_exit
_on_context_updated()
func try_reveal() -> bool:
if not visible or animation_player.get_animation("vanish") or animation_player.get_animation("vanish_all"):
update_state()
visible = true
animation_player.play("reveal")
return true
return false
#FIXME something was eating all my inputs, maybe I can use the more pretty pattern when I figure out the culprit
func _input(event: InputEvent) -> void:
if not visible: return
if event.is_action_pressed("collect_memento_ui"):
if is_exit:
exit_room.emit()
else:
collect_memento()
get_viewport().set_input_as_handled()
elif event.is_action_pressed("option_memento_ui"):
is_expanded = true
get_viewport().set_input_as_handled()
func vanish() -> void:
if not visible: return
if is_expanded:
animation_player.play("vanish_all")
else:
animation_player.play("vanish")
func collect_memento() -> void:
print_debug("CollectableUi.collect_memento() - scene: %s" % Scenes.id.keys()[scene])
# Hide the collectable UI
vanish()
is_collected = true
# Signal that a scene is starting (for music, etc.)
Scenes.begin_sequence(scene, false)
# Hide mouse and collapse other interactables BEFORE showing canvas
get_tree().call_group("interactables", "collapse")
Input.mouse_mode = Input.MOUSE_MODE_HIDDEN
# Show the CanvasLayer so the story is visible full-screen
canvas_layer.show()
# Play the story
await interaction_ui.play()
if interaction_ui is StoryPlayable:
# Pick the cards
var picker := State.room.get_node("%Picker") as CardPicker
await picker.pick_cards(interaction_ui.scene_id)
# Hide the CanvasLayer when done
canvas_layer.hide()
# Restore mouse to captured mode (player controller will be given back control)
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
# Signal that the scene is finished
Scenes.end_sequence(scene, false)
if was_skipped:
scene_skipped.emit(-1)
is_collected = true
get_viewport().gui_release_focus()
# Signal that playback is finished so the InteractiveSprite can restore player control
playback_finished.emit()

View File

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

View File

@ -1,987 +0,0 @@
[gd_scene load_steps=18 format=3 uid="uid://wfyna16xhlo0"]
[ext_resource type="Script" uid="uid://ct2503epxj4av" path="res://logic-scenes/collectable/collectable_ui.gd" id="1_fk5x4"]
[ext_resource type="Texture2D" uid="uid://epjksqlw8frf" path="res://logic-scenes/collectable/decorative_paper.png" id="1_g0dpf"]
[ext_resource type="Script" uid="uid://bbs1u7ojno7xo" path="res://addons/input_prompts/action_prompt/action_prompt.gd" id="2_2apub"]
[ext_resource type="Texture2D" uid="uid://b7breoabkyifr" path="res://addons/input_prompts/icons/xbox/A.png" id="3_g0dpf"]
[ext_resource type="Texture2D" uid="uid://615hvpuiacvm" path="res://addons/input_prompts/icons/xbox/X.png" id="5_fk5x4"]
[sub_resource type="InputEventMouseButton" id="InputEventMouseButton_yg774"]
device = -1
button_index = 1
[sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_vmmjr"]
device = -1
[sub_resource type="InputEventKey" id="InputEventKey_qqo47"]
device = -1
physical_keycode = 4194309
[sub_resource type="InputEventMouseButton" id="InputEventMouseButton_axm2i"]
device = -1
button_index = 2
[sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_762cl"]
device = -1
button_index = 2
[sub_resource type="Animation" id="Animation_8vhsk"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("VBoxContainer/HSplitContainer:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("DecorativePaper:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("DecorativePaper:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(201, 179)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("DecorativePaper:scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0.570658, 0.570658)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("DecorativePaper:rotation")
tracks/4/interp = 4
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("VBoxContainer/HBoxContainer:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("VBoxContainer2:modulate")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("DecorativePaper2:position")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(200.373, 236.593)]
}
tracks/8/type = "value"
tracks/8/imported = false
tracks/8/enabled = true
tracks/8/path = NodePath("DecorativePaper2:scale")
tracks/8/interp = 1
tracks/8/loop_wrap = true
tracks/8/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0.325643, 0.76646)]
}
tracks/9/type = "value"
tracks/9/imported = false
tracks/9/enabled = true
tracks/9/path = NodePath("DecorativePaper2:modulate")
tracks/9/interp = 1
tracks/9/loop_wrap = true
tracks/9/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/10/type = "value"
tracks/10/imported = false
tracks/10/enabled = true
tracks/10/path = NodePath("VBoxContainer/ContentNoteLabel:self_modulate")
tracks/10/interp = 1
tracks/10/loop_wrap = true
tracks/10/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/11/type = "value"
tracks/11/imported = false
tracks/11/enabled = true
tracks/11/path = NodePath(".:visible")
tracks/11/interp = 1
tracks/11/loop_wrap = true
tracks/11/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/12/type = "value"
tracks/12/imported = false
tracks/12/enabled = true
tracks/12/path = NodePath("VBoxContainer2:visible")
tracks/12/interp = 1
tracks/12/loop_wrap = true
tracks/12/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/13/type = "value"
tracks/13/imported = false
tracks/13/enabled = true
tracks/13/path = NodePath("DecorativePaper2:visible")
tracks/13/interp = 1
tracks/13/loop_wrap = true
tracks/13/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/14/type = "value"
tracks/14/imported = false
tracks/14/enabled = true
tracks/14/path = NodePath("VBoxContainer2/HSeparator:custom_minimum_size")
tracks/14/interp = 1
tracks/14/loop_wrap = true
tracks/14/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 50)]
}
[sub_resource type="Animation" id="Animation_t7f8v"]
resource_name = "expand"
length = 0.2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("VBoxContainer2:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.2),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("DecorativePaper2:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.2),
"transitions": PackedFloat32Array(0.225313, 1),
"update": 0,
"values": [Vector2(210.221, 236.593), Vector2(200.373, 236.593)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("DecorativePaper2:scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.2),
"transitions": PackedFloat32Array(0.225313, 1),
"update": 0,
"values": [Vector2(0.291, 0.452), Vector2(0.326, 0.721)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("DecorativePaper2:modulate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.08),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("DecorativePaper2:visible")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("VBoxContainer2:visible")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_bnbqn"]
resource_name = "init"
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("VBoxContainer/HSplitContainer:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("DecorativePaper:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("DecorativePaper:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(201, 179)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("DecorativePaper:scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0.570658, 0.570658)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("DecorativePaper:rotation")
tracks/4/interp = 4
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("VBoxContainer/HBoxContainer:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("VBoxContainer2:modulate")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("DecorativePaper2:position")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(200.373, 236.593)]
}
tracks/8/type = "value"
tracks/8/imported = false
tracks/8/enabled = true
tracks/8/path = NodePath("DecorativePaper2:scale")
tracks/8/interp = 1
tracks/8/loop_wrap = true
tracks/8/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0.325643, 0.76646)]
}
tracks/9/type = "value"
tracks/9/imported = false
tracks/9/enabled = true
tracks/9/path = NodePath("DecorativePaper2:modulate")
tracks/9/interp = 1
tracks/9/loop_wrap = true
tracks/9/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/10/type = "value"
tracks/10/imported = false
tracks/10/enabled = true
tracks/10/path = NodePath("VBoxContainer/ContentNoteLabel:self_modulate")
tracks/10/interp = 1
tracks/10/loop_wrap = true
tracks/10/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 0)]
}
tracks/11/type = "value"
tracks/11/imported = false
tracks/11/enabled = true
tracks/11/path = NodePath("DecorativePaper2:visible")
tracks/11/interp = 1
tracks/11/loop_wrap = true
tracks/11/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/12/type = "value"
tracks/12/imported = false
tracks/12/enabled = true
tracks/12/path = NodePath("VBoxContainer2:visible")
tracks/12/interp = 1
tracks/12/loop_wrap = true
tracks/12/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/13/type = "value"
tracks/13/imported = false
tracks/13/enabled = true
tracks/13/path = NodePath(".:visible")
tracks/13/interp = 1
tracks/13/loop_wrap = true
tracks/13/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_fk5x4"]
resource_name = "reveal"
length = 0.6
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("VBoxContainer/HSplitContainer:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.233333, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("DecorativePaper:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.3),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("DecorativePaper:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.466667),
"transitions": PackedFloat32Array(0.129408, 1),
"update": 0,
"values": [Vector2(201, 300), Vector2(201, 190.91)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("DecorativePaper:scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.466667),
"transitions": PackedFloat32Array(0.450625, 1),
"update": 0,
"values": [Vector2(0.341, 0.381), Vector2(0.570658, 0.570658)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("DecorativePaper:rotation")
tracks/4/interp = 4
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 0.333333),
"transitions": PackedFloat32Array(0.450625, 1),
"update": 0,
"values": [1.5708, 0.0]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("VBoxContainer/HBoxContainer:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0.166667, 0.366667),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath(".:visible")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0, 0.6),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, true]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("VBoxContainer/ContentNoteLabel:self_modulate")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0.34, 0.6),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_6fedj"]
resource_name = "vanish"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("VBoxContainer/HSplitContainer:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.1, 0.366667),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("DecorativePaper:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.366667, 0.9),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("DecorativePaper:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.0333333, 0.833333),
"transitions": PackedFloat32Array(6.49802, 0.129408),
"update": 0,
"values": [Vector2(201, 190.91), Vector2(201, 400)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("DecorativePaper:scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.333333, 0.833333),
"transitions": PackedFloat32Array(2.92817, 0.450625),
"update": 0,
"values": [Vector2(0.570658, 0.570658), Vector2(0.341, 0.381)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("DecorativePaper:rotation")
tracks/4/interp = 4
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0.166667, 0.5, 1),
"transitions": PackedFloat32Array(1, 0.378929, 0.450625),
"update": 0,
"values": [0.0, -0.198968, 1.5708]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("VBoxContainer/HBoxContainer:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0.0333333, 0.2),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath(".:visible")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("VBoxContainer/ContentNoteLabel:self_modulate")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0, 0.28),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
[sub_resource type="Animation" id="Animation_jtrhv"]
resource_name = "vanish_all"
length = 0.8
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("VBoxContainer/HSplitContainer:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.1, 0.366667),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("DecorativePaper:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.366667, 0.833333),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("DecorativePaper:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.0333333, 0.8),
"transitions": PackedFloat32Array(6.49802, 0.129408),
"update": 0,
"values": [Vector2(201, 190.91), Vector2(201, 400)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("DecorativePaper:scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.333333, 0.8),
"transitions": PackedFloat32Array(2.92817, 0.450625),
"update": 0,
"values": [Vector2(0.570658, 0.570658), Vector2(0.341, 0.381)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("DecorativePaper:rotation")
tracks/4/interp = 4
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0.0666667, 0.433333, 0.8),
"transitions": PackedFloat32Array(1, 0.378929, 0.450625),
"update": 0,
"values": [0.0, -0.198968, 1.5708]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("VBoxContainer/HBoxContainer:modulate")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0.0333333, 0.2),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath(".:visible")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0, 0.8),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("VBoxContainer2/HSeparator:custom_minimum_size")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0.5, 0.8),
"transitions": PackedFloat32Array(0.353553, 1),
"update": 0,
"values": [Vector2(0, 123.06), Vector2(0, 50)]
}
tracks/8/type = "value"
tracks/8/imported = false
tracks/8/enabled = true
tracks/8/path = NodePath("DecorativePaper2:position")
tracks/8/interp = 2
tracks/8/loop_wrap = true
tracks/8/keys = {
"times": PackedFloat32Array(0.11, 0.3, 0.49, 0.8),
"transitions": PackedFloat32Array(1, 1, 0.482968, 1),
"update": 0,
"values": [Vector2(200.373, 236.593), Vector2(200.373, 246.497), Vector2(200.373, 236.593), Vector2(200.373, 183.66)]
}
tracks/9/type = "value"
tracks/9/imported = false
tracks/9/enabled = true
tracks/9/path = NodePath("DecorativePaper2:scale")
tracks/9/interp = 2
tracks/9/loop_wrap = true
tracks/9/keys = {
"times": PackedFloat32Array(0.11, 0.3, 0.49, 0.8),
"transitions": PackedFloat32Array(1, 1, 0.482968, 1),
"update": 0,
"values": [Vector2(0.325643, 0.76646), Vector2(0.353939, 0.76646), Vector2(0.325643, 0.76646), Vector2(0.270026, 0.76646)]
}
tracks/10/type = "value"
tracks/10/imported = false
tracks/10/enabled = true
tracks/10/path = NodePath("DecorativePaper2:modulate")
tracks/10/interp = 1
tracks/10/loop_wrap = true
tracks/10/keys = {
"times": PackedFloat32Array(0.566667, 0.733333),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/11/type = "value"
tracks/11/imported = false
tracks/11/enabled = true
tracks/11/path = NodePath("VBoxContainer2:modulate")
tracks/11/interp = 1
tracks/11/loop_wrap = true
tracks/11/keys = {
"times": PackedFloat32Array(0.566667, 0.69),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/12/type = "value"
tracks/12/imported = false
tracks/12/enabled = true
tracks/12/path = NodePath("VBoxContainer/ContentNoteLabel:self_modulate")
tracks/12/interp = 1
tracks/12/loop_wrap = true
tracks/12/keys = {
"times": PackedFloat32Array(0, 0.39),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/13/type = "value"
tracks/13/imported = false
tracks/13/enabled = true
tracks/13/path = NodePath("DecorativePaper2:visible")
tracks/13/interp = 1
tracks/13/loop_wrap = true
tracks/13/keys = {
"times": PackedFloat32Array(0, 0.8),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
tracks/14/type = "value"
tracks/14/imported = false
tracks/14/enabled = true
tracks/14/path = NodePath("VBoxContainer2:visible")
tracks/14/interp = 1
tracks/14/loop_wrap = true
tracks/14/keys = {
"times": PackedFloat32Array(0, 0.8),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_6fedj"]
_data = {
&"RESET": SubResource("Animation_8vhsk"),
&"expand": SubResource("Animation_t7f8v"),
&"init": SubResource("Animation_bnbqn"),
&"reveal": SubResource("Animation_fk5x4"),
&"vanish": SubResource("Animation_6fedj"),
&"vanish_all": SubResource("Animation_jtrhv")
}
[node name="CollectableUI" type="CenterContainer"]
offset_right = 400.0
offset_bottom = 350.0
script = ExtResource("1_fk5x4")
scene = 1
[node name="DecorativePaper" type="Sprite2D" parent="."]
position = Vector2(201, 179)
scale = Vector2(0.570658, 0.570658)
texture = ExtResource("1_g0dpf")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="HSplitContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
alignment = 1
[node name="CheckBox" type="CheckBox" parent="VBoxContainer/HSplitContainer"]
unique_name_in_owner = true
modulate = Color(0, 0, 0, 1)
layout_mode = 2
focus_mode = 0
button_mask = 0
[node name="TitleLabel" type="Label" parent="VBoxContainer/HSplitContainer"]
unique_name_in_owner = true
self_modulate = Color(0, 0, 0, 1)
layout_mode = 2
size_flags_horizontal = 4
theme_type_variation = &"HeaderLarge"
text = "collectable title"
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
alignment = 1
[node name="CollectPrompt" type="TextureRect" parent="VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
texture = ExtResource("3_g0dpf")
expand_mode = 2
stretch_mode = 5
script = ExtResource("2_2apub")
action = "collect_memento_ui"
icon = 0
events = Array[InputEvent]([SubResource("InputEventMouseButton_yg774"), SubResource("InputEventJoypadButton_vmmjr"), SubResource("InputEventKey_qqo47")])
metadata/_custom_type_script = "uid://bbs1u7ojno7xo"
[node name="CollectLabel" type="Label" parent="VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
modulate = Color(0, 0, 0, 1)
layout_mode = 2
size_flags_horizontal = 4
text = "MementoLabel_collect"
[node name="OptionPrompt" type="TextureRect" parent="VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
texture = ExtResource("5_fk5x4")
expand_mode = 2
stretch_mode = 5
script = ExtResource("2_2apub")
action = "option_memento_ui"
icon = 0
events = Array[InputEvent]([SubResource("InputEventMouseButton_axm2i"), SubResource("InputEventJoypadButton_762cl")])
metadata/_custom_type_script = "uid://bbs1u7ojno7xo"
[node name="OptionsLabel" type="Label" parent="VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
visible = false
modulate = Color(0, 0, 0, 1)
layout_mode = 2
size_flags_horizontal = 4
text = "options"
[node name="ContentNoteLabel" type="RichTextLabel" parent="VBoxContainer"]
unique_name_in_owner = true
visible = false
modulate = Color(0, 0, 0, 1)
custom_minimum_size = Vector2(350, 90)
layout_mode = 2
bbcode_enabled = true
text = "[b]MementoLabel_CN[/b]: MementoLabel_ChildhoodCN"
fit_content = true
horizontal_alignment = 1
vertical_alignment = 1
[node name="DecorativePaper2" type="Sprite2D" parent="."]
visible = false
position = Vector2(200.373, 236.593)
rotation = 1.57079
scale = Vector2(0.325643, 0.76646)
texture = ExtResource("1_g0dpf")
[node name="VBoxContainer2" type="VBoxContainer" parent="."]
visible = false
layout_mode = 2
[node name="HSeparator" type="HSeparator" parent="VBoxContainer2"]
modulate = Color(1, 1, 1, 0)
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
[node name="CollectButton" type="Button" parent="VBoxContainer2"]
unique_name_in_owner = true
layout_mode = 2
text = "collect"
[node name="ReadStory" type="Button" parent="VBoxContainer2"]
unique_name_in_owner = true
visible = false
layout_mode = 2
text = "read again"
[node name="SummaryButton" type="Button" parent="VBoxContainer2"]
unique_name_in_owner = true
visible = false
layout_mode = 2
text = "get summary"
[node name="SkipButton" type="Button" parent="VBoxContainer2"]
unique_name_in_owner = true
visible = false
layout_mode = 2
text = "skip"
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
&"": SubResource("AnimationLibrary_6fedj")
}
autoplay = "init"
[node name="CanvasLayer" type="CanvasLayer" parent="."]

View File

@ -1,4 +1,4 @@
class_name Interactable extends Node3D class_name Interactable extends Area3D
@export var interaction: PackedScene = null @export var interaction: PackedScene = null
var playable : Playable = null var playable : Playable = null
@ -94,7 +94,7 @@ func _process_hover() -> void:
elif not hover and shown or shown and not active: elif not hover and shown or shown and not active:
collapse() collapse()
func _input(event: InputEvent) -> void: func handle_input(event: InputEvent) -> void:
if not active or not hover or not shown: return if not active or not hover or not shown: return
var clicked : bool = (event.is_action_pressed("ui_accept")) or (event is InputEventMouseButton and event.is_pressed()) var clicked : bool = (event.is_action_pressed("ui_accept")) or (event is InputEventMouseButton and event.is_pressed())
@ -143,6 +143,7 @@ func play_board() -> void:
canvas_layer.hide() canvas_layer.hide()
Scenes.player_enable.emit(true) Scenes.player_enable.emit(true)
expand() expand()
@ -159,13 +160,10 @@ func play_burner() -> void:
func interact() -> void: func interact() -> void:
Scenes.player_enable.emit(false) Scenes.player_enable.emit(false)
var repeat := collected
var scene : Scenes.id = playable.scene_id if playable is StoryPlayable else Scenes.id.NONE
Scenes.scene_starting.emit(scene, repeat)
# we must wait for our own collapse, so it doesnt change its caption while the canvas shows
await collapse() await collapse()
# collapse other interactables BEFORE showing canvas
get_tree().call_group("interactables", "collapse") get_tree().call_group("interactables", "collapse")
if playable is StoryPlayable: if playable is StoryPlayable:
@ -177,8 +175,7 @@ func interact() -> void:
if playable is CardBurner: if playable is CardBurner:
await play_burner() await play_burner()
Scenes.scene_finished.emit(scene, repeat) # player is re-enabled by the inner code, or the room proceeds to next scene
## Updates caption label based on the instantiated interaction_ui ## Updates caption label based on the instantiated interaction_ui

View File

@ -10,19 +10,25 @@
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ih54h"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ih54h"]
height = 1.1483154 height = 1.1483154
[node name="Interactable" type="Node3D" groups=["interactables"]] [node name="Interactable" type="Area3D" groups=["interactables"]]
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, 0) collision_layer = 16
collision_mask = 16
script = ExtResource("1_ih54h") script = ExtResource("1_ih54h")
metadata/_custom_type_script = "uid://bp6s7vhdd6btk" metadata/_custom_type_script = "uid://bp6s7vhdd6btk"
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(-4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, 0, 1, -0.2727661, -1.1922985e-08, 0)
shape = SubResource("CapsuleShape3D_ih54h")
[node name="Frame" type="Sprite3D" parent="."] [node name="Frame" type="Sprite3D" parent="."]
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, 0)
pixel_size = 0.0005 pixel_size = 0.0005
no_depth_test = true no_depth_test = true
render_priority = 100 render_priority = 100
texture = ExtResource("2_ih54h") texture = ExtResource("2_ih54h")
[node name="View" type="Node3D" parent="."] [node name="View" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.52599776, 0.1, 4.5984184e-08) transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0.52599776, 0.1, 0)
[node name="Sprite3D" type="Sprite3D" parent="View"] [node name="Sprite3D" type="Sprite3D" parent="View"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.072, -0.047, -0.1) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.072, -0.047, -0.1)
@ -68,15 +74,8 @@ font_size = 8
outline_size = 0 outline_size = 0
horizontal_alignment = 0 horizontal_alignment = 0
[node name="Area3D" type="Area3D" parent="."]
collision_layer = 16
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
transform = Transform3D(-4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, 0, 1, -0.2727661, -1.1922985e-08, 0)
shape = SubResource("CapsuleShape3D_ih54h")
[node name="collectable_particles" parent="." instance=ExtResource("6_a6wx8")] [node name="collectable_particles" parent="." instance=ExtResource("6_a6wx8")]
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, 0)
[node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="CanvasLayer" type="CanvasLayer" parent="."]
visible = false visible = false

View File

@ -1,68 +0,0 @@
[gd_scene load_steps=10 format=3 uid="uid://cy4yesucptcr3"]
[ext_resource type="Script" uid="uid://dr4wd80dobxjd" path="res://base-environments/youth_room/interactive_sprite.gd" id="1_v8gd7"]
[ext_resource type="PackedScene" uid="uid://bdnesuqroi7ss" path="res://vfx/collectable_particles.tscn" id="2_lqlgh"]
[ext_resource type="Script" uid="uid://dbdw3v7mbqscf" path="res://dev-util/click-trough-area.gd" id="3_1fk5i"]
[ext_resource type="Script" uid="uid://cdjjn1jx1fdeb" path="res://logic-scenes/interactive_sprite/ui_sprite.gd" id="4_uwc8q"]
[ext_resource type="PackedScene" uid="uid://wfyna16xhlo0" path="res://logic-scenes/collectable/collectable_ui.tscn" id="5_kqyl2"]
[ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://import/interface-elements/frame.png" id="6_13pus"]
[sub_resource type="BoxShape3D" id="BoxShape3D_v8gd7"]
[sub_resource type="ViewportTexture" id="ViewportTexture_uwc8q"]
viewport_path = NodePath("UiWrapper/UiSprite/SubViewport")
[sub_resource type="BoxShape3D" id="BoxShape3D_uwc8q"]
size = Vector3(1, 1, 0.14892578)
[node name="Memento" type="Area3D" groups=["interactables"]]
transform = Transform3D(0.9999994, 0, 0, 0, 1, 0, 0, 0, 0.9999994, 0, 0, 0)
collision_layer = 16
collision_mask = 0
script = ExtResource("1_v8gd7")
[node name="collectable_particles" parent="." instance=ExtResource("2_lqlgh")]
[node name="UiWrapper" type="Area3D" parent="."]
transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0, 0)
script = ExtResource("3_1fk5i")
[node name="UI_click_collider" type="CollisionShape3D" parent="UiWrapper"]
transform = Transform3D(1, -6.984922e-08, -1.908213e-15, 6.984922e-08, 1, 2.3283043e-08, 2.8191056e-16, -2.3283043e-08, 1, 0, 0, 0)
shape = SubResource("BoxShape3D_v8gd7")
[node name="UiSprite" type="Sprite3D" parent="UiWrapper"]
gi_mode = 0
modulate = Color(0.9999996, 0.96863645, 0.88173, 1)
pixel_size = 0.015
no_depth_test = true
texture = SubResource("ViewportTexture_uwc8q")
script = ExtResource("4_uwc8q")
[node name="SubViewport" type="SubViewport" parent="UiWrapper/UiSprite"]
unique_name_in_owner = true
transparent_bg = true
size = Vector2i(400, 350)
[node name="CollectableUi" parent="UiWrapper/UiSprite/SubViewport" instance=ExtResource("5_kqyl2")]
[node name="Frame" type="Sprite3D" parent="UiWrapper"]
transform = Transform3D(0.7045709, 0, -1.1920898e-07, 0, 0.704571, 0, 1.1920898e-07, 0, 0.7045709, 0, -1, 0)
visibility_range_end = 0.6
visibility_range_end_margin = 0.3
visibility_range_fade_mode = 1
modulate = Color(1.8247963, 1.8247963, 1.8247963, 1)
no_depth_test = true
texture = ExtResource("6_13pus")
region_enabled = true
region_rect = Rect2(735.5, 0, 995.5, 1024)
[node name="HoverDetect" type="CollisionShape3D" parent="."]
transform = Transform3D(-4.3711356e-08, -0.9999997, 0, 0.9999993, -4.3711374e-08, 0, 0, 0, 0.99999976, 0, 0, 0.060790993)
shape = SubResource("BoxShape3D_uwc8q")
[node name="CanvasLayer" type="CanvasLayer" parent="."]
unique_name_in_owner = true
visible = false
[connection signal="input_event" from="UiWrapper" to="UiWrapper" method="_on_input_event"]

View File

@ -1,4 +0,0 @@
extends Sprite3D
func _ready() -> void:
pass

View File

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

View File

@ -174,20 +174,23 @@ var has_entered:bool = false:
var delay_passed:bool = false var delay_passed:bool = false
func _on_ray_entered(_area : Area3D) -> void: func _on_ray_entered(_area : Area3D) -> void:
var parent := _area.get_parent() as Interactable var interactable := _area as Interactable
if not parent.visible: return assert(interactable, "Ray entered non-interactable area!")
assert(parent != null, "Ray entered non-interactable area!")
if not interactable.visible: return
#printt("ray entered", parent.name, parent) #printt("ray entered", parent.name, parent)
parent.hover = true interactable.hover = true
# Switch to pointing hand cursor when hovering over interactable # Switch to pointing hand cursor when hovering over interactable
if hand_cursor: if hand_cursor:
hand_cursor.texture = cursor_point hand_cursor.texture = cursor_point
func _on_ray_exited(_area : Area3D) -> void: func _on_ray_exited(_area : Area3D) -> void:
var parent := _area.get_parent() as Interactable var interactable := _area as Interactable
if not parent.visible: return assert(interactable, "Ray entered non-interactable area!")
if not interactable.visible: return
#printt("ray exited", parent.name, parent) #printt("ray exited", parent.name, parent)
parent.hover = false interactable.hover = false
# Switch back to default cursor when not hovering # Switch back to default cursor when not hovering
if hand_cursor: if hand_cursor:
hand_cursor.texture = cursor_default hand_cursor.texture = cursor_default
@ -281,8 +284,8 @@ func _input(event: InputEvent) -> void:
if event.is_action_pressed("collect_memento_ui") or event.is_action_pressed("option_memento_ui"): if event.is_action_pressed("collect_memento_ui") or event.is_action_pressed("option_memento_ui"):
if focus_ray.is_colliding(): if focus_ray.is_colliding():
var collider := focus_ray.get_collider() var collider := focus_ray.get_collider()
if collider is InteractiveSprite: if collider is Interactable:
collider.handle(event) collider.handle_input(event)
get_viewport().set_input_as_handled() get_viewport().set_input_as_handled()
if event.is_action_pressed("crouch"): if event.is_action_pressed("crouch"):

View File

@ -6,11 +6,9 @@ var started_sequences: int = 0
var completed_sequences: int = 0 var completed_sequences: int = 0
var enabled_sequences: int = 255: var enabled_sequences: int = 255:
set(stuff): pass set(stuff): pass
var current_sequence: int = -1
## Returns true if a scene is currently playing. ## Returns true if a scene is currently playing.
var is_playing: bool: var is_playing: bool = false
get: return current_sequence != -1
enum id { enum id {
NONE = -1, NONE = -1,
@ -39,11 +37,11 @@ func _ready() -> void:
# Called by CollectableUi when it starts playing a scene # Called by CollectableUi when it starts playing a scene
func begin_sequence(scene_id: id, repeat: bool) -> void: func begin_sequence(scene_id: id, repeat: bool) -> void:
print_debug(">>> Scenes.begin_sequence(%s)" % str(id)) print_debug(">>> Scenes.begin_sequence(%s)" % str(id))
is_playing = true
# Disable player movement during cutscenes # Disable player movement during cutscenes
player_enable.emit(false) player_enable.emit(false)
current_sequence = scene_id
started_sequences = started_sequences | (1 << scene_id) started_sequences = started_sequences | (1 << scene_id)
# Emit signal for other systems (music, animations, etc.) # Emit signal for other systems (music, animations, etc.)
@ -59,9 +57,7 @@ func end_sequence(scene_id: id, repeat: bool) -> void:
# Mark as completed # Mark as completed
completed_sequences = completed_sequences | (1 << scene_id) completed_sequences = completed_sequences | (1 << scene_id)
# Clear current sequence is_playing = false
if current_sequence == scene_id:
current_sequence = -1
# Re-enable player movement after cutscene # Re-enable player movement after cutscene
player_enable.emit(true) player_enable.emit(true)