Merge remote-tracking branch 'origin/main' into adi_dev

This commit is contained in:
Adrian Schmid 2023-07-18 19:01:41 +02:00
commit 8be2560943
14 changed files with 215 additions and 110 deletions

View File

@ -26,7 +26,14 @@ func _on_mouse_entered():
has_mouse = true
func _on_mouse_exited():
assert(false)
print("mouse_exited")
input_ray_pickable = true
ui.collapsed = true
has_mouse = false
func reveal():
revealed = true
func collapse():
_on_mouse_exited()
revealed = false

View File

@ -625,7 +625,7 @@ tracks/41/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
"values": [false]
}
tracks/42/type = "value"
tracks/42/imported = false
@ -1030,6 +1030,20 @@ tracks/18/keys = {
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
tracks/19/type = "method"
tracks/19/imported = false
tracks/19/enabled = true
tracks/19/path = NodePath("ScenePlayer")
tracks/19/interp = 1
tracks/19/loop_wrap = true
tracks/19/keys = {
"times": PackedFloat32Array(138.4),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"on_draeven_done"
}]
}
[sub_resource type="Animation" id="Animation_1pmhi"]
resource_name = "intro"
@ -1504,8 +1518,6 @@ script/source = "extends AnimationPlayer
var has_stage
signal draeven_beginning
func start_soundtrack():
$Moving.play(70)
$Childhood.play(70)
@ -1536,9 +1548,6 @@ func on_jui_jutsu_done():
func on_draeven_done():
get_tree().call_group(\"animation_player\", \"scene_finished\", Scenes.id.YOUTH_DRAEVEN)
func on_draeven_beginning():
emit_signal(\"draeven_fade\")
func scene_finished(_id):
play(\"RESET\")
"
@ -1942,10 +1951,9 @@ auto_exposure_enabled = true
auto_exposure_scale = 0.2
dof_blur_far_distance = 0.4
dof_blur_far_transition = 0.2
dof_blur_near_enabled = true
dof_blur_near_distance = 6.0
dof_blur_near_transition = 2.0
dof_blur_amount = 0.4
dof_blur_amount = 0.0
auto_exposure_min_sensitivity = 100.0
[sub_resource type="GDScript" id="GDScript_wb8kg"]
@ -1957,8 +1965,11 @@ func _ready():
func focus_env():
var dof_strength_tween: Tween = create_tween()
dof_strength_tween.tween_property(camera_attributes, \"dof_blur_amount\", 0, 1)
await(dof_strength_tween.finished)
camera_attributes.dof_blur_near_enabled = false
func focus_object():
camera_attributes.dof_blur_near_enabled = true
var dof_strength_tween: Tween = create_tween()
dof_strength_tween.tween_property(camera_attributes, \"dof_blur_amount\", 0.4, 1)
@ -1966,7 +1977,7 @@ func play_scene(_id: int):
focus_object()
func scene_finished(_id: int):
focus_env()
pass
"
[sub_resource type="QuadMesh" id="QuadMesh_n875y"]
@ -2070,10 +2081,6 @@ shape = SubResource("BoxShape3D_wdkxn")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.02419, 1.06708, 2.75985)
shape = SubResource("BoxShape3D_3lwkl")
[node name="Wall2" type="CollisionShape3D" parent="logic/colission/Room_Colission"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.64826, 1.06708, 2.75985)
shape = SubResource("BoxShape3D_3lwkl")
[node name="Wall3" type="CollisionShape3D" parent="logic/colission/Room_Colission"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.254488, 1.06708, 3.24245)
shape = SubResource("BoxShape3D_3lwkl")
@ -2183,7 +2190,7 @@ visible = false
layout_mode = 1
[node name="ScenePlayer" type="AnimationPlayer" parent="logic" groups=["animation_player"]]
autoplay = "draeven"
autoplay = "RESET"
libraries = {
"": SubResource("AnimationLibrary_ilekd")
}
@ -2471,7 +2478,6 @@ layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
mouse_filter = 2
scroll_vertical = 638
horizontal_scroll_mode = 0
vertical_scroll_mode = 3
@ -2556,6 +2562,7 @@ scale = Vector2(0.4, 0.4)
texture = ExtResource("12_xnele")
[node name="draeven" type="CenterContainer" parent="logic/ScenePlayer"]
visible = false
modulate = Color(1, 1, 1, 0)
anchors_preset = 15
anchor_right = 1.0
@ -2600,7 +2607,6 @@ layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
mouse_filter = 0
scroll_vertical = 150
horizontal_scroll_mode = 0
vertical_scroll_mode = 3
@ -2670,7 +2676,7 @@ light_size = 1.0
light_cull_mask = 4294967293
[node name="Luna_frame-of-mind" parent="logic/ScenePlayer/draeven" instance=ExtResource("27_pb1jl")]
transform = Transform3D(0.958899, 0, 0.283747, 0, 1, 0, -0.283747, 0, 0.958899, -10.1552, 14.9384, -16.2182)
transform = Transform3D(0.958898, 0, 0.283747, 0, 1, 0, -0.283747, 0, 0.958898, -10.1552, 14.9384, -16.2182)
visible = false
[node name="OmniLight3D" type="OmniLight3D" parent="logic/ScenePlayer/draeven/Luna_frame-of-mind"]
@ -2833,10 +2839,7 @@ render_target_update_mode = 4
[node name="Collectable_ui" parent="logic/Draeven-interaction/UiWrapper/UiSprite/SubViewport" instance=ExtResource("11_jxai0")]
visible = false
scene = 3
is_story = true
item_name = "Starlight"
content_notes = "Alienation"
item_name = "Mind Board"
[node name="HoverDetect" type="CollisionShape3D" parent="logic/Draeven-interaction"]
transform = Transform3D(1, 0, 2.98023e-08, 0, 1, 0, -2.98023e-08, 0, 1, 0, -0.237872, 0)

View File

@ -27,7 +27,7 @@ text = "but at least I get good grades."
[node name="p_upset_peers" parent="childhood/c_homework" groups=["c_Joy", "c_backlash", "c_boy_stuff", "c_comic_heroes", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "and my peers were upset about that."
text = "my peers were upset about that."
[node name="c_teachers" parent="childhood" instance=ExtResource("1_xrckx")]
position = Vector2(0, 300)
@ -45,11 +45,11 @@ text = "maybe I want to become a teacher."
position = Vector2(0, 600)
text = "I can put ages into things I enjoy "
[node name="p_worried_mother" parent="childhood/c_Joy" groups=["c_body", "c_boy_stuff", "c_comic_heroes", "c_homework", "c_teachers"] instance=ExtResource("2_ucudl")]
[node name="p_worried_mother" parent="childhood/c_Joy" groups=["c_Joy", "c_body", "c_boy_stuff", "c_comic_heroes", "c_homework", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "my mother would be worried about that"
[node name="p_thomas" parent="childhood/c_Joy" groups=["c_backlash", "c_comic_heroes", "c_homework", "c_teachers"] instance=ExtResource("2_ucudl")]
[node name="p_thomas" parent="childhood/c_Joy" groups=["c_Joy", "c_backlash", "c_comic_heroes", "c_homework", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "Mr Thomas thinks that makes me gifted."
@ -67,7 +67,7 @@ text = "Comic heroes are my role models "
position = Vector2(-32, 50)
text = "when I put in the effort, I can make the world a better place"
[node name="p_upset_peers" parent="voice_training/c_comic_heroes" groups=["c_Joy", "c_body", "c_boy_stuff", "c_hit"] instance=ExtResource("2_ucudl")]
[node name="p_agent_q" parent="voice_training/c_comic_heroes" groups=["c_Joy", "c_body", "c_boy_stuff", "c_hit"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "and I want to be like agent q!"
@ -75,9 +75,9 @@ text = "and I want to be like agent q!"
position = Vector2(0, 300)
text = "I like boy stuff "
[node name="p_slut" parent="voice_training/c_boy_stuff" groups=["c_Joy", "c_body", "c_hit", "c_homework", "c_teachers"] instance=ExtResource("2_ucudl")]
[node name="p_pretending" parent="voice_training/c_boy_stuff" groups=["c_Joy", "c_body", "c_hit", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "others think I only pretend to."
text = "yet they think I'm just pretending"
[node name="p_girls" parent="voice_training/c_boy_stuff" groups=["c_Joy", "c_body", "c_comic_heroes", "c_hit", "c_homework", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
@ -85,11 +85,11 @@ text = "and girls don't get that."
[node name="c_backlash" parent="voice_training" instance=ExtResource("1_xrckx")]
position = Vector2(0, 600)
text = "Despite the backlash, I protected Joyo in front of class "
text = "Despite the backlash, I protected my friend"
[node name="p_cross_friend" parent="voice_training/c_backlash" groups=["c_Joy", "c_boy_stuff", "c_comic_heroes", "c_hit"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "I would never cross a friend, even if it was for my own good."
text = "I wouldn't never not do that, even if it was for my own good"
[node name="p_reward" parent="voice_training/c_backlash" groups=["c_Joy"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
@ -136,41 +136,83 @@ text = "… I was wet, so I must have been into it."
position = Vector2(-32, 140)
text = "… I didnt say stop."
[node name="test" type="Control" parent="."]
[node name="draeven" type="Control" parent="."]
anchors_preset = 0
offset_left = 1234.0
offset_top = 141.0
offset_right = 1274.0
offset_bottom = 181.0
[node name="c_random1" parent="test" instance=ExtResource("1_xrckx")]
[node name="c_out-of-world" parent="draeven" instance=ExtResource("1_xrckx")]
text = "I feel like I am not from of this world"
[node name="p_random11" parent="test/c_random1" groups=["c_boy_stuff"] instance=ExtResource("2_ucudl")]
[node name="p_random11" parent="draeven/c_out-of-world" groups=["c_boy_stuff"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "I like being unique like that"
[node name="p_random12" parent="draeven/c_out-of-world" instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "I am thankful for the few friends that get me"
[node name="c_rejection" parent="draeven" instance=ExtResource("1_xrckx")]
position = Vector2(0, 300)
text = "I fear being rejected"
[node name="p_friends" parent="draeven/c_rejection" groups=["c_Joy", "c_backlash", "c_boy_stuff", "c_comic_heroes", "c_homework"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "that makes it hard to find friends"
[node name="p_laughed" parent="draeven/c_rejection" groups=["c_Joy", "c_backlash", "c_boy_stuff", "c_comic_heroes", "c_homework", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "I'm afraid I will just get laughed at"
[node name="c_confusion" parent="draeven" instance=ExtResource("1_xrckx")]
position = Vector2(0, 600)
text = "I am just too many things at once"
[node name="p_random21" parent="draeven/c_confusion" groups=["c_void"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "it is just so overwhealming for me"
[node name="p_random22" parent="draeven/c_confusion" groups=["c_void"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "this is just too much for others"
[node name="test2" type="Control" parent="."]
anchors_preset = 0
offset_left = 1610.0
offset_top = 141.0
offset_right = 1650.0
offset_bottom = 181.0
[node name="c_random1" parent="test2" instance=ExtResource("1_xrckx")]
[node name="p_random11" parent="test2/c_random1" groups=["c_boy_stuff"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "random 1"
[node name="p_random12" parent="test/c_random1" instance=ExtResource("2_ucudl")]
[node name="p_random12" parent="test2/c_random1" instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "random 1"
[node name="c_pick" parent="test" instance=ExtResource("1_xrckx")]
[node name="c_pick" parent="test2" instance=ExtResource("1_xrckx")]
position = Vector2(0, 300)
[node name="p_pick" parent="test/c_pick" groups=["c_Joy", "c_backlash", "c_boy_stuff", "c_comic_heroes", "c_homework"] instance=ExtResource("2_ucudl")]
[node name="p_pick" parent="test2/c_pick" groups=["c_Joy", "c_backlash", "c_boy_stuff", "c_comic_heroes", "c_homework"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "pick me 2"
[node name="p_goof" parent="test/c_pick" groups=["c_Joy", "c_backlash", "c_boy_stuff", "c_comic_heroes", "c_homework", "c_teachers"] instance=ExtResource("2_ucudl")]
[node name="p_goof" parent="test2/c_pick" groups=["c_Joy", "c_backlash", "c_boy_stuff", "c_comic_heroes", "c_homework", "c_teachers"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "you done goofed"
[node name="c_random2" parent="test" instance=ExtResource("1_xrckx")]
[node name="c_random2" parent="test2" instance=ExtResource("1_xrckx")]
position = Vector2(0, 600)
[node name="p_random21" parent="test/c_random2" groups=["c_void"] instance=ExtResource("2_ucudl")]
[node name="p_random21" parent="test2/c_random2" groups=["c_void"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 50)
text = "random 2"
[node name="p_random22" parent="test/c_random2" groups=["c_void"] instance=ExtResource("2_ucudl")]
[node name="p_random22" parent="test2/c_random2" groups=["c_void"] instance=ExtResource("2_ucudl")]
position = Vector2(-32, 140)
text = "random 2"

View File

@ -27,8 +27,21 @@ var has_stage = false:
@onready var postit_container = $HBoxContainer/ScrollContainer/VBoxContainer
@onready var board_of_devs = $"board of devs"
@onready var base_postit_panel = $HBoxContainer/ScrollContainer/VBoxContainer/Panel
@onready var empty_text = $emptyText
@onready var active_context = ui_context.DROPZONE # 0 = dropzone, 1 = post it list
@onready var instructions = $instructions_panel/HBoxContainer/cards_remaining
var mementos_collected: int = 0:
set(mementos):
mementos_collected = mementos
match mementos:
1:
instructions.text = "There are three Mementos left to find."
2:
instructions.text = "You have collected half of the mementos."
3:
instructions.text = "Find the last Memento to complete the Board."
4:
instructions.text = "Combine cards to order your thoughts."
var currently_selected_node: Area2D = null
var currently_selected_card_for_assigning: Area2D = null
@ -62,12 +75,13 @@ func _process(delta):
# we should maybe consider moving this to _input() for consistency
if Input.is_action_just_pressed("ui_cancel"):
populate_board(["c_Joy","p_effort","c_backlash","c_body","c_hit","p_slut","p_worried_mother","p_cross_friend"])
populate_board(["c_Joy","p_effort","c_backlash","c_body","c_void","p_reward","p_worried_mother","p_cross_friend"])
# Will be used later to spawn Cards and Post-Its and remember them in the dictionary
func populate_board(card_names: Array):
empty_text.visible = false
mementos_collected += 1
var all_cards = Array()
var all_postits = Array()
@ -172,6 +186,7 @@ func handle_mouse_button(to_handle: Area2D, input: InputEvent):
"post-it": # 2 = PostIt
if input.is_pressed():
to_handle.reparent(dropzone)
to_handle.on_board = true
to_handle.set_owner(self) # needs to be here otherwise the owner disappears
area_dict["post_its_in_list"].erase(to_handle)
area_dict["dropzone_content"].push_back(to_handle)
@ -195,12 +210,15 @@ func handle_mouse_button(to_handle: Area2D, input: InputEvent):
# Logic for attaching a postit to a card. Also reset postit positions if the card cannot be attached
func attach_postit_to_card(postit: Area2D, card: Area2D, update_dict = false):
if postit.is_in_group(card.name):
if card.has_postit_attached():
if active_context == ui_context.ASSIGN_POST_IT:
_return_postit_to_panels(postit) # don't attach if card has already a post-it attached
return
postit.reparent(card)
postit.on_board = false
postit.set_owner(self)
postit.position = card.get_child(3).position
@ -361,6 +379,7 @@ func _return_postit_to_panels(post_it: Area2D):
for panel in area_dict["post_it_panels"]:
if panel.get_child_count() == 1:
area_dict["dropzone_content"].erase(post_it)
post_it.on_board = false
area_dict["post_its_in_list"].push_back(post_it)
post_it.tween_transform_to(panel.get_child(0).position)
post_it.rotation = post_it.base_rotation

View File

@ -98,7 +98,7 @@ func _process(delta: float) -> void:
if area is Card or area is CardCollider:
if area is CardCollider:
position += area.direction * delta
elif not area.highlighted:
elif not area.highlighted or self.highlighted:
var diff:Vector2 = position - area.position
position -= diff.normalized() * ((diff.length()-diameter)/diameter) * bounce_speed * (delta/(1.0/60))
@ -143,9 +143,10 @@ func _on_input_event(viewport, event, shape_idx):
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT:
if is_dragable and "handle_mouse_button" in owner:
if "handle_mouse_button" in owner:
mouse_offset = (get_viewport().get_mouse_position() - position)
if highlighted: owner.handle_mouse_button(self, event)
if highlighted:
owner.handle_mouse_button(self, event)
func _move_card():
if is_dragged:

View File

@ -70,7 +70,14 @@ var void_active:
void_active = become_void
func _process(delta):
if void_active != $GPUParticles2D.is_void:
$GPUParticles2D.is_void = void_active
$GPUParticles2D.emitting = void_active
$Sprite2D.is_void = void_active
if void_active and not State.reduce_motion:
noise_position += delta * 10
var random_position = Vector2(noise.get_noise_1d(noise_position*2), noise.get_noise_1d(-noise_position))

View File

@ -12,12 +12,12 @@ shader = ExtResource("1_ggnth")
shader_parameter/magic_scale_factor = 1500.0
shader_parameter/tex = ExtResource("1_8brxc")
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ivo5o"]
size = Vector2(4249, 766.5)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_5ri3m"]
size = Vector2(4262, 766.5)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ivo5o"]
size = Vector2(4249, 766.5)
[node name="board" type="PanelContainer"]
material = SubResource("ShaderMaterial_ttqei")
clip_contents = true
@ -75,15 +75,6 @@ process_mode = 4
visible = false
layout_mode = 2
[node name="border_right" type="Area2D" parent="."]
position = Vector2(1872, 461)
script = ExtResource("6_wpxls")
direction = Vector2(-100, 0)
[node name="CollisionShape2D" type="CollisionShape2D" parent="border_right"]
rotation = 1.5708
shape = SubResource("RectangleShape2D_ivo5o")
[node name="up" type="Control" parent="."]
layout_mode = 2
size_flags_horizontal = 4
@ -94,7 +85,7 @@ script = ExtResource("6_wpxls")
direction = Vector2(0, 100)
[node name="CollisionShape2D" type="CollisionShape2D" parent="up/border_up"]
position = Vector2(-58, -423)
position = Vector2(-58, -369)
shape = SubResource("RectangleShape2D_5ri3m")
[node name="left" type="Control" parent="."]
@ -107,7 +98,7 @@ script = ExtResource("6_wpxls")
direction = Vector2(100, 0)
[node name="CollisionShape2D" type="CollisionShape2D" parent="left/border_left"]
position = Vector2(-476, -22.5)
position = Vector2(-371, -21.5)
rotation = 1.5708
shape = SubResource("RectangleShape2D_ivo5o")
@ -121,7 +112,7 @@ script = ExtResource("6_wpxls")
direction = Vector2(0, -100)
[node name="CollisionShape2D" type="CollisionShape2D" parent="down/border_down"]
position = Vector2(2, 416)
position = Vector2(2, 377)
shape = SubResource("RectangleShape2D_5ri3m")
[node name="right" type="Control" parent="."]
@ -134,23 +125,29 @@ script = ExtResource("6_wpxls")
direction = Vector2(-100, 0)
[node name="CollisionShape2D" type="CollisionShape2D" parent="right/border_left"]
position = Vector2(12, 13)
position = Vector2(20, 13)
rotation = 1.5708
shape = SubResource("RectangleShape2D_ivo5o")
[node name="emptyText" type="Label" parent="."]
modulate = Color(0, 0, 0, 1)
[node name="instructions_panel" type="PanelContainer" parent="."]
layout_mode = 2
theme_override_font_sizes/font_size = 50
text = "Collect mementos to fill board with cards."
size_flags_horizontal = 4
size_flags_vertical = 0
[node name="HBoxContainer" type="HBoxContainer" parent="instructions_panel"]
layout_mode = 2
[node name="VSeparator2" type="VSeparator" parent="instructions_panel/HBoxContainer"]
custom_minimum_size = Vector2(15, 0)
layout_mode = 2
[node name="cards_remaining" type="Label" parent="instructions_panel/HBoxContainer"]
layout_mode = 2
size_flags_vertical = 0
text = "Collect Mementos to fill the mind-board."
horizontal_alignment = 1
vertical_alignment = 1
[node name="disclaimer" type="Label" parent="."]
modulate = Color(0, 0, 0, 1)
[node name="VSeparator" type="VSeparator" parent="instructions_panel/HBoxContainer"]
custom_minimum_size = Vector2(15, 0)
layout_mode = 2
size_flags_vertical = 0
theme_override_font_sizes/font_size = 40
text = "alpha: Gamepad compatibility is limited. Using a mouse to move cards is advised."
horizontal_alignment = 1
vertical_alignment = 1

View File

@ -51,6 +51,10 @@ var is_dragged: bool = false:
var mouse_offset: Vector2
@onready var diameter = $CollisionShape2D.shape.height
@export_range(1.0, 10.0) var bounce_speed: float = 8
var on_board = false
func _ready() -> void:
self.set_meta("type", "post-it") # set type information to find out if this node is a post-it
@ -63,8 +67,22 @@ func replace_with(postit: PostIt):
self.text = postit.text
self.voice_line = postit.voice_line
self.sibling = postit.sibling
self.name = postit.name
for group in self.get_groups():
self.remove_from_group(group)
for group in postit.get_groups():
self.add_to_group(group)
func _process(delta: float) -> void:
if get_overlapping_areas().size() > 0 and is_dragable and on_board:
for area in get_overlapping_areas():
if area is Card or area is CardCollider:
if area is CardCollider:
position += area.direction * delta
elif not area.highlighted or self.highlighted:
var diff:Vector2 = position - area.position
position -= diff.normalized() * ((diff.length()-diameter)/diameter) * bounce_speed * (delta/(1.0/60))
func _process(_delta: float) -> void:
_move_post_it()
@ -91,7 +109,7 @@ func _on_input_event(viewport, event, shape_idx):
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT:
if is_dragable and "handle_mouse_button" in owner:
if "handle_mouse_button" in owner:
mouse_offset = (get_viewport().get_mouse_position() - global_position)
owner.handle_mouse_button(self, event)

View File

@ -4,6 +4,7 @@ extends CenterContainer
enum {
INI,
CARDS,
CARDS_SELECTED,
TRANSITION,
POSTS,
DONE
@ -24,9 +25,11 @@ var has_stage = false:
self.hide()
has_stage = focus
var selection_state = INI
var input_locked = true
var _input_locked = true
var selection_state = INI:
set(state):
selection_state = state
_input_locked = !(state == CARDS or state == POSTS)
var anim_players:Array
var curr_selection_id: int = -1:
@ -51,6 +54,8 @@ signal cards_picked(Array)
# Called when the node enters the scene tree for the first time.
func _ready():
if get_parent() == get_tree().root: selection_state = CARDS
var card_controls = $cards.get_children()
for control in card_controls:
options.append(control.get_child(1))
@ -58,13 +63,12 @@ func _ready():
fill_card_slots(0)
input_locked = false
func fill_card_slots(id: int):
for i in range($cards.get_child_count()):
var card:Card = $cards.get_child(i).get_child(1)
card.replace_with(debug_board.get_child(id).get_child(i) as Card)
card.connect("mouse_entered", Callable(self, "get_highlight"))
card.owner = self
func fill_post_slots():
var post_its: Array[PostIt] = []
@ -74,9 +78,10 @@ func fill_post_slots():
for i in range(post_its.size()):
options[i].replace_with(post_its[i])
options[i].owner = self
func _unhandled_input(event):
if has_stage and not input_locked:
if has_stage and not _input_locked:
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
elif event.is_action_pressed("ui_down") or event.is_action_pressed("ui_right") or event.is_action_pressed("ui_focus_prev"):
@ -91,7 +96,10 @@ func pick(id: int):
curr_selection_id = 0
return
input_locked = true
if selection_state == CARDS:
selection_state = CARDS_SELECTED
elif selection_state == POSTS:
selection_state = DONE
anim_players[id].play("pick")
var yield_to = anim_players[id].animation_finished
@ -123,7 +131,7 @@ func pick(id: int):
await yield_to
if selection_state == CARDS:
if selection_state == CARDS_SELECTED:
selection_state = TRANSITION
options = []
anim_players = []
@ -137,8 +145,7 @@ func pick(id: int):
await anim_players[0].animation_finished
selection_state = POSTS
input_locked = false
else:
elif selection_state == DONE:
var out_str:Array[String] = []
for card in output:
out_str.append(card.name)
@ -146,15 +153,14 @@ func pick(id: int):
State.leave_stage(self)
func handle_hover(new_highlight):
if not input_locked:
if not _input_locked:
curr_selection_id = options.find(new_highlight)
func handle_mouse_button(new_selection: Node, button_event: InputEventMouseButton):
if not input_locked:
if not _input_locked:
if button_event.button_index == MOUSE_BUTTON_LEFT and button_event.pressed:
pick(options.find(new_selection))
func scene_finished(id: int):
fill_card_slots(id)
State.transition_stage_to(self)

View File

@ -1531,7 +1531,7 @@ offset_top = -150.0
offset_bottom = -150.0
[node name="AnimationPlayer" type="AnimationPlayer" parent="postIts/postIt_1"]
root_node = NodePath("../post-it")
root_node = NodePath(".")
autoplay = "ini"
libraries = {
"": SubResource("AnimationLibrary_ga4dm")
@ -1547,7 +1547,7 @@ offset_top = -50.0
offset_bottom = -50.0
[node name="AnimationPlayer" type="AnimationPlayer" parent="postIts/postIt_2"]
root_node = NodePath("../post-it")
root_node = NodePath(".")
autoplay = "ini"
libraries = {
"": SubResource("AnimationLibrary_sxnmi")
@ -1563,7 +1563,7 @@ offset_top = 50.0
offset_bottom = 50.0
[node name="AnimationPlayer" type="AnimationPlayer" parent="postIts/postIt_3"]
root_node = NodePath("../post-it")
root_node = NodePath(".")
autoplay = "ini"
libraries = {
"": SubResource("AnimationLibrary_xs06v")
@ -1579,7 +1579,7 @@ offset_top = 150.0
offset_bottom = 150.0
[node name="AnimationPlayer" type="AnimationPlayer" parent="postIts/postIt_4"]
root_node = NodePath("../post-it")
root_node = NodePath(".")
autoplay = "ini"
libraries = {
"": SubResource("AnimationLibrary_tdl1s")
@ -1589,5 +1589,6 @@ libraries = {
text = "Post 4"
[node name="board of devs" parent="." instance=ExtResource("4_1kvte")]
process_mode = 4
visible = false
layout_mode = 2

View File

@ -162,6 +162,7 @@ func _input(event:InputEvent):
if event.button_index == MOUSE_BUTTON_RIGHT and event.pressed:
if !Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT):
State.take_stage(self, true)
get_tree().call_group("interactables", "collapse")
func play_scene(id: int):
if id == Scenes.id.YOUTH_DRAEVEN:

View File

@ -29,7 +29,6 @@ grow_vertical = 2
texture = ExtResource("1_0oiki")
[node name="youth room" parent="." instance=ExtResource("2_23ia3")]
visible = false
[node name="Main Menu" type="Panel" parent="."]
anchors_preset = 15
@ -77,6 +76,7 @@ offset_bottom = 35.0
script = SubResource("GDScript_8sq0u")
[node name="Startup Menu" parent="." instance=ExtResource("1_v5rpm")]
visible = false
[node name="Disclaimer" parent="." instance=ExtResource("7_t45fc")]

View File

@ -43,7 +43,10 @@ func leave_stage(actor:Object, dropObject: bool = false) -> bool:
stage_list.erase(actor)
if stage_list != []:
stage_list.front().has_stage = true
else:
get_tree().quit()
return false