[gd_scene load_steps=9 format=3 uid="uid://d3pb25xuef2t2"]

[ext_resource type="Theme" uid="uid://b056fn288p8ha" path="res://logic-scenes/themes/easy-handwriting.theme" id="1_2apkb"]
[ext_resource type="Script" path="res://logic-scenes/collectable/collectable_ui.gd" id="1_tgjc2"]
[ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://import/interface-elements/frame.png" id="3_63j61"]

[sub_resource type="GDScript" id="GDScript_g0qhf"]
script/source = "@tool
extends Button

func hide():
    if visible == true and not State.reduce_motion:
        var tween:Tween = create_tween()
        custom_minimum_size = get_minimum_size()
        var tmp = text
        text = \"\"
        tween.tween_property(self, \"custom_minimum_size\", Vector2(size.x, 0), 0.2)
        update_minimum_size()    
        await tween.finished
        visible = false
        text = tmp
        update_minimum_size()
    else:
        visible = false
    
func show():
    if visible == false and not State.reduce_motion:
        var tmp = text
        var tween:Tween = create_tween()    
        if is_instance_valid(tween):
            tween.tween_property(self, \"custom_minimum_size\", get_minimum_size(), 0.2)
            text = \"\"
            update_minimum_size()
            visible = true
            await tween.finished
            text = tmp
        
    else:
        visible = true
    
"

[sub_resource type="Animation" id="Animation_rhsmi"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Panel/Content/Buttons:custom_minimum_size")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 256)]
}

[sub_resource type="Animation" id="Animation_bq4rh"]
resource_name = "invisible"
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Panel/Content/Buttons:custom_minimum_size")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(0, 0)]
}

[sub_resource type="Animation" id="Animation_rx43a"]
resource_name = "show_buttons"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Panel/Content/Buttons:custom_minimum_size")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.4, 0.6),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(0, 0), Vector2(0, 135), Vector2(0, 130)]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_jad23"]
_data = {
"RESET": SubResource("Animation_rhsmi"),
"invisible": SubResource("Animation_bq4rh"),
"show_buttons": SubResource("Animation_rx43a")
}

[node name="CollectableUi" type="CenterContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_2apkb")
script = ExtResource("1_tgjc2")
scene = null

[node name="Panel" type="PanelContainer" parent="."]
clip_children = 2
layout_mode = 2

[node name="Content" type="VBoxContainer" parent="Panel"]
layout_mode = 2

[node name="Name" type="Label" parent="Panel/Content"]
layout_mode = 2
theme_type_variation = &"HeaderLarge"
horizontal_alignment = 1

[node name="ContentNotes" type="RichTextLabel" parent="Panel/Content"]
visible = false
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
bbcode_enabled = true
fit_content = true

[node name="Buttons" type="ScrollContainer" parent="Panel/Content"]
custom_minimum_size = Vector2(0, 256)
layout_mode = 2
horizontal_scroll_mode = 0
vertical_scroll_mode = 3

[node name="VBoxContainer" type="VBoxContainer" parent="Panel/Content/Buttons"]
custom_minimum_size = Vector2(350, 0)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="collect_or_listen" type="Button" parent="Panel/Content/Buttons/VBoxContainer"]
layout_mode = 2
tooltip_text = "Take this with you, and listen to it's story."
text = "Order Thoughts"
script = SubResource("GDScript_g0qhf")

[node name="Summary" type="Button" parent="Panel/Content/Buttons/VBoxContainer"]
visible = false
layout_mode = 2
tooltip_text = "Take this with you, but get a neutral description of it's story."
text = "get neutral summary"
script = SubResource("GDScript_g0qhf")

[node name="skip" type="Button" parent="Panel/Content/Buttons/VBoxContainer"]
visible = false
layout_mode = 2
tooltip_text = "Choose this to entirely skip this Item without being unable to progress in the story. Skipped Segments can still be interacted with via the Pause Screen, if you decide to change your mind."
text = "skip"
script = SubResource("GDScript_g0qhf")

[node name="put_back" type="Button" parent="Panel/Content/Buttons/VBoxContainer"]
visible = false
layout_mode = 2
text = "put back"
script = SubResource("GDScript_g0qhf")

[node name="Control" type="Control" parent="Panel"]
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 0

[node name="StartFrame" type="TextureRect" parent="Panel/Control"]
layout_mode = 2
offset_left = -330.0
offset_top = -8.0
offset_right = 7.0
offset_bottom = 284.0
mouse_filter = 2
texture = ExtResource("3_63j61")
expand_mode = 2
stretch_mode = 4

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_jad23")
}
autoplay = "invisible"

[connection signal="focus_entered" from="Panel/Content/Buttons/VBoxContainer/collect_or_listen" to="." method="_yoink_focus"]
[connection signal="pressed" from="Panel/Content/Buttons/VBoxContainer/collect_or_listen" to="." method="_on_pick_button_pressed"]
[connection signal="focus_entered" from="Panel/Content/Buttons/VBoxContainer/Summary" to="." method="_yoink_focus"]
[connection signal="focus_entered" from="Panel/Content/Buttons/VBoxContainer/skip" to="." method="_yoink_focus"]
[connection signal="pressed" from="Panel/Content/Buttons/VBoxContainer/skip" to="." method="_on_skip_pressed"]
[connection signal="focus_entered" from="Panel/Content/Buttons/VBoxContainer/put_back" to="." method="_yoink_focus"]
