From 9c339a636ed4accbcb8667483448a51660c7dcf2 Mon Sep 17 00:00:00 2001 From: Jowan Spooner Date: Sun, 26 Feb 2023 01:22:05 +0100 Subject: [PATCH] A lot of stuff - fix event collapsing (hiding contained events) - improve look of collapsed events - simplify add-event button - add small mode for event button sidebar when to thin - save and restore event button sidebar size - modulate text input box - fix text input event name not being capitalized - fix bug when saving timelines in visual timeline editor - fix variable event "Variable Editor" button not working --- addons/dialogic/Editor/Events/BranchEnd.gd | 68 +++++++----- addons/dialogic/Editor/Events/BranchEnd.tscn | 22 ++-- .../Editor/Events/EventBlock/event_block.gd | 25 +---- .../VisualEditor/AddEventButton.gd | 67 ++++++++---- .../VisualEditor/AddEventButton.tscn | 103 +++++++----------- .../VisualEditor/EventButton.gd | 16 --- .../VisualEditor/timeline_editor_visual.gd | 68 +++++++++--- .../VisualEditor/timeline_editor_visual.tscn | 78 ++++++------- .../Default/DialogicDefaultLayout.gd | 1 + .../Events/TextInput/event_text_input.gd | 2 +- .../Events/Variable/event_variable.gd | 2 +- 11 files changed, 237 insertions(+), 215 deletions(-) delete mode 100644 addons/dialogic/Editor/TimelineEditor/VisualEditor/EventButton.gd diff --git a/addons/dialogic/Editor/Events/BranchEnd.gd b/addons/dialogic/Editor/Events/BranchEnd.gd index 290ebc417..211a39294 100644 --- a/addons/dialogic/Editor/Events/BranchEnd.gd +++ b/addons/dialogic/Editor/Events/BranchEnd.gd @@ -1,50 +1,66 @@ @tool extends Control -var resource -var parent_node +## A scene shown at the end of events that contain other events -var end_control :Control +var resource : DialogicEndBranchEvent -### the indent size -var indent_size = 15 -var current_indent_level = 1 +# References +var parent_node : Control = null +var end_control :Control = null -func _ready(): +# Indent +var indent_size := 15 +var current_indent_level := 1 + +func _ready() -> void: $Icon.icon = get_theme_icon("GuiSpinboxUpdown", "EditorIcons") - parent_node_changed() $Spacer.custom_minimum_size.x = 100*DialogicUtil.get_editor_scale() - + visual_deselect() + parent_node_changed() + -func visual_select(): - modulate = get_theme_color("warning_color", "Editor") +## Called by the visual timeline editor +func visual_select() -> void: + modulate = get_theme_color("highlighted_font_color", "Editor") -func visual_deselect(): - modulate = Color(1,1,1,1) +## Called by the visual timeline editor +func visual_deselect() -> void: + modulate = parent_node.resource.event_color -func highlight(): +## Called by the visual timeline editor +func highlight() -> void: modulate = parent_node.resource.event_color.lightened(0.5) -func unhighlight(): - modulate = Color(1,1,1,1) +## Called by the visual timeline editor +func unhighlight() -> void: + modulate = parent_node.resource.event_color -func set_indent(indent: int): - var indent_node = $Indent - indent_node.custom_minimum_size = Vector2(indent_size * indent, 0) - indent_node.visible = indent != 0 + +func update_hidden_events_indicator(hidden_events_count:int = 0) -> void: + $HiddenEventsLabel.visible = hidden_events_count > 0 + $HiddenEventsLabel.text = "["+str(hidden_events_count)+ " events hidden]" + +## Called by the visual timeline editor +func set_indent(indent: int) -> void: + $Indent.custom_minimum_size = Vector2(indent_size * indent, 0) + $Indent.visible = indent != 0 current_indent_level = indent queue_redraw() -func parent_node_changed(): - if parent_node: - if end_control and end_control.has_method('refresh'): - end_control.refresh() -func add_end_control(control:Control): +## Called by the visual timeline editor if something was edited on the parent event block +func parent_node_changed() -> void: + if parent_node and end_control and end_control.has_method('refresh'): + end_control.refresh() + + +## Called on creation of the parent event provides an end control +func add_end_control(control:Control) -> void: add_child(control) - control.size_flags_vertical = SIZE_SHRINK_BEGIN + control.size_flags_vertical = SIZE_SHRINK_CENTER if "parent_resource" in control: control.parent_resource = parent_node.resource if control.has_method('refresh'): diff --git a/addons/dialogic/Editor/Events/BranchEnd.tscn b/addons/dialogic/Editor/Events/BranchEnd.tscn index af4935445..e90f8fc29 100644 --- a/addons/dialogic/Editor/Events/BranchEnd.tscn +++ b/addons/dialogic/Editor/Events/BranchEnd.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://addons/dialogic/Editor/Events/BranchEnd.gd" id="1"] -[sub_resource type="Image" id="Image_ov00m"] +[sub_resource type="Image" id="Image_8tlok"] 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", @@ -11,14 +11,15 @@ data = { "width": 16 } -[sub_resource type="ImageTexture" id="ImageTexture_oe0il"] -image = SubResource("Image_ov00m") +[sub_resource type="ImageTexture" id="ImageTexture_vm1jl"] +image = SubResource("Image_8tlok") [node name="EndBranch" type="HBoxContainer"] custom_minimum_size = Vector2(0, 40) anchors_preset = 10 anchor_right = 1.0 -offset_bottom = 24.0 +offset_bottom = 40.0 +grow_horizontal = 2 mouse_filter = 0 script = ExtResource("1") @@ -33,9 +34,16 @@ size_flags_vertical = 0 [node name="Icon" type="Button" parent="."] unique_name_in_owner = true -custom_minimum_size = Vector2(31, 0) +custom_minimum_size = Vector2(20, 0) layout_mode = 2 -size_flags_vertical = 0 +size_flags_vertical = 4 +tooltip_text = "Click and drag" +focus_mode = 0 mouse_filter = 1 -icon = SubResource("ImageTexture_oe0il") +icon = SubResource("ImageTexture_vm1jl") flat = true + +[node name="HiddenEventsLabel" type="Label" parent="."] +visible = false +layout_mode = 2 +text = "XX Events hidden" diff --git a/addons/dialogic/Editor/Events/EventBlock/event_block.gd b/addons/dialogic/Editor/Events/EventBlock/event_block.gd index ae6820ef8..209aa65c5 100644 --- a/addons/dialogic/Editor/Events/EventBlock/event_block.gd +++ b/addons/dialogic/Editor/Events/EventBlock/event_block.gd @@ -113,15 +113,6 @@ func _set_event_icon(icon: Texture) -> void: custom_style.corner_radius_bottom_right = 5 * _scale -func _request_selection() -> void: - # TODO doesn't work. I'm sure - JS - var timeline_editor = editor_reference.get_node_or_null('MainPanel/TimelineEditor') - if (timeline_editor != null): - # @todo select item and clear selection is marked as "private" in TimelineEditor.gd - # consider to make it "public" or add a public helper function - timeline_editor.select_item(self) - - # called to inform event parts, that a focus is wanted func focus(): pass @@ -129,8 +120,7 @@ func focus(): func toggle_collapse(toggled:bool) -> void: collapsed = toggled - $PanelContainer/VBoxContainer/CollapsedBody.visible = toggled - var timeline_editor = find_parent('TimelineVisualEditor') + var timeline_editor = find_parent('VisualEditor') if (timeline_editor != null): # @todo select item and clear selection is marked as "private" in TimelineEditor.gd # consider to make it "public" or add a public helper function @@ -356,7 +346,6 @@ func _ready(): if resource: if resource.event_name: - #title_label.text = DTS.translate(resource.event_name) title_label.text = resource.event_name if resource._get_icon() != null: _set_event_icon(resource._get_icon()) @@ -364,18 +353,6 @@ func _ready(): %IconPanel.self_modulate = resource.event_color _on_ExpandButton_toggled(resource.expand_by_default) - - # Only create this if it can collapse children events - if resource.can_contain_events: - var cb:HBoxContainer = HBoxContainer.new() - cb.name = 'CollapsedBody' - cb.visible = false - var cb_label:Label = Label.new() - cb_label.text = 'Contains Events (currently hidden)' - cb_label.size_flags_horizontal = 3 - cb_label.horizontal_alignment = 1 - cb.add_child(cb_label) - $PanelContainer/VBoxContainer.add_child(cb) set_focus_mode(1) # Allowing this node to grab focus diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.gd index 2c5345129..d98972d50 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.gd @@ -8,34 +8,42 @@ extends Button return event_icon set(texture): event_icon = texture - %Icon.texture = texture + icon = event_icon @export var event_category:int = 0 @export var event_sorting_index:int = 0 -@export var resource:Resource +@export var resource:DialogicEvent @export var dialogic_color_name:String = '' -func _ready(): - self_modulate = Color(1,1,1) - if visible_name != '': - text = ' ' + visible_name - #tooltip_text = DTS.translate(tooltip_text) - - var _scale = DialogicUtil.get_editor_scale() - custom_minimum_size = Vector2(30,30)* _scale - icon = null - %ColorBorder.custom_minimum_size.x = 5 * _scale - %IconContainer.custom_minimum_size = custom_minimum_size + +func _ready() -> void: + toggle_name() + tooltip_text = visible_name + + custom_minimum_size = Vector2(get_theme_font("font", 'Label').get_string_size(text).x+35,30)* DialogicUtil.get_editor_scale() add_theme_color_override("font_color", get_theme_color("font_color", "Editor")) add_theme_color_override("font_color_hover", get_theme_color("accent_color", "Editor")) - %Icon.modulate = get_theme_color("font_color", "Button") - - # TODO godot4 signal was removed. find a way to react to color changes - # ProjectSettings.project_settings_changed.connect(_update_color) + apply_base_button_style() -func set_color(color): - %ColorBorder.self_modulate = color +func apply_base_button_style() -> void: + var scale := DialogicUtil.get_editor_scale() + var nstyle :StyleBoxFlat= get_parent().get_theme_stylebox('normal', 'Button').duplicate() + nstyle.border_width_left = 5 *scale + add_theme_stylebox_override('normal', nstyle) + var hstyle :StyleBoxFlat= get_parent().get_theme_stylebox('hover', 'Button').duplicate() + hstyle.border_width_left = 5 *scale + add_theme_stylebox_override('hover', hstyle) + set_color(resource.event_color) + + +func set_color(color:Color) -> void: + var style := get_theme_stylebox('normal', 'Button') + style.border_color = color + add_theme_stylebox_override('normal', style) + style = get_theme_stylebox('hover', 'Button') + style.border_color = color + add_theme_stylebox_override('hover', style) #func _update_color(): # if dialogic_color_name != '': @@ -43,13 +51,28 @@ func set_color(color): # resource.event_color = new_color # %ColorBorder.self_modulate = DialogicUtil.get_color(dialogic_color_name) -func _get_drag_data(position): - var preview_label = Label.new() +func _get_drag_data(position:Vector2) -> Variant: + var preview_label := Label.new() preview_label.text = 'Add Event %s' % [ tooltip_text ] if self.text != '': preview_label.text = text - + set_drag_preview(preview_label) return { "source": "EventButton", "resource": resource } + +func toggle_name(): + if text != "": + text = "" + custom_minimum_size = Vector2(40, 40)*DialogicUtil.get_editor_scale() + var style := get_theme_stylebox('normal', 'Button') + style.bg_color = style.border_color.darkened(0.2) + add_theme_stylebox_override('normal', style) + style = get_theme_stylebox('hover', 'Button') + style.bg_color = style.border_color + add_theme_stylebox_override('hover', style) + else: + text = visible_name + custom_minimum_size = Vector2(get_theme_font("font", 'Label').get_string_size(text).x+35,30)* DialogicUtil.get_editor_scale() + apply_base_button_style() diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.tscn b/addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.tscn index 7d8b061b0..000bf09c8 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.tscn +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.tscn @@ -1,71 +1,46 @@ -[gd_scene load_steps=3 format=3] +[gd_scene load_steps=5 format=3 uid="uid://depcrpeh3f4rv"] [ext_resource type="Script" path="res://addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.gd" id="1_s43sc"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ba8bn"] -bg_color = Color(1, 1, 1, 1) -corner_radius_top_left = 5 -corner_radius_bottom_left = 5 +[ext_resource type="Texture2D" uid="uid://bbqfq3s7qrduv" path="res://icon.svg" id="2_mncsv"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qx31r"] +content_margin_left = 4.0 +content_margin_top = 4.0 +content_margin_right = 4.0 +content_margin_bottom = 4.0 +bg_color = Color(0.1, 0.1, 0.1, 0.6) +border_width_left = 3 +border_color = Color(0.231373, 0.545098, 0.94902, 1) +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_n1o16"] +content_margin_left = 4.0 +content_margin_top = 4.0 +content_margin_right = 4.0 +content_margin_bottom = 4.0 +bg_color = Color(0.225, 0.225, 0.225, 0.6) +border_width_left = 3 +border_color = Color(0.231373, 0.545098, 0.94902, 1) +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="AddEventButton" type="Button"] -custom_minimum_size = Vector2(60, 60) -offset_right = 103.0 -offset_bottom = 31.0 +custom_minimum_size = Vector2(29.25, 22.5) +offset_right = 97.0 +offset_bottom = 42.0 theme_override_colors/font_color = Color(0, 0, 0, 1) -text = " S" -flat = true +theme_override_styles/normal = SubResource("StyleBoxFlat_qx31r") +theme_override_styles/hover = SubResource("StyleBoxFlat_n1o16") +text = "S" +icon = ExtResource("2_mncsv") +alignment = 0 +expand_icon = true script = ExtResource("1_s43sc") visible_name = "S" - -[node name="Border" type="Panel" parent="."] -show_behind_parent = true -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -mouse_filter = 2 - -[node name="Hbox" type="HBoxContainer" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme_override_constants/separation = 0 -metadata/_edit_layout_mode = 1 - -[node name="ColorBorder" type="Panel" parent="Hbox"] -unique_name_in_owner = true -self_modulate = Color(0.635294, 0.635294, 0.635294, 0.282353) -show_behind_parent = true -custom_minimum_size = Vector2(10, 0) -layout_mode = 2 -offset_right = 10.0 -offset_bottom = 60.0 -mouse_filter = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_ba8bn") - -[node name="IconContainer" type="MarginContainer" parent="Hbox"] -unique_name_in_owner = true -custom_minimum_size = Vector2(60, 60) -layout_mode = 2 -offset_left = 10.0 -offset_right = 70.0 -offset_bottom = 60.0 -theme_override_constants/margin_left = 0 -theme_override_constants/margin_top = 0 -theme_override_constants/margin_right = 0 -theme_override_constants/margin_bottom = 0 - -[node name="Icon" type="TextureRect" parent="Hbox/IconContainer"] -unique_name_in_owner = true -modulate = Color(0, 0, 0, 1) -layout_mode = 2 -offset_right = 60.0 -offset_bottom = 60.0 -grow_vertical = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 -ignore_texture_size = true -metadata/_edit_layout_mode = 1 diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/EventButton.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/EventButton.gd deleted file mode 100644 index 75c3db7df..000000000 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/EventButton.gd +++ /dev/null @@ -1,16 +0,0 @@ -@tool -extends Button - -@export var EventName:String = '' - -func get_drag_data(position): - var preview_label = Label.new() - - if (self.text != ''): - preview_label.text = text - else: - preview_label.text = 'Add Event %s' % [ EventName ] - - set_drag_preview(preview_label) - - return { "source": "EventButton", "event_name": EventName } diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd index b3790ef97..819610ca1 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd @@ -9,6 +9,7 @@ extends Container ################################################################################ var TimelineUndoRedo := UndoRedo.new() var event_node +var sidebar_collapsed := false ################################################################################ ## SIGNALS @@ -61,7 +62,7 @@ func save_timeline() -> void: if !get_parent().current_resource: return - get_parent().events = new_events + get_parent().current_resource.events = new_events get_parent().current_resource.events_processed = true var error :int = ResourceSaver.save(get_parent().current_resource, get_parent().current_resource.resource_path) if error != OK: @@ -70,6 +71,9 @@ func save_timeline() -> void: get_parent().current_resource.set_meta("unsaved", false) get_parent().current_resource_state = DialogicEditor.ResourceStates.Saved get_parent().editors_manager.resource_helper.rebuild_timeline_directory() + + ## Also save sidebar size + ProjectSettings.set_setting('dialogic/editor/visual_timeline_editor_sidebar', %RightSidebar.size.x) func load_timeline(resource:DialogicTimeline) -> void: @@ -144,12 +148,7 @@ func _ready(): batch_loaded.connect(_on_batch_loaded) - # Margins - var _scale := DialogicUtil.get_editor_scale() - var scroll_container :ScrollContainer = $View/ScrollContainer - scroll_container.custom_minimum_size.x = 200 * _scale - - + if find_parent('EditorView'): # This prevents the view to turn black if you are editing this scene in Godot %TimelineArea.get_theme_color("background_color", "CodeEdit") @@ -160,7 +159,7 @@ func load_event_buttons() -> void: var scripts: Array = get_parent().editors_manager.resource_helper.get_event_scripts() # Event buttons - var buttonScene = load("res://addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.tscn") + var buttonScene := load("res://addons/dialogic/Editor/TimelineEditor/VisualEditor/AddEventButton.tscn") for event_script in scripts: var event_resource: Variant @@ -171,9 +170,9 @@ func load_event_buttons() -> void: event_resource = event_script if event_resource.disable_editor_button == true: continue - var button = buttonScene.instantiate() + var button :Button = buttonScene.instantiate() button.resource = event_resource - button.visible_name = ' ' + event_resource.event_name + button.visible_name = event_resource.event_name button.event_icon = event_resource._get_icon() button.set_color(event_resource.event_color) button.dialogic_color_name = event_resource.dialogic_color_name @@ -182,10 +181,15 @@ func load_event_buttons() -> void: button.button_up.connect(_add_event_button_pressed.bind(event_resource)) - get_node("View/ScrollContainer/EventContainer/FlexContainer" + str(button.event_category)).add_child(button) - while event_resource.event_sorting_index < get_node("View/ScrollContainer/EventContainer/FlexContainer" + str(button.event_category)).get_child(max(0, button.get_index()-1)).resource.event_sorting_index: - get_node("View/ScrollContainer/EventContainer/FlexContainer" + str(button.event_category)).move_child(button, button.get_index()-1) - + %RightSidebar.get_node("EventContainer/FlexContainer" + str(button.event_category)).add_child(button) + while event_resource.event_sorting_index < %RightSidebar.get_node("EventContainer/FlexContainer" + str(button.event_category)).get_child(max(0, button.get_index()-1)).resource.event_sorting_index: + %RightSidebar.get_node("EventContainer/FlexContainer" + str(button.event_category)).move_child(button, button.get_index()-1) + + # Margins + var _scale := DialogicUtil.get_editor_scale() + %RightSidebar.custom_minimum_size.x = 50 * _scale + %RightSidebar.size.y = ProjectSettings.get_setting('dialogic/editor/visual_timeline_editor_sidebar', 200) + ################################################################################ ## CLEANUP @@ -825,8 +829,9 @@ func indent_events() -> void: if event_list.size() < 2: return - var currently_hidden = false - var hidden_until = null + var currently_hidden := false + var hidden_count := 0 + var hidden_until :Control= null # will be applied to the indent after the current event var delayed_indent: int = 0 @@ -834,17 +839,22 @@ func indent_events() -> void: for event in event_list: if (not "resource" in event): continue - + if (not currently_hidden) and event.resource.can_contain_events and event.end_node and event.collapsed: currently_hidden = true hidden_until = event.end_node + hidden_count = 0 elif currently_hidden and event == hidden_until: + event.update_hidden_events_indicator(hidden_count) currently_hidden = false hidden_until = null elif currently_hidden: event.hide() + hidden_count += 1 else: event.show() + if event.resource is DialogicEndBranchEvent: + event.update_hidden_events_indicator(0) delayed_indent = 0 @@ -903,3 +913,27 @@ func _on_event_popup_menu_index_pressed(index:int) -> void: elif index == 5: delete_selected_events() indent_events() + + +func _on_right_sidebar_resized() -> void: + if %RightSidebar.size.x < 120 and !sidebar_collapsed: + sidebar_collapsed = true + for con in %RightSidebar.get_node('EventContainer').get_children(): + if con.get_child_count() == 0: + continue + if con.get_child(0) is Label: + con.get_child(0).hide() + elif con.get_child(0) is Button: + for button in con.get_children(): + button.toggle_name() + + elif %RightSidebar.size.x > 120 and sidebar_collapsed: + sidebar_collapsed = false + for con in %RightSidebar.get_node('EventContainer').get_children(): + if con.get_child_count() == 0: + continue + if con.get_child(0) is Label: + con.get_child(0).show() + elif con.get_child(0) is Button: + for button in con.get_children(): + button.toggle_name() diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.tscn b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.tscn index 81fd549d7..4caa29071 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.tscn +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.tscn @@ -9,14 +9,14 @@ [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_phyjj"] content_margin_top = 10.0 -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8o7ew"] +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_y5dg1"] [sub_resource type="Theme" id="Theme_ycwn2"] PopupMenu/colors/font_color_hover = Color(0.44, 0.73, 0.98, 1) -PopupMenu/styles/hover = SubResource("StyleBoxEmpty_8o7ew") +PopupMenu/styles/hover = SubResource("StyleBoxEmpty_y5dg1") PopupMenu/styles/panel = ExtResource("4_cqp1m") -[sub_resource type="Image" id="Image_wp5qe"] +[sub_resource type="Image" id="Image_5sal8"] 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,10 +25,11 @@ data = { "width": 16 } -[sub_resource type="ImageTexture" id="ImageTexture_4u7aj"] -image = SubResource("Image_wp5qe") +[sub_resource type="ImageTexture" id="ImageTexture_cm3pl"] +image = SubResource("Image_5sal8") [node name="TimelineVisualEditor" type="MarginContainer"] +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 @@ -65,125 +66,128 @@ unique_name_in_owner = true theme = SubResource("Theme_ycwn2") item_count = 6 item_0/text = "Documentation" -item_0/icon = SubResource("ImageTexture_4u7aj") +item_0/icon = SubResource("ImageTexture_cm3pl") item_0/id = 0 item_1/text = "" item_1/id = -1 item_1/separator = true item_2/text = "Move up" -item_2/icon = SubResource("ImageTexture_4u7aj") +item_2/icon = SubResource("ImageTexture_cm3pl") item_2/id = 2 item_3/text = "Move down" -item_3/icon = SubResource("ImageTexture_4u7aj") +item_3/icon = SubResource("ImageTexture_cm3pl") item_3/id = 3 item_4/text = "" item_4/id = -1 item_4/separator = true item_5/text = "Delete" -item_5/icon = SubResource("ImageTexture_4u7aj") +item_5/icon = SubResource("ImageTexture_cm3pl") item_5/id = 5 script = ExtResource("4_ugiq6") -[node name="ScrollContainer" type="ScrollContainer" parent="View"] -custom_minimum_size = Vector2(150, 0) +[node name="RightSidebar" type="ScrollContainer" parent="View"] +unique_name_in_owner = true +custom_minimum_size = Vector2(50, 0) layout_mode = 2 +horizontal_scroll_mode = 0 -[node name="EventContainer" type="VBoxContainer" parent="View/ScrollContainer"] +[node name="EventContainer" type="VBoxContainer" parent="View/RightSidebar"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="HBoxContainer6" type="HBoxContainer" parent="View/ScrollContainer/EventContainer"] +[node name="HBoxContainer6" type="HBoxContainer" parent="View/RightSidebar/EventContainer"] layout_mode = 2 -[node name="Label" type="Label" parent="View/ScrollContainer/EventContainer/HBoxContainer6"] +[node name="Label" type="Label" parent="View/RightSidebar/EventContainer/HBoxContainer6"] layout_mode = 2 text = "Main" -[node name="HSeparator2" type="HSeparator" parent="View/ScrollContainer/EventContainer/HBoxContainer6"] +[node name="HSeparator2" type="HSeparator" parent="View/RightSidebar/EventContainer/HBoxContainer6"] layout_mode = 2 size_flags_horizontal = 3 -[node name="FlexContainer0" type="HFlowContainer" parent="View/ScrollContainer/EventContainer"] +[node name="FlexContainer0" type="HFlowContainer" parent="View/RightSidebar/EventContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="HBoxContainer5" type="HBoxContainer" parent="View/ScrollContainer/EventContainer"] +[node name="HBoxContainer5" type="HBoxContainer" parent="View/RightSidebar/EventContainer"] layout_mode = 2 -[node name="Label2" type="Label" parent="View/ScrollContainer/EventContainer/HBoxContainer5"] +[node name="Label2" type="Label" parent="View/RightSidebar/EventContainer/HBoxContainer5"] layout_mode = 2 text = "Logic" -[node name="HSeparator2" type="HSeparator" parent="View/ScrollContainer/EventContainer/HBoxContainer5"] +[node name="HSeparator2" type="HSeparator" parent="View/RightSidebar/EventContainer/HBoxContainer5"] layout_mode = 2 size_flags_horizontal = 3 -[node name="FlexContainer1" type="HFlowContainer" parent="View/ScrollContainer/EventContainer"] +[node name="FlexContainer1" type="HFlowContainer" parent="View/RightSidebar/EventContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="HBoxContainer3" type="HBoxContainer" parent="View/ScrollContainer/EventContainer"] +[node name="HBoxContainer3" type="HBoxContainer" parent="View/RightSidebar/EventContainer"] layout_mode = 2 -[node name="Label3" type="Label" parent="View/ScrollContainer/EventContainer/HBoxContainer3"] +[node name="Label3" type="Label" parent="View/RightSidebar/EventContainer/HBoxContainer3"] layout_mode = 2 text = "Timeline" -[node name="HSeparator2" type="HSeparator" parent="View/ScrollContainer/EventContainer/HBoxContainer3"] +[node name="HSeparator2" type="HSeparator" parent="View/RightSidebar/EventContainer/HBoxContainer3"] layout_mode = 2 size_flags_horizontal = 3 -[node name="FlexContainer2" type="HFlowContainer" parent="View/ScrollContainer/EventContainer"] +[node name="FlexContainer2" type="HFlowContainer" parent="View/RightSidebar/EventContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="HBoxContainer4" type="HBoxContainer" parent="View/ScrollContainer/EventContainer"] +[node name="HBoxContainer4" type="HBoxContainer" parent="View/RightSidebar/EventContainer"] layout_mode = 2 -[node name="Label4" type="Label" parent="View/ScrollContainer/EventContainer/HBoxContainer4"] +[node name="Label4" type="Label" parent="View/RightSidebar/EventContainer/HBoxContainer4"] layout_mode = 2 text = "Audio/Visual" -[node name="HSeparator2" type="HSeparator" parent="View/ScrollContainer/EventContainer/HBoxContainer4"] +[node name="HSeparator2" type="HSeparator" parent="View/RightSidebar/EventContainer/HBoxContainer4"] layout_mode = 2 size_flags_horizontal = 3 -[node name="FlexContainer3" type="HFlowContainer" parent="View/ScrollContainer/EventContainer"] +[node name="FlexContainer3" type="HFlowContainer" parent="View/RightSidebar/EventContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="HBoxContainer" type="HBoxContainer" parent="View/ScrollContainer/EventContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="View/RightSidebar/EventContainer"] layout_mode = 2 -[node name="Label5" type="Label" parent="View/ScrollContainer/EventContainer/HBoxContainer"] +[node name="Label5" type="Label" parent="View/RightSidebar/EventContainer/HBoxContainer"] layout_mode = 2 text = "Godot" -[node name="HSeparator2" type="HSeparator" parent="View/ScrollContainer/EventContainer/HBoxContainer"] +[node name="HSeparator2" type="HSeparator" parent="View/RightSidebar/EventContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="FlexContainer4" type="HFlowContainer" parent="View/ScrollContainer/EventContainer"] +[node name="FlexContainer4" type="HFlowContainer" parent="View/RightSidebar/EventContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="OtherContainer" type="HBoxContainer" parent="View/ScrollContainer/EventContainer"] +[node name="OtherContainer" type="HBoxContainer" parent="View/RightSidebar/EventContainer"] layout_mode = 2 -[node name="Label6" type="Label" parent="View/ScrollContainer/EventContainer/OtherContainer"] +[node name="Label6" type="Label" parent="View/RightSidebar/EventContainer/OtherContainer"] layout_mode = 2 text = "Other" -[node name="HSeparator2" type="HSeparator" parent="View/ScrollContainer/EventContainer/OtherContainer"] +[node name="HSeparator2" type="HSeparator" parent="View/RightSidebar/EventContainer/OtherContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="FlexContainer5" type="HFlowContainer" parent="View/ScrollContainer/EventContainer"] +[node name="FlexContainer5" type="HFlowContainer" parent="View/RightSidebar/EventContainer"] layout_mode = 2 size_flags_horizontal = 3 -[node name="Spacer" type="Control" parent="View/ScrollContainer/EventContainer"] +[node name="Spacer" type="Control" parent="View/RightSidebar/EventContainer"] layout_mode = 2 [connection signal="index_pressed" from="View/TimelineArea/EventPopupMenu" to="." method="_on_event_popup_menu_index_pressed"] +[connection signal="resized" from="View/RightSidebar" to="." method="_on_right_sidebar_resized"] diff --git a/addons/dialogic/Events/DefaultLayouts/Default/DialogicDefaultLayout.gd b/addons/dialogic/Events/DefaultLayouts/Default/DialogicDefaultLayout.gd index 1d8526628..a4dc6b3d5 100644 --- a/addons/dialogic/Events/DefaultLayouts/Default/DialogicDefaultLayout.gd +++ b/addons/dialogic/Events/DefaultLayouts/Default/DialogicDefaultLayout.gd @@ -49,6 +49,7 @@ func _ready(): ## BOX SETTINGS %DialogTextPanel.self_modulate = box_modulate + %TextInputPanel.self_modulate = box_modulate ## NAME LABEL SETTINGS %DialogicNode_NameLabel.add_theme_font_size_override("font_size", name_label_font_size) diff --git a/addons/dialogic/Events/TextInput/event_text_input.gd b/addons/dialogic/Events/TextInput/event_text_input.gd index 1dfcc934c..d47ad26ba 100644 --- a/addons/dialogic/Events/TextInput/event_text_input.gd +++ b/addons/dialogic/Events/TextInput/event_text_input.gd @@ -45,7 +45,7 @@ func _on_DialogicTextInput_input_confirmed(input:String) -> void: ################################################################################ func _init() -> void: - event_name = "text Input" + event_name = "Text Input" set_default_color('Color1') event_category = Category.Godot event_sorting_index = 6 diff --git a/addons/dialogic/Events/Variable/event_variable.gd b/addons/dialogic/Events/Variable/event_variable.gd index 4c348b8dc..f24a7eb06 100644 --- a/addons/dialogic/Events/Variable/event_variable.gd +++ b/addons/dialogic/Events/Variable/event_variable.gd @@ -201,4 +201,4 @@ func get_value_suggestions(filter:String) -> Dictionary: func _on_variable_editor_pressed(): var editor_manager := _editor_node.find_parent('EditorsManager') if editor_manager: - editor_manager.open_editor(editor_manager.editors['Settings']['node'], true, 'VariablesEditor') + editor_manager.open_editor(editor_manager.editors['VariablesEditor']['node'], true)