Compare commits

...

2 Commits

18 changed files with 145 additions and 190 deletions

View File

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="UserContentModel"> <component name="UserContentModel">
<attachedFolders /> <attachedFolders>
<Path>.</Path>
</attachedFolders>
<explicitIncludes /> <explicitIncludes />
<explicitExcludes> <explicitExcludes>
<Path>.godot</Path> <Path>.godot</Path>

View File

@ -31,8 +31,9 @@ var revealed: bool = false:
var has_mouse: bool = false var has_mouse: bool = false
# Automatically triggered story playback - e.g. for Intro in Youth Room
func play_story() -> void: func play_story() -> void:
await ui.story_playable.play() await ui.collect_memento()
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
@ -54,12 +55,10 @@ func _ready():
func _on_mouse_entered(): func _on_mouse_entered():
if not Scenes.is_playing: if not Scenes.is_playing:
input_ray_pickable = false input_ray_pickable = false
ui.is_collapsed = false
has_mouse = true has_mouse = true
func _on_mouse_exited(): func _on_mouse_exited():
input_ray_pickable = true input_ray_pickable = true
ui.is_collapsed = true
has_mouse = false has_mouse = false
func try_reveal(for_player: PlayerController) -> bool: func try_reveal(for_player: PlayerController) -> bool:
@ -79,7 +78,7 @@ func collapse():
func _on_playback_finished(): func _on_playback_finished():
# Restore player controller control using the room's unique node reference # Restore player controller control using the room's unique node reference
var player_controller = owner.get_node_or_null("%PlayerController") var player_controller := owner.get_node_or_null("%PlayerController") as PlayerController
if player_controller and "has_stage" in player_controller: if player_controller and "has_stage" in player_controller:
player_controller.has_stage = true player_controller.has_stage = true
else: else:

View File

@ -509,6 +509,7 @@ offset_right = -424.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("1_40hhx") script = ExtResource("1_40hhx")
scene_id = 1
progress = 17.0 progress = 17.0
[node name="PanelContainer" type="PanelContainer" parent="."] [node name="PanelContainer" type="PanelContainer" parent="."]

View File

@ -449,8 +449,6 @@ offset_right = -875.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("1_o2rjr") script = ExtResource("1_o2rjr")
story_array = PackedStringArray("Moonlight trickled down through clouds and twigs as Dräven tapped through the night.", "He had been searching for a while and he knew a special someone must be hiding in the thicket.", "When a familiar smell first led him to a few bronce hairs as fluffy as his tail, he didn\'t think much of it.", "But then he saw paw-prints, that matched his own where he had not been. Would he finally find someone of his kind?", "He was sure of it, as the familiar scent has never been stronger than tonight.", "When suddenly: Was that chatter?", "His wings rustled with joy over the familiar voice and Dräven decided to get a better look.", "A few flaps and leaps brought him up a tree, to get a glimpse of his soon to be friend.", "But all he saw was a fox.", "He didn\'t even want to bother it anymore.", "It would just scream and laugh at his wings of leafs, just like the trees crackled at his paws, that were no roots.", "With a small whimper, Dräven spread his wings, and slid away to at least find comfort by seeing his reflection in the nearby lake.", "It took him a while to notice, how there was a sudden silence when the clouds broke: ", "Northern lights danced through the sky to form wings, that met at a sleek body made of stars and clouds.", "The whole forest held its breath as it stared into eyes of moonlight gazing down.", "Dräven was moved to tears when he gazed back at it. He was sad for the dragon that was of the moon and the stars and the skies.", "It must feel so lost in the universe.", "But his tears were of joy: It was the first time Dräven saw another creature of many kinds.")
paragraph_lengths = PackedInt32Array(2, 4, 5, 6, 8, 9, 12, 14, 17)
[node name="PanelContainer" type="PanelContainer" parent="."] [node name="PanelContainer" type="PanelContainer" parent="."]
layout_mode = 2 layout_mode = 2

View File

@ -821,6 +821,7 @@ offset_right = -424.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("1_aby4n") script = ExtResource("1_aby4n")
scene_id = 3
progress = 17.0 progress = 17.0
[node name="PanelContainer" type="PanelContainer" parent="."] [node name="PanelContainer" type="PanelContainer" parent="."]

View File

@ -661,8 +661,7 @@ offset_right = -424.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("1_543ki") script = ExtResource("1_543ki")
story_array = PackedStringArray("My secret comic stash. I remember playing Clue-Men with the boys.", "I had a voice for every character in that comic. But more often than not I played him: Agent Q.", "Going under the radar, putting in precise work to save the world.", "Not having to deal with being a girl.", "Boys were so much easier. They like cars, bikes, guns and agents.", "They don\'t talk behind your back. They don\'t think everything is about relationships.", "Girls don\'t get that. I knew they talked behind my back about me only “pretending” to like boy stuff, so Id get laid ", "… I mean, maybe they were right?", "Like I won\'t deny I was probably the first girl in my class to see a dick.", "But like - thats what the boys do, right?", "At least it has gotten better after me and Jojo became friends.", "I still remember how that happend. I did a voice acting workshop in art class.", "Being allowed to share my technique in front of everyone was just :D", "I mean next to nobody put in any effort. But Jojo did.", "When our Mr Funny then decided to ape her attempts instead of just minding his own, I pretty much exploded.", "After this, we suddenly were besties. And my class finally started to just leave me be. ", "Maybe because I for once was friends with another girl. Maybe because I scared them. Maybe both.") scene_id = 2
paragraph_lengths = PackedInt32Array(1, 2, 5, 7, 9, 10, 13, 14, 16)
progress = 17.0 progress = 17.0
[node name="PanelContainer" type="PanelContainer" parent="."] [node name="PanelContainer" type="PanelContainer" parent="."]
@ -724,12 +723,12 @@ render_target_update_mode = 3
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.21953, 3.52719, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.21953, 3.52719, 0)
[node name="YouthSpecialMeshesComicBook1" type="MeshInstance3D" parent="PanelContainer/StartFrame/TextureRect/SubViewport/Node3D"] [node name="YouthSpecialMeshesComicBook1" type="MeshInstance3D" parent="PanelContainer/StartFrame/TextureRect/SubViewport/Node3D"]
transform = Transform3D(-0.0923767, -0.0774974, -0.992704, 0.0851048, 0.992704, -0.0854169, 0.992081, -0.0923743, -0.0851073, -0.045, -0.111, 0.033) transform = Transform3D(-0.09237667, -0.07749741, -0.992704, 0.085104756, 0.9927039, -0.08541691, 0.992081, -0.0923743, -0.08510727, -0.045, -0.111, 0.033)
mesh = ExtResource("3_ho85h") mesh = ExtResource("3_ho85h")
skeleton = NodePath("../..") skeleton = NodePath("../..")
[node name="YouthSpecialMeshesComicBook2" type="MeshInstance3D" parent="PanelContainer/StartFrame/TextureRect/SubViewport/Node3D"] [node name="YouthSpecialMeshesComicBook2" type="MeshInstance3D" parent="PanelContainer/StartFrame/TextureRect/SubViewport/Node3D"]
transform = Transform3D(-0.42101, 0.126406, -0.773945, 0.152605, 0.785327, 0.0775686, 0.78068, -0.0853444, -0.432541, 0.02, -0.055, -0.02) transform = Transform3D(-0.4210099, 0.12640645, -0.7739451, 0.15260528, 0.785327, 0.07756861, 0.78067994, -0.085344404, -0.4325408, 0.02, -0.055, -0.02)
mesh = ExtResource("4_kn83e") mesh = ExtResource("4_kn83e")
skeleton = NodePath("../..") skeleton = NodePath("../..")

View File

@ -157,7 +157,7 @@ func arrange(cards: Array[Card], rect: Rect2, _obstacles: Array[Area2D]) -> Arra
if (colliding.position - card.position).length() > (nearest.position - card.position).length(): if (colliding.position - card.position).length() > (nearest.position - card.position).length():
nearest = colliding nearest = colliding
card.position += min(nearest.position - card.position.normalized() * card.diameter + 1, nearest.position - card.position) card.position += min(nearest.position - card.position.normalized() * (card.diameter + 1), nearest.position - card.position)
continue continue
break break

View File

@ -1,5 +1,9 @@
class_name CardCollider class_name CardCollider
extends Area2D extends Area2D
var is_dragged: bool = false
@export var direction: Vector2 = Vector2.ZERO @export var direction: Vector2 = Vector2.ZERO
var is_dragged: bool = false:
set(dragged):
is_dragged = dragged
z_index = int(dragged)

View File

@ -1,4 +1,4 @@
extends Area2D extends CardCollider
class_name Card class_name Card
var card_id var card_id
@ -32,9 +32,12 @@ var transfor_arr: Array[Transform2D] = [
@export var text: String = "" : @export var text: String = "" :
set(value): set(value):
text = value text = value
_on_text_updated() _on_text_updated.call_deferred()
var label:Label
var background_sprite: AnimatedSprite2D @onready var label: Label = $Label
@onready var background_sprite: AnimatedSprite2D = $AnimatedSprite2D
@export var picked_random: bool = false @export var picked_random: bool = false
@ -70,7 +73,7 @@ var background_sprite: AnimatedSprite2D
@export var voice_line: AudioStream = null @export var voice_line: AudioStream = null
@export var is_dragable: bool = false @export var is_dragable: bool = false
@export var diameter = 336.0 @export var diameter := 336.0
@export_range(0, 2) var burn_progress: float = 0: @export_range(0, 2) var burn_progress: float = 0:
set(burn): set(burn):
if is_node_ready(): if is_node_ready():
@ -125,12 +128,6 @@ var crumble_material: ShaderMaterial = preload("res://logic-scenes/card_burner/c
var card_fire: Sprite2D = preload("res://logic-scenes/card_burner/card_fire.tscn").instantiate() var card_fire: Sprite2D = preload("res://logic-scenes/card_burner/card_fire.tscn").instantiate()
var sticky_note_position: Vector2 = Vector2(-66, 83) var sticky_note_position: Vector2 = Vector2(-66, 83)
var collider: Shape2D
var is_dragged: bool = false:
set(dragged):
is_dragged = dragged
z_index = int(dragged)
var is_mouse_entered: bool = false var is_mouse_entered: bool = false
var mouse_offset: Vector2 var mouse_offset: Vector2
@ -147,35 +144,12 @@ func _ready():
mouse_entered.connect(_on_mouse_entered) mouse_entered.connect(_on_mouse_entered)
mouse_exited.connect(_on_mouse_exited) mouse_exited.connect(_on_mouse_exited)
background_sprite = AnimatedSprite2D.new() _handle_wiggle(0)
background_sprite.sprite_frames = preload("res://logic-scenes/board/card-textures/card-sprites.tres") _on_text_updated.call_deferred()
background_sprite.clip_children = CanvasItem.CLIP_CHILDREN_AND_DRAW
label = Label.new()
label.theme_type_variation = "card_text"
label.size = Vector2(273.0, 131.0)
label.position = Vector2(-135.0, -82.0)
label.autowrap_mode = TextServer.AUTOWRAP_WORD
var collision_shape: = CollisionShape2D.new()
collider = CapsuleShape2D.new()
collider.height = diameter
collider.radius = 110
collision_shape.shape = collider
add_child(collision_shape, false, Node.INTERNAL_MODE_FRONT)
add_child(background_sprite, false, Node.INTERNAL_MODE_FRONT)
add_child(label, false, Node.INTERNAL_MODE_FRONT)
collision_shape.rotation = PI/2
_handle_wiggle(0)
_on_text_updated()
func _on_text_updated(): func _on_text_updated():
if is_node_ready(): if is_node_ready():
var curr_frame = text.hash() % background_sprite.sprite_frames.get_frame_count(background_sprite.animation) var curr_frame := text.hash() % background_sprite.sprite_frames.get_frame_count(background_sprite.animation)
background_sprite.frame = curr_frame background_sprite.frame = curr_frame
background_sprite.scale = Vector2(0.6, 0.6) background_sprite.scale = Vector2(0.6, 0.6)

View File

@ -1,8 +1,38 @@
[gd_scene load_steps=2 format=3 uid="uid://dy5rd437h5hsw"] [gd_scene load_steps=5 format=3 uid="uid://dy5rd437h5hsw"]
[ext_resource type="Script" uid="uid://2loic2eeec5b" path="res://logic-scenes/board/card.gd" id="1_emip0"] [ext_resource type="Script" uid="uid://2loic2eeec5b" path="res://logic-scenes/board/card.gd" id="1_emip0"]
[ext_resource type="SpriteFrames" uid="uid://j7e7me3hl6xt" path="res://logic-scenes/board/card-textures/card-sprites.tres" id="2_mai6h"]
[ext_resource type="Theme" uid="uid://d1jvpqykmpfyg" path="res://logic-scenes/themes/serif.theme" id="3_mdi7r"]
[node name="card" type="Area2D"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_mai6h"]
size = Vector2(511, 410)
[node name="Card" type="Area2D"]
script = ExtResource("1_emip0") script = ExtResource("1_emip0")
text = "asdf" text = "asdf"
metadata/_custom_type_script = "uid://ddy8kb2hjvgss"
metadata/type = "card" metadata/type = "card"
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = ExtResource("2_mai6h")
[node name="Label" type="Label" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -203.0
offset_top = -166.29167
offset_right = 224.0
offset_bottom = 173.12498
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("3_mdi7r")
theme_type_variation = &"card_text"
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. "
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 3
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(11, -2)
shape = SubResource("RectangleShape2D_mai6h")

View File

@ -23,7 +23,7 @@ signal transform_tween_finished
@export var text: String = "" : @export var text: String = "" :
set (value): set (value):
if is_node_ready(): if is_node_ready():
_on_text_updated() _on_text_updated.call_deferred()
text = value text = value
var content: Node2D var content: Node2D
var label: Label var label: Label
@ -112,7 +112,7 @@ func _ready() -> void:
label = $Content/Label label = $Content/Label
background_sprite = $Content/BackgroundSprite background_sprite = $Content/BackgroundSprite
content = $Content content = $Content
_on_text_updated() _on_text_updated.call_deferred()
input_event.connect(_on_input_event) input_event.connect(_on_input_event)
mouse_entered.connect(_on_mouse_entered) mouse_entered.connect(_on_mouse_entered)
@ -215,9 +215,15 @@ func is_sticky_note_in_panel() -> bool:
## fixme ~> see above ## fixme ~> see above
return attached_to is StickyNotePanel return attached_to is StickyNotePanel
var transform_tween: Tween
func tween_transform_to(target: Transform2D): func tween_transform_to(target: Transform2D):
var transform_tween: Tween = create_tween() if transform_tween and transform_tween.is_running():
transform_tween.stop()
transform_tween = create_tween()
transform_tween.tween_property(self, "transform", target, 0.25) transform_tween.tween_property(self, "transform", target, 0.25)
await transform_tween.finished await transform_tween.finished
transform_tween_finished.emit() transform_tween_finished.emit()

View File

@ -1,17 +1,17 @@
[gd_scene load_steps=15 format=3 uid="uid://g2a27jwdapai"] [gd_scene load_steps=15 format=3 uid="uid://g2a27jwdapai"]
[ext_resource type="Script" uid="uid://bbia2hcdwctyn" path="res://logic-scenes/card_burner/card_burner.gd" id="1_copuj"] [ext_resource type="Script" uid="uid://bbia2hcdwctyn" path="res://logic-scenes/card_burner/card_burner.gd" id="1_copuj"]
[ext_resource type="Script" uid="uid://2loic2eeec5b" path="res://logic-scenes/board/card.gd" id="2_l4ogr"]
[ext_resource type="Texture2D" uid="uid://615hvpuiacvm" path="res://addons/input_prompts/icons/xbox/X.png" id="3_ckmi5"] [ext_resource type="Texture2D" uid="uid://615hvpuiacvm" path="res://addons/input_prompts/icons/xbox/X.png" id="3_ckmi5"]
[ext_resource type="PackedScene" uid="uid://uc6urpgv7n1y" path="res://logic-scenes/card_burner/cursor_candle.tscn" id="3_l4ogr"] [ext_resource type="PackedScene" uid="uid://uc6urpgv7n1y" path="res://logic-scenes/card_burner/cursor_candle.tscn" id="3_l4ogr"]
[ext_resource type="Script" uid="uid://bbs1u7ojno7xo" path="res://addons/input_prompts/action_prompt/action_prompt.gd" id="4_x6cxt"] [ext_resource type="Script" uid="uid://bbs1u7ojno7xo" path="res://addons/input_prompts/action_prompt/action_prompt.gd" id="4_x6cxt"]
[ext_resource type="PackedScene" uid="uid://dy5rd437h5hsw" path="res://logic-scenes/board/card.tscn" id="5_ckmi5"]
[sub_resource type="InputEventKey" id="InputEventKey_ckmi5"] [sub_resource type="InputEventKey" id="InputEventKey_x6cxt"]
device = -1 device = -1
physical_keycode = 88 physical_keycode = 88
unicode = 120 unicode = 120
[sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_x6cxt"] [sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_23lqb"]
device = -1 device = -1
button_index = 2 button_index = 2
pressed = true pressed = true
@ -128,11 +128,6 @@ offset_right = -518.0
offset_bottom = 14.0 offset_bottom = 14.0
rotation = -0.0352522 rotation = -0.0352522
[node name="Card" type="Area2D" parent="Control/Ancor1"]
script = ExtResource("2_l4ogr")
text = "card"
metadata/_custom_type_script = "uid://2loic2eeec5b"
[node name="Ancor2" type="Control" parent="Control"] [node name="Ancor2" type="Control" parent="Control"]
unique_name_in_owner = true unique_name_in_owner = true
anchors_preset = 0 anchors_preset = 0
@ -142,11 +137,6 @@ offset_right = -183.0
offset_bottom = 35.0 offset_bottom = 35.0
rotation = 0.0120591 rotation = 0.0120591
[node name="card" type="Area2D" parent="Control/Ancor2"]
script = ExtResource("2_l4ogr")
text = "card"
metadata/_custom_type_script = "uid://2loic2eeec5b"
[node name="Ancor3" type="Control" parent="Control"] [node name="Ancor3" type="Control" parent="Control"]
unique_name_in_owner = true unique_name_in_owner = true
anchors_preset = 0 anchors_preset = 0
@ -156,11 +146,6 @@ offset_right = 153.0
offset_bottom = 22.0 offset_bottom = 22.0
rotation = -0.0139755 rotation = -0.0139755
[node name="card" type="Area2D" parent="Control/Ancor3"]
script = ExtResource("2_l4ogr")
text = "card"
metadata/_custom_type_script = "uid://2loic2eeec5b"
[node name="Ancor4" type="Control" parent="Control"] [node name="Ancor4" type="Control" parent="Control"]
unique_name_in_owner = true unique_name_in_owner = true
anchors_preset = 0 anchors_preset = 0
@ -170,11 +155,6 @@ offset_right = 495.0
offset_bottom = 15.0 offset_bottom = 15.0
rotation = 0.0245775 rotation = 0.0245775
[node name="card" type="Area2D" parent="Control/Ancor4"]
script = ExtResource("2_l4ogr")
text = "card"
metadata/_custom_type_script = "uid://2loic2eeec5b"
[node name="HSplitContainer" type="HSplitContainer" parent="Control"] [node name="HSplitContainer" type="HSplitContainer" parent="Control"]
layout_mode = 1 layout_mode = 1
anchors_preset = 5 anchors_preset = 5
@ -196,7 +176,7 @@ stretch_mode = 5
script = ExtResource("4_x6cxt") script = ExtResource("4_x6cxt")
action = "skip" action = "skip"
icon = 0 icon = 0
events = Array[InputEvent]([null, SubResource("InputEventKey_ckmi5"), SubResource("InputEventJoypadButton_x6cxt")]) events = Array[InputEvent]([null, SubResource("InputEventKey_x6cxt"), SubResource("InputEventJoypadButton_23lqb")])
metadata/_custom_type_script = "uid://bbs1u7ojno7xo" metadata/_custom_type_script = "uid://bbs1u7ojno7xo"
[node name="SkipButton" type="Button" parent="Control/HSplitContainer"] [node name="SkipButton" type="Button" parent="Control/HSplitContainer"]
@ -218,3 +198,11 @@ root_node = NodePath("../Control/HSplitContainer")
libraries = { libraries = {
&"": SubResource("AnimationLibrary_kaqqi") &"": SubResource("AnimationLibrary_kaqqi")
} }
[node name="Card1" parent="." instance=ExtResource("5_ckmi5")]
[node name="Card2" parent="." instance=ExtResource("5_ckmi5")]
[node name="Card3" parent="." instance=ExtResource("5_ckmi5")]
[node name="Card4" parent="." instance=ExtResource("5_ckmi5")]

View File

@ -11,20 +11,8 @@ enum {
DONE DONE
} }
var has_stage: bool = false:
set(focus):
if not focus == has_stage:
if focus:
process_mode = Node.PROCESS_MODE_INHERIT
self.show()
self.mouse_filter = Control.MOUSE_FILTER_PASS
else:
self.mouse_filter = Control.MOUSE_FILTER_IGNORE
self.hide()
process_mode = Node.PROCESS_MODE_DISABLED
has_stage = focus
var _input_locked: bool = true var _input_locked: bool = true
var selection_state := INI: var selection_state := INI:
set(state): set(state):
print_debug("Setting picker state to %s" % ["INI","CARDS","CARDS_SELECTED","TRANSITION","POSTS","POSTS_SELECTED","DONE"][state]) print_debug("Setting picker state to %s" % ["INI","CARDS","CARDS_SELECTED","TRANSITION","POSTS","POSTS_SELECTED","DONE"][state])
@ -38,6 +26,7 @@ var selection_state := INI:
reset() reset()
var anim_players:Array[AnimationPlayer] = [] var anim_players:Array[AnimationPlayer] = []
var curr_selection_id: int = -1: var curr_selection_id: int = -1:
set(new_id): set(new_id):
if selection_state == CARDS or selection_state == POSTS: if selection_state == CARDS or selection_state == POSTS:
@ -84,7 +73,6 @@ func fill_card_slots(id: int):
new_card.connect("mouse_entered", Callable(self, "get_highlight")) new_card.connect("mouse_entered", Callable(self, "get_highlight"))
options.append(new_card) options.append(new_card)
anim_players.append($cards.get_child(i).get_child(0)) anim_players.append($cards.get_child(i).get_child(0))
reset()
func fill_post_slots(): func fill_post_slots():
var sticky_notes: Array[StickyNote] = [] var sticky_notes: Array[StickyNote] = []
@ -110,48 +98,44 @@ var random_player: AnimationPlayer
var on_cooldown: bool = false var on_cooldown: bool = false
var card_anim_skipped:bool = false var card_anim_skipped:bool = false
func _input(event):
#if event.is_action_pressed("ui_end"):
# fill_card_slots(3)
# selection_state = CARDS
func _input(event):
if event is not InputEventAction: if event is not InputEventAction:
return return
if has_stage: if not _input_locked:
if not _input_locked: if not on_cooldown:
if not on_cooldown: if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_focus_next"):
if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_focus_next"): curr_selection_id -= 1
curr_selection_id -= 1 elif event.is_action_pressed("ui_down") or event.is_action_pressed("ui_right") or event.is_action_pressed("ui_focus_prev"):
elif event.is_action_pressed("ui_down") or event.is_action_pressed("ui_right") or event.is_action_pressed("ui_focus_prev"): curr_selection_id += 1
curr_selection_id += 1 on_cooldown = true
on_cooldown = true await get_tree().create_timer(0.1).timeout
await get_tree().create_timer(0.1).timeout on_cooldown = false
on_cooldown = false
if event.is_action_pressed("ui_accept"): if event.is_action_pressed("ui_accept"):
pick(curr_selection_id) pick(curr_selection_id)
elif event.is_action_pressed("skip"): elif event.is_action_pressed("skip"):
$Meaning.stop() $Meaning.stop()
if selection_state == CARDS_SELECTED: if selection_state == CARDS_SELECTED:
picked_player.play("skip_pick", .1) picked_player.play("skip_pick", .1)
random_player.play("skip_shuffle", .1) random_player.play("skip_shuffle", .1)
for player in anim_players: for player in anim_players:
player.advance(10.0) player.advance(10.0)
transition() transition()
card_anim_skipped = true card_anim_skipped = true
show_posts() show_posts()
elif selection_state == POSTS_SELECTED: elif selection_state == POSTS_SELECTED:
for player:AnimationPlayer in anim_players + [picked_player, random_player]: for player:AnimationPlayer in anim_players + [picked_player, random_player]:
player.play("ini") player.play("ini")
# I do not know, why process_frame won't work here, but this is workaround seems to prevent the notes from flashing the next selection. # I do not know, why process_frame won't work here, but this is workaround seems to prevent the notes from flashing the next selection.
await(get_tree().create_timer(0.1).timeout) await(get_tree().create_timer(0.1).timeout)
transition() transition()
elif selection_state == TRANSITION: elif selection_state == TRANSITION:
show_posts() show_posts()
func pick(id: int): func pick(id: int) -> void:
print_debug("%s picked card %s at id %d" % [name, options[id].text, id]) print_debug("%s picked card %s at id %d" % [name, options[id].text, id])
if id == -1: if id == -1:
curr_selection_id = 0 curr_selection_id = 0
@ -164,7 +148,8 @@ func pick(id: int):
anim_players[id].play("pick") anim_players[id].play("pick")
picked_player = anim_players[id] picked_player = anim_players[id]
var yield_to = anim_players[id].animation_finished var yield_to := anim_players[id].animation_finished
output.append(options[id]) output.append(options[id])
options.remove_at(id) options.remove_at(id)
@ -252,12 +237,9 @@ func pick_cards(id: int, repeat: bool):
if not repeat: if not repeat:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
fill_card_slots(id) fill_card_slots(id)
reset()
show()
selection_state = CARDS selection_state = CARDS
if id == Scenes.id.YOUTH_DRAEVEN and not repeat: if id == Scenes.id.YOUTH_DRAEVEN and not repeat:
$Meaning.play() $Meaning.play()
await cards_picked
else:
Scenes.finish_sequence(self)
func play_scene(_id, _repeat):
pass

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=73 format=3 uid="uid://brk4hjdf2x81a"] [gd_scene load_steps=73 format=3 uid="uid://brk4hjdf2x81a"]
[ext_resource type="Script" uid="uid://bdb6n10apk1en" path="res://logic-scenes/card_picker/card_picker.gd" id="1_pjntm"] [ext_resource type="Script" uid="uid://bdb6n10apk1en" path="res://logic-scenes/card_picker/card_picker.gd" id="1_pjntm"]
[ext_resource type="Script" uid="uid://2loic2eeec5b" path="res://logic-scenes/board/card.gd" id="2_f4sp4"] [ext_resource type="PackedScene" uid="uid://dy5rd437h5hsw" path="res://logic-scenes/board/card.tscn" id="2_t7byf"]
[ext_resource type="Script" uid="uid://r12efqgk6t4n" path="res://logic-scenes/board/sticky-note.gd" id="3_f4sp4"] [ext_resource type="Script" uid="uid://r12efqgk6t4n" path="res://logic-scenes/board/sticky-note.gd" id="3_f4sp4"]
[ext_resource type="AudioStream" uid="uid://bakwypwhs7a5n" path="res://base-environments/youth_room/audio/why-does-it-mean.wav" id="4_ujc5a"] [ext_resource type="AudioStream" uid="uid://bakwypwhs7a5n" path="res://base-environments/youth_room/audio/why-does-it-mean.wav" id="4_ujc5a"]
[ext_resource type="Script" uid="uid://c1oub0cs7cph6" path="res://dev-util/stereo-switch.gd" id="5_et74x"] [ext_resource type="Script" uid="uid://c1oub0cs7cph6" path="res://dev-util/stereo-switch.gd" id="5_et74x"]
@ -1749,7 +1749,7 @@ layout_mode = 2
[node name="label" type="Label" parent="Control"] [node name="label" type="Label" parent="Control"]
visible = false visible = false
layout_mode = 2 layout_mode = 0
offset_left = -359.0 offset_left = -359.0
offset_top = -256.0 offset_top = -256.0
offset_right = 358.0 offset_right = 358.0
@ -1761,7 +1761,6 @@ horizontal_alignment = 1
layout_mode = 2 layout_mode = 2
[node name="card_1" type="Control" parent="cards"] [node name="card_1" type="Control" parent="cards"]
layout_mode = 2
anchors_preset = 0 anchors_preset = 0
offset_left = -317.0 offset_left = -317.0
offset_top = 25.0 offset_top = 25.0
@ -1774,13 +1773,9 @@ libraries = {
&"": SubResource("AnimationLibrary_gdxmh") &"": SubResource("AnimationLibrary_gdxmh")
} }
[node name="Card" type="Area2D" parent="cards/card_1"] [node name="Card" parent="cards/card_1" instance=ExtResource("2_t7byf")]
script = ExtResource("2_f4sp4")
text = "Slot 1"
metadata/_custom_type_script = "uid://2loic2eeec5b"
[node name="card_2" type="Control" parent="cards"] [node name="card_2" type="Control" parent="cards"]
layout_mode = 2
anchors_preset = 0 anchors_preset = 0
[node name="AnimationPlayer" type="AnimationPlayer" parent="cards/card_2"] [node name="AnimationPlayer" type="AnimationPlayer" parent="cards/card_2"]
@ -1788,13 +1783,9 @@ libraries = {
&"": SubResource("AnimationLibrary_oxheu") &"": SubResource("AnimationLibrary_oxheu")
} }
[node name="Card" type="Area2D" parent="cards/card_2"] [node name="Card" parent="cards/card_2" instance=ExtResource("2_t7byf")]
script = ExtResource("2_f4sp4")
text = "Slot 2"
metadata/_custom_type_script = "uid://2loic2eeec5b"
[node name="card_3" type="Control" parent="cards"] [node name="card_3" type="Control" parent="cards"]
layout_mode = 2
anchors_preset = 0 anchors_preset = 0
offset_left = 315.0 offset_left = 315.0
offset_top = 22.0 offset_top = 22.0
@ -1807,16 +1798,12 @@ libraries = {
&"": SubResource("AnimationLibrary_8blxm") &"": SubResource("AnimationLibrary_8blxm")
} }
[node name="Card" type="Area2D" parent="cards/card_3"] [node name="Card" parent="cards/card_3" instance=ExtResource("2_t7byf")]
script = ExtResource("2_f4sp4")
text = "Slot 3"
metadata/_custom_type_script = "uid://2loic2eeec5b"
[node name="sticky_notes" type="Panel" parent="."] [node name="sticky_notes" type="Panel" parent="."]
layout_mode = 2 layout_mode = 2
[node name="sticky_note_1" type="Control" parent="sticky_notes"] [node name="sticky_note_1" type="Control" parent="sticky_notes"]
layout_mode = 2
anchors_preset = 0 anchors_preset = 0
offset_top = -150.0 offset_top = -150.0
offset_bottom = -150.0 offset_bottom = -150.0
@ -1834,7 +1821,6 @@ text = "Slot 1"
metadata/_custom_type_script = "uid://r12efqgk6t4n" metadata/_custom_type_script = "uid://r12efqgk6t4n"
[node name="sticky_note_2" type="Control" parent="sticky_notes"] [node name="sticky_note_2" type="Control" parent="sticky_notes"]
layout_mode = 2
anchors_preset = 0 anchors_preset = 0
offset_top = -50.0 offset_top = -50.0
offset_bottom = -50.0 offset_bottom = -50.0
@ -1852,7 +1838,6 @@ text = "Slot 2"
metadata/_custom_type_script = "uid://r12efqgk6t4n" metadata/_custom_type_script = "uid://r12efqgk6t4n"
[node name="sticky_note_3" type="Control" parent="sticky_notes"] [node name="sticky_note_3" type="Control" parent="sticky_notes"]
layout_mode = 2
anchors_preset = 0 anchors_preset = 0
offset_top = 50.0 offset_top = 50.0
offset_bottom = 50.0 offset_bottom = 50.0
@ -1870,7 +1855,6 @@ text = "Slot 3"
metadata/_custom_type_script = "uid://r12efqgk6t4n" metadata/_custom_type_script = "uid://r12efqgk6t4n"
[node name="sticky_note_4" type="Control" parent="sticky_notes"] [node name="sticky_note_4" type="Control" parent="sticky_notes"]
layout_mode = 2
anchors_preset = 0 anchors_preset = 0
offset_top = 150.0 offset_top = 150.0
offset_bottom = 150.0 offset_bottom = 150.0

View File

@ -3,22 +3,21 @@ class_name CollectableUi
@onready var canvas_layer: CanvasLayer = %CanvasLayer @onready var canvas_layer: CanvasLayer = %CanvasLayer
signal open_board
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. ## The StoryPlayable to play when this memento is collected.
## Auto-discovered from the owner's %CanvasLayer, or can be set manually. ## Auto-discovered from the owner's %CanvasLayer, or can be set manually.
var story_playable: StoryPlayable var story_playable: StoryPlayable
@export var has_stage: bool = false:
set(focused):
if has_stage == focused: return
if focused:
has_stage = true
is_collapsed = false
if not visible: show()
else:
has_stage = false
get_viewport().gui_release_focus()
is_collapsed = true
@export var scene: Scenes.id = Scenes.id.YOUTH_DRAEVEN: @export var scene: Scenes.id = Scenes.id.YOUTH_DRAEVEN:
set(id): set(id):
@ -92,7 +91,6 @@ var story_playable: StoryPlayable
@onready var cn_label: RichTextLabel = %ContentNoteLabel @onready var cn_label: RichTextLabel = %ContentNoteLabel
@onready var animation_player: AnimationPlayer = %AnimationPlayer @onready var animation_player: AnimationPlayer = %AnimationPlayer
@export var is_collapsed: bool = true
@export var is_expanded: bool = false: @export var is_expanded: bool = false:
set(expanded): set(expanded):
if expanded != is_expanded: if expanded != is_expanded:
@ -141,13 +139,6 @@ var story_playable: StoryPlayable
collected_box.show() collected_box.show()
signal open_board
signal exit_room
signal playback_finished
#TODO implement proper scene skipping
signal scene_skipped(i: int)
func _ready() -> void: func _ready() -> void:
State.settings_changed.connect(_on_context_updated) State.settings_changed.connect(_on_context_updated)
%CollectButton.pressed.connect(collect_memento) %CollectButton.pressed.connect(collect_memento)
@ -170,10 +161,6 @@ func update_state() -> void:
_on_context_updated() _on_context_updated()
func try_reveal() -> bool: func try_reveal() -> bool:
#if is_exit and not State.active_save_game.is_childhood_board_complete: return false
#if not is_board:
# if (not Scenes.is_sequence_unlocked( self.scene )) or false: #FIXME only for testing!!!
# return false
if not visible or animation_player.get_animation("vanish") or animation_player.get_animation("vanish_all"): if not visible or animation_player.get_animation("vanish") or animation_player.get_animation("vanish_all"):
update_state() update_state()
visible = true visible = true
@ -181,15 +168,6 @@ func try_reveal() -> bool:
return true return true
return false return false
#func _process(_delta: float) -> void:
# if not visible or Engine.is_editor_hint(): return
# if Input.is_action_just_pressed("collect_memento_ui"):
# if not is_board:
# collect_memento()
# else:
# open_board.emit()
# elif Input.is_action_just_pressed("option_memento_ui"):
# is_expanded = true
#FIXME something was eating all my inputs, maybe I can use the more pretty pattern when I figure out the culprit #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: func _input(event: InputEvent) -> void:
@ -243,6 +221,10 @@ func collect_memento() -> void:
# Play the story # Play the story
await story_playable.play() await story_playable.play()
# Pick the cards
var picker := State.room.get_node("%Picker") as CardPicker
await picker.pick_cards(story_playable.scene_id, false)
# Hide the CanvasLayer when done # Hide the CanvasLayer when done
canvas_layer.hide() canvas_layer.hide()
@ -256,5 +238,7 @@ func collect_memento() -> void:
scene_skipped.emit(-1) scene_skipped.emit(-1)
is_collected = true is_collected = true
get_viewport().gui_release_focus()
# Signal that playback is finished so the InteractiveSprite can restore player control # Signal that playback is finished so the InteractiveSprite can restore player control
playback_finished.emit() playback_finished.emit()

View File

@ -6,6 +6,9 @@ signal finished
signal intro signal intro
signal emit_thunder signal emit_thunder
@export var scene_id : Scenes.id
#TODO properly implement animation taking stage, as it should do, disabling processing when it does not have stage. #TODO properly implement animation taking stage, as it should do, disabling processing when it does not have stage.
var max_lines: float = 0 var max_lines: float = 0

View File

@ -117,7 +117,7 @@ func _process(_delta):
#dhas_entered = false #dhas_entered = false
if Input.is_action_just_pressed("ui_accept"): if Input.is_action_just_pressed("ui_accept"):
# Pass focus to the collider if it has has_stage property # Pass focus to the collider if it has has_stage property
var collider = focus_ray.get_collider() var collider := focus_ray.get_collider()
if collider and "has_stage" in collider: if collider and "has_stage" in collider:
has_stage = false has_stage = false
collider.has_stage = true collider.has_stage = true

View File

@ -191,7 +191,7 @@ crouch={
[internationalization] [internationalization]
locale/translations=PackedStringArray("res://internationalisation.de.translation", "res://internationalisation.en.translation") locale/translations=PackedStringArray("res://internationalisation.de.translation", "res://internationalisation.en.translation", "res://internationalisation.es.translation", "res://internationalisation.ja.translation")
locale/test="de" locale/test="de"
[layer_names] [layer_names]