diff --git a/addons/dialogic/Editor/Common/side_bar.tscn b/addons/dialogic/Editor/Common/side_bar.tscn index f37f54532..72f82cd45 100644 --- a/addons/dialogic/Editor/Common/side_bar.tscn +++ b/addons/dialogic/Editor/Common/side_bar.tscn @@ -1,6 +1,8 @@ -[gd_scene load_steps=5 format=3 uid="uid://cwe3r2tbh2og1"] +[gd_scene load_steps=7 format=3 uid="uid://cwe3r2tbh2og1"] [ext_resource type="Script" path="res://addons/dialogic/Editor/Common/sidebar.gd" id="1_jnq65"] +[ext_resource type="Texture2D" uid="uid://bff65e82555qr" path="res://addons/dialogic/Editor/Images/Pieces/close-icon.svg" id="2_54pks"] +[ext_resource type="Texture2D" uid="uid://dx3o2ild56i76" path="res://addons/dialogic/Editor/Images/Pieces/closed-icon.svg" id="2_ilyps"] [sub_resource type="Theme" id="Theme_pn0f4"] VBoxContainer/constants/separation = 4 @@ -20,24 +22,41 @@ theme = SubResource("Theme_pn0f4") split_offset = 100 script = ExtResource("1_jnq65") -[node name="VBox" type="VBoxContainer" parent="."] +[node name="VBoxHidden" type="VBoxContainer" parent="."] +unique_name_in_owner = true +visible = false +layout_mode = 2 + +[node name="OpenButton" type="Button" parent="VBoxHidden"] +unique_name_in_owner = true layout_mode = 2 +size_flags_horizontal = 0 size_flags_vertical = 3 +tooltip_text = "Show Sidebar" +theme_override_constants/icon_max_width = 20 +icon = ExtResource("2_ilyps") +flat = true +icon_alignment = 1 -[node name="Margin" type="MarginContainer" parent="VBox"] +[node name="VBoxPrimary" type="VBoxContainer" parent="."] +unique_name_in_owner = true +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Margin" type="MarginContainer" parent="VBoxPrimary"] layout_mode = 2 size_flags_vertical = 3 theme_override_constants/margin_left = 5 theme_override_constants/margin_bottom = 5 -[node name="VSplitContainer" type="VSplitContainer" parent="VBox/Margin"] +[node name="VSplitContainer" type="VSplitContainer" parent="VBoxPrimary/Margin"] layout_mode = 2 -[node name="VBox" type="VBoxContainer" parent="VBox/Margin/VSplitContainer"] +[node name="VBox" type="VBoxContainer" parent="VBoxPrimary/Margin/VSplitContainer"] layout_mode = 2 size_flags_vertical = 3 -[node name="Logo" type="TextureRect" parent="VBox/Margin/VSplitContainer/VBox"] +[node name="Logo" type="TextureRect" parent="VBoxPrimary/Margin/VSplitContainer/VBox"] unique_name_in_owner = true modulate = Color(1, 1, 1, 0.623529) texture_filter = 6 @@ -46,7 +65,10 @@ layout_mode = 2 expand_mode = 3 stretch_mode = 4 -[node name="CurrentResource" type="LineEdit" parent="VBox/Margin/VSplitContainer/VBox"] +[node name="HBox" type="HBoxContainer" parent="VBoxPrimary/Margin/VSplitContainer/VBox"] +layout_mode = 2 + +[node name="CurrentResource" type="LineEdit" parent="VBoxPrimary/Margin/VSplitContainer/VBox/HBox"] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 @@ -54,25 +76,78 @@ text = "No resource" alignment = 1 editable = false -[node name="Search" type="LineEdit" parent="VBox/Margin/VSplitContainer/VBox"] +[node name="CloseButton" type="Button" parent="VBoxPrimary/Margin/VSplitContainer/VBox/HBox"] unique_name_in_owner = true layout_mode = 2 +tooltip_text = "Hide Sidebar" +text = " " +icon = ExtResource("2_54pks") +flat = true +icon_alignment = 1 +expand_icon = true + +[node name="HBoxSearchSort" type="HBoxContainer" parent="VBoxPrimary/Margin/VSplitContainer/VBox"] +layout_mode = 2 + +[node name="Search" type="LineEdit" parent="VBoxPrimary/Margin/VSplitContainer/VBox/HBoxSearchSort"] +unique_name_in_owner = true +layout_mode = 2 +size_flags_horizontal = 3 +tooltip_text = "Filter Resources" placeholder_text = "Filter Resources" caret_blink = true caret_blink_interval = 0.5 -[node name="ResourcesList" type="ItemList" parent="VBox/Margin/VSplitContainer/VBox"] +[node name="SortOption" type="OptionButton" parent="VBoxPrimary/Margin/VSplitContainer/VBox/HBoxSearchSort"] +unique_name_in_owner = true +layout_mode = 2 +tooltip_text = "Sort +- Default: Sort alphabetically split into Characters & Timeilnes. +- Folder: Sort alphabetically by parent directory. +- Path: Display full path relative to res://. +- None: Sort alphabetically with no categories." +text_overrun_behavior = 1 +clip_text = true +selected = 0 +item_count = 4 +popup/item_0/text = "Type" +popup/item_1/text = "Folder" +popup/item_1/id = 1 +popup/item_2/text = "Path" +popup/item_2/id = 2 +popup/item_3/text = "None" +popup/item_3/id = 3 + +[node name="ResourceTree" type="Tree" parent="VBoxPrimary/Margin/VSplitContainer/VBox"] unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 3 -same_column_width = true +allow_rmb_select = true +hide_root = true +scroll_horizontal_enabled = false + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxPrimary/Margin/VSplitContainer/VBox"] +visible = false +layout_mode = 2 + +[node name="Label" type="Label" parent="VBoxPrimary/Margin/VSplitContainer/VBox/HBoxContainer"] +layout_mode = 2 +size_flags_vertical = 1 +text = "Sort Order" +vertical_alignment = 1 + +[node name="SortOption" type="OptionButton" parent="VBoxPrimary/Margin/VSplitContainer/VBox/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +item_count = 1 +popup/item_0/text = "Alphabetical (All)" -[node name="ContentListSection" type="VBoxContainer" parent="VBox/Margin/VSplitContainer"] +[node name="ContentListSection" type="VBoxContainer" parent="VBoxPrimary/Margin/VSplitContainer"] unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 3 -[node name="ContentList" type="ItemList" parent="VBox/Margin/VSplitContainer/ContentListSection"] +[node name="ContentList" type="ItemList" parent="VBoxPrimary/Margin/VSplitContainer/ContentListSection"] unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 3 @@ -82,7 +157,7 @@ theme_override_styles/selected_focus = SubResource("StyleBoxEmpty_n8rql") allow_reselect = true same_column_width = true -[node name="CurrentVersion" type="Button" parent="VBox"] +[node name="CurrentVersion" type="Button" parent="VBoxPrimary"] unique_name_in_owner = true layout_mode = 2 text = "Some Version" @@ -93,7 +168,8 @@ clip_text = true unique_name_in_owner = true size = Vector2i(164, 100) -[connection signal="gui_input" from="VBox/Margin/VSplitContainer/VBox/Logo" to="." method="_on_logo_gui_input"] -[connection signal="text_changed" from="VBox/Margin/VSplitContainer/VBox/Search" to="." method="_on_search_text_changed"] -[connection signal="pressed" from="VBox/CurrentVersion" to="." method="_on_current_version_pressed"] +[connection signal="gui_input" from="VBoxPrimary/Margin/VSplitContainer/VBox/Logo" to="." method="_on_logo_gui_input"] +[connection signal="text_changed" from="VBoxPrimary/Margin/VSplitContainer/VBox/HBoxSearchSort/Search" to="." method="_on_search_text_changed"] +[connection signal="text_submitted" from="VBoxPrimary/Margin/VSplitContainer/VBox/HBoxSearchSort/Search" to="." method="_on_search_text_submitted"] +[connection signal="pressed" from="VBoxPrimary/CurrentVersion" to="." method="_on_current_version_pressed"] [connection signal="id_pressed" from="RightClickMenu" to="." method="_on_right_click_menu_id_pressed"] diff --git a/addons/dialogic/Editor/Common/sidebar.gd b/addons/dialogic/Editor/Common/sidebar.gd index 1d7c43ea6..339b6181d 100644 --- a/addons/dialogic/Editor/Common/sidebar.gd +++ b/addons/dialogic/Editor/Common/sidebar.gd @@ -1,5 +1,5 @@ @tool -extends Control +class_name DialogicSidebar extends Control ## Script that handles the editor sidebar. @@ -7,20 +7,43 @@ signal file_activated(file_path) signal content_item_activated(item_name) -@onready var editors_manager: Node = get_parent().get_parent() +signal show_sidebar(show: bool) + +@onready var editors_manager = get_parent().get_parent() +@onready var resource_tree: Tree = %ResourceTree +var current_resource_list: Array = [] +enum SortMode { + TYPE, + FOLDER, + PATH, + NONE, +} + + +var sort_mode: SortMode = SortMode.TYPE func _ready() -> void: - if owner.get_parent() is SubViewport: + if owner != null and owner.get_parent() is SubViewport: + return + if editors_manager is SubViewportContainer: return ## CONNECTIONS - %ResourcesList.item_selected.connect(_on_resources_list_item_selected) - %ResourcesList.item_clicked.connect(_on_resources_list_item_clicked) editors_manager.resource_opened.connect(_on_editors_resource_opened) editors_manager.editor_changed.connect(_on_editors_editor_changed) - %ContentList.item_selected.connect(func (idx:int): content_item_activated.emit(%ContentList.get_item_text(idx))) + resource_tree.item_activated.connect(_on_resources_tree_item_activated) + resource_tree.item_mouse_selected.connect(_on_resources_tree_item_clicked) + + + + %ContentList.item_selected.connect( + func(idx: int): content_item_activated.emit(%ContentList.get_item_text(idx)) + ) + + (%OpenButton as Button).pressed.connect(_show_sidebar) + (%CloseButton as Button).pressed.connect(_hide_sidebar) var editor_scale := DialogicUtil.get_editor_scale() ## ICONS @@ -28,13 +51,22 @@ func _ready() -> void: %Logo.custom_minimum_size.y = 30 * editor_scale %Search.right_icon = get_theme_icon("Search", "EditorIcons") - - %ContentList.add_theme_color_override("font_hovered_color", get_theme_color("warning_color", "Editor")) - %ContentList.add_theme_color_override("font_selected_color", get_theme_color("property_color_z", "Editor")) + %ContentList.add_theme_color_override( + "font_hovered_color", get_theme_color("warning_color", "Editor") + ) + %ContentList.add_theme_color_override( + "font_selected_color", get_theme_color("property_color_z", "Editor") + ) ## MARGINS - $VBox/Margin.set("theme_override_constants/margin_left", get_theme_constant("base_margin", "Editor") * editor_scale) - $VBox/Margin.set("theme_override_constants/margin_bottom", get_theme_constant("base_margin", "Editor") * editor_scale) + %VBoxPrimary/Margin.set( + "theme_override_constants/margin_left", + get_theme_constant("base_margin", "Editor") * editor_scale + ) + %VBoxPrimary/Margin.set( + "theme_override_constants/margin_bottom", + get_theme_constant("base_margin", "Editor") * editor_scale + ) ## RIGHT CLICK MENU %RightClickMenu.clear() @@ -42,28 +74,68 @@ func _ready() -> void: %RightClickMenu.add_separator() %RightClickMenu.add_icon_item(get_theme_icon("ActionCopy", "EditorIcons"), "Copy Identifier", 4) %RightClickMenu.add_separator() - %RightClickMenu.add_icon_item(get_theme_icon("Filesystem", "EditorIcons"), "Show in FileSystem", 2) - %RightClickMenu.add_icon_item(get_theme_icon("ExternalLink", "EditorIcons"), "Open in External Program", 3) + %RightClickMenu.add_icon_item( + get_theme_icon("Filesystem", "EditorIcons"), "Show in FileSystem", 2 + ) + %RightClickMenu.add_icon_item( + get_theme_icon("ExternalLink", "EditorIcons"), "Open in External Program", 3 + ) + + ## SORT MENU + %SortOption.set_item_icon(0, get_theme_icon("AnimationTrackGroup", "EditorIcons")) + %SortOption.set_item_icon(1, get_theme_icon("Folder", "EditorIcons")) + %SortOption.set_item_icon(2, get_theme_icon("FolderBrowse", "EditorIcons")) + %SortOption.set_item_icon(3, get_theme_icon("AnimationTrackList", "EditorIcons")) + %SortOption.item_selected.connect(_on_sort_changed) + + await get_tree().process_frame + if DialogicUtil.get_editor_setting("sidebar_collapsed", false): + _hide_sidebar() + + %SortOption.select(DialogicUtil.get_editor_setting("sidebar_sort_mode", 0)) + sort_mode = DialogicUtil.get_editor_setting("sidebar_sort_mode", 0) + update_resource_list() + + +################################################################################ +## SHOW/HIDE SIDEBAR +################################################################################ + + +func _show_sidebar() -> void: + %VBoxPrimary.show() + %VBoxHidden.hide() + DialogicUtil.set_editor_setting("sidebar_collapsed", false) + show_sidebar.emit(true) + + +func _hide_sidebar() -> void: + %VBoxPrimary.hide() + %VBoxHidden.show() + DialogicUtil.set_editor_setting("sidebar_collapsed", true) + show_sidebar.emit(false) ################################################################################ ## RESOURCE LIST ################################################################################ -func _on_editors_resource_opened(resource:Resource) -> void: + +func _on_editors_resource_opened(resource: Resource) -> void: update_resource_list() + pass -func _on_editors_editor_changed(previous:DialogicEditor, current:DialogicEditor) -> void: +func _on_editors_editor_changed(previous: DialogicEditor, current: DialogicEditor) -> void: %ContentListSection.visible = current.current_resource is DialogicTimeline update_resource_list() -func clean_resource_list(resources_list:Array = []) -> PackedStringArray: +func clean_resource_list(resources_list: Array = []) -> PackedStringArray: return PackedStringArray(resources_list.filter(func(x): return ResourceLoader.exists(x))) -func update_resource_list(resources_list:PackedStringArray = []) -> void: +func update_resource_list(resources_list: PackedStringArray = []) -> void: var filter: String = %Search.text var current_file := "" if editors_manager.current_editor and editors_manager.current_editor.current_resource: @@ -72,89 +144,230 @@ func update_resource_list(resources_list:PackedStringArray = []) -> void: var character_directory: Dictionary = DialogicResourceUtil.get_character_directory() var timeline_directory: Dictionary = DialogicResourceUtil.get_timeline_directory() if resources_list.is_empty(): - resources_list = DialogicUtil.get_editor_setting('last_resources', []) + resources_list = DialogicUtil.get_editor_setting("last_resources", []) if !current_file in resources_list: resources_list.append(current_file) resources_list = clean_resource_list(resources_list) %CurrentResource.text = "No Resource" - %CurrentResource.add_theme_color_override("font_uneditable_color", get_theme_color("disabled_font_color", "Editor")) - - %ResourcesList.clear() - var idx := 0 - for character_name in character_directory: - if character_directory[character_name] in resources_list: - if filter.is_empty() or filter.to_lower() in character_name.to_lower(): - %ResourcesList.add_item( - character_name, - load("res://addons/dialogic/Editor/Images/Resources/character.svg")) - %ResourcesList.set_item_metadata(idx, character_directory[character_name]) - %ResourcesList.set_item_tooltip(idx, character_directory[character_name]) - if character_directory[character_name] == current_file: - %ResourcesList.select(idx) - %ResourcesList.set_item_custom_fg_color(idx, get_theme_color("accent_color", "Editor")) - %CurrentResource.text = character_directory[character_name].get_file() - idx += 1 - for timeline_name in timeline_directory: - if timeline_directory[timeline_name] in resources_list: - if filter.is_empty() or filter.to_lower() in timeline_name.to_lower(): - %ResourcesList.add_item(timeline_name, get_theme_icon("TripleBar", "EditorIcons")) - %ResourcesList.set_item_metadata(idx, timeline_directory[timeline_name]) - %ResourcesList.set_item_tooltip(idx, timeline_directory[timeline_name]) - if timeline_directory[timeline_name] == current_file: - %ResourcesList.select(idx) - %ResourcesList.set_item_custom_fg_color(idx, get_theme_color("accent_color", "Editor")) - %CurrentResource.text = timeline_name+'.dtl' - idx += 1 + %CurrentResource.add_theme_color_override( + "font_uneditable_color", get_theme_color("disabled_font_color", "Editor") + ) + + resource_tree.clear() + var resource_list_items := [] + + var get_directory_items := func(directory:Dictionary, filter:String, icon:Texture2D) -> Array: + var items := [] + for item_name in directory: + if (directory[item_name] in resources_list) and (filter.is_empty() or filter.to_lower() in item_name.to_lower()): + var item := ResourceListItem.new() + item.text = item_name + item.icon = icon + item.metadata = directory[item_name] + item.tooltip = directory[item_name] + items.append(item) + return items + + var character_items: Array = get_directory_items.call(character_directory, filter, load("res://addons/dialogic/Editor/Images/Resources/character.svg")) + var timeline_items: Array = get_directory_items.call(timeline_directory, filter, get_theme_icon("TripleBar", "EditorIcons")) + + + # BUILD TREE + var root: TreeItem = resource_tree.create_item() + + if sort_mode == SortMode.TYPE: + character_items.sort_custom(_sort_by_item_text) + timeline_items.sort_custom(_sort_by_item_text) + if character_items.size() > 0: + var character_tree := add_folder_item("Characters", root) + for item in character_items: + add_item(item, character_tree, current_file) + + if timeline_items.size() > 0: + var timeline_tree := add_folder_item("Timelines", root) + for item in timeline_items: + add_item(item, timeline_tree, current_file) + + if sort_mode == SortMode.NONE: + var all_items := character_items + timeline_items + all_items.sort_custom(_sort_by_item_text) + for item in all_items: + var tree_item = resource_tree.create_item(root) + tree_item.set_text(0, item.text) + tree_item.set_icon(0, item.icon) + tree_item.set_metadata(0, item.metadata) + tree_item.set_tooltip_text(0, item.tooltip) + if item.metadata == current_file: + %CurrentResource.text = item.metadata.get_file() + resource_tree.set_selected(tree_item, 0) + + if sort_mode == SortMode.FOLDER: + var all_items := character_items + timeline_items + var dirs := {} + for item in all_items: + var dir := item.get_parent_directory() as String + if !dirs.has(dir): + dirs[dir] = [] + dirs[dir].append(item) + for dir in dirs: + var dir_item = resource_tree.create_item(root) + dir_item.set_text(0, dir) + dir_item.set_icon(0, get_theme_icon("Folder", "EditorIcons")) + dir_item.set_custom_bg_color(0, get_theme_color("base_color", "Editor")) + for item in dirs[dir]: + var tree_item = resource_tree.create_item(dir_item) + tree_item.set_text(0, item.text) + tree_item.set_icon(0, item.icon) + tree_item.set_metadata(0, item.metadata) + tree_item.set_tooltip_text(0, item.tooltip) + if item.metadata == current_file: + %CurrentResource.text = item.metadata.get_file() + resource_tree.set_selected(tree_item, 0) + + if sort_mode == SortMode.PATH: + var all_items := character_items + timeline_items + var dirs := {} + var regex := RegEx.new() + for item in all_items: + var path := (item.metadata.get_base_dir() as String).replace("res://", "") + regex.compile("(\\w+\\/)?\\w+$") + if !dirs.has(path): + dirs[path] = [] + dirs[path].append(item) + + for dir in dirs: + var dir_display := regex.search(dir).get_string(0) + var dir_item = resource_tree.create_item(root) + var dir_color = ProjectSettings.get_setting("file_customization/folder_colors").get("res://" + dir + "/", get_theme_color("base_color", "Editor")) + var default_color_used = true; + if dir_color as Color != null and Color(dir_color) != get_theme_color("base_color", "Editor"): + dir_color = Color(dir_color) + dir_color.a = 0.2 + dir_color = (dir_color as Color).to_html(true) + default_color_used = false + dir_item.set_text(0, dir_display) + dir_item.set_icon(0, get_theme_icon("Folder", "EditorIcons")) + dir_item.set_custom_bg_color(0, dir_color) + for item in dirs[dir]: + var tree_item = resource_tree.create_item(dir_item) + tree_item.set_text(0, item.text) + tree_item.set_icon(0, item.icon) + tree_item.set_metadata(0, item.metadata) + if !default_color_used: + dir_color = Color(dir_color) + dir_color.a = 0.1 + dir_color = (dir_color as Color).to_html(true) + tree_item.set_custom_bg_color(0, dir_color) + tree_item.set_tooltip_text(0, item.tooltip) + if item.metadata == current_file: + %CurrentResource.text = item.metadata.get_file() + resource_tree.set_selected(tree_item, 0) + if %CurrentResource.text != "No Resource": - %CurrentResource.add_theme_color_override("font_uneditable_color", get_theme_color("font_color", "Editor")) - %ResourcesList.sort_items_by_text() - DialogicUtil.set_editor_setting('last_resources', resources_list) + %CurrentResource.add_theme_color_override( + "font_uneditable_color", get_theme_color("font_color", "Editor") + ) + DialogicUtil.set_editor_setting("last_resources", resources_list) + + +func add_item(item:ResourceListItem, parent:TreeItem, current_file := "") -> TreeItem: + var tree_item := resource_tree.create_item(parent) + tree_item.set_text(0, item.text) + tree_item.set_icon(0, item.icon) + tree_item.set_metadata(0, item.metadata) + tree_item.set_tooltip_text(0, item.tooltip) + if item.metadata == current_file: + %CurrentResource.text = item.metadata.get_file() + resource_tree.set_selected(tree_item, 0) + return tree_item -func _on_resources_list_item_selected(index:int) -> void: - if %ResourcesList.get_item_metadata(index) == null: - return - editors_manager.edit_resource(load(%ResourcesList.get_item_metadata(index))) +func add_folder_item(label: String, parent:TreeItem) -> TreeItem: + var folder_item := resource_tree.create_item(parent) + folder_item.set_text(0, label) + folder_item.set_icon(0, get_theme_icon("Folder", "EditorIcons")) + folder_item.set_custom_bg_color(0, get_theme_color("base_color", "Editor")) + return folder_item -func _on_resources_list_item_clicked(index: int, at_position: Vector2, mouse_button_index: int) -> void: - # If clicked with the middle mouse button, remove the item from the list + +func _on_resources_tree_item_activated() -> void: + if resource_tree.get_selected() == null: + return + var item := resource_tree.get_selected() + if item.get_metadata(0) == null: + return + edit_resource(item.get_metadata(0)) + + +func _on_resources_tree_item_clicked(_pos: Vector2, mouse_button_index: int) -> void: + if mouse_button_index == MOUSE_BUTTON_LEFT: + var selected_item := resource_tree.get_selected() + if selected_item == null: + return + if selected_item.get_metadata(0) == null: + return + var resource_item := load(selected_item.get_metadata(0)) + call_deferred("edit_resource", resource_item) + return if mouse_button_index == MOUSE_BUTTON_MIDDLE: - remove_item_from_list(index) + remove_item_from_list(resource_tree.get_selected()) + return if mouse_button_index == MOUSE_BUTTON_RIGHT: - %RightClickMenu.popup_on_parent(Rect2(get_global_mouse_position(), Vector2())) - %RightClickMenu.set_meta('item_index', index) + if resource_tree.get_selected().get_metadata(0): + %RightClickMenu.popup_on_parent(Rect2(get_global_mouse_position(), Vector2())) + (%RightClickMenu as PopupMenu).set_meta("item_clicked", resource_tree.get_selected()) + return -func _on_search_text_changed(new_text:String) -> void: +func _on_search_text_changed(new_text: String) -> void: update_resource_list() + var tree_root := resource_tree.get_root() + var tree_items := tree_root.get_children() + if tree_items.size() == 0: + return + for item in tree_items: + if item.get_children().size() > 0: + resource_tree.set_selected(item.get_child(0), 0) + break + + +func _on_search_text_submitted(new_text: String) -> void: + if resource_tree.get_selected() == null: + return + var item := resource_tree.get_selected() + if item.get_metadata(0) == null: + return + edit_resource(item.get_metadata(0)) + %Search.clear() -func set_unsaved_indicator(saved:bool = true) -> void: - if saved and %CurrentResource.text.ends_with('(*)'): - %CurrentResource.text = %CurrentResource.text.trim_suffix('(*)') - if not saved and not %CurrentResource.text.ends_with('(*)'): - %CurrentResource.text = %CurrentResource.text+"(*)" +func set_unsaved_indicator(saved: bool = true) -> void: + if saved and %CurrentResource.text.ends_with("(*)"): + %CurrentResource.text = %CurrentResource.text.trim_suffix("(*)") + if not saved and not %CurrentResource.text.ends_with("(*)"): + %CurrentResource.text = %CurrentResource.text + "(*)" -func _on_logo_gui_input(event:InputEvent) -> void: +func _on_logo_gui_input(event: InputEvent) -> void: if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed: - editors_manager.open_editor(editors_manager.editors['HomePage'].node) + editors_manager.open_editor(editors_manager.editors["HomePage"].node) -func update_content_list(list:PackedStringArray) -> void: +func update_content_list(list: PackedStringArray) -> void: var prev_selected := "" if %ContentList.is_anything_selected(): prev_selected = %ContentList.get_item_text(%ContentList.get_selected_items()[0]) %ContentList.clear() - %ContentList.add_item('~ Top') + %ContentList.add_item("~ Top") for i in list: - if i.is_empty(): continue + if i.is_empty(): + continue %ContentList.add_item(i) if i == prev_selected: - %ContentList.select(%ContentList.item_count-1) + %ContentList.select(%ContentList.item_count - 1) if list.is_empty(): return @@ -172,21 +385,96 @@ func update_content_list(list:PackedStringArray) -> void: DialogicResourceUtil.set_label_cache(label_directory) -func remove_item_from_list(index) -> void: + +func remove_item_from_list(item: TreeItem) -> void: var new_list := [] - for entry in DialogicUtil.get_editor_setting('last_resources', []): - if entry != %ResourcesList.get_item_metadata(index): + for entry in DialogicUtil.get_editor_setting("last_resources", []): + if entry != item.get_metadata(0): new_list.append(entry) - DialogicUtil.set_editor_setting('last_resources', new_list) - %ResourcesList.remove_item(index) + DialogicUtil.set_editor_setting("last_resources", new_list) + update_resource_list(new_list) + -func _on_right_click_menu_id_pressed(id:int) -> void: +func _on_right_click_menu_id_pressed(id: int) -> void: match id: - 1: # REMOVE ITEM FROM LIST - remove_item_from_list(%RightClickMenu.get_meta("item_index")) - 2: # OPEN IN FILESYSTEM - EditorInterface.get_file_system_dock().navigate_to_path(%ResourcesList.get_item_metadata(%RightClickMenu.get_meta("item_index"))) - 3: # OPEN IN EXTERNAL EDITOR - OS.shell_open(ProjectSettings.globalize_path(%ResourcesList.get_item_metadata(%RightClickMenu.get_meta("item_index")))) - 4: - DisplayServer.clipboard_set(DialogicResourceUtil.get_unique_identifier(%ResourcesList.get_item_metadata(%RightClickMenu.get_meta("item_index")))) + 1: # REMOVE ITEM FROM LIST + remove_item_from_list(%RightClickMenu.get_meta("item_clicked")) + 2: # OPEN IN FILESYSTEM + EditorInterface.get_file_system_dock().navigate_to_path( + %RightClickMenu.get_meta("item_clicked").get_metadata(0) + ) + 3: # OPEN IN EXTERNAL EDITOR + OS.shell_open( + ProjectSettings.globalize_path( + %RightClickMenu.get_meta("item_clicked").get_metadata(0) + ) + ) + 4: # COPY IDENTIFIER + DisplayServer.clipboard_set( + DialogicResourceUtil.get_unique_identifier( + %RightClickMenu.get_meta("item_clicked").get_metadata(0) + ) + ) + + +func _on_sort_changed(idx: int) -> void: + if (SortMode as Dictionary).values().has(idx): + sort_mode = idx + DialogicUtil.set_editor_setting("sidebar_sort_mode", idx) + update_resource_list() + else: + sort_mode = SortMode.TYPE + print("Invalid sort mode: ", idx) + + +func _sort_by_item_text(a: ResourceListItem, b: ResourceListItem) -> bool: + return a.text < b.text + + +func edit_resource(resource_item: Variant) -> void: + if resource_item is Resource: + editors_manager.edit_resource(resource_item) + else: + editors_manager.edit_resource(load(resource_item)) + + + + +class ResourceListItem: + extends Object + + var text: String + var index: int = -1 + var icon: Texture + var metadata: String + var tooltip: String + + func _to_string() -> String: + return JSON.stringify( + { + "text": text, + "index": index, + "icon": icon.resource_path, + "metadata": metadata, + "tooltip": tooltip, + "parent_dir": get_parent_directory() + }, + "\t", + false + ) + + func add_to_item_list(item_list: ItemList, current_file: String) -> void: + item_list.add_item(text, icon) + item_list.set_item_metadata(item_list.item_count - 1, metadata) + item_list.set_item_tooltip(item_list.item_count - 1, tooltip) + + func get_parent_directory() -> String: + return (metadata.get_base_dir() as String).split("/")[-1] + + func current_file(sidebar: Control, resource_list: ItemList, current_file: String) -> void: + if metadata == current_file: + resource_list.select(index) + resource_list.set_item_custom_fg_color( + index, resource_list.get_theme_color("accent_color", "Editor") + ) + sidebar.find_child("CurrentResource").text = metadata.get_file() diff --git a/addons/dialogic/Editor/Images/Pieces/close-icon.svg b/addons/dialogic/Editor/Images/Pieces/close-icon.svg new file mode 100644 index 000000000..3e3f7af3b --- /dev/null +++ b/addons/dialogic/Editor/Images/Pieces/close-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/dialogic/Editor/Images/Pieces/close-icon.svg.import b/addons/dialogic/Editor/Images/Pieces/close-icon.svg.import new file mode 100644 index 000000000..cbc36f218 --- /dev/null +++ b/addons/dialogic/Editor/Images/Pieces/close-icon.svg.import @@ -0,0 +1,38 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bff65e82555qr" +path="res://.godot/imported/close-icon.svg-c630c93ada599b08938f4854f5376f2f.ctex" +metadata={ +"has_editor_variant": true, +"vram_texture": false +} + +[deps] + +source_file="res://addons/dialogic/Editor/Images/Pieces/close-icon.svg" +dest_files=["res://.godot/imported/close-icon.svg-c630c93ada599b08938f4854f5376f2f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=true +editor/convert_colors_with_editor_theme=true diff --git a/addons/dialogic/Editor/editor_main.gd b/addons/dialogic/Editor/editor_main.gd index 5c60b1bb2..599405756 100644 --- a/addons/dialogic/Editor/editor_main.gd +++ b/addons/dialogic/Editor/editor_main.gd @@ -8,14 +8,20 @@ var editors_manager: Control = null var editor_file_dialog: EditorFileDialog +@onready var sidebar := %Sidebar as DialogicSidebar func _ready() -> void: if get_parent() is SubViewport: return + ## CONNECTIONS + sidebar.show_sidebar.connect(_on_sidebar_toggled) + ## REFERENCES editors_manager = $EditorsManager - var button: Button = editors_manager.add_icon_button(get_theme_icon("MakeFloating", "EditorIcons"), 'Make floating') + var button: Button = editors_manager.add_icon_button( + get_theme_icon("MakeFloating", "EditorIcons"), "Make floating" + ) button.pressed.connect(toggle_floating_window) # File dialog @@ -23,69 +29,108 @@ func _ready() -> void: add_child(editor_file_dialog) var info_message := Label.new() - info_message.add_theme_color_override('font_color', get_theme_color("warning_color", "Editor")) + info_message.add_theme_color_override("font_color", get_theme_color("warning_color", "Editor")) editor_file_dialog.get_line_edit().get_parent().add_sibling(info_message) - info_message.get_parent().move_child(info_message, info_message.get_index()-1) - editor_file_dialog.set_meta('info_message_label', info_message) + info_message.get_parent().move_child(info_message, info_message.get_index() - 1) + editor_file_dialog.set_meta("info_message_label", info_message) - $SaveConfirmationDialog.add_button('No Saving Please!', true, 'nosave') + $SaveConfirmationDialog.add_button("No Saving Please!", true, "nosave") $SaveConfirmationDialog.hide() update_theme_additions() EditorInterface.get_base_control().theme_changed.connect(update_theme_additions) +func _on_sidebar_toggled(sidebar_shown: bool) -> void: + var h_split := (%HSplit as HSplitContainer) + if sidebar_shown: + h_split.dragger_visibility = SplitContainer.DRAGGER_VISIBLE + h_split.split_offset = 150 + h_split.collapsed = false + else: + h_split.dragger_visibility = SplitContainer.DRAGGER_HIDDEN_COLLAPSED + h_split.split_offset = 0 + h_split.collapsed = true + + func update_theme_additions() -> void: - add_theme_stylebox_override("panel", DCSS.inline({ - 'background': get_theme_color("base_color", "Editor"), - 'padding': [5*DialogicUtil.get_editor_scale(), 5*DialogicUtil.get_editor_scale()], - })) - var holder_panel := DCSS.inline({ - 'border-radius':5, - #'border': 2, - #'border-color': get_theme_color("base_color", "Editor"), - 'background': get_theme_color("dark_color_2", "Editor"), - 'padding': [5*DialogicUtil.get_editor_scale(), 5*DialogicUtil.get_editor_scale()], - }) + add_theme_stylebox_override( + "panel", + ( + DCSS + . inline( + { + "background": get_theme_color("base_color", "Editor"), + "padding": + [5 * DialogicUtil.get_editor_scale(), 5 * DialogicUtil.get_editor_scale()], + } + ) + ) + ) + var holder_panel := ( + DCSS + . inline( + { + "border-radius": 5, + #'border': 2, + #'border-color': get_theme_color("base_color", "Editor"), + "background": get_theme_color("dark_color_2", "Editor"), + "padding": + [5 * DialogicUtil.get_editor_scale(), 5 * DialogicUtil.get_editor_scale()], + } + ) + ) holder_panel.border_width_top = 0 holder_panel.corner_radius_top_left = 0 - editors_manager.editors_holder.add_theme_stylebox_override('panel', holder_panel) + editors_manager.editors_holder.add_theme_stylebox_override("panel", holder_panel) if theme == null: theme = Theme.new() theme.clear() - theme.set_type_variation('DialogicTitle', 'Label') - theme.set_font('font', 'DialogicTitle', get_theme_font("title", "EditorFonts")) - theme.set_color('font_color', 'DialogicTitle', get_theme_color('warning_color', 'Editor')) - theme.set_color('font_uneditable_color', 'DialogicTitle', get_theme_color('warning_color', 'Editor')) - theme.set_color('font_selected_color', 'DialogicTitle', get_theme_color('warning_color', 'Editor')) - theme.set_font_size('font_size', 'DialogicTitle', get_theme_font_size("doc_size", "EditorFonts")) - - theme.set_type_variation('DialogicSubTitle', 'Label') - theme.set_font('font', 'DialogicSubTitle', get_theme_font("title", "EditorFonts")) - theme.set_font_size('font_size', 'DialogicSubTitle', get_theme_font_size("doc_size", "EditorFonts")) - theme.set_color('font_color', 'DialogicSubTitle', get_theme_color('accent_color', 'Editor')) - - theme.set_type_variation('DialogicPanelA', 'PanelContainer') - var panel_style := DCSS.inline({ - 'border-radius': 10, - 'background': get_theme_color("base_color", "Editor"), - 'padding': [5, 5], - }) - theme.set_stylebox('panel', 'DialogicPanelA', panel_style) - theme.set_stylebox('normal', 'DialogicPanelA', panel_style) + theme.set_type_variation("DialogicTitle", "Label") + theme.set_font("font", "DialogicTitle", get_theme_font("title", "EditorFonts")) + theme.set_color("font_color", "DialogicTitle", get_theme_color("warning_color", "Editor")) + theme.set_color( + "font_uneditable_color", "DialogicTitle", get_theme_color("warning_color", "Editor") + ) + theme.set_color( + "font_selected_color", "DialogicTitle", get_theme_color("warning_color", "Editor") + ) + theme.set_font_size( + "font_size", "DialogicTitle", get_theme_font_size("doc_size", "EditorFonts") + ) + + theme.set_type_variation("DialogicSubTitle", "Label") + theme.set_font("font", "DialogicSubTitle", get_theme_font("title", "EditorFonts")) + theme.set_font_size( + "font_size", "DialogicSubTitle", get_theme_font_size("doc_size", "EditorFonts") + ) + theme.set_color("font_color", "DialogicSubTitle", get_theme_color("accent_color", "Editor")) + + theme.set_type_variation("DialogicPanelA", "PanelContainer") + var panel_style := ( + DCSS + . inline( + { + "border-radius": 10, + "background": get_theme_color("base_color", "Editor"), + "padding": [5, 5], + } + ) + ) + theme.set_stylebox("panel", "DialogicPanelA", panel_style) + theme.set_stylebox("normal", "DialogicPanelA", panel_style) var dark_panel := panel_style.duplicate() dark_panel.bg_color = get_theme_color("dark_color_3", "Editor") - theme.set_stylebox('panel', 'DialogicPanelDarkA', dark_panel) + theme.set_stylebox("panel", "DialogicPanelDarkA", dark_panel) var cornerless_panel := panel_style.duplicate() cornerless_panel.corner_radius_top_left = 0 - theme.set_stylebox('panel', 'DialogicPanelA_cornerless', cornerless_panel) - + theme.set_stylebox("panel", "DialogicPanelA_cornerless", cornerless_panel) # panel used for example for portrait previews in character editor - theme.set_type_variation('DialogicPanelB', 'PanelContainer') + theme.set_type_variation("DialogicPanelB", "PanelContainer") var side_panel: StyleBoxFlat = panel_style.duplicate() side_panel.corner_radius_top_left = 0 side_panel.corner_radius_bottom_left = 0 @@ -94,80 +139,110 @@ func update_theme_additions() -> void: side_panel.set_border_width_all(1) side_panel.border_width_left = 0 side_panel.border_color = get_theme_color("contrast_color_2", "Editor") - theme.set_stylebox('panel', 'DialogicPanelB', side_panel) - + theme.set_stylebox("panel", "DialogicPanelB", side_panel) - theme.set_type_variation('DialogicEventEdit', 'Control') + theme.set_type_variation("DialogicEventEdit", "Control") var edit_panel := StyleBoxFlat.new() edit_panel.draw_center = true edit_panel.bg_color = get_theme_color("accent_color", "Editor") edit_panel.bg_color.a = 0.05 edit_panel.border_width_bottom = 2 - edit_panel.border_color = get_theme_color("accent_color", "Editor").lerp(get_theme_color("dark_color_2", "Editor"), 0.4) + edit_panel.border_color = get_theme_color("accent_color", "Editor").lerp( + get_theme_color("dark_color_2", "Editor"), 0.4 + ) edit_panel.content_margin_left = 5 edit_panel.content_margin_right = 5 edit_panel.set_corner_radius_all(1) - theme.set_stylebox('panel', 'DialogicEventEdit', edit_panel) - theme.set_stylebox('normal', 'DialogicEventEdit', edit_panel) + theme.set_stylebox("panel", "DialogicEventEdit", edit_panel) + theme.set_stylebox("normal", "DialogicEventEdit", edit_panel) var focus_edit := edit_panel.duplicate() focus_edit.border_color = get_theme_color("property_color_z", "Editor") focus_edit.draw_center = false - theme.set_stylebox('focus', 'DialogicEventEdit', focus_edit) + theme.set_stylebox("focus", "DialogicEventEdit", focus_edit) var hover_edit := edit_panel.duplicate() hover_edit.border_color = get_theme_color("warning_color", "Editor") - theme.set_stylebox('hover', 'DialogicEventEdit', hover_edit) + theme.set_stylebox("hover", "DialogicEventEdit", hover_edit) var disabled_edit := edit_panel.duplicate() disabled_edit.border_color = get_theme_color("property_color", "Editor") - theme.set_stylebox('disabled', 'DialogicEventEdit', disabled_edit) - - theme.set_type_variation('DialogicHintText', 'Label') - theme.set_color('font_color', 'DialogicHintText', get_theme_color("readonly_color", "Editor")) - theme.set_font('font', 'DialogicHintText', get_theme_font("doc_italic", "EditorFonts")) - - theme.set_type_variation('DialogicHintText2', 'Label') - theme.set_color('font_color', 'DialogicHintText2', get_theme_color("property_color_w", "Editor")) - theme.set_font('font', 'DialogicHintText2', get_theme_font("doc_italic", "EditorFonts")) - - theme.set_type_variation('DialogicSection', 'Label') - theme.set_font('font', 'DialogicSection', get_theme_font("main_msdf", "EditorFonts")) - theme.set_color('font_color', 'DialogicSection', get_theme_color("property_color_z", "Editor")) - theme.set_font_size('font_size', 'DialogicSection', get_theme_font_size("doc_size", "EditorFonts")) - - theme.set_type_variation('DialogicSettingsSection', 'DialogicSection') - theme.set_font('font', 'DialogicSettingsSection', get_theme_font("main_msdf", "EditorFonts")) - theme.set_color('font_color', 'DialogicSettingsSection', get_theme_color("property_color_z", "Editor")) - theme.set_font_size('font_size', 'DialogicSettingsSection', get_theme_font_size("doc_size", "EditorFonts")) - - theme.set_type_variation('DialogicSectionBig', 'DialogicSection') - theme.set_color('font_color', 'DialogicSectionBig', get_theme_color("accent_color", "Editor")) - theme.set_font_size('font_size', 'DialogicSectionBig', get_theme_font_size("doc_title_size", "EditorFonts")) - - theme.set_type_variation('DialogicLink', 'LinkButton') - theme.set_color('font_hover_color', 'DialogicLink', get_theme_color("warning_color", "Editor")) - - theme.set_type_variation('DialogicMegaSeparator', 'HSeparator') - theme.set_stylebox('separator', 'DialogicMegaSeparator', DCSS.inline({ - 'border-radius': 10, - 'border': 0, - 'background': get_theme_color("accent_color", "Editor"), - 'padding': [5, 5], - })) - theme.set_constant('separation', 'DialogicMegaSeparator', 50) - - theme.set_type_variation('DialogicTextEventTextEdit', 'CodeEdit') + theme.set_stylebox("disabled", "DialogicEventEdit", disabled_edit) + + theme.set_type_variation("DialogicHintText", "Label") + theme.set_color("font_color", "DialogicHintText", get_theme_color("readonly_color", "Editor")) + theme.set_font("font", "DialogicHintText", get_theme_font("doc_italic", "EditorFonts")) + + theme.set_type_variation("DialogicHintText2", "Label") + theme.set_color( + "font_color", "DialogicHintText2", get_theme_color("property_color_w", "Editor") + ) + theme.set_font("font", "DialogicHintText2", get_theme_font("doc_italic", "EditorFonts")) + + theme.set_type_variation("DialogicSection", "Label") + theme.set_font("font", "DialogicSection", get_theme_font("main_msdf", "EditorFonts")) + theme.set_color("font_color", "DialogicSection", get_theme_color("property_color_z", "Editor")) + theme.set_font_size( + "font_size", "DialogicSection", get_theme_font_size("doc_size", "EditorFonts") + ) + + theme.set_type_variation("DialogicSettingsSection", "DialogicSection") + theme.set_font("font", "DialogicSettingsSection", get_theme_font("main_msdf", "EditorFonts")) + theme.set_color( + "font_color", "DialogicSettingsSection", get_theme_color("property_color_z", "Editor") + ) + theme.set_font_size( + "font_size", "DialogicSettingsSection", get_theme_font_size("doc_size", "EditorFonts") + ) + + theme.set_type_variation("DialogicSectionBig", "DialogicSection") + theme.set_color("font_color", "DialogicSectionBig", get_theme_color("accent_color", "Editor")) + theme.set_font_size( + "font_size", "DialogicSectionBig", get_theme_font_size("doc_title_size", "EditorFonts") + ) + + theme.set_type_variation("DialogicLink", "LinkButton") + theme.set_color("font_hover_color", "DialogicLink", get_theme_color("warning_color", "Editor")) + + theme.set_type_variation("DialogicMegaSeparator", "HSeparator") + ( + theme + . set_stylebox( + "separator", + "DialogicMegaSeparator", + ( + DCSS + . inline( + { + "border-radius": 10, + "border": 0, + "background": get_theme_color("accent_color", "Editor"), + "padding": [5, 5], + } + ) + ) + ) + ) + theme.set_constant("separation", "DialogicMegaSeparator", 50) + + theme.set_type_variation("DialogicTextEventTextEdit", "CodeEdit") var editor_settings := plugin_reference.get_editor_interface().get_editor_settings() - var text_panel := DCSS.inline({ - 'border-radius': 8, - 'background': editor_settings.get_setting("text_editor/theme/highlighting/background_color").lerp( - editor_settings.get_setting("text_editor/theme/highlighting/text_color"), 0.05), - 'padding': [8, 8], - }) + var text_panel := ( + DCSS + . inline( + { + "border-radius": 8, + "background": + editor_settings.get_setting("text_editor/theme/highlighting/background_color").lerp( + editor_settings.get_setting("text_editor/theme/highlighting/text_color"), 0.05 + ), + "padding": [8, 8], + } + ) + ) text_panel.content_margin_bottom = 5 text_panel.content_margin_left = 13 - theme.set_stylebox('normal', 'DialogicTextEventTextEdit', text_panel) + theme.set_stylebox("normal", "DialogicTextEventTextEdit", text_panel) var event_field_group_panel := DCSS.inline({ 'border-radius': 8, @@ -209,7 +284,7 @@ func swap_to_floating_window() -> void: window.disable_3d = true window.wrap_controls = true window.popup_centered() - plugin_reference.get_editor_interface().set_main_screen_editor('2D') + plugin_reference.get_editor_interface().set_main_screen_editor("2D") ## Removes the main control from the window node and adds it to it's grandparent @@ -220,12 +295,20 @@ func swap_to_embedded_editor() -> void: var window := get_parent() get_parent().remove_child(self) - plugin_reference.get_editor_interface().set_main_screen_editor('Dialogic') + plugin_reference.get_editor_interface().set_main_screen_editor("Dialogic") window.get_parent().add_child(self) window.queue_free() -func godot_file_dialog(callable:Callable, filter:String, mode := EditorFileDialog.FILE_MODE_OPEN_FILE, window_title := "Save", current_file_name := 'New_File', saving_something := false, extra_message:String = "") -> EditorFileDialog: +func godot_file_dialog( + callable: Callable, + filter: String, + mode := EditorFileDialog.FILE_MODE_OPEN_FILE, + window_title := "Save", + current_file_name := "New_File", + saving_something := false, + extra_message: String = "" +) -> EditorFileDialog: for connection in editor_file_dialog.file_selected.get_connections(): editor_file_dialog.file_selected.disconnect(connection.callable) for connection in editor_file_dialog.dir_selected.get_connections(): @@ -238,10 +321,10 @@ func godot_file_dialog(callable:Callable, filter:String, mode := EditorFileDialo editor_file_dialog.current_file = current_file_name editor_file_dialog.disable_overwrite_warning = !saving_something if extra_message: - editor_file_dialog.get_meta('info_message_label').show() - editor_file_dialog.get_meta('info_message_label').text = extra_message + editor_file_dialog.get_meta("info_message_label").show() + editor_file_dialog.get_meta("info_message_label").text = extra_message else: - editor_file_dialog.get_meta('info_message_label').hide() + editor_file_dialog.get_meta("info_message_label").hide() if mode == EditorFileDialog.FILE_MODE_OPEN_FILE or mode == EditorFileDialog.FILE_MODE_SAVE_FILE: editor_file_dialog.file_selected.connect(callable) diff --git a/addons/dialogic/Editor/editor_main.tscn b/addons/dialogic/Editor/editor_main.tscn index 79465bd1b..849ad796b 100644 --- a/addons/dialogic/Editor/editor_main.tscn +++ b/addons/dialogic/Editor/editor_main.tscn @@ -15,7 +15,7 @@ [ext_resource type="Script" path="res://addons/dialogic/Editor/Common/update_manager.gd" id="14_l6b1p"] [ext_resource type="PackedScene" uid="uid://vv3m5m68fwg7" path="res://addons/dialogic/Editor/Common/update_install_window.tscn" id="15_cu4xj"] -[sub_resource type="Image" id="Image_80r2n"] +[sub_resource type="Image" id="Image_uqxml"] data = { "data": PackedByteArray(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, 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, 94, 94, 127, 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, 94, 94, 127, 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, 94, 94, 127, 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, 255, 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, 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, 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, 94, 94, 54, 255, 94, 94, 57, 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, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 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, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 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, 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, 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,20 +25,16 @@ data = { } [sub_resource type="ImageTexture" id="ImageTexture_drcn6"] -image = SubResource("Image_80r2n") - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0gy47"] -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 +image = SubResource("Image_uqxml") + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5bs7k"] +content_margin_left = 8.0 +content_margin_top = 8.0 +content_margin_right = 8.0 +content_margin_bottom = 8.0 +bg_color = Color(0.1155, 0.132, 0.1595, 1) corner_detail = 1 +anti_aliasing = false [node name="EditorView" type="ScrollContainer"] anchors_preset = 15 @@ -57,6 +53,7 @@ size_flags_vertical = 3 script = ExtResource("2_pe2tl") [node name="HSplit" type="HSplitContainer" parent="EditorsManager"] +unique_name_in_owner = true layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -89,7 +86,6 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 8 tab_count = 7 -tab_0/title = "" tab_0/icon = ExtResource("2_scwcl") tab_1/title = "Timeline" tab_1/icon = SubResource("ImageTexture_drcn6") @@ -138,7 +134,7 @@ content_scale_aspect = 4 script = ExtResource("10_xbkrt") [node name="Manager" parent="ReferenceManager" instance=ExtResource("10_l1rf8")] -theme_override_styles/panel = SubResource("StyleBoxFlat_0gy47") +theme_override_styles/panel = SubResource("StyleBoxFlat_5bs7k") [node name="UpdateManager" type="Node" parent="."] script = ExtResource("14_l6b1p")