diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor_ptab_exports.gd b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.gd similarity index 89% rename from addons/dialogic/Editor/CharacterEditor/character_editor_ptab_exports.gd rename to addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.gd index 47d22c189..1c4b2209e 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor_ptab_exports.gd +++ b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.gd @@ -1,5 +1,5 @@ @tool -extends DialogicCharacterEditorPortraitSettingsTab +extends DialogicCharacterEditorPortraitSection ## Tab that allows setting values of exported scene variables ## for custom portrait scenes @@ -7,18 +7,26 @@ extends DialogicCharacterEditorPortraitSettingsTab var current_portrait_data := {} func _ready() -> void: - get_parent().set_tab_icon(get_index(), get_theme_icon("EditInternal", "EditorIcons")) add_theme_stylebox_override('panel', get_theme_stylebox("Background", "EditorStyles")) + + $Label.add_theme_color_override("font_color", get_theme_color("readonly_color", "Editor")) + func _load_portrait_data(data:Dictionary) -> void: + _recheck(data) + +func _recheck(data:Dictionary): if data.get('scene', '').is_empty(): - get_parent().set_tab_hidden(get_index(), true) + hide() + get_parent().get_child(get_index()-1).hide() + get_parent().get_child(get_index()+1).hide() else: - get_parent().set_tab_hidden(get_index(), false) - + get_parent().get_child(get_index()-1).show() + current_portrait_data = data load_portrait_scene_export_variables() + func load_portrait_scene_export_variables(): var scene = null if !current_portrait_data.get('scene', '').is_empty(): @@ -56,6 +64,9 @@ func load_portrait_scene_export_variables(): title.add_theme_stylebox_override('normal', get_theme_stylebox("ContextualToolbar", "EditorStyles")) $Grid.add_child(title) $Grid.add_child(Control.new()) + + $Label.visible = $Grid.get_child_count() == 0 + func set_export_override(property_name:String, value:String = "") -> void: var data:Dictionary = selected_item.get_metadata(0) diff --git a/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.tscn b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.tscn new file mode 100644 index 000000000..e42b92d70 --- /dev/null +++ b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=2 format=3] + +[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.gd" id="1_isys8"] + +[node name="Exports" type="VBoxContainer"] +custom_minimum_size = Vector2(0, 35) +offset_right = 367.0 +offset_bottom = 82.0 +script = ExtResource("1_isys8") + +[node name="Label" type="Label" parent="."] +layout_mode = 2 +text = "There are no exported variables to override. Add @export properties to the root script of your scene and make sure it's in @tool mode." +autowrap_mode = 3 + +[node name="Grid" type="GridContainer" parent="."] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme_override_constants/h_separation = 10 +columns = 2 diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor_ptab_layout.gd b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.gd similarity index 59% rename from addons/dialogic/Editor/CharacterEditor/character_editor_ptab_layout.gd rename to addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.gd index 7cb92c0db..f2547c153 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor_ptab_layout.gd +++ b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.gd @@ -1,17 +1,14 @@ @tool -extends DialogicCharacterEditorPortraitSettingsTab +extends DialogicCharacterEditorPortraitSection ## Tab that allows setting size, offset and mirror of a portrait. -func _ready(): - get_parent().set_tab_icon(get_index(), get_theme_icon('EditorPivot', 'EditorIcons')) - - func _load_portrait_data(data:Dictionary) -> void: + %IgnoreScale.button_pressed = data.get('ignore_char_scale', false) + %PortraitScale.value = data.get('scale', 1.0)*100 - %PortraitOffsetX.value = data.get('offset', Vector2()).x - %PortraitOffsetY.value = data.get('offset', Vector2()).y + %PortraitOffset.set_value(data.get('offset', Vector2())) %PortraitMirror.button_pressed = data.get('mirror', false) @@ -22,22 +19,22 @@ func _on_portrait_scale_value_changed(value) -> void: changed.emit() -func _on_portrait_offset_x_value_changed(value) -> void: +func _on_portrait_mirror_toggled(button_pressed:bool)-> void: var data:Dictionary = selected_item.get_metadata(0) - data['offset'] = data.get('offset', Vector2()) - data['offset'].x = value + data['mirror'] = button_pressed update_preview.emit() changed.emit() -func _on_portrait_offset_y_value_changed(value)-> void: + +func _on_ignore_scale_toggled(button_pressed:bool) -> void: var data:Dictionary = selected_item.get_metadata(0) - data['offset'] = data.get('offset', Vector2()) - data['offset'].y = value + data['ignore_char_scale'] = button_pressed update_preview.emit() changed.emit() -func _on_portrait_mirror_toggled(button_pressed:bool)-> void: + +func _on_portrait_offset_value_changed(property:String, value:Vector2) -> void: var data:Dictionary = selected_item.get_metadata(0) - data['mirror'] = button_pressed + data['offset'] = value update_preview.emit() changed.emit() diff --git a/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.tscn b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.tscn new file mode 100644 index 000000000..797de881a --- /dev/null +++ b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.tscn @@ -0,0 +1,65 @@ +[gd_scene load_steps=3 format=3 uid="uid://crke8suvv52c6"] + +[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.gd" id="1_76vf2"] +[ext_resource type="PackedScene" uid="uid://dtimnsj014cu" path="res://addons/dialogic/Editor/Events/Fields/Vector2.tscn" id="2_c8kyi"] + +[node name="Layout" type="HFlowContainer"] +offset_right = 428.0 +offset_bottom = 128.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource("1_76vf2") + +[node name="Label3" type="Label" parent="."] +layout_mode = 2 +text = "Ignore Main Scale: " + +[node name="IgnoreScale" type="CheckBox" parent="."] +unique_name_in_owner = true +layout_mode = 2 +tooltip_text = "This portrait will ignore the main scale." + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Label" type="Label" parent="HBoxContainer"] +layout_mode = 2 +text = "Scale:" + +[node name="PortraitScale" type="SpinBox" parent="HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +tooltip_text = "A scale to be applied on top of the main scale +(unless ignore main scale is pressed)." +value = 100.0 +allow_greater = true +suffix = "%" + +[node name="HBoxContainer2" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Label2" type="Label" parent="HBoxContainer2"] +layout_mode = 2 +text = "Offset:" + +[node name="PortraitOffset" parent="HBoxContainer2" instance=ExtResource("2_c8kyi")] +unique_name_in_owner = true +layout_mode = 2 +tooltip_text = "Offset that is applied on top of the main portrait offset." + +[node name="MirrorOption" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Label" type="Label" parent="MirrorOption"] +layout_mode = 2 +text = "Mirror:" + +[node name="PortraitMirror" type="CheckBox" parent="MirrorOption"] +unique_name_in_owner = true +layout_mode = 2 +tooltip_text = "Mirroring that is applied on top of the main portrait mirror." + +[connection signal="toggled" from="IgnoreScale" to="." method="_on_ignore_scale_toggled"] +[connection signal="value_changed" from="HBoxContainer/PortraitScale" to="." method="_on_portrait_scale_value_changed"] +[connection signal="value_changed" from="HBoxContainer2/PortraitOffset" to="." method="_on_portrait_offset_value_changed"] +[connection signal="toggled" from="MirrorOption/PortraitMirror" to="." method="_on_portrait_mirror_toggled"] diff --git a/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd new file mode 100644 index 000000000..ebc14cd29 --- /dev/null +++ b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd @@ -0,0 +1,39 @@ +@tool +extends DialogicCharacterEditorPortraitSection + +## Tab that allows setting an image file on a portrait. + + +func _ready() -> void: + %ImagePicker.file_filter = "*.png, *.svg" + %ImagePicker.resource_icon = get_theme_icon('Image', 'EditorIcons') + + %ScenePicker.file_filter = "*.tscn, *.scn; Scenes" + %ScenePicker.resource_icon = get_theme_icon('PackedScene', 'EditorIcons') + %ScenePicker.placeholder = 'Default scene' + + +func _load_portrait_data(data:Dictionary) -> void: + %ScenePicker.set_value(data.get('scene', '')) + %ImagePicker.set_value(data.get('image', '')) + update_image_picker_visibility(data['scene'].is_empty()) + + +func _on_image_picker_value_changed(prop_name:String, value:String): + var data:Dictionary = selected_item.get_metadata(0) + data['image'] = value + changed.emit() + update_preview.emit() + + +func _on_scene_picker_value_changed(prop_name:String, value:String) -> void: + var data:Dictionary = selected_item.get_metadata(0) + data['scene'] = value + update_image_picker_visibility(data['scene'].is_empty()) + update_preview.emit() + changed.emit() + + +func update_image_picker_visibility(show= true) -> void: + %ImagePicker.visible = show + %ImageLabel.visible = show diff --git a/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.tscn b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.tscn new file mode 100644 index 000000000..1778366a1 --- /dev/null +++ b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.tscn @@ -0,0 +1,80 @@ +[gd_scene load_steps=7 format=3 uid="uid://djq4aasoihexj"] + +[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd" id="1_ht8lu"] +[ext_resource type="PackedScene" uid="uid://7mvxuaulctcq" path="res://addons/dialogic/Editor/Events/Fields/FilePicker.tscn" id="2_k8xs0"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rimrq"] +content_margin_left = 4.0 +content_margin_top = 0.0 +content_margin_right = 4.0 +content_margin_bottom = 0.0 +bg_color = Color(0.1, 0.1, 0.1, 0.6) +border_width_bottom = 2 +border_color = Color(0, 0, 0, 0.6) +corner_radius_top_left = 3 +corner_radius_top_right = 3 +corner_radius_bottom_right = 3 +corner_radius_bottom_left = 3 +corner_detail = 5 + +[sub_resource type="Image" id="Image_4x7i8"] +data = { +"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), +"format": "RGBA8", +"height": 16, +"mipmaps": false, +"width": 16 +} + +[sub_resource type="ImageTexture" id="ImageTexture_y34ar"] +image = SubResource("Image_4x7i8") + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bvmrg"] +content_margin_left = 4.0 +content_margin_top = 0.0 +content_margin_right = 4.0 +content_margin_bottom = 0.0 +bg_color = Color(0.1, 0.1, 0.1, 0.6) +border_width_bottom = 2 +border_color = Color(0, 0, 0, 0.6) +corner_radius_top_left = 3 +corner_radius_top_right = 3 +corner_radius_bottom_right = 3 +corner_radius_bottom_left = 3 +corner_detail = 5 + +[node name="General" type="GridContainer"] +offset_right = 298.0 +offset_bottom = 86.0 +size_flags_horizontal = 3 +columns = 2 +script = ExtResource("1_ht8lu") + +[node name="Label2" type="Label" parent="."] +layout_mode = 2 +text = "Scene: " + +[node name="ScenePicker" parent="." instance=ExtResource("2_k8xs0")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_styles/panel = SubResource("StyleBoxFlat_rimrq") +file_filter = "*.tscn, *.scn; Scenes" +placeholder = "Default scene" +resource_icon = SubResource("ImageTexture_y34ar") + +[node name="ImageLabel" type="Label" parent="."] +unique_name_in_owner = true +layout_mode = 2 +text = "Image: " + +[node name="ImagePicker" parent="." instance=ExtResource("2_k8xs0")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_styles/panel = SubResource("StyleBoxFlat_bvmrg") +file_filter = "*.png, *.svg" +resource_icon = SubResource("ImageTexture_y34ar") + +[connection signal="value_changed" from="ScenePicker" to="." method="_on_scene_picker_value_changed"] +[connection signal="value_changed" from="ImagePicker" to="." method="_on_image_picker_value_changed"] diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor_tab_general.gd b/addons/dialogic/Editor/CharacterEditor/char_edit_section_general.gd similarity index 96% rename from addons/dialogic/Editor/CharacterEditor/character_editor_tab_general.gd rename to addons/dialogic/Editor/CharacterEditor/char_edit_section_general.gd index 4aa3fec9c..a9dc834c4 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor_tab_general.gd +++ b/addons/dialogic/Editor/CharacterEditor/char_edit_section_general.gd @@ -1,5 +1,5 @@ @tool -extends DialogicCharacterEditorMainTab +extends DialogicCharacterEditorMainSection ## The general character settings tab diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor_tab_general.tscn b/addons/dialogic/Editor/CharacterEditor/char_edit_section_general.tscn similarity index 93% rename from addons/dialogic/Editor/CharacterEditor/character_editor_tab_general.tscn rename to addons/dialogic/Editor/CharacterEditor/char_edit_section_general.tscn index 326e06187..fd887f9fa 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor_tab_general.tscn +++ b/addons/dialogic/Editor/CharacterEditor/char_edit_section_general.tscn @@ -1,6 +1,6 @@ -[gd_scene load_steps=2 format=3 uid="uid://de5kj4vd0we1w"] +[gd_scene load_steps=2 format=3] -[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_tab_general.gd" id="1_3e1i1"] +[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_section_general.gd" id="1_3e1i1"] [node name="General" type="GridContainer"] anchors_preset = 15 @@ -19,6 +19,7 @@ script = ExtResource("1_3e1i1") [node name="Label2" type="Label" parent="."] layout_mode = 2 +size_flags_vertical = 0 text = "Display Name: " [node name="DisplayName" type="HBoxContainer" parent="."] @@ -43,6 +44,7 @@ edit_alpha = false [node name="Label3" type="Label" parent="."] layout_mode = 2 +size_flags_vertical = 0 text = "Nicknames:" [node name="NicknameLineEdit" type="LineEdit" parent="."] diff --git a/addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.gd b/addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.gd new file mode 100644 index 000000000..7c038e50d --- /dev/null +++ b/addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.gd @@ -0,0 +1,63 @@ +@tool +extends DialogicCharacterEditorMainSection + +## The general portrait settings section + + +func _ready() -> void: + # Connecting all necessary signals + %DefaultPortraitPicker.value_changed.connect(default_portrait_changed) + %MainScale.value_changed.connect(main_portrait_settings_update) + %MainOffset.value_changed.connect(main_portrait_settings_update) + %MainMirror.toggled.connect(main_portrait_settings_update) + + # Setting up Default Portrait Picker + %DefaultPortraitPicker.resource_icon = load("res://addons/dialogic/Editor/Images/Resources/portrait.svg") + %DefaultPortraitPicker.get_suggestions_func = suggest_portraits + + + +# Make sure preview get's updated when portrait settings change +func main_portrait_settings_update(_something=null, _value=null) -> void: + character_editor.current_resource.scale = %MainScale.value/100.0 + character_editor.current_resource.offset = %MainOffset.current_value + character_editor.current_resource.mirror = %MainMirror.button_pressed + character_editor.update_preview() + character_editor.something_changed() + + +func default_portrait_changed(property:String, value:String) -> void: + character_editor.current_resource.default_portrait = value + character_editor.update_default_portrait_star(value) + + +func _load_character(resource:DialogicCharacter) -> void: + %DefaultPortraitPicker.set_value(resource.default_portrait) + + %MainScale.value = 100*resource.scale + %MainOffset.set_value(resource.offset) + %MainMirror.button_pressed = resource.mirror + + +func _save_changes(resource:DialogicCharacter) -> DialogicCharacter: + # Portrait settings + if %DefaultPortraitPicker.current_value in resource.portraits.keys(): + resource.default_portrait = %DefaultPortraitPicker.current_value + elif !resource.portraits.is_empty(): + resource.default_portrait = resource.portraits.keys()[0] + else: + resource.default_portrait = "" + + resource.scale = %MainScale.value/100.0 + resource.offset = %MainOffset.current_value + resource.mirror = %MainMirror.button_pressed + return resource + + +# Get suggestions for DefaultPortraitPicker +func suggest_portraits(search:String) -> Dictionary: + var suggestions := {} + for portrait in character_editor.get_updated_portrait_dict().keys(): + suggestions[portrait] = {'value':portrait} + return suggestions + diff --git a/addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.tscn b/addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.tscn new file mode 100644 index 000000000..a899bc190 --- /dev/null +++ b/addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.tscn @@ -0,0 +1,59 @@ +[gd_scene load_steps=4 format=3] + +[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.gd" id="1_6sxsl"] +[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn" id="2_birla"] +[ext_resource type="PackedScene" uid="uid://dtimnsj014cu" path="res://addons/dialogic/Editor/Events/Fields/Vector2.tscn" id="3_vcvin"] + +[node name="Portraits" type="GridContainer"] +offset_right = 453.0 +offset_bottom = 141.0 +theme_override_constants/h_separation = 1 +theme_override_constants/v_separation = 6 +columns = 2 +script = ExtResource("1_6sxsl") + +[node name="Label5" type="Label" parent="."] +layout_mode = 2 +size_flags_vertical = 0 +text = "Default:" + +[node name="DefaultPortraitPicker" parent="." instance=ExtResource("2_birla")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +placeholder_text = "Select Default Portrait" +fit_text_length = false + +[node name="Label" type="Label" parent="."] +layout_mode = 2 +size_flags_vertical = 0 +text = "Main Scale:" + +[node name="MainScale" type="SpinBox" parent="."] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 8 +value = 100.0 +allow_greater = true +alignment = 1 +suffix = "%" + +[node name="Label2" type="Label" parent="."] +layout_mode = 2 +size_flags_vertical = 0 +text = "Main Offset:" + +[node name="MainOffset" parent="." instance=ExtResource("3_vcvin")] +unique_name_in_owner = true +layout_mode = 2 +alignment = 2 + +[node name="Label3" type="Label" parent="."] +layout_mode = 2 +size_flags_vertical = 0 +text = "Main Mirror:" + +[node name="MainMirror" type="CheckBox" parent="."] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 8 diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor.gd b/addons/dialogic/Editor/CharacterEditor/character_editor.gd index 982b1d584..4162d39c1 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor.gd +++ b/addons/dialogic/Editor/CharacterEditor/character_editor.gd @@ -7,11 +7,7 @@ signal character_loaded(resource_path:String) signal portrait_selected() -# Enums -enum PreviewModes {Full, Real} - # Current state -var current_preview_mode :int = PreviewModes.Full var loading := false var current_previewed_scene = null @@ -47,15 +43,10 @@ func _open_resource(resource:Resource) -> void: loading = true ## Load other main tabs - for main_edit in %MainEditTabs.get_children(): - main_edit._load_character(current_resource) - - %DefaultPortraitPicker.set_value(resource.default_portrait) + for child in %MainSettingsSections.get_children(): + if child is DialogicCharacterEditorMainSection: + child._load_character(current_resource) - %MainScale.value = 100*resource.scale - %MainOffsetX.value = resource.offset.x - %MainOffsetY.value = resource.offset.y - %MainMirror.button_pressed = resource.mirror # Portrait section %PortraitSearch.text = "" @@ -64,7 +55,13 @@ func _open_resource(resource:Resource) -> void: loading = false character_loaded.emit(resource.resource_path) + for character in editors_manager.resource_helper.character_directory.values(): + if character.resource == resource: + %CharacterName.text = character.unique_short_path + $NoCharacterScreen.hide() + + func _save() -> void: @@ -74,21 +71,10 @@ func _save() -> void: # Portrait list current_resource.portraits = get_updated_portrait_dict() - # Portrait settings - if %DefaultPortraitPicker.current_value in current_resource.portraits.keys(): - current_resource.default_portrait = %DefaultPortraitPicker.current_value - elif !current_resource.portraits.is_empty(): - current_resource.default_portrait = current_resource.portraits.keys()[0] - else: - current_resource.default_portrait = "" - - current_resource.scale = %MainScale.value/100.0 - current_resource.offset = Vector2(%MainOffsetX.value, %MainOffsetY.value) - current_resource.mirror = %MainMirror.button_pressed - # Main tabs - for main_edit in %MainEditTabs.get_children(): - current_resource = main_edit._save_changes(current_resource) + for child in %MainSettingsSections.get_children(): + if child is DialogicCharacterEditorMainSection: + current_resource = child._save_changes(current_resource) ResourceSaver.save(current_resource, current_resource.resource_path) current_resource_state = ResourceStates.Saved @@ -116,62 +102,112 @@ func _ready() -> void: get_parent().set_tab_icon(get_index(), load("res://addons/dialogic/Editor/Images/Resources/character.svg")) $NoCharacterScreen.color = get_theme_color("dark_color_2", "Editor") - + $NoCharacterScreen.show() setup_portrait_list_tab() - setup_portrait_settings_tab() + _on_fit_preview_toggle_toggled(DialogicUtil.get_editor_setting('character_preview_fit', true)) + %PreviewLabel.add_theme_color_override("font_color", get_theme_color("readonly_color", "Editor")) + + %CharacterName.add_theme_font_override("font", get_theme_font("title", "EditorFonts")) + %CharacterName.add_theme_color_override("font_color", get_theme_color("accent_color", "Editor")) + %CharacterName.add_theme_font_size_override("font_size", get_theme_font_size("doc_size", "EditorFonts")) - %PreviewMode.item_selected.connect(_on_PreviewMode_item_selected) - %PreviewMode.select(DialogicUtil.get_editor_setting('character_preview_mode', 0)) - _on_PreviewMode_item_selected(%PreviewMode.selected) + %NameTooltip.texture = get_theme_icon("NodeInfo", "EditorIcons") + %NameTooltip.modulate = get_theme_color("readonly_color", "Editor") ## General Styling var panel_style := DCSS.inline({ - 'border-radius': 3, + 'border-radius': 10, 'border': 0, 'border_color':get_theme_color("dark_color_3", "Editor"), 'background': get_theme_color("base_color", "Editor"), - 'padding': [10, 10], + 'padding': [5, 5], }) var tab_panel :StyleBoxFlat = get_theme_stylebox('tab_selected', 'TabContainer').duplicate() tab_panel.bg_color = get_theme_color("base_color", "Editor") - %MainEditTabs.add_theme_stylebox_override('panel', panel_style) - %MainEditTabs.add_theme_stylebox_override('tab_selected', tab_panel) - %MainEditTabs.add_theme_constant_override('side_margin', 5) %PortraitListSection.add_theme_stylebox_override('panel', panel_style) %PortraitListSection.add_theme_stylebox_override('tab_selected', tab_panel) %PortraitListSection.add_theme_constant_override('side_margin', 5) - %PortraitPreviewSection.add_theme_stylebox_override('panel', panel_style) + var preview_panel :StyleBoxFlat= panel_style.duplicate() + preview_panel.corner_radius_top_left = 0 + preview_panel.corner_radius_bottom_left = 0 + preview_panel.expand_margin_left = 8 + preview_panel.bg_color = get_theme_color("dark_color_2", "Editor") + preview_panel.set_border_width_all(1) + preview_panel.border_width_left = 0 + preview_panel.border_color = get_theme_color("contrast_color_2", "Editor") + %PortraitPreviewSection.add_theme_stylebox_override('panel', preview_panel) %PortraitSettingsSection.add_theme_stylebox_override('panel', panel_style) %PortraitSettingsSection.add_theme_stylebox_override('tab_selected', tab_panel) %PortraitSettingsSection.add_theme_constant_override('side_margin', 5) + %RealPreviewPivot.texture = get_theme_icon("EditorPivot", "EditorIcons") # Add general tab - add_main_tab("res://addons/dialogic/Editor/CharacterEditor/character_editor_tab_general.tscn") + add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_section_general.tscn").instantiate(), %MainSettingsSections) + add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.tscn").instantiate(), %MainSettingsSections) - # Load main tabs from subsystems/events - for indexer in DialogicUtil.get_indexers(): - for main_tab in indexer._get_character_editor_tabs(): - add_main_tab(main_tab) - for child in %PortraitSettingsSection.get_children(): - if !child is DialogicCharacterEditorPortraitSettingsTab: - printerr("[Dialogic Editor] Portrait settings tabs should extend the right class!") - else: - child.character_editor = self - child.changed.connect(something_changed) - child.update_preview.connect(update_preview) + add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.tscn").instantiate(), %PortraitSettingsSection) + add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.tscn").instantiate(), %PortraitSettingsSection) + add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.tscn").instantiate(), %PortraitSettingsSection) + + # Load custom sections from modules + for indexer in DialogicUtil.get_indexers(): + for path in indexer._get_character_editor_sections(): + var scene :Control = load(path).instantiate() + if scene is DialogicCharacterEditorMainSection: + add_settings_section(scene, %MainSettingsSections) + elif scene is DialogicCharacterEditorPortraitSection: + add_settings_section(scene, %PortraitSettingsSection) -func add_main_tab(scene_path:String) -> void: - var edit: DialogicCharacterEditorMainTab = load(scene_path).instantiate() +func add_settings_section(edit:Control, parent:Node) -> void: edit.changed.connect(something_changed) edit.character_editor = self - %MainEditTabs.add_child(edit) + if edit.has_signal('update_preview'): + edit.update_preview.connect(update_preview) + + var button := Button.new() + button.flat = true + button.add_theme_color_override('font_color', get_theme_color("readonly_color", "Editor")) + button.add_theme_color_override('font_hover_color', get_theme_color("readonly_color", "Editor")) + button.add_theme_color_override('font_pressed_color', get_theme_color("readonly_color", "Editor")) + button.alignment = HORIZONTAL_ALIGNMENT_LEFT + button.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN + button.text = edit.name + button.icon_alignment = HORIZONTAL_ALIGNMENT_RIGHT + button.pressed.connect(_on_section_button_pressed.bind(button)) + button.focus_mode = Control.FOCUS_NONE + button.icon = get_theme_icon("CodeFoldDownArrow", "EditorIcons") + button.add_theme_color_override('icon_normal_color', get_theme_color("readonly_color", "Editor")) + parent.add_child(button) + parent.add_child(edit) + parent.add_child(HSeparator.new()) + if !edit.name == "General": + _on_section_button_pressed(button) + + +func get_settings_section_by_name(name:String, main:=true) -> Node: + if main: + return %MainSettingsSections.get_node(name) + else: + return %PortraitSettingsSection.get_node(name) + + +func _on_section_button_pressed(button:Button) -> void: + if button.get_parent().get_child(button.get_index()+1).visible: + button.icon = get_theme_icon("CodeFoldedRightArrow", "EditorIcons") + button.get_parent().get_child(button.get_index()+1).visible = false + else: + button.icon = get_theme_icon("CodeFoldDownArrow", "EditorIcons") + button.get_parent().get_child(button.get_index()+1).visible = true + + if button.get_parent().get_child_count() > button.get_index()+2 and button.get_parent().get_child(button.get_index()+2) is Separator: + button.get_parent().get_child(button.get_index()+2).visible = button.get_parent().get_child(button.get_index()+1).visible func something_changed(fake_argument = "", fake_arg2 = null) -> void: @@ -187,12 +223,16 @@ func something_changed(fake_argument = "", fake_arg2 = null) -> void: func setup_portrait_list_tab() -> void: %PortraitTree.editor = self + %PortraitsTitle.add_theme_font_override("font", get_theme_font("title", "EditorFonts")) + %PortraitsTitle.add_theme_font_size_override("font_size", get_theme_font_size("doc_size", "EditorFonts")) + + ## Portrait section styling/connections %AddPortraitButton.icon = get_theme_icon("Add", "EditorIcons") %AddPortraitButton.pressed.connect(add_portrait) - %AddPortraitGroupButton.icon = get_theme_icon("Groups", "EditorIcons") + %AddPortraitGroupButton.icon = get_theme_icon("Filesystem", "EditorIcons") %AddPortraitGroupButton.pressed.connect(add_portrait_group) - %ImportPortraitsButton.icon = get_theme_icon("Folder", "EditorIcons") + %ImportPortraitsButton.icon = load("res://addons/dialogic/Editor/Images/Pieces/add-folder.svg") %ImportPortraitsButton.pressed.connect(open_portrait_folder_select) %PortraitSearch.right_icon = get_theme_icon("Search", "EditorIcons") %PortraitSearch.text_changed.connect(filter_portrait_list) @@ -261,6 +301,8 @@ func load_portrait_tree() -> void: if root.get_child_count(): root.get_first_child().select(0) + while %PortraitTree.get_selected().get_child_count(): + %PortraitTree.get_selected().get_child(0).select(0) else: # Call anyways to clear preview and hide portrait settings section load_selected_portrait() @@ -301,10 +343,9 @@ func list_portraits(tree_items:Array[TreeItem], dict:Dictionary = {}, path_prefi func load_selected_portrait(): if selected_item and is_instance_valid(selected_item): selected_item.set_editable(0, false) - + selected_item = %PortraitTree.get_selected() - - + if selected_item and !selected_item.get_metadata(0).has('group'): %PortraitSettingsSection.show() var current_portrait_data :Dictionary = selected_item.get_metadata(0) @@ -312,22 +353,11 @@ func load_selected_portrait(): update_preview() - for tab in %PortraitSettingsSection.get_children(): - if !tab is DialogicCharacterEditorPortraitSettingsTab: - printerr("[Dialogic Editor] Portrait settings tabs should extend the right class!") - else: - tab.selected_item = selected_item - tab._load_portrait_data(current_portrait_data) + for child in %PortraitSettingsSection.get_children(): + if child is DialogicCharacterEditorPortraitSection: + child.selected_item = selected_item + child._load_portrait_data(current_portrait_data) - # switch tabs if the current one is hidden (until the next not hidden tab) - for i in range(%PortraitSettingsSection.get_tab_count()): - if %PortraitSettingsSection.is_tab_hidden(%PortraitSettingsSection.current_tab): - if %PortraitSettingsSection.current_tab == %PortraitSettingsSection.get_tab_count()-1: - %PortraitSettingsSection.current_tab = 0 - else: - %PortraitSettingsSection.current_tab += 1 - else: - break else: %PortraitSettingsSection.hide() update_preview() @@ -338,6 +368,8 @@ func load_selected_portrait(): func delete_portrait_item(item:TreeItem) -> void: + if item.get_next_visible(true): + item.get_next_visible(true).select(0) item.free() something_changed() @@ -346,13 +378,14 @@ func duplicate_item(item:TreeItem) -> void: %PortraitTree.add_portrait_item(item.get_text(0)+'_duplicated', item.get_metadata(0).duplicate(true), item.get_parent()).select(0) -func _on_portrait_tree_button_clicked(item:TreeItem, column:int, id:int, mouse_button_index:int): + +func _on_portrait_right_click_menu_index_pressed(id:int) -> void: # DELETE BUTTON if id == 1: - delete_portrait_item(item) + delete_portrait_item(%PortraitTree.get_selected()) # DUPLICATE ITEM - if id == 3: - duplicate_item(item) + elif id == 0: + duplicate_item(%PortraitTree.get_selected()) # this removes/and adds the DEFAULT star on the portrait list @@ -364,11 +397,7 @@ func update_default_portrait_star(default_portrait_name:String) -> void: if item.get_button_by_id(0, 2) != -1: item.erase_button(0, item.get_button_by_id(0, 2)) if %PortraitTree.get_full_item_name(item) == default_portrait_name: - item.erase_button(0, item.get_button_by_id(0, 1)) - item.erase_button(0, item.get_button_by_id(0, 3)) item.add_button(0, get_theme_icon('Favorites', 'EditorIcons'), 2, true, 'Default') - item.add_button(0, get_theme_icon('Duplicate', 'EditorIcons'), 3, false, 'Duplicate') - item.add_button(0, get_theme_icon('Remove', 'EditorIcons'), 1, false, 'Remove') item_list.append_array(item.get_children()) if item_list.is_empty(): @@ -385,44 +414,6 @@ func _on_item_edited(): -############################################################################## -## PORTRAIT SETTINGS TAB -############################################################################## - -func setup_portrait_settings_tab() -> void: - %DefaultPortraitPicker.value_changed.connect(default_portrait_changed) - %MainScale.value_changed.connect(main_portrait_settings_update) - %MainOffsetX.value_changed.connect(main_portrait_settings_update) - %MainOffsetY.value_changed.connect(main_portrait_settings_update) - %MainMirror.toggled.connect(main_portrait_settings_update) - - # Setting up Default Portrait Picker - %DefaultPortraitPicker.resource_icon = load("res://addons/dialogic/Editor/Images/Resources/portrait.svg") - %DefaultPortraitPicker.get_suggestions_func = suggest_portraits - - -# Make sure preview get's updated when portrait settings change -func main_portrait_settings_update(value = null) -> void: - current_resource.scale = %MainScale.value/100.0 - current_resource.offset = Vector2(%MainOffsetX.value, %MainOffsetY.value) - current_resource.mirror = %MainMirror.button_pressed - update_preview() - something_changed() - - -func default_portrait_changed(property:String, value:String) -> void: - current_resource.default_portrait = value - update_default_portrait_star(value) - - -# Get suggestions for DefaultPortraitPicker -func suggest_portraits(search:String) -> Dictionary: - var suggestions := {} - for portrait in get_updated_portrait_dict().keys(): - suggestions[portrait] = {'value':portrait} - return suggestions - - ############################################################################## ## PREVIEW ############################################################################## @@ -431,9 +422,12 @@ func update_preview() -> void: %ScenePreviewWarning.hide() if selected_item and is_instance_valid(selected_item) and !selected_item.get_metadata(0).has('group'): %PreviewLabel.text = 'Preview of "'+%PortraitTree.get_full_item_name(selected_item)+'"' + var current_portrait_data: Dictionary = selected_item.get_metadata(0) var mirror:bool = current_portrait_data.get('mirror', false) != current_resource.mirror var scale:float = current_portrait_data.get('scale', 1) * current_resource.scale + if current_portrait_data.get('ignore_char_scale', false): + scale = current_portrait_data.get('scale', 1) var offset:Vector2 =current_portrait_data.get('offset', Vector2()) + current_resource.offset if current_previewed_scene != null \ @@ -469,13 +463,11 @@ func update_preview() -> void: scene._update_portrait(current_resource, %PortraitTree.get_full_item_name(selected_item)) if scene.has_method('_set_mirror'): scene._set_mirror(mirror) - if current_preview_mode == PreviewModes.Real: + if !%FitPreview_Toggle.button_pressed: scene.position = Vector2() + offset - - if current_portrait_data.get('scene', '').is_empty() or !current_portrait_data.get('ignore_char_scale', false): - scene.scale = Vector2(1,1)*scale + scene.scale = Vector2(1,1)*scale else: - if is_instance_valid(scene.get_script()) and scene.script.is_tool() and scene.has_method('_get_covered_rect'): + if is_instance_valid(scene.get_script()) and scene.script.is_tool() and scene.has_method('_get_covered_rect'): var rect :Rect2= scene._get_covered_rect() var available_rect:Rect2 = %FullPreviewAvailableRect.get_rect() scene.scale = Vector2(1,1) * min(available_rect.size.x/rect.size.x, available_rect.size.y/rect.size.y) @@ -485,10 +477,10 @@ func update_preview() -> void: else: %ScenePreviewWarning.show() else: - %PreviewRealRect.texture = null - %PreviewFullRect.texture = null %PreviewLabel.text = 'Nothing to preview' - + for child in %PortraitSettingsSection.get_children(): + if child is DialogicCharacterEditorPortraitSection: + child._recheck(current_portrait_data) else: %PreviewLabel.text = 'No portrait to preview.' for node in %RealPreviewPivot.get_children(): @@ -496,20 +488,9 @@ func update_preview() -> void: current_previewed_scene = null -func _on_PreviewMode_item_selected(index:int) -> void: - current_preview_mode = index - # FULL VIEW - if index == PreviewModes.Full: - %RealSizeRemotePivotTransform.update_position = false - # REAL SIZE - if index == PreviewModes.Real or index == null: - %RealSizeRemotePivotTransform.update_position = true - update_preview() - DialogicUtil.set_editor_setting('character_preview_mode', 0) - func _on_full_preview_available_rect_resized(): - if current_preview_mode == PreviewModes.Full: + if %FitPreview_Toggle.button_pressed: update_preview() @@ -521,3 +502,14 @@ func _on_create_character_button_pressed(): 'character', ) + +func _on_fit_preview_toggle_toggled(button_pressed): + %FitPreview_Toggle.set_pressed_no_signal(button_pressed) + if button_pressed: + %FitPreview_Toggle.icon = get_theme_icon("ScrollContainer", "EditorIcons") + %FitPreview_Toggle.tooltip_text = "Real scale" + else: + %FitPreview_Toggle.tooltip_text = "Fit into preview" + %FitPreview_Toggle.icon = get_theme_icon("CenterContainer", "EditorIcons") + DialogicUtil.set_editor_setting('character_preview_fit', button_pressed) + update_preview() diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor.tscn b/addons/dialogic/Editor/CharacterEditor/character_editor.tscn index dab447da1..a4fda24f1 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor.tscn +++ b/addons/dialogic/Editor/CharacterEditor/character_editor.tscn @@ -1,23 +1,8 @@ -[gd_scene load_steps=19 format=3 uid="uid://dlskc36c5hrwv"] +[gd_scene load_steps=10 format=3 uid="uid://dlskc36c5hrwv"] [ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor.gd" id="2"] -[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn" id="2_01va3"] -[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_ptab_image.gd" id="2_cusvj"] +[ext_resource type="Texture2D" uid="uid://mc7a24bcvjo3" path="res://addons/dialogic/Editor/Images/Pieces/open-icon.svg" id="2_pfw6k"] [ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd" id="2_vad0i"] -[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_ptab_scene.gd" id="4_6tltp"] -[ext_resource type="PackedScene" uid="uid://7mvxuaulctcq" path="res://addons/dialogic/Editor/Events/Fields/FilePicker.tscn" id="4_a4bcu"] -[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_ptab_layout.gd" id="5_eicvp"] -[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_ptab_exports.gd" id="7_4enie"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_defg7"] -content_margin_left = 10.0 -content_margin_top = 4.0 -content_margin_right = 10.0 -content_margin_bottom = 4.0 -bg_color = Color(0, 0, 0, 1) -border_width_top = 2 -border_color = Color(1, 1, 1, 0.75) -corner_detail = 1 [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fv43a"] content_margin_left = 7.5 @@ -30,7 +15,7 @@ corner_radius_top_right = 2 corner_radius_bottom_right = 2 corner_radius_bottom_left = 2 -[sub_resource type="Image" id="Image_s8imb"] +[sub_resource type="Image" id="Image_yerk3"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -40,25 +25,11 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_mpcxh"] -image = SubResource("Image_s8imb") +image = SubResource("Image_yerk3") [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4xgdx"] -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_k4a75"] -content_margin_left = 4.0 -content_margin_top = 0.0 -content_margin_right = 4.0 -content_margin_bottom = 0.0 -bg_color = Color(0.1, 0.1, 0.1, 0.6) -border_width_bottom = 2 -border_color = Color(0, 0, 0, 0.6) -corner_radius_top_left = 3 -corner_radius_top_right = 3 -corner_radius_bottom_right = 3 -corner_radius_bottom_left = 3 -corner_detail = 5 - -[sub_resource type="Image" id="Image_d7ala"] +[sub_resource type="Image" id="Image_5fvib"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -67,35 +38,8 @@ data = { "width": 16 } -[sub_resource type="ImageTexture" id="ImageTexture_kntou"] -image = SubResource("Image_d7ala") - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8kdal"] -content_margin_left = 4.0 -content_margin_top = 0.0 -content_margin_right = 4.0 -content_margin_bottom = 0.0 -bg_color = Color(0.1, 0.1, 0.1, 0.6) -border_width_bottom = 2 -border_color = Color(0, 0, 0, 0.6) -corner_radius_top_left = 3 -corner_radius_top_right = 3 -corner_radius_bottom_right = 3 -corner_radius_bottom_left = 3 -corner_detail = 5 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mnrmp"] -content_margin_left = 4.0 -content_margin_top = 4.0 -content_margin_right = 4.0 -content_margin_bottom = 4.0 -bg_color = Color(1, 0.365, 0.365, 1) -draw_center = false -border_width_left = 2 -border_width_top = 2 -border_width_right = 2 -border_width_bottom = 2 -corner_detail = 1 +[sub_resource type="ImageTexture" id="ImageTexture_th6mo"] +image = SubResource("Image_5fvib") [node name="CharacterEditor" type="MarginContainer"] self_modulate = Color(0, 0, 0, 1) @@ -114,59 +58,91 @@ script = ExtResource("2") layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 +theme_override_constants/separation = 0 -[node name="Editor" type="VSplitContainer" parent="Split"] +[node name="HSplitContainer" type="HSplitContainer" parent="Split"] layout_mode = 2 size_flags_horizontal = 3 -size_flags_vertical = 11 +size_flags_stretch_ratio = 0.6 -[node name="EditorScroll" type="ScrollContainer" parent="Split/Editor"] +[node name="MainSettingsPanel" type="PanelContainer" parent="Split/HSplitContainer"] +unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 -size_flags_stretch_ratio = 0.0 -vertical_scroll_mode = 0 -[node name="MainEditTabs" type="TabContainer" parent="Split/Editor/EditorScroll"] +[node name="Scroll" type="ScrollContainer" parent="Split/HSplitContainer/MainSettingsPanel"] +layout_mode = 2 + +[node name="MainSettingsSections" type="VBoxContainer" parent="Split/HSplitContainer/MainSettingsPanel/Scroll"] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -theme_override_constants/side_margin = 5 -theme_override_styles/tab_selected = SubResource("StyleBoxFlat_defg7") -theme_override_styles/panel = SubResource("StyleBoxFlat_fv43a") -[node name="PortraitListSection" type="TabContainer" parent="Split/Editor"] +[node name="Scroll" type="ScrollContainer" parent="Split/HSplitContainer/MainSettingsPanel/Scroll/MainSettingsSections"] +layout_mode = 2 +horizontal_scroll_mode = 3 +vertical_scroll_mode = 0 + +[node name="HBox" type="HBoxContainer" parent="Split/HSplitContainer/MainSettingsPanel/Scroll/MainSettingsSections/Scroll"] +layout_mode = 2 + +[node name="CharacterName" type="Label" parent="Split/HSplitContainer/MainSettingsPanel/Scroll/MainSettingsSections/Scroll/HBox"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +text = "My Character" + +[node name="NameTooltip" type="TextureRect" parent="Split/HSplitContainer/MainSettingsPanel/Scroll/MainSettingsSections/Scroll/HBox"] +unique_name_in_owner = true +layout_mode = 2 +tooltip_text = "This name is determined from the file name. +Use this name in timelines to reference this character." +texture = ExtResource("2_pfw6k") +stretch_mode = 3 + +[node name="MarginContainer" type="MarginContainer" parent="Split/HSplitContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_bottom = 10 + +[node name="PortraitListSection" type="PanelContainer" parent="Split/HSplitContainer/MarginContainer"] unique_name_in_owner = true layout_mode = 2 -theme_override_constants/side_margin = 5 -theme_override_styles/tab_selected = SubResource("StyleBoxFlat_defg7") +size_flags_horizontal = 3 theme_override_styles/panel = SubResource("StyleBoxFlat_fv43a") -[node name="Portraits" type="VBoxContainer" parent="Split/Editor/PortraitListSection"] +[node name="Portraits" type="VBoxContainer" parent="Split/HSplitContainer/MarginContainer/PortraitListSection"] +layout_mode = 2 + +[node name="PortraitsTitle" type="Label" parent="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits"] +unique_name_in_owner = true layout_mode = 2 +text = "Portraits" -[node name="PortraitListTools" type="HBoxContainer" parent="Split/Editor/PortraitListSection/Portraits"] +[node name="PortraitListTools" type="HBoxContainer" parent="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits"] layout_mode = 2 -[node name="AddPortraitButton" type="Button" parent="Split/Editor/PortraitListSection/Portraits/PortraitListTools"] +[node name="AddPortraitButton" type="Button" parent="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits/PortraitListTools"] unique_name_in_owner = true layout_mode = 2 tooltip_text = "Add portrait" icon = SubResource("ImageTexture_mpcxh") -[node name="AddPortraitGroupButton" type="Button" parent="Split/Editor/PortraitListSection/Portraits/PortraitListTools"] +[node name="AddPortraitGroupButton" type="Button" parent="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits/PortraitListTools"] unique_name_in_owner = true layout_mode = 2 tooltip_text = "Add Group" icon = SubResource("ImageTexture_mpcxh") -[node name="ImportPortraitsButton" type="Button" parent="Split/Editor/PortraitListSection/Portraits/PortraitListTools"] +[node name="ImportPortraitsButton" type="Button" parent="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits/PortraitListTools"] unique_name_in_owner = true layout_mode = 2 tooltip_text = "Import images from folder" icon = SubResource("ImageTexture_mpcxh") -[node name="PortraitSearch" type="LineEdit" parent="Split/Editor/PortraitListSection/Portraits/PortraitListTools"] +[node name="PortraitSearch" type="LineEdit" parent="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits/PortraitListTools"] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 @@ -178,110 +154,70 @@ right_icon = SubResource("ImageTexture_mpcxh") caret_blink = true caret_blink_interval = 0.5 -[node name="Panel" type="PanelContainer" parent="Split/Editor/PortraitListSection/Portraits"] +[node name="PortraitTreePanel" type="PanelContainer" parent="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits"] layout_mode = 2 size_flags_vertical = 3 theme_override_styles/panel = SubResource("StyleBoxEmpty_4xgdx") -[node name="PortraitTree" type="Tree" parent="Split/Editor/PortraitListSection/Portraits/Panel"] +[node name="PortraitTree" type="Tree" parent="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits/PortraitTreePanel"] unique_name_in_owner = true layout_mode = 2 allow_rmb_select = true hide_root = true -drop_mode_flags = 1 +drop_mode_flags = 3 script = ExtResource("2_vad0i") -[node name="P Settings" type="VBoxContainer" parent="Split/Editor/PortraitListSection"] -visible = false -layout_mode = 2 - -[node name="DefaultPortrait" type="HBoxContainer" parent="Split/Editor/PortraitListSection/P Settings"] -layout_mode = 2 -size_flags_horizontal = 3 - -[node name="Label5" type="Label" parent="Split/Editor/PortraitListSection/P Settings/DefaultPortrait"] -layout_mode = 2 -text = "Default:" - -[node name="DefaultPortraitPicker" parent="Split/Editor/PortraitListSection/P Settings/DefaultPortrait" instance=ExtResource("2_01va3")] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -placeholder_text = "Select Portrait" - -[node name="HSeparator" type="HSeparator" parent="Split/Editor/PortraitListSection/P Settings"] -layout_mode = 2 +[node name="PortraitRightClickMenu" type="PopupMenu" parent="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits/PortraitTreePanel/PortraitTree"] +size = Vector2i(118, 100) +item_count = 2 +item_0/text = "Duplicate" +item_0/icon = SubResource("ImageTexture_th6mo") +item_0/id = 0 +item_1/text = "Delete" +item_1/icon = SubResource("ImageTexture_th6mo") +item_1/id = 1 -[node name="PortraitMainSettings" type="HFlowContainer" parent="Split/Editor/PortraitListSection/P Settings"] +[node name="RightSection" type="VBoxContainer" parent="Split"] layout_mode = 2 size_flags_horizontal = 3 +size_flags_stretch_ratio = 0.5 -[node name="Label" type="Label" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings"] -layout_mode = 2 -text = "Scale" - -[node name="MainScale" type="SpinBox" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings"] -unique_name_in_owner = true -layout_mode = 2 -value = 100.0 -allow_greater = true -suffix = "%" - -[node name="Offset" type="HBoxContainer" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings"] -layout_mode = 2 - -[node name="Label2" type="Label" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings/Offset"] +[node name="Spacer" type="Control" parent="Split/RightSection"] +custom_minimum_size = Vector2(0, 30) layout_mode = 2 -text = "Offset" -[node name="MainOffsetX" type="SpinBox" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings/Offset"] -unique_name_in_owner = true -layout_mode = 2 -allow_greater = true -allow_lesser = true -suffix = "X" - -[node name="MainOffsetY" type="SpinBox" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings/Offset"] -unique_name_in_owner = true -layout_mode = 2 -allow_greater = true -allow_lesser = true -suffix = "Y" - -[node name="MirrorOption" type="HBoxContainer" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings"] -layout_mode = 2 - -[node name="Label" type="Label" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings/MirrorOption"] -layout_mode = 2 -text = "Mirror" - -[node name="MainMirror" type="CheckBox" parent="Split/Editor/PortraitListSection/P Settings/PortraitMainSettings/MirrorOption"] -unique_name_in_owner = true -layout_mode = 2 - -[node name="RightSection" type="VSplitContainer" parent="Split"] +[node name="RightSection" type="VSplitContainer" parent="Split/RightSection"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -size_flags_stretch_ratio = 1.5 +size_flags_stretch_ratio = 0.5 -[node name="PortraitPreviewSection" type="Panel" parent="Split/RightSection"] +[node name="PortraitPreviewSection" type="Panel" parent="Split/RightSection/RightSection"] unique_name_in_owner = true -clip_contents = true +show_behind_parent = true layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_styles/panel = SubResource("StyleBoxFlat_fv43a") -[node name="Node2D" type="Node2D" parent="Split/RightSection/PortraitPreviewSection"] +[node name="ClipRect" type="Control" parent="Split/RightSection/RightSection/PortraitPreviewSection"] +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="Split/RightSection/RightSection/PortraitPreviewSection/ClipRect"] position = Vector2(13, 17) -[node name="RealPreviewPivot" type="Sprite2D" parent="Split/RightSection/PortraitPreviewSection/Node2D"] +[node name="RealPreviewPivot" type="Sprite2D" parent="Split/RightSection/RightSection/PortraitPreviewSection/ClipRect/Node2D"] unique_name_in_owner = true position = Vector2(330, 405) texture = SubResource("ImageTexture_mpcxh") -[node name="ScenePreviewWarning" type="Label" parent="Split/RightSection/PortraitPreviewSection"] +[node name="ScenePreviewWarning" type="Label" parent="Split/RightSection/RightSection/PortraitPreviewSection"] unique_name_in_owner = true visible = false layout_mode = 1 @@ -302,7 +238,7 @@ vertical_alignment = 1 autowrap_mode = 3 metadata/_edit_layout_mode = 1 -[node name="PreviewReal" type="CenterContainer" parent="Split/RightSection/PortraitPreviewSection"] +[node name="PreviewReal" type="CenterContainer" parent="Split/RightSection/RightSection/PortraitPreviewSection"] unique_name_in_owner = true layout_mode = 1 anchors_preset = 7 @@ -311,23 +247,23 @@ anchor_top = 1.0 anchor_right = 0.5 anchor_bottom = 1.0 offset_left = -302.0 -offset_top = -139.0 +offset_top = -80.0 offset_right = 302.0 grow_horizontal = 2 grow_vertical = 0 metadata/_edit_layout_mode = 1 -[node name="Control" type="Control" parent="Split/RightSection/PortraitPreviewSection/PreviewReal"] +[node name="Control" type="Control" parent="Split/RightSection/RightSection/PortraitPreviewSection/PreviewReal"] layout_mode = 2 -[node name="RealSizeRemotePivotTransform" type="RemoteTransform2D" parent="Split/RightSection/PortraitPreviewSection/PreviewReal/Control"] +[node name="RealSizeRemotePivotTransform" type="RemoteTransform2D" parent="Split/RightSection/RightSection/PortraitPreviewSection/PreviewReal/Control"] unique_name_in_owner = true -remote_path = NodePath("../../../Node2D/RealPreviewPivot") +remote_path = NodePath("../../../ClipRect/Node2D/RealPreviewPivot") update_position = false update_rotation = false update_scale = false -[node name="FullPreviewAvailableRect" type="Control" parent="Split/RightSection/PortraitPreviewSection"] +[node name="FullPreviewAvailableRect" type="Control" parent="Split/RightSection/RightSection/PortraitPreviewSection"] unique_name_in_owner = true layout_mode = 1 anchors_preset = 15 @@ -341,187 +277,50 @@ grow_horizontal = 2 grow_vertical = 2 metadata/_edit_layout_mode = 1 -[node name="PreviewLabel" type="Label" parent="Split/RightSection/PortraitPreviewSection"] +[node name="PreviewLabel" type="Label" parent="Split/RightSection/RightSection/PortraitPreviewSection"] unique_name_in_owner = true -layout_mode = 0 -offset_right = 40.0 -offset_bottom = 23.0 +show_behind_parent = true +layout_mode = 1 +anchors_preset = 10 +anchor_right = 1.0 +offset_left = -1.0 +offset_top = -23.0 +offset_right = -1.0 +offset_bottom = 3.0 +grow_horizontal = 2 text = "No portrait to preview." +horizontal_alignment = 2 +clip_text = true +text_overrun_behavior = 1 -[node name="PreviewMode" type="OptionButton" parent="Split/RightSection/PortraitPreviewSection"] +[node name="FitPreview_Toggle" type="Button" parent="Split/RightSection/RightSection/PortraitPreviewSection"] unique_name_in_owner = true layout_mode = 1 anchors_preset = 1 anchor_left = 1.0 anchor_right = 1.0 -offset_left = -121.0 -offset_top = 9.0 -offset_right = -9.0 -offset_bottom = 40.0 +offset_left = -38.0 +offset_top = 8.0 +offset_right = -7.0 +offset_bottom = 39.0 grow_horizontal = 0 -item_count = 2 -popup/item_0/text = "Full View" -popup/item_0/id = 0 -popup/item_1/text = "Real Size" -popup/item_1/id = 1 +focus_mode = 0 +toggle_mode = true +button_pressed = true +flat = true metadata/_edit_layout_mode = 1 -[node name="TextureRect" type="TextureRect" parent="Split/RightSection/PortraitPreviewSection"] -layout_mode = 0 -offset_top = -12.0 -offset_right = 597.0 -offset_bottom = -12.0 - -[node name="PortraitSettingsSection" type="TabContainer" parent="Split/RightSection"] -unique_name_in_owner = true +[node name="Scroll" type="ScrollContainer" parent="Split/RightSection/RightSection"] layout_mode = 2 size_flags_vertical = 3 -size_flags_stretch_ratio = 0.3 -theme_override_constants/side_margin = 5 -theme_override_styles/tab_selected = SubResource("StyleBoxFlat_defg7") -theme_override_styles/panel = SubResource("StyleBoxFlat_fv43a") - -[node name="Image" type="ScrollContainer" parent="Split/RightSection/PortraitSettingsSection"] -custom_minimum_size = Vector2(0, 35) -layout_mode = 2 -horizontal_scroll_mode = 0 -script = ExtResource("2_cusvj") - -[node name="Flow" type="HFlowContainer" parent="Split/RightSection/PortraitSettingsSection/Image"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="GridContainer" type="GridContainer" parent="Split/RightSection/PortraitSettingsSection/Image/Flow"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 -columns = 2 - -[node name="Label" type="Label" parent="Split/RightSection/PortraitSettingsSection/Image/Flow/GridContainer"] -layout_mode = 2 -text = "Image: " - -[node name="ImagePicker" parent="Split/RightSection/PortraitSettingsSection/Image/Flow/GridContainer" instance=ExtResource("4_a4bcu")] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_styles/panel = SubResource("StyleBoxFlat_k4a75") -file_filter = "*.png, *.svg" -resource_icon = SubResource("ImageTexture_kntou") - -[node name="Scene" type="ScrollContainer" parent="Split/RightSection/PortraitSettingsSection"] -visible = false -custom_minimum_size = Vector2(0, 35) -layout_mode = 2 -horizontal_scroll_mode = 0 -script = ExtResource("4_6tltp") - -[node name="Flow" type="HFlowContainer" parent="Split/RightSection/PortraitSettingsSection/Scene"] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="GridContainer" type="GridContainer" parent="Split/RightSection/PortraitSettingsSection/Scene/Flow"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 -columns = 2 - -[node name="Label" type="Label" parent="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer"] -layout_mode = 2 -text = "Scene: " - -[node name="ScenePicker" parent="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer" instance=ExtResource("4_a4bcu")] -unique_name_in_owner = true -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_styles/panel = SubResource("StyleBoxFlat_8kdal") -file_filter = "*.tscn" -placeholder = "Default scene" -resource_icon = SubResource("ImageTexture_kntou") - -[node name="Label2" type="Label" parent="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer"] -layout_mode = 2 -text = "Ignore scale: " +size_flags_stretch_ratio = 0.4 -[node name="IgnoreScale" type="CheckBox" parent="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer"] +[node name="PortraitSettingsSection" type="VBoxContainer" parent="Split/RightSection/RightSection/Scroll"] unique_name_in_owner = true layout_mode = 2 - -[node name="Layout" type="ScrollContainer" parent="Split/RightSection/PortraitSettingsSection"] -visible = false -custom_minimum_size = Vector2(0, 35) -layout_mode = 2 -horizontal_scroll_mode = 0 -script = ExtResource("5_eicvp") - -[node name="Flow" type="HFlowContainer" parent="Split/RightSection/PortraitSettingsSection/Layout"] -layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 - -[node name="HBoxContainer" type="HBoxContainer" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow"] -layout_mode = 2 - -[node name="Label" type="Label" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer"] -layout_mode = 2 -text = "Scale:" - -[node name="PortraitScale" type="SpinBox" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer"] -unique_name_in_owner = true -layout_mode = 2 -value = 100.0 -allow_greater = true -suffix = "%" - -[node name="HBoxContainer2" type="HBoxContainer" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow"] -layout_mode = 2 - -[node name="Label2" type="Label" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer2"] -layout_mode = 2 -text = "Offset:" - -[node name="PortraitOffsetX" type="SpinBox" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer2"] -unique_name_in_owner = true -layout_mode = 2 -allow_greater = true -allow_lesser = true -suffix = "X" - -[node name="PortraitOffsetY" type="SpinBox" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer2"] -unique_name_in_owner = true -layout_mode = 2 -allow_greater = true -allow_lesser = true -suffix = "Y" - -[node name="MirrorOption" type="HBoxContainer" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow"] -layout_mode = 2 - -[node name="Label" type="Label" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/MirrorOption"] -layout_mode = 2 -text = "Mirror:" - -[node name="PortraitMirror" type="CheckBox" parent="Split/RightSection/PortraitSettingsSection/Layout/Flow/MirrorOption"] -unique_name_in_owner = true -layout_mode = 2 - -[node name="Exports" type="ScrollContainer" parent="Split/RightSection/PortraitSettingsSection"] -visible = false -custom_minimum_size = Vector2(0, 35) -layout_mode = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_mnrmp") -horizontal_scroll_mode = 0 -script = ExtResource("7_4enie") - -[node name="Grid" type="GridContainer" parent="Split/RightSection/PortraitSettingsSection/Exports"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 -theme_override_constants/h_separation = 10 -columns = 2 +size_flags_stretch_ratio = 0.3 [node name="NoCharacterScreen" type="ColorRect" parent="."] layout_mode = 2 @@ -547,17 +346,13 @@ Create a character or double-click one in the file system dock." horizontal_alignment = 1 autowrap_mode = 3 -[node name="CreateTimelineButton" type="Button" parent="NoCharacterScreen/CenterContainer/VBoxContainer"] +[node name="CreateCharacterButton" type="Button" parent="NoCharacterScreen/CenterContainer/VBoxContainer"] layout_mode = 2 text = "Create New Character" -[connection signal="button_clicked" from="Split/Editor/PortraitListSection/Portraits/Panel/PortraitTree" to="." method="_on_portrait_tree_button_clicked"] -[connection signal="resized" from="Split/RightSection/PortraitPreviewSection/FullPreviewAvailableRect" to="." method="_on_full_preview_available_rect_resized"] -[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Image/Flow/GridContainer/ImagePicker" to="Split/RightSection/PortraitSettingsSection/Image" method="_on_image_picker_value_changed"] -[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer/ScenePicker" to="Split/RightSection/PortraitSettingsSection/Scene" method="_on_scene_picker_value_changed"] -[connection signal="toggled" from="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer/IgnoreScale" to="Split/RightSection/PortraitSettingsSection/Scene" method="_on_ignore_scale_toggled"] -[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer/PortraitScale" to="Split/RightSection/PortraitSettingsSection/Layout" method="_on_portrait_scale_value_changed"] -[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer2/PortraitOffsetX" to="Split/RightSection/PortraitSettingsSection/Layout" method="_on_portrait_offset_x_value_changed"] -[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer2/PortraitOffsetY" to="Split/RightSection/PortraitSettingsSection/Layout" method="_on_portrait_offset_y_value_changed"] -[connection signal="toggled" from="Split/RightSection/PortraitSettingsSection/Layout/Flow/MirrorOption/PortraitMirror" to="Split/RightSection/PortraitSettingsSection/Layout" method="_on_portrait_mirror_toggled"] -[connection signal="pressed" from="NoCharacterScreen/CenterContainer/VBoxContainer/CreateTimelineButton" to="." method="_on_create_timeline_button_pressed"] +[connection signal="button_clicked" from="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits/PortraitTreePanel/PortraitTree" to="." method="_on_portrait_tree_button_clicked"] +[connection signal="item_mouse_selected" from="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits/PortraitTreePanel/PortraitTree" to="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits/PortraitTreePanel/PortraitTree" method="_on_item_mouse_selected"] +[connection signal="index_pressed" from="Split/HSplitContainer/MarginContainer/PortraitListSection/Portraits/PortraitTreePanel/PortraitTree/PortraitRightClickMenu" to="." method="_on_portrait_right_click_menu_index_pressed"] +[connection signal="resized" from="Split/RightSection/RightSection/PortraitPreviewSection/FullPreviewAvailableRect" to="." method="_on_full_preview_available_rect_resized"] +[connection signal="toggled" from="Split/RightSection/RightSection/PortraitPreviewSection/FitPreview_Toggle" to="." method="_on_fit_preview_toggle_toggled"] +[connection signal="pressed" from="NoCharacterScreen/CenterContainer/VBoxContainer/CreateCharacterButton" to="." method="_on_create_character_button_pressed"] diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor_main_tab.gd b/addons/dialogic/Editor/CharacterEditor/character_editor_main_settings_section.gd similarity index 88% rename from addons/dialogic/Editor/CharacterEditor/character_editor_main_tab.gd rename to addons/dialogic/Editor/CharacterEditor/character_editor_main_settings_section.gd index 45aef4a1b..238eedb9a 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor_main_tab.gd +++ b/addons/dialogic/Editor/CharacterEditor/character_editor_main_settings_section.gd @@ -1,5 +1,5 @@ @tool -class_name DialogicCharacterEditorMainTab +class_name DialogicCharacterEditorMainSection extends Control ## Base class for all character editor main tabs. Methods should be overriden. diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor_portrait_settings_tab.gd b/addons/dialogic/Editor/CharacterEditor/character_editor_portrait_settings_section.gd similarity index 70% rename from addons/dialogic/Editor/CharacterEditor/character_editor_portrait_settings_tab.gd rename to addons/dialogic/Editor/CharacterEditor/character_editor_portrait_settings_section.gd index 5570a62dd..1e485bb80 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor_portrait_settings_tab.gd +++ b/addons/dialogic/Editor/CharacterEditor/character_editor_portrait_settings_section.gd @@ -1,6 +1,6 @@ @tool -class_name DialogicCharacterEditorPortraitSettingsTab -extends ScrollContainer +class_name DialogicCharacterEditorPortraitSection +extends Control ## Base class for all portrait settings tabs. Methods should be overriden. @@ -14,3 +14,6 @@ var selected_item :TreeItem = null func _load_portrait_data(data:Dictionary) -> void: pass + +func _recheck(data:Dictionary) -> void: + pass diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd b/addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd index 41b2c04b1..32750c62f 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd +++ b/addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd @@ -7,6 +7,11 @@ var editor = find_parent('Character Editor') var current_group_nodes := {} +func _ready() -> void: + $PortraitRightClickMenu.set_item_icon(0, get_theme_icon('Duplicate', 'EditorIcons')) + $PortraitRightClickMenu.set_item_icon(1, get_theme_icon('Remove', 'EditorIcons')) + + func clear_tree() -> void: clear() current_group_nodes = {} @@ -18,17 +23,14 @@ func add_portrait_item(portrait_name:String, portrait_data:Dictionary, parent_it item.set_metadata(0, portrait_data) if portrait_name == editor.current_resource.default_portrait: item.add_button(0, get_theme_icon('Favorites', 'EditorIcons'), 2, true, 'Default') - item.add_button(0, get_theme_icon('Duplicate', 'EditorIcons'), 3, false, 'Duplicate') - item.add_button(0, get_theme_icon('Remove', 'EditorIcons'), 1, false, 'Remove') return item func add_portrait_group(goup_name:String = "Group", parent_item:TreeItem = get_root()) -> TreeItem: var item :TreeItem = %PortraitTree.create_item(parent_item) - item.set_icon(0, get_theme_icon("Groups", "EditorIcons")) + item.set_icon(0, get_theme_icon("Folder", "EditorIcons")) item.set_text(0, goup_name) item.set_metadata(0, {'group':true}) - item.add_button(0, get_theme_icon('Remove', 'EditorIcons'), 1, false, 'Remove') return item @@ -58,13 +60,18 @@ func create_necessary_group_items(path:String) -> TreeItem: return last_item +func _on_item_mouse_selected(pos:Vector2, mouse_button_index): + if mouse_button_index == MOUSE_BUTTON_RIGHT: + $PortraitRightClickMenu.popup_on_parent(Rect2(get_global_mouse_position(),Vector2())) + + + ################################################################################ ## DRAG AND DROP ################################################################################ func _get_drag_data(position:Vector2) -> Variant: - set_drop_mode_flags(DROP_MODE_ON_ITEM) - + drop_mode_flags = DROP_MODE_INBETWEEN var preview := Label.new() preview.text = " "+get_selected().get_text(0) preview.add_theme_stylebox_override('normal', get_theme_stylebox("Background", "EditorStyles")) @@ -88,18 +95,22 @@ func _drop_data(position:Vector2, item:Variant) -> void: if test_item == get_root(): break + var drop_section := get_drop_section_at_position(position) var parent := get_root() if to_item: parent = to_item.get_parent() - if to_item and to_item.get_metadata(0).has('group'): + if to_item and to_item.get_metadata(0).has('group') and drop_section == 1: parent = to_item var new_item := copy_branch_or_item(item, parent) - if to_item and !to_item.get_metadata(0).has('group'): + if to_item and !to_item.get_metadata(0).has('group') and drop_section == 1: new_item.move_after(to_item) + if drop_section == -1: + new_item.move_before(to_item) + item.free() @@ -113,3 +124,4 @@ func copy_branch_or_item(item:TreeItem, new_parent:TreeItem) -> TreeItem: for child in item.get_children(): copy_branch_or_item(child, new_item) return new_item + diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor_ptab_image.gd b/addons/dialogic/Editor/CharacterEditor/character_editor_ptab_image.gd deleted file mode 100644 index bec8e40a3..000000000 --- a/addons/dialogic/Editor/CharacterEditor/character_editor_ptab_image.gd +++ /dev/null @@ -1,25 +0,0 @@ -@tool -extends DialogicCharacterEditorPortraitSettingsTab - -## Tab that allows setting an image file on a portrait. - - -func _ready() -> void: - get_parent().set_tab_icon(get_index(), get_theme_icon('Image', 'EditorIcons')) - %ImagePicker.file_filter = "*.png, *.svg" - %ImagePicker.resource_icon = get_theme_icon('Image', 'EditorIcons') - - -func _load_portrait_data(data:Dictionary) -> void: - # hides/shows this tab based on the scene value of this portrait - # (only shown if the default scene is used) - get_parent().set_tab_hidden(get_index(), !data.get('scene', '').is_empty()) - - %ImagePicker.set_value(data.get('image', '')) - - -func _on_image_picker_value_changed(prop_name:String, value:String): - var data:Dictionary = selected_item.get_metadata(0) - data['image'] = value - changed.emit() - update_preview.emit() diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor_ptab_scene.gd b/addons/dialogic/Editor/CharacterEditor/character_editor_ptab_scene.gd deleted file mode 100644 index 1bb61b0ee..000000000 --- a/addons/dialogic/Editor/CharacterEditor/character_editor_ptab_scene.gd +++ /dev/null @@ -1,30 +0,0 @@ -@tool -extends DialogicCharacterEditorPortraitSettingsTab - -## Tab that allows setting a custom scene. - - -func _ready(): - get_parent().set_tab_icon(get_index(), get_theme_icon('PackedScene', 'EditorIcons')) - %ScenePicker.file_filter = "*.tscn" - %ScenePicker.resource_icon = get_theme_icon('PackedScene', 'EditorIcons') - %ScenePicker.placeholder = 'Default scene' - - -func _load_portrait_data(data:Dictionary) -> void: - %ScenePicker.set_value(data.get('scene', '')) - %IgnoreScale.button_pressed = data.get('ignore_char_scale', false) - - -func _on_scene_picker_value_changed(prop_name:String, value:String) -> void: - var data:Dictionary = selected_item.get_metadata(0) - data['scene'] = value - update_preview.emit() - changed.emit() - - -func _on_ignore_scale_toggled(button_pressed): - var data:Dictionary = selected_item.get_metadata(0) - data['ignore_char_scale'] = button_pressed - update_preview.emit() - changed.emit() diff --git a/addons/dialogic/Editor/Events/Fields/ComplexPicker.gd b/addons/dialogic/Editor/Events/Fields/ComplexPicker.gd index 6167895dc..9b83dca9d 100644 --- a/addons/dialogic/Editor/Events/Fields/ComplexPicker.gd +++ b/addons/dialogic/Editor/Events/Fields/ComplexPicker.gd @@ -15,6 +15,7 @@ var file_extension : String = "" var get_suggestions_func : Callable = get_default_suggestions var empty_text : String = "" @export var enable_pretty_name : bool = false +@export var fit_text_length : bool = true var resource_icon : Texture = null: get: @@ -71,6 +72,7 @@ func _ready(): var scale: float = DialogicUtil.get_editor_scale() %SelectButton.icon = get_theme_icon("Collapse", "EditorIcons") %Search.placeholder_text = placeholder_text + %Search.expand_to_text_length = fit_text_length %Suggestions.add_theme_stylebox_override('bg', load("res://addons/dialogic/Editor/Events/styles/ResourceMenuPanelBackground.tres")) %Suggestions.hide() %Suggestions.item_selected.connect(suggestion_selected) @@ -153,6 +155,8 @@ func get_default_suggestions(input:String) -> Dictionary: func suggestion_selected(index : int, position:=Vector2(), button_index:=MOUSE_BUTTON_LEFT) -> void: + if button_index != MOUSE_BUTTON_LEFT: + return if %Suggestions.is_item_disabled(index): return @@ -174,7 +178,7 @@ func suggestion_selected(index : int, position:=Vector2(), button_index:=MOUSE_B emit_signal("value_changed", property_name, current_value) func _input(event:InputEvent): - if event is InputEventMouseButton and event.pressed: + if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT: if %Suggestions.visible: if !%Suggestions.get_global_rect().has_point(get_global_mouse_position()): hide_suggestions() diff --git a/addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn b/addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn index 7f68e473b..0a203a5ab 100644 --- a/addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn +++ b/addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.gd" id="1"] -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nxpo5"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_eo5hy"] content_margin_left = 4.0 content_margin_top = 4.0 content_margin_right = 4.0 @@ -18,7 +18,7 @@ corner_detail = 5 [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_vennf"] -[sub_resource type="Image" id="Image_pax1c"] +[sub_resource type="Image" id="Image_ykvnc"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -27,10 +27,10 @@ data = { "width": 16 } -[sub_resource type="ImageTexture" id="ImageTexture_qktsr"] -image = SubResource("Image_pax1c") +[sub_resource type="ImageTexture" id="ImageTexture_ay30j"] +image = SubResource("Image_ykvnc") -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_sys5h"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_w5nny"] content_margin_left = 4.0 content_margin_top = 4.0 content_margin_right = 4.0 @@ -78,7 +78,7 @@ theme_override_constants/margin_bottom = 0 unique_name_in_owner = true layout_mode = 2 mouse_filter = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_nxpo5") +theme_override_styles/panel = SubResource("StyleBoxFlat_eo5hy") metadata/_edit_use_anchors_ = true [node name="MarginContainer" type="MarginContainer" parent="PanelContainer"] @@ -134,7 +134,7 @@ layout_mode = 2 focus_mode = 0 toggle_mode = true shortcut_in_tooltip = false -icon = SubResource("ImageTexture_qktsr") +icon = SubResource("ImageTexture_ay30j") flat = true [node name="Focus" type="Panel" parent="PanelContainer"] @@ -142,7 +142,7 @@ unique_name_in_owner = true visible = false layout_mode = 2 mouse_filter = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_sys5h") +theme_override_styles/panel = SubResource("StyleBoxFlat_w5nny") metadata/_edit_use_anchors_ = true [connection signal="focus_entered" from="." to="." method="_on_focus_entered"] diff --git a/addons/dialogic/Editor/Events/Fields/Number.gd b/addons/dialogic/Editor/Events/Fields/Number.gd index c4391bd84..44b04cefe 100644 --- a/addons/dialogic/Editor/Events/Fields/Number.gd +++ b/addons/dialogic/Editor/Events/Fields/Number.gd @@ -21,12 +21,12 @@ func _ready(): $Value.add_theme_stylebox_override('normal', get_theme_stylebox('normal', 'LineEdit')) $Value.add_theme_stylebox_override('focus', get_theme_stylebox('focus', 'LineEdit')) - func set_value(new_value) -> void: if new_value: _on_value_text_submitted(str(new_value)) else: _on_value_text_submitted(str(value)) + $Value.tooltip_text = tooltip_text func get_value(): return value diff --git a/addons/dialogic/Editor/Events/Fields/Vector2.gd b/addons/dialogic/Editor/Events/Fields/Vector2.gd index f5b5c49d9..3c02d2e03 100644 --- a/addons/dialogic/Editor/Events/Fields/Vector2.gd +++ b/addons/dialogic/Editor/Events/Fields/Vector2.gd @@ -6,14 +6,21 @@ extends Control signal value_changed var property_name : String +var current_value := Vector2() + func _ready() -> void: $X.value_changed.connect(_on_value_changed) $Y.value_changed.connect(_on_value_changed) + func _on_value_changed(property:String, value:float) -> void: - emit_signal("value_changed", property_name, Vector2($X.value, $Y.value)) + current_value = Vector2($X.value, $Y.value) + emit_signal("value_changed", property_name, current_value) func set_value(value:Vector2) -> void: + $X.tooltip_text = tooltip_text + $Y.tooltip_text = tooltip_text $X.set_value(value.x) $Y.set_value(value.y) + current_value = value diff --git a/addons/dialogic/Modules/Character/preview_character.png b/addons/dialogic/Editor/Images/preview_character.png similarity index 100% rename from addons/dialogic/Modules/Character/preview_character.png rename to addons/dialogic/Editor/Images/preview_character.png diff --git a/addons/dialogic/Modules/Character/preview_character.png.import b/addons/dialogic/Editor/Images/preview_character.png.import similarity index 67% rename from addons/dialogic/Modules/Character/preview_character.png.import rename to addons/dialogic/Editor/Images/preview_character.png.import index 140f3f8c2..abf95b106 100644 --- a/addons/dialogic/Modules/Character/preview_character.png.import +++ b/addons/dialogic/Editor/Images/preview_character.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://41634vnjwsfw" -path="res://.godot/imported/preview_character.png-e76a7e79877ef6b610dfbecbeeb930fb.ctex" +path="res://.godot/imported/preview_character.png-54f0625ad8281c635fea35a4930d95b6.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/dialogic/Modules/Character/preview_character.png" -dest_files=["res://.godot/imported/preview_character.png-e76a7e79877ef6b610dfbecbeeb930fb.ctex"] +source_file="res://addons/dialogic/Editor/Images/preview_character.png" +dest_files=["res://.godot/imported/preview_character.png-54f0625ad8281c635fea35a4930d95b6.ctex"] [params] diff --git a/addons/dialogic/Modules/Character/preview_character.tres b/addons/dialogic/Modules/Character/preview_character.tres index 4f27bbcf7..83a2bb4d2 100644 --- a/addons/dialogic/Modules/Character/preview_character.tres +++ b/addons/dialogic/Modules/Character/preview_character.tres @@ -14,7 +14,7 @@ mirror = false default_portrait = "preview" portraits = { "preview": { -"image": "res://addons/dialogic/Events/Character/preview_character.png" +"image": "res://addons/dialogic/Editor/Images/preview_character.png" } } custom_info = {} diff --git a/addons/dialogic/Modules/Style/character_settings_style.gd b/addons/dialogic/Modules/Style/character_settings_style.gd index 76c77ddef..d53f00cdc 100644 --- a/addons/dialogic/Modules/Style/character_settings_style.gd +++ b/addons/dialogic/Modules/Style/character_settings_style.gd @@ -1,9 +1,12 @@ @tool -extends DialogicCharacterEditorMainTab +extends DialogicCharacterEditorMainSection ## Character editor tab that allows setting a custom style fot the character. +func _ready(): + $InfoLabel.add_theme_color_override('font_color', get_theme_color("readonly_color", "Editor")) + func _load_character(character:DialogicCharacter) -> void: %StyleName.text = character.custom_info.get('style', '') diff --git a/addons/dialogic/Modules/Style/character_settings_style.tscn b/addons/dialogic/Modules/Style/character_settings_style.tscn index ea15ba4d8..612a847f8 100644 --- a/addons/dialogic/Modules/Style/character_settings_style.tscn +++ b/addons/dialogic/Modules/Style/character_settings_style.tscn @@ -1,27 +1,28 @@ -[gd_scene load_steps=2 format=3] +[gd_scene load_steps=2 format=3 uid="uid://fgplvp0f3giu"] [ext_resource type="Script" path="res://addons/dialogic/Modules/Style/character_settings_style.gd" id="2"] -[node name="Style" type="HBoxContainer"] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -offset_bottom = -569.0 -grow_horizontal = 2 -grow_vertical = 2 +[node name="Style" type="VBoxContainer"] +offset_right = 280.0 +offset_bottom = 79.0 script = ExtResource("2") -[node name="Label" type="Label" parent="."] +[node name="Style" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="Label" type="Label" parent="Style"] layout_mode = 2 -offset_right = 42.0 -offset_bottom = 26.0 size_flags_vertical = 0 text = "Style:" -[node name="StyleName" type="LineEdit" parent="."] +[node name="StyleName" type="LineEdit" parent="Style"] unique_name_in_owner = true layout_mode = 2 -offset_left = 46.0 -offset_right = 113.0 -offset_bottom = 31.0 +size_flags_horizontal = 3 +size_flags_vertical = 0 + +[node name="InfoLabel" type="Label" parent="."] +layout_mode = 2 size_flags_vertical = 0 +text = "Whenever this character speaks, dialogic will switch to this style. It has to be defined in the layout scene and is a pretty advanced feature." +autowrap_mode = 3 diff --git a/addons/dialogic/Modules/Style/index.gd b/addons/dialogic/Modules/Style/index.gd index 43e901253..17988ae67 100644 --- a/addons/dialogic/Modules/Style/index.gd +++ b/addons/dialogic/Modules/Style/index.gd @@ -10,5 +10,5 @@ func _get_subsystems() -> Array: return [{'name':'Styles', 'script':this_folder.path_join('subsystem_styles.gd')}] -func _get_character_editor_tabs() -> Array: +func _get_character_editor_sections() -> Array: return [this_folder.path_join('character_settings_style.tscn')] diff --git a/addons/dialogic/Modules/Text/character_settings/character_settings_text.gd b/addons/dialogic/Modules/Text/character_settings/character_moods_settings.gd similarity index 75% rename from addons/dialogic/Modules/Text/character_settings/character_settings_text.gd rename to addons/dialogic/Modules/Text/character_settings/character_moods_settings.gd index 0a70225ed..5a03957ef 100644 --- a/addons/dialogic/Modules/Text/character_settings/character_settings_text.gd +++ b/addons/dialogic/Modules/Text/character_settings/character_moods_settings.gd @@ -1,5 +1,5 @@ @tool -extends DialogicCharacterEditorMainTab +extends DialogicCharacterEditorMainSection ## Character editor tab that allows editing typing sound moods. @@ -12,11 +12,12 @@ func _load_character(character:DialogicCharacter): for mood in %Moods.get_children(): mood.queue_free() - %PortraitMood.set_value('') %DefaultMood.set_value(character.custom_info.get('sound_moods_default', '')) for mood in character.custom_info.get('sound_moods', {}): create_mood_item(character.custom_info.sound_moods[mood]) + + character_editor.get_settings_section_by_name('Typing Sound Mood', false).update_visibility(%Moods.get_child_count() != 0) func _save_changes(character:DialogicCharacter) -> DialogicCharacter: @@ -40,15 +41,10 @@ func set_portrait_data(data:Dictionary) -> void: func _ready(): - character_editor.portrait_selected.connect(_on_portrait_selected) - %PortraitMood.get_suggestions_func = mood_suggestions %DefaultMood.get_suggestions_func = mood_suggestions + %AddMood.icon = get_theme_icon("Add", "EditorIcons") -func _on_portrait_selected(portrait_name:String, data:Dictionary) -> void: - %PortraitMood.set_value(data.get('sound_mood', '')) - %PortraitMoodLabel.text = 'Mood for "%s":'%portrait_name - ################################################################################ ## OWN STUFF @@ -60,11 +56,13 @@ func _on_AddMood_pressed() -> void: func create_mood_item(data:Dictionary) -> void: - var new_mood = load(get_script().resource_path.get_base_dir().path_join('ui_mood_item.tscn')).instantiate() + var new_mood :Control = load(get_script().resource_path.get_base_dir().path_join('ui_mood_item.tscn')).instantiate() %Moods.add_child(new_mood) new_mood.load_data(data) - new_mood.duplicate.connect(duplicate_mood_item.bind(new_mood)) + new_mood.duplicate_request.connect(duplicate_mood_item.bind(new_mood)) new_mood.changed.connect(emit_signal.bind('changed')) + + character_editor.get_settings_section_by_name('Typing Sound Mood', false).update_visibility(true) func duplicate_mood_item(item:Control) -> void: @@ -79,15 +77,12 @@ func mood_suggestions(filter:String) -> Dictionary: return suggestions -func _on_PortraitMood_value_changed(property_name:String, value:Variant): - var data: Dictionary = get_portrait_data() - data['sound_mood'] = value - set_portrait_data(data) - changed.emit() - - func _on_default_mood_value_changed(property_name:String, value:Variant): var data: Dictionary = get_portrait_data() data['sound_mood_default'] = value set_portrait_data(data) changed.emit() + + +func _on_moods_child_exiting_tree(node): + character_editor.get_settings_section_by_name('Typing Sound Mood', false).update_visibility(%Moods.get_child_count()-1 != 0) diff --git a/addons/dialogic/Modules/Text/character_settings/character_moods_settings.tscn b/addons/dialogic/Modules/Text/character_settings/character_moods_settings.tscn new file mode 100644 index 000000000..fce068474 --- /dev/null +++ b/addons/dialogic/Modules/Text/character_settings/character_moods_settings.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=5 format=3 uid="uid://8ad1pwbjuqpt"] + +[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/character_settings/character_moods_settings.gd" id="1_3px07"] +[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn" id="2_wo52a"] + +[sub_resource type="Image" id="Image_saj5a"] +data = { +"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), +"format": "RGBA8", +"height": 16, +"mipmaps": false, +"width": 16 +} + +[sub_resource type="ImageTexture" id="ImageTexture_d2fmg"] +image = SubResource("Image_saj5a") + +[node name="Typing Sounds" type="VBoxContainer"] +offset_right = 443.0 +offset_bottom = 144.0 +script = ExtResource("1_3px07") + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="AddMood" type="Button" parent="HBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +tooltip_text = "Add type sound mood" +icon = SubResource("ImageTexture_d2fmg") + +[node name="Moods" type="VBoxContainer" parent="."] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="DefaultMood" type="HBoxContainer" parent="."] +layout_mode = 2 + +[node name="DefaultMoodLabel" type="Label" parent="DefaultMood"] +layout_mode = 2 +text = "Default:" + +[node name="DefaultMood" parent="DefaultMood" instance=ExtResource("2_wo52a")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +placeholder_text = "Select Default Mood" +fit_text_length = false + +[connection signal="pressed" from="HBoxContainer/AddMood" to="." method="_on_AddMood_pressed"] +[connection signal="child_exiting_tree" from="Moods" to="." method="_on_moods_child_exiting_tree"] +[connection signal="value_changed" from="DefaultMood/DefaultMood" to="." method="_on_default_mood_value_changed"] diff --git a/addons/dialogic/Modules/Text/character_settings/character_portrait_mood_settings.gd b/addons/dialogic/Modules/Text/character_settings/character_portrait_mood_settings.gd new file mode 100644 index 000000000..120df7d35 --- /dev/null +++ b/addons/dialogic/Modules/Text/character_settings/character_portrait_mood_settings.gd @@ -0,0 +1,32 @@ +@tool +extends DialogicCharacterEditorPortraitSection + + +func _ready() -> void: + %PortraitMood.get_suggestions_func = mood_suggestions + + +func _load_portrait_data(data:Dictionary): + %PortraitMood.set_value(data.get('mood')) + + +func update_visibility(show:=true): + if !show: + hide() + get_parent().get_child(get_index()-1).hide() + get_parent().get_child(get_index()+1).hide() + else: + get_parent().get_child(get_index()-1).show() + + +func _on_portrait_mood_value_changed(property_name:String, value:String): + var data: Dictionary = selected_item.get_metadata(0) + data['sound_mood'] = value + changed.emit() + + +func mood_suggestions(filter:String) -> Dictionary: + var suggestions := {} + for child in character_editor.get_settings_section_by_name('Typing Sounds').get_node('%Moods').get_children(): + suggestions[child.get_data().name] = {'value':child.get_data().name} + return suggestions diff --git a/addons/dialogic/Modules/Text/character_settings/character_portrait_mood_settings.tscn b/addons/dialogic/Modules/Text/character_settings/character_portrait_mood_settings.tscn new file mode 100644 index 000000000..9616d2009 --- /dev/null +++ b/addons/dialogic/Modules/Text/character_settings/character_portrait_mood_settings.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=3 format=3 uid="uid://bvfiv5uhmkqq7"] + +[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/character_settings/character_portrait_mood_settings.gd" id="1_5ni5u"] +[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn" id="1_oggvu"] + +[node name="Typing Sound Mood" type="HBoxContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_5ni5u") + +[node name="PortraitMoodLabel" type="Label" parent="."] +unique_name_in_owner = true +layout_mode = 2 +text = "Sound Mood:" + +[node name="PortraitMood" parent="." instance=ExtResource("1_oggvu")] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +placeholder_text = "Select Mood" + +[connection signal="value_changed" from="PortraitMood" to="." method="_on_portrait_mood_value_changed"] diff --git a/addons/dialogic/Modules/Text/character_settings/character_settings_text.tscn b/addons/dialogic/Modules/Text/character_settings/character_settings_text.tscn deleted file mode 100644 index a24776889..000000000 --- a/addons/dialogic/Modules/Text/character_settings/character_settings_text.tscn +++ /dev/null @@ -1,86 +0,0 @@ -[gd_scene load_steps=3 format=3] - -[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/character_settings/character_settings_text.gd" id="1"] -[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn" id="2"] - -[node name="TypingSounds" type="VBoxContainer"] -custom_minimum_size = Vector2(0, 130) -offset_right = 443.0 -offset_bottom = 100.0 -size_flags_vertical = 3 -script = ExtResource("1") - -[node name="DefaultMood" type="HBoxContainer" parent="."] -offset_right = 315.0 -offset_bottom = 33.0 -size_flags_horizontal = 0 - -[node name="DefaultMoodLabel" type="Label" parent="DefaultMood"] -offset_top = 3.0 -offset_right = 111.0 -offset_bottom = 29.0 -size_flags_horizontal = 3 -text = "Default mood:" - -[node name="DefaultMood" parent="DefaultMood" instance=ExtResource("2")] -unique_name_in_owner = true -anchor_right = 0.0 -anchor_bottom = 0.0 -offset_left = 115.0 -offset_right = 315.0 -offset_bottom = 33.0 -placeholder_text = "Select Mood" - -[node name="PortraitMood" type="HBoxContainer" parent="."] -offset_top = 37.0 -offset_right = 325.0 -offset_bottom = 70.0 -size_flags_horizontal = 0 - -[node name="PortraitMoodLabel" type="Label" parent="PortraitMood"] -unique_name_in_owner = true -offset_top = 3.0 -offset_right = 121.0 -offset_bottom = 29.0 -size_flags_horizontal = 3 -text = "Mood for \"sad\":" - -[node name="PortraitMood" parent="PortraitMood" instance=ExtResource("2")] -unique_name_in_owner = true -anchor_right = 0.0 -anchor_bottom = 0.0 -offset_left = 125.0 -offset_right = 325.0 -offset_bottom = 33.0 -placeholder_text = "Select Mood" - -[node name="HBoxContainer" type="HBoxContainer" parent="."] -offset_top = 74.0 -offset_right = 443.0 -offset_bottom = 105.0 -alignment = 2 - -[node name="AddMood" type="Button" parent="HBoxContainer"] -unique_name_in_owner = true -offset_left = 355.0 -offset_right = 443.0 -offset_bottom = 31.0 -text = "Add mood" - -[node name="ScrollContainer" type="ScrollContainer" parent="."] -offset_top = 109.0 -offset_right = 443.0 -offset_bottom = 130.0 -size_flags_vertical = 3 -horizontal_scroll_mode = 0 - -[node name="Moods" type="VBoxContainer" parent="ScrollContainer"] -unique_name_in_owner = true -offset_right = 443.0 -offset_bottom = 21.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[connection signal="value_changed" from="DefaultMood/DefaultMood" to="." method="_on_default_mood_value_changed"] -[connection signal="value_changed" from="PortraitMood/PortraitMood" to="." method="_on_PortraitMood_value_changed"] -[connection signal="pressed" from="HBoxContainer/AddMood" to="." method="_on_AddMood_pressed"] diff --git a/addons/dialogic/Modules/Text/character_settings/ui_mood_item.gd b/addons/dialogic/Modules/Text/character_settings/ui_mood_item.gd index 3170541d5..a7b74d9c0 100644 --- a/addons/dialogic/Modules/Text/character_settings/ui_mood_item.gd +++ b/addons/dialogic/Modules/Text/character_settings/ui_mood_item.gd @@ -1,7 +1,7 @@ @tool extends PanelContainer -signal duplicate +signal duplicate_request signal changed func _ready(): @@ -9,12 +9,12 @@ func _ready(): %Name.tooltip_text = "Mood name" %Duplicate.icon = get_theme_icon("Duplicate", "EditorIcons") %Duplicate.tooltip_text = "Duplicate" - %Duplicate.button_up.connect(emit_signal.bind("duplicate")) + %Duplicate.button_up.connect(emit_signal.bind("duplicate_request")) %Delete.icon = get_theme_icon("Remove", "EditorIcons") %Delete.tooltip_text = "Delete" %ChangeSoundFolderButton.icon = get_theme_icon("Folder", "EditorIcons") %ChangeSoundFolderButton.tooltip_text = "Change sounds folder" - %Fold.icon = get_theme_icon("GuiVisibilityVisible", "EditorIcons") + %Fold.icon = get_theme_icon("Forward", "EditorIcons") %Fold.tooltip_text = "Fold/Unfold" %Play.icon = get_theme_icon("Play", "EditorIcons") %Play.tooltip_text = "Preview" @@ -51,9 +51,9 @@ func something_changed(fake_arg= ''): emit_signal("changed") func _on_Fold_toggled(button_pressed): %Fold.button_pressed = button_pressed if button_pressed: - %Fold.icon = get_theme_icon("GuiVisibilityHidden", "EditorIcons") + %Fold.icon = get_theme_icon("Forward", "EditorIcons") else: - %Fold.icon = get_theme_icon("GuiVisibilityVisible", "EditorIcons") + %Fold.icon = get_theme_icon("Collapse", "EditorIcons") %Content.visible = !button_pressed func _on_Delete_pressed(): @@ -70,12 +70,12 @@ func file_folder_selected(path): func preview(): if %SoundFolder.tooltip_text.is_empty(): return - $DialogicNode_TypeSounds.load_overwrite(get_data()) + $Preview.load_overwrite(get_data()) var preview_timer = Timer.new() DialogicUtil.update_timer_process_callback(preview_timer) add_child(preview_timer) preview_timer.start(ProjectSettings.get_setting('text/speed', 0.01)) for i in range(20): - $DialogicNode_TypeSounds._on_continued_revealing_text("a") + $Preview._on_continued_revealing_text("a") await preview_timer.timeout preview_timer.queue_free() diff --git a/addons/dialogic/Modules/Text/character_settings/ui_mood_item.tscn b/addons/dialogic/Modules/Text/character_settings/ui_mood_item.tscn index 807122df0..5fcf82049 100644 --- a/addons/dialogic/Modules/Text/character_settings/ui_mood_item.tscn +++ b/addons/dialogic/Modules/Text/character_settings/ui_mood_item.tscn @@ -1,9 +1,9 @@ -[gd_scene load_steps=6 format=3] +[gd_scene load_steps=6 format=3 uid="uid://bsyf4bjesluuq"] [ext_resource type="Script" path="res://addons/dialogic/Modules/Text/character_settings/ui_mood_item.gd" id="2"] [ext_resource type="Script" path="res://addons/dialogic/Modules/Text/node_type_sound.gd" id="3"] -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rsmy0"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5h6jv"] content_margin_left = 4.0 content_margin_top = 4.0 content_margin_right = 4.0 @@ -16,7 +16,7 @@ border_width_right = 2 border_width_bottom = 2 corner_detail = 1 -[sub_resource type="Image" id="Image_uegt4"] +[sub_resource type="Image" id="Image_wdcjv"] data = { "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), "format": "RGBA8", @@ -25,12 +25,12 @@ data = { "width": 16 } -[sub_resource type="ImageTexture" id="ImageTexture_osvex"] -image = SubResource("Image_uegt4") +[sub_resource type="ImageTexture" id="ImageTexture_thq2a"] +image = SubResource("Image_wdcjv") [node name="MoodItem" type="PanelContainer"] size_flags_horizontal = 3 -theme_override_styles/panel = SubResource("StyleBoxFlat_rsmy0") +theme_override_styles/panel = SubResource("StyleBoxFlat_5h6jv") script = ExtResource("2") [node name="VBox" type="VBoxContainer" parent="."] @@ -50,27 +50,28 @@ caret_blink = true unique_name_in_owner = true layout_mode = 2 tooltip_text = "Preview" -icon = SubResource("ImageTexture_osvex") +icon = SubResource("ImageTexture_thq2a") [node name="Duplicate" type="Button" parent="VBox/General"] unique_name_in_owner = true layout_mode = 2 tooltip_text = "Duplicate" -icon = SubResource("ImageTexture_osvex") +icon = SubResource("ImageTexture_thq2a") [node name="Delete" type="Button" parent="VBox/General"] unique_name_in_owner = true layout_mode = 2 tooltip_text = "Delete" -icon = SubResource("ImageTexture_osvex") +icon = SubResource("ImageTexture_thq2a") [node name="Fold" type="Button" parent="VBox/General"] unique_name_in_owner = true +custom_minimum_size = Vector2(30, 0) layout_mode = 2 tooltip_text = "Fold/Unfold" toggle_mode = true button_pressed = true -icon = SubResource("ImageTexture_osvex") +icon = SubResource("ImageTexture_thq2a") [node name="Content" type="HBoxContainer" parent="VBox"] unique_name_in_owner = true @@ -102,7 +103,7 @@ horizontal_alignment = 2 unique_name_in_owner = true layout_mode = 2 tooltip_text = "Change sounds folder" -icon = SubResource("ImageTexture_osvex") +icon = SubResource("ImageTexture_thq2a") [node name="Pitch" type="HBoxContainer" parent="VBox/Content/Content"] layout_mode = 2 @@ -145,9 +146,8 @@ layout_mode = 2 step = 0.001 prefix = "+/-" -[node name="DialogicNode_TypeSounds" type="AudioStreamPlayer" parent="."] +[node name="Preview" type="AudioStreamPlayer" parent="."] script = ExtResource("3") -sounds = [] play_every_character = 0 [connection signal="pressed" from="VBox/General/Play" to="." method="preview"] diff --git a/addons/dialogic/Modules/Text/index.gd b/addons/dialogic/Modules/Text/index.gd index 5c27c999b..e79fd341c 100644 --- a/addons/dialogic/Modules/Text/index.gd +++ b/addons/dialogic/Modules/Text/index.gd @@ -14,8 +14,10 @@ func _get_settings_pages() -> Array: return [this_folder.path_join('settings_text.tscn')] -func _get_character_editor_tabs() -> Array: - return [this_folder.path_join('character_settings/character_settings_text.tscn')] +func _get_character_editor_sections() -> Array: + return [this_folder.path_join('character_settings/character_moods_settings.tscn'), + this_folder.path_join('character_settings/character_portrait_mood_settings.tscn'), + ] func _get_text_effects() -> Array[Dictionary]: diff --git a/addons/dialogic/Modules/Text/node_type_sound.gd b/addons/dialogic/Modules/Text/node_type_sound.gd index 3007b147a..e619b5b4b 100644 --- a/addons/dialogic/Modules/Text/node_type_sound.gd +++ b/addons/dialogic/Modules/Text/node_type_sound.gd @@ -1,4 +1,4 @@ -#@tool +@tool class_name DialogicNode_TypeSounds extends AudioStreamPlayer diff --git a/addons/dialogic/Other/DialogicUtil.gd b/addons/dialogic/Other/DialogicUtil.gd index db9d857cd..2aee587fd 100644 --- a/addons/dialogic/Other/DialogicUtil.gd +++ b/addons/dialogic/Other/DialogicUtil.gd @@ -222,7 +222,15 @@ static func setup_script_property_edit_node(property_info: Dictionary, value:Var else: input = SpinBox.new() input.value_changed.connect(methods.get('int').bind(property_info['name'])) - input.step = 1 + if property_info.hint_string == 'int': + input.step = 1 + input.allow_greater = true + input.allow_lesser = true + elif ',' in property_info.hint_string: + input.min_value = int(property_info.hint_string.get_slice(',', 0)) + input.max_value = int(property_info.hint_string.get_slice(',', 1)) + if property_info.hint_string.count(',') > 1: + input.step = int(property_info.hint_string.get_slice(',', 2)) if value != null: input.value = value TYPE_FLOAT: diff --git a/addons/dialogic/Other/index_class.gd b/addons/dialogic/Other/index_class.gd index 03d428d99..761861d9e 100644 --- a/addons/dialogic/Other/index_class.gd +++ b/addons/dialogic/Other/index_class.gd @@ -30,7 +30,7 @@ func _get_settings_pages() -> Array: return [] -func _get_character_editor_tabs() -> Array: +func _get_character_editor_sections() -> Array: return []