[gd_scene load_steps=10 format=3 uid="uid://ccsihk3yxwei5"]

[ext_resource type="PackedScene" uid="uid://3pmb60gpst7b" path="res://src/UI/Nodes/TransparentChecker.tscn" id="1"]
[ext_resource type="Shader" path="res://src/Shaders/TransparentChecker.gdshader" id="2"]
[ext_resource type="Script" path="res://src/UI/Canvas/CameraMovement.gd" id="3"]
[ext_resource type="Script" path="res://src/UI/CanvasPreviewContainer/CanvasPreviewContainer.gd" id="4"]
[ext_resource type="PackedScene" uid="uid://c546tskdu53j1" path="res://src/UI/Canvas/CanvasPreview.tscn" id="5"]
[ext_resource type="Texture2D" uid="uid://c7smxwfa8826j" path="res://assets/graphics/timeline/play.png" id="6"]
[ext_resource type="PackedScene" uid="uid://cii2hpylme60s" path="res://src/UI/Nodes/CollapsibleContainer.tscn" id="7"]
[ext_resource type="Script" path="res://src/UI/Nodes/ValueSlider.gd" id="8"]

[sub_resource type="ShaderMaterial" id="1"]
shader = ExtResource("2")
shader_parameter/size = 10.0
shader_parameter/alpha = 1.0
shader_parameter/color1 = Color(0.7, 0.7, 0.7, 1)
shader_parameter/color2 = Color(1, 1, 1, 1)
shader_parameter/offset = Vector2(0, 0)
shader_parameter/scale = Vector2(0, 0)
shader_parameter/rect_size = Vector2(0, 0)
shader_parameter/follow_movement = false
shader_parameter/follow_scale = false

[node name="CanvasPreviewContainer" type="PanelContainer"]
custom_minimum_size = Vector2(0, 110)
offset_right = 328.0
offset_bottom = 174.0
script = ExtResource("4")

[node name="VBox" type="VBoxContainer" parent="."]
layout_mode = 2

[node name="HBox" type="HBoxContainer" parent="VBox"]
layout_mode = 2
size_flags_vertical = 3

[node name="VBoxContainer" type="VBoxContainer" parent="VBox/HBox"]
layout_mode = 2

[node name="Label" type="Label" parent="VBox/HBox/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 4
text = "+"

[node name="PreviewZoomSlider" type="VSlider" parent="VBox/HBox/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 3
mouse_default_cursor_shape = 2
min_value = 1.0
max_value = 5.0
step = 0.01
value = 1.0

[node name="Label2" type="Label" parent="VBox/HBox/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 4
text = "-"

[node name="PreviewViewportContainer" type="SubViewportContainer" parent="VBox/HBox"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
stretch = true

[node name="SubViewport" type="SubViewport" parent="VBox/HBox/PreviewViewportContainer"]
transparent_bg = true
handle_input_locally = false
canvas_item_default_texture_filter = 0
size = Vector2i(308, 139)
render_target_update_mode = 4

[node name="TransparentChecker" parent="VBox/HBox/PreviewViewportContainer/SubViewport" instance=ExtResource("1")]
material = SubResource("1")
anchors_preset = 0

[node name="CanvasPreview" parent="VBox/HBox/PreviewViewportContainer/SubViewport" instance=ExtResource("5")]
unique_name_in_owner = true

[node name="CameraPreview" type="Camera2D" parent="VBox/HBox/PreviewViewportContainer/SubViewport"]
unique_name_in_owner = true
offset = Vector2(32, 32)
zoom = Vector2(0.15, 0.15)
script = ExtResource("3")
index = 2

[node name="Animation" type="HBoxContainer" parent="VBox"]
layout_mode = 2

[node name="PlayButton" type="Button" parent="VBox/Animation" groups=["UIButtons"]]
unique_name_in_owner = true
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
size_flags_vertical = 4
mouse_default_cursor_shape = 2
toggle_mode = true

[node name="TextureRect" type="TextureRect" parent="VBox/Animation/PlayButton"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -3.5
offset_top = -6.0
offset_right = 3.5
offset_bottom = 6.0
mouse_default_cursor_shape = 2
texture = ExtResource("6")

[node name="VBoxContainer" type="VBoxContainer" parent="VBox/Animation"]
layout_mode = 2
size_flags_horizontal = 3

[node name="Mode" type="HBoxContainer" parent="VBox/Animation/VBoxContainer"]
layout_mode = 2

[node name="Label" type="Label" parent="VBox/Animation/VBoxContainer/Mode"]
layout_mode = 2
text = "Animation mode:"

[node name="OptionButton" type="OptionButton" parent="VBox/Animation/VBoxContainer/Mode"]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
clip_text = true
item_count = 2
selected = 0
popup/item_0/text = "All frames"
popup/item_0/id = 0
popup/item_1/text = "Current frame as spritesheet"
popup/item_1/id = 1

[node name="Options" parent="VBox/Animation/VBoxContainer" instance=ExtResource("7")]
visible = false
layout_mode = 2
text = "Spritesheet options"

[node name="GridContainer" type="GridContainer" parent="VBox/Animation/VBoxContainer/Options"]
visible = false
layout_mode = 2
columns = 2

[node name="HFrames" type="TextureProgressBar" parent="VBox/Animation/VBoxContainer/Options/GridContainer"]
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
mouse_default_cursor_shape = 2
theme_type_variation = &"ValueSlider"
min_value = 1.0
value = 1.0
allow_greater = true
nine_patch_stretch = true
stretch_margin_left = 3
stretch_margin_top = 3
stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource("8")
prefix = "Horizontal frames:"

[node name="VFrames" type="TextureProgressBar" parent="VBox/Animation/VBoxContainer/Options/GridContainer"]
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
mouse_default_cursor_shape = 2
theme_type_variation = &"ValueSlider"
min_value = 1.0
value = 1.0
allow_greater = true
nine_patch_stretch = true
stretch_margin_left = 3
stretch_margin_top = 3
stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource("8")
prefix = "Vertical frames:"

[node name="StartFrame" type="TextureProgressBar" parent="VBox/Animation/VBoxContainer/Options/GridContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
mouse_default_cursor_shape = 2
theme_type_variation = &"ValueSlider"
min_value = 1.0
max_value = 1.0
value = 1.0
nine_patch_stretch = true
stretch_margin_left = 3
stretch_margin_top = 3
stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource("8")
prefix = "Start frame:"

[node name="EndFrame" type="TextureProgressBar" parent="VBox/Animation/VBoxContainer/Options/GridContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
mouse_default_cursor_shape = 2
theme_type_variation = &"ValueSlider"
min_value = 1.0
max_value = 1.0
value = 1.0
nine_patch_stretch = true
stretch_margin_left = 3
stretch_margin_top = 3
stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource("8")
prefix = "End frame:"

[connection signal="value_changed" from="VBox/HBox/VBoxContainer/PreviewZoomSlider" to="." method="_on_PreviewZoomSlider_value_changed"]
[connection signal="mouse_entered" from="VBox/HBox/PreviewViewportContainer" to="." method="_on_PreviewViewportContainer_mouse_entered"]
[connection signal="mouse_exited" from="VBox/HBox/PreviewViewportContainer" to="." method="_on_PreviewViewportContainer_mouse_exited"]
[connection signal="toggled" from="VBox/Animation/PlayButton" to="." method="_on_PlayButton_toggled"]
[connection signal="item_selected" from="VBox/Animation/VBoxContainer/Mode/OptionButton" to="." method="_on_OptionButton_item_selected"]
[connection signal="value_changed" from="VBox/Animation/VBoxContainer/Options/GridContainer/HFrames" to="." method="_on_HFrames_value_changed"]
[connection signal="value_changed" from="VBox/Animation/VBoxContainer/Options/GridContainer/VFrames" to="." method="_on_VFrames_value_changed"]
[connection signal="value_changed" from="VBox/Animation/VBoxContainer/Options/GridContainer/StartFrame" to="." method="_on_StartFrame_value_changed"]
[connection signal="value_changed" from="VBox/Animation/VBoxContainer/Options/GridContainer/EndFrame" to="." method="_on_EndFrame_value_changed"]
