[gd_scene format=3 uid="uid://dlskc36c5hrwv"]

[ext_resource type="Script" uid="uid://cwhe7tpe75oh7" path="res://addons/dialogic/Editor/CharacterEditor/character_editor.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="2_uhhqs"]
[ext_resource type="Script" uid="uid://deliic6d8vajo" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd" id="2_vad0i"]
[ext_resource type="Texture2D" uid="uid://my600mb32ydt" path="res://addons/dialogic/Editor/Images/Toolbar/add-character.svg" id="6_2ogmx"]

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_es2rd"]

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4xgdx"]

[node name="CharacterEditor" type="Control" unique_id=1430618019]
self_modulate = Color(0, 0, 0, 1)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("2")

[node name="Scroll" type="ScrollContainer" parent="." unique_id=2103751498]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="VBox" type="VBoxContainer" parent="Scroll" unique_id=478102003]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.3
theme_override_constants/separation = 0

[node name="TopSection" type="HBoxContainer" parent="Scroll/VBox" unique_id=196003140]
layout_mode = 2

[node name="NameContainer" type="HBoxContainer" parent="Scroll/VBox/TopSection" unique_id=1249855270]
layout_mode = 2

[node name="CharacterName" type="Label" parent="Scroll/VBox/TopSection/NameContainer" unique_id=1631969065]
unique_name_in_owner = true
layout_mode = 2
theme_type_variation = &"DialogicTitle"
text = "My Character"

[node name="NameTooltip" parent="Scroll/VBox/TopSection/NameContainer" unique_id=1870345891 instance=ExtResource("2_uhhqs")]
layout_mode = 2
tooltip_text = "This unique identifier is based on the file name. You can change it in the Reference Manager.
Use this name in timelines to reference this character."
texture = null
hint_text = "This unique identifier is based on the file name. You can change it in the Reference Manager.
Use this name in timelines to reference this character."

[node name="MainHSplit" type="HSplitContainer" parent="Scroll/VBox" unique_id=1603115244]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="MainSettingsPanel" type="PanelContainer" parent="Scroll/VBox/MainHSplit" unique_id=465890127]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.2
theme_type_variation = &"DialogicPanelA"

[node name="MainSettings" type="VBoxContainer" parent="Scroll/VBox/MainHSplit/MainSettingsPanel" unique_id=843706490]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.2

[node name="HBoxContainer" type="HBoxContainer" parent="Scroll/VBox/MainHSplit/MainSettingsPanel/MainSettings" unique_id=989140237]
layout_mode = 2

[node name="MainSettingsTitle" type="Label" parent="Scroll/VBox/MainHSplit/MainSettingsPanel/MainSettings/HBoxContainer" unique_id=1680089144]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_type_variation = &"DialogicSubTitle"
text = "Main Settings"

[node name="CloseButton" type="Button" parent="Scroll/VBox/MainHSplit/MainSettingsPanel/MainSettings/HBoxContainer" unique_id=21396123]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Hide Main Settings"
theme_type_variation = &"FlatButton"
text = "     "

[node name="MainSettingsScroll" type="ScrollContainer" parent="Scroll/VBox/MainHSplit/MainSettingsPanel/MainSettings" unique_id=802937484]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxEmpty_es2rd")
horizontal_scroll_mode = 0

[node name="MainSettingsSections" type="VBoxContainer" parent="Scroll/VBox/MainHSplit/MainSettingsPanel/MainSettings/MainSettingsScroll" unique_id=667263369]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="MainSettingsHidden" type="VBoxContainer" parent="Scroll/VBox/MainHSplit/MainSettingsPanel" unique_id=190117290]
unique_name_in_owner = true
visible = false
layout_mode = 2

[node name="OpenButton" type="Button" parent="Scroll/VBox/MainHSplit/MainSettingsPanel/MainSettingsHidden" unique_id=349430792]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 3
tooltip_text = "Show Main Settings"
theme_type_variation = &"FlatButton"
theme_override_constants/icon_max_width = 20

[node name="Split" type="HSplitContainer" parent="Scroll/VBox/MainHSplit" unique_id=203063071]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3

[node name="HBoxContainer" type="HBoxContainer" parent="Scroll/VBox/MainHSplit/Split" unique_id=1087042926]
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.2
theme_override_constants/separation = 0

[node name="MarginContainer" type="MarginContainer" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer" unique_id=1163073523]
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.2

[node name="PortraitListSection" type="PanelContainer" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer" unique_id=95553638]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_type_variation = &"DialogicPanelA"

[node name="Portraits" type="VBoxContainer" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection" unique_id=331914429]
layout_mode = 2

[node name="Title" type="HBoxContainer" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits" unique_id=1467490767]
layout_mode = 2

[node name="PortraitsTitle" type="Label" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/Title" unique_id=1012902349]
layout_mode = 2
theme_type_variation = &"DialogicSubTitle"
text = "Portraits"

[node name="AddPortraitButton" type="Button" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/Title" unique_id=1343539624]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Add Empty Portrait"
theme_type_variation = &"FlatButton"

[node name="AddPortraitGroupButton" type="Button" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/Title" unique_id=554125997]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Add Portrait Group"
theme_type_variation = &"FlatButton"

[node name="ImportPortraitsButton" type="Button" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/Title" unique_id=423626215]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Import Images as Portraits"
theme_type_variation = &"FlatButton"

[node name="PortraitListTools" type="HBoxContainer" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits" unique_id=1864279451]
layout_mode = 2

[node name="PortraitSearch" type="LineEdit" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/PortraitListTools" unique_id=1047008144]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 4
placeholder_text = "Filter Portraits"
expand_to_text_length = true
clear_button_enabled = true
caret_blink = true
caret_blink_interval = 0.5

[node name="PortraitTreePanel" type="PanelContainer" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits" unique_id=1248108876]
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxEmpty_4xgdx")

[node name="PortraitTree" type="Tree" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/PortraitTreePanel" unique_id=1126516054]
unique_name_in_owner = true
layout_mode = 2
allow_rmb_select = true
hide_root = true
script = ExtResource("2_vad0i")

[node name="PortraitRightClickMenu" type="PopupMenu" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/PortraitTreePanel/PortraitTree" unique_id=1852436528]
size = Vector2i(118, 100)
item_count = 5
item_0/text = "Rename"
item_0/id = 2
item_1/text = "Duplicate"
item_1/id = 0
item_2/text = "Delete"
item_2/id = 1
item_3/id = 3
item_3/separator = true
item_4/text = "Make Default"
item_4/id = 4

[node name="PortraitChangeInfo" type="HBoxContainer" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits" unique_id=867743359]
unique_name_in_owner = true
layout_mode = 2

[node name="PortraitChangeWarning" type="Label" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/PortraitChangeInfo" unique_id=505408175]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_colors/font_color = Color(0, 0, 0, 1)
text = "Some portraits were renamed. Make sure no references broke!"
autowrap_mode = 3

[node name="ReferenceMangerButton" type="Button" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/PortraitChangeInfo" unique_id=1685213609]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 4
text = "Reference
Manager"

[node name="RightSection2" type="VBoxContainer" parent="Scroll/VBox/MainHSplit/Split" unique_id=223577878]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.5

[node name="Spacer" type="Control" parent="Scroll/VBox/MainHSplit/Split/RightSection2" unique_id=1547642731]
custom_minimum_size = Vector2(0, 10)
layout_mode = 2

[node name="RightSection" type="SplitContainer" parent="Scroll/VBox/MainHSplit/Split/RightSection2" unique_id=1177475928]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.5
vertical = true

[node name="PortraitPreviewSection" type="Panel" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection" unique_id=1063379299]
unique_name_in_owner = true
show_behind_parent = true
custom_minimum_size = Vector2(100, 0)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_type_variation = &"DialogicPanelB"

[node name="ClipRect" type="Control" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection" unique_id=167304182]
clip_contents = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Node2D" type="Node2D" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection/ClipRect" unique_id=2047494054]
position = Vector2(13, 17)

[node name="RealPreviewPivot" type="Sprite2D" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection/ClipRect/Node2D" unique_id=1422961354]
unique_name_in_owner = true
position = Vector2(329, 287)

[node name="ScenePreviewWarning" type="Label" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection" unique_id=1589232067]
unique_name_in_owner = true
visible = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -143.0
offset_top = -44.5
offset_right = 143.0
offset_bottom = 85.5
grow_horizontal = 2
grow_vertical = 2
text = "Custom scenes can only be viewed in \"Full mode\" if they are in @tool mode and override _get_covered_rect"
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 3
metadata/_edit_layout_mode = 1

[node name="PreviewReal" type="CenterContainer" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection" unique_id=817899797]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -302.0
offset_top = -80.0
offset_right = 302.0
grow_horizontal = 2
grow_vertical = 0
mouse_filter = 2
metadata/_edit_layout_mode = 1

[node name="Control" type="Control" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection/PreviewReal" unique_id=1058864451]
layout_mode = 2

[node name="RealSizeRemotePivotTransform" type="RemoteTransform2D" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection/PreviewReal/Control" unique_id=995132075]
unique_name_in_owner = true
remote_path = NodePath("../../../ClipRect/Node2D/RealPreviewPivot")
update_rotation = false
update_scale = false

[node name="FullPreviewAvailableRect" type="Control" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection" unique_id=115907348]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 10.0
offset_top = 28.0
offset_right = -10.0
offset_bottom = -16.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
metadata/_edit_layout_mode = 1

[node name="HBoxContainer" type="HBoxContainer" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection" unique_id=1496501948]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_left = 6.0
offset_top = 7.0
offset_right = -6.0
offset_bottom = 43.0
grow_horizontal = 2
mouse_filter = 2

[node name="PreviewLabel" type="Label" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection/HBoxContainer" unique_id=564645258]
unique_name_in_owner = true
show_behind_parent = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 0
theme_override_colors/font_color = Color(0, 0, 0, 1)
text = "No portrait to preview."
text_overrun_behavior = 1

[node name="FitPreview_Toggle" type="Button" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection/HBoxContainer" unique_id=388224784]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 0
tooltip_text = "Real scale"
focus_mode = 0
toggle_mode = true
button_pressed = true
flat = true
metadata/_edit_layout_mode = 1

[node name="VBox" type="VBoxContainer" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection" unique_id=1189439711]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.75

[node name="Hbox" type="HBoxContainer" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/VBox" unique_id=130485759]
layout_mode = 2

[node name="PortraitSettingsTitle" type="Label" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/VBox/Hbox" unique_id=1706205105]
unique_name_in_owner = true
layout_mode = 2
theme_type_variation = &"DialogicSubTitle"
text = "Portrait Settings"

[node name="SwitchPortraitSettingsPosition" type="Button" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/VBox/Hbox" unique_id=1532886824]
unique_name_in_owner = true
modulate = Color(1, 1, 1, 0.647059)
layout_mode = 2
tooltip_text = "Switch position"
focus_mode = 0
flat = true

[node name="Scroll" type="ScrollContainer" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/VBox" unique_id=1486898798]
layout_mode = 2
size_flags_vertical = 3
size_flags_stretch_ratio = 0.4

[node name="PortraitSettingsSection" type="VBoxContainer" parent="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/VBox/Scroll" unique_id=1171723602]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.3

[node name="Spacer2" type="Control" parent="Scroll/VBox/MainHSplit/Split/RightSection2" unique_id=1167242753]
visible = false
custom_minimum_size = Vector2(0, 20)
layout_mode = 2

[node name="NoCharacterScreen" type="PanelContainer" parent="." unique_id=190821474]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3

[node name="CenterContainer" type="CenterContainer" parent="NoCharacterScreen" unique_id=1885703718]
layout_mode = 2

[node name="VBoxContainer" type="VBoxContainer" parent="NoCharacterScreen/CenterContainer" unique_id=135127017]
custom_minimum_size = Vector2(250, 0)
layout_mode = 2

[node name="Label" type="Label" parent="NoCharacterScreen/CenterContainer/VBoxContainer" unique_id=429783209]
layout_mode = 2
text = "No character opened. 
Create a character or double-click one in the file system dock."
horizontal_alignment = 1
autowrap_mode = 3

[node name="CreateCharacterButton" type="Button" parent="NoCharacterScreen/CenterContainer/VBoxContainer" unique_id=1496778365]
layout_mode = 2
size_flags_horizontal = 4
text = "Create New Character"
icon = ExtResource("6_2ogmx")

[connection signal="pressed" from="Scroll/VBox/MainHSplit/MainSettingsPanel/MainSettings/HBoxContainer/CloseButton" to="." method="hide_main_settings"]
[connection signal="pressed" from="Scroll/VBox/MainHSplit/MainSettingsPanel/MainSettingsHidden/OpenButton" to="." method="show_main_settings"]
[connection signal="item_mouse_selected" from="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/PortraitTreePanel/PortraitTree" to="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/PortraitTreePanel/PortraitTree" method="_on_item_mouse_selected"]
[connection signal="index_pressed" from="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/PortraitTreePanel/PortraitTree/PortraitRightClickMenu" to="." method="_on_portrait_right_click_menu_index_pressed"]
[connection signal="pressed" from="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/PortraitChangeInfo/ReferenceMangerButton" to="." method="_on_reference_manger_button_pressed"]
[connection signal="resized" from="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection/FullPreviewAvailableRect" to="." method="_on_full_preview_available_rect_resized"]
[connection signal="toggled" from="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/PortraitPreviewSection/HBoxContainer/FitPreview_Toggle" to="." method="_on_fit_preview_toggle_toggled"]
[connection signal="pressed" from="Scroll/VBox/MainHSplit/Split/RightSection2/RightSection/VBox/Hbox/SwitchPortraitSettingsPosition" to="." method="_on_switch_portrait_settings_position_pressed"]
[connection signal="pressed" from="NoCharacterScreen/CenterContainer/VBoxContainer/CreateCharacterButton" to="." method="_on_create_character_button_pressed"]
