From f9af8f867a787a509bffdc458363c168b086e8b2 Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Mon, 8 Dec 2025 13:17:55 +0100 Subject: [PATCH 01/19] Small editor theming fix Character Editor had wrong BG color when no charater was selected. Adds Icons to the Create New Character/Timeline button (when those editors are empty), to make it clearer that the buttons in the toolbar do the same thing. --- .../Editor/CharacterEditor/character_editor.gd | 2 +- .../Editor/CharacterEditor/character_editor.tscn | 16 ++++++---------- .../Editor/TimelineEditor/timeline_editor.tscn | 13 +++---------- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor.gd b/addons/dialogic/Editor/CharacterEditor/character_editor.gd index daf69a8f2..c1dfe48cb 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor.gd +++ b/addons/dialogic/Editor/CharacterEditor/character_editor.gd @@ -149,7 +149,7 @@ func _ready() -> void: if DialogicUtil.get_dialogic_plugin().has_signal("scene_saved"): DialogicUtil.get_dialogic_plugin().scene_saved.connect(_on_some_resource_saved) - $NoCharacterScreen.color = get_theme_color("dark_color_3", "Editor") + $NoTimelineScreen.add_theme_stylebox_override("panel", get_theme_stylebox("Background", "EditorStyles")) $NoCharacterScreen.show() setup_portrait_list_tab() diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor.tscn b/addons/dialogic/Editor/CharacterEditor/character_editor.tscn index 8bd30f125..4553927c2 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor.tscn +++ b/addons/dialogic/Editor/CharacterEditor/character_editor.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=8 format=3 uid="uid://dlskc36c5hrwv"] +[gd_scene load_steps=9 format=3 uid="uid://dlskc36c5hrwv"] [ext_resource type="Script" uid="uid://cwhe7tpe75oh7" path="res://addons/dialogic/Editor/CharacterEditor/character_editor.gd" id="2"] [ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="2_uhhqs"] [ext_resource type="Script" uid="uid://deliic6d8vajo" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd" id="2_vad0i"] [ext_resource type="Texture2D" uid="uid://bff65e82555qr" path="res://addons/dialogic/Editor/Images/Pieces/close-icon.svg" id="3_2ogmx"] [ext_resource type="Texture2D" uid="uid://dx3o2ild56i76" path="res://addons/dialogic/Editor/Images/Pieces/closed-icon.svg" id="4_wg7ys"] +[ext_resource type="Texture2D" uid="uid://my600mb32ydt" path="res://addons/dialogic/Editor/Images/Toolbar/add-character.svg" id="6_2ogmx"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_es2rd"] @@ -409,8 +410,7 @@ visible = false custom_minimum_size = Vector2(0, 20) layout_mode = 2 -[node name="NoCharacterScreen" type="ColorRect" parent="." unique_id=2122222002] -visible = false +[node name="NoCharacterScreen" type="PanelContainer" parent="." unique_id=190821474] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -418,15 +418,9 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 size_flags_horizontal = 3 -color = Color(0, 0, 0, 1) [node name="CenterContainer" type="CenterContainer" parent="NoCharacterScreen" unique_id=1885703718] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 +layout_mode = 2 [node name="VBoxContainer" type="VBoxContainer" parent="NoCharacterScreen/CenterContainer" unique_id=135127017] custom_minimum_size = Vector2(250, 0) @@ -441,7 +435,9 @@ autowrap_mode = 3 [node name="CreateCharacterButton" type="Button" parent="NoCharacterScreen/CenterContainer/VBoxContainer" unique_id=1496778365] layout_mode = 2 +size_flags_horizontal = 4 text = "Create New Character" +icon = ExtResource("6_2ogmx") [connection signal="pressed" from="Scroll/VBox/MainHSplit/MainSettingsPanel/MainSettings/HBoxContainer/CloseButton" to="." method="hide_main_settings"] [connection signal="pressed" from="Scroll/VBox/MainHSplit/MainSettingsPanel/MainSettingsHidden/OpenButton" to="." method="show_main_settings"] diff --git a/addons/dialogic/Editor/TimelineEditor/timeline_editor.tscn b/addons/dialogic/Editor/TimelineEditor/timeline_editor.tscn index 517da01b6..83f755ac4 100644 --- a/addons/dialogic/Editor/TimelineEditor/timeline_editor.tscn +++ b/addons/dialogic/Editor/TimelineEditor/timeline_editor.tscn @@ -4,6 +4,7 @@ [ext_resource type="PackedScene" uid="uid://ysqbusmy0qma" path="res://addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.tscn" id="2_qs7vc"] [ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="2_yqd26"] [ext_resource type="PackedScene" uid="uid://defdeav8rli6o" path="res://addons/dialogic/Editor/TimelineEditor/TextEditor/timeline_editor_text.tscn" id="3_up2bn"] +[ext_resource type="Texture2D" uid="uid://bymlbr4o2m3jc" path="res://addons/dialogic/Editor/Images/Toolbar/add-timeline.svg" id="5_u2118"] [ext_resource type="Script" uid="uid://b35hvsvrvjjl4" path="res://addons/dialogic/Editor/TimelineEditor/shortcut_popup.gd" id="6_rfuk0"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_boacm"] @@ -14,14 +15,6 @@ content_margin_bottom = 6.0 bg_color = Color(0.153, 0.153, 0.153, 1) corner_detail = 4 -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_suoo8"] -content_margin_left = 0.0 -content_margin_top = 0.0 -content_margin_right = 0.0 -content_margin_bottom = 0.0 -bg_color = Color(0.083385, 0.083385, 0.083385, 1) -corner_detail = 4 - [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4bvbc"] content_margin_left = 0.0 content_margin_top = 0.0 @@ -219,14 +212,12 @@ unique_name_in_owner = true layout_mode = 2 [node name="NoTimelineScreen" type="PanelContainer" parent="." unique_id=946023967] -visible = false layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_suoo8") [node name="CenterContainer" type="CenterContainer" parent="NoTimelineScreen" unique_id=1698409400] layout_mode = 2 @@ -244,7 +235,9 @@ autowrap_mode = 3 [node name="CreateTimelineButton" type="Button" parent="NoTimelineScreen/CenterContainer/VBoxContainer" unique_id=1761424501] layout_mode = 2 +size_flags_horizontal = 4 text = "Create New Timeline" +icon = ExtResource("5_u2118") [node name="ShortcutsPanel" type="PanelContainer" parent="." unique_id=1337371675] unique_name_in_owner = true From 72a47b8e28d9f777639b7e8979011111b3e93449 Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Mon, 8 Dec 2025 13:31:38 +0100 Subject: [PATCH 02/19] Fixes for previous commit --- addons/dialogic/Editor/CharacterEditor/character_editor.gd | 2 +- .../Editor/TimelineEditor/TextEditor/timeline_editor_text.gd | 3 +++ .../Editor/TimelineEditor/VisualEditor/TimelineArea.gd | 3 +++ .../TimelineEditor/VisualEditor/timeline_editor_visual.gd | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor.gd b/addons/dialogic/Editor/CharacterEditor/character_editor.gd index c1dfe48cb..675474d69 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor.gd +++ b/addons/dialogic/Editor/CharacterEditor/character_editor.gd @@ -149,7 +149,7 @@ func _ready() -> void: if DialogicUtil.get_dialogic_plugin().has_signal("scene_saved"): DialogicUtil.get_dialogic_plugin().scene_saved.connect(_on_some_resource_saved) - $NoTimelineScreen.add_theme_stylebox_override("panel", get_theme_stylebox("Background", "EditorStyles")) + $NoCharacterScreen.add_theme_stylebox_override("panel", get_theme_stylebox("Background", "EditorStyles")) $NoCharacterScreen.show() setup_portrait_list_tab() diff --git a/addons/dialogic/Editor/TimelineEditor/TextEditor/timeline_editor_text.gd b/addons/dialogic/Editor/TimelineEditor/TextEditor/timeline_editor_text.gd index a49ed7367..d71676f59 100644 --- a/addons/dialogic/Editor/TimelineEditor/TextEditor/timeline_editor_text.gd +++ b/addons/dialogic/Editor/TimelineEditor/TextEditor/timeline_editor_text.gd @@ -10,6 +10,9 @@ var label_regex := RegEx.create_from_string('label +(?[^\n]+)') var channel_regex := RegEx.create_from_string(r'audio +(?[\w-]{2,}|[\w]+)') func _ready() -> void: + if get_parent() is SubViewport or owner.get_parent() is SubViewport: + return + await find_parent('EditorView').ready syntax_highlighter = code_completion_helper.syntax_highlighter timeline_editor.editors_manager.sidebar.content_item_activated.connect(_on_content_item_clicked) diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd index d95062a1c..ca6203a3b 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd @@ -22,6 +22,9 @@ signal drag_canceled() func _ready() -> void: + if owner.get_parent() is SubViewport: + return + resized.connect(add_extra_scroll_area_to_timeline) %Timeline.child_entered_tree.connect(add_extra_scroll_area_to_timeline) diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd index 34615790a..816b86616 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd @@ -175,6 +175,9 @@ func clear_timeline_nodes() -> void: ################################################################################ func _ready() -> void: + if get_parent() is SubViewport or owner.get_parent() is SubViewport: + return + event_node = load("res://addons/dialogic/Editor/Events/EventBlock/event_block.tscn") batch_loaded.connect(_on_batch_loaded) From ee4040f8c45759d14102b8174ccc616cf29e8044 Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Mon, 8 Dec 2025 13:57:14 +0100 Subject: [PATCH 03/19] Clean up event code script regions & Add some docs links --- addons/dialogic/Modules/Audio/event_audio.gd | 30 ++++++++++++------- .../Modules/Background/event_background.gd | 4 ++- addons/dialogic/Modules/Call/event_call.gd | 30 ++++++++++++------- .../Modules/Character/event_character.gd | 22 ++++++++++---- addons/dialogic/Modules/Clear/event_clear.gd | 20 ++++++++----- .../dialogic/Modules/Comment/event_comment.gd | 24 +++++++++------ .../Modules/Condition/event_condition.gd | 29 +++++++++++------- .../Modules/Glossary/event_glossary.gd | 22 +++++++++----- .../dialogic/Modules/History/event_history.gd | 21 ++++++++----- addons/dialogic/Modules/Jump/event_jump.gd | 29 +++++++++++------- addons/dialogic/Modules/Jump/event_label.gd | 29 +++++++++++------- addons/dialogic/Modules/Jump/event_return.gd | 29 +++++++++++------- addons/dialogic/Modules/Save/event_save.gd | 20 ++++++++----- .../Modules/Settings/event_setting.gd | 29 +++++++++++------- .../dialogic/Modules/Signal/event_signal.gd | 21 ++++++++----- addons/dialogic/Modules/Style/event_style.gd | 20 ++++++++----- .../Modules/TextInput/event_text_input.gd | 8 +++++ .../Modules/Variable/event_variable.gd | 28 ++++++++++------- addons/dialogic/Modules/Voice/event_voice.gd | 20 ++++++++----- addons/dialogic/Modules/Wait/event_wait.gd | 21 ++++++++----- .../Modules/WaitInput/event_wait_input.gd | 17 +++++++---- 21 files changed, 305 insertions(+), 168 deletions(-) diff --git a/addons/dialogic/Modules/Audio/event_audio.gd b/addons/dialogic/Modules/Audio/event_audio.gd index cd4f8cc32..fec8b1030 100644 --- a/addons/dialogic/Modules/Audio/event_audio.gd +++ b/addons/dialogic/Modules/Audio/event_audio.gd @@ -47,8 +47,8 @@ var set_sync_channel := false var regex := RegEx.create_from_string(r'(?:audio)\s*(?[\w-]{2,}|[\w]*)?\s*(")?(?(?(2)[^"\n]*|[^(: \n]*))(?(2)"|)(?:\s*\[(?.*)\])?') var channel_name_regex := RegEx.create_from_string(r'(?^-$)|(?[^\w-]{1})') -################################################################################ -## EXECUTE + +#region EXECUTE ################################################################################ func _execute() -> void: @@ -66,8 +66,10 @@ func _execute() -> void: finish() -################################################################################ -## INITIALIZE +#endregion + + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -80,8 +82,10 @@ func _init() -> void: func _get_icon() -> Resource: return load(this_folder.path_join('icon_music.png')) -################################################################################ -## SAVING/LOADING +#endregion + + +#region SAVING/LOADING ################################################################################ func to_text () -> String: @@ -253,11 +257,10 @@ func _sound_from_text(string:String) -> void: loop = str_to_var(data['loop']) update_text_version() - #endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -353,9 +356,10 @@ func get_audio_channel_suggestions(filter:String) -> Dictionary: func get_sync_audio_channel_suggestions(filter:="") -> Dictionary: return DialogicUtil.get_audio_channel_suggestions(filter) +#endregion -####################### CODE COMPLETION ######################################## +#region CODE COMPLETION ################################################################################ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:String, word:String, symbol:String) -> void: @@ -380,8 +384,10 @@ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:Str func _get_start_code_completion(_CodeCompletionHelper:Node, TextNode:TextEdit) -> void: TextNode.add_code_completion_option(CodeEdit.KIND_PLAIN_TEXT, 'audio', 'audio ', event_color.lerp(TextNode.syntax_highlighter.normal_color, 0.3)) +#endregion + -#################### SYNTAX HIGHLIGHTING ####################################### +#region SYNTAX HIGHLIGHTING ################################################################################ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, line:String) -> Dictionary: @@ -395,3 +401,5 @@ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, li dict = Highlighter.color_shortcode_content(dict, line, result.get_start("shortcode"), 0, event_color) return dict + +#endregion diff --git a/addons/dialogic/Modules/Background/event_background.gd b/addons/dialogic/Modules/Background/event_background.gd index f2c0c4c1e..f8adb7c3f 100644 --- a/addons/dialogic/Modules/Background/event_background.gd +++ b/addons/dialogic/Modules/Background/event_background.gd @@ -65,6 +65,7 @@ func _execute() -> void: #endregion + #region INITIALIZE ################################################################################ @@ -76,6 +77,7 @@ func _init() -> void: #endregion + #region SAVE & LOAD ################################################################################ @@ -93,9 +95,9 @@ func get_shortcode_parameters() -> Dictionary: "suggestions": get_transition_suggestions}, } - #endregion + #region EDITOR REPRESENTATION ################################################################################ diff --git a/addons/dialogic/Modules/Call/event_call.gd b/addons/dialogic/Modules/Call/event_call.gd index e00a63e6d..9f5cf912e 100644 --- a/addons/dialogic/Modules/Call/event_call.gd +++ b/addons/dialogic/Modules/Call/event_call.gd @@ -24,8 +24,8 @@ var arguments := []: var _current_method_arg_hints := {'a':null, 'm':null, 'info':{}} -################################################################################ -## EXECUTION + +#region EXECUTION ################################################################################ func _execute() -> void: @@ -62,9 +62,10 @@ func _execute() -> void: finish() +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -73,9 +74,10 @@ func _init() -> void: event_category = "Logic" event_sorting_index = 10 +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func to_text() -> String: @@ -131,9 +133,10 @@ func get_shortcode_parameters() -> Dictionary: "args" : {"property": "arguments", "default": []}, } +#endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -197,7 +200,10 @@ func check_arguments_and_update_warning() -> void: return ui_update_warning.emit() -####################### CODE COMPLETION ######################################## +#endregion + + +#region CODE COMPLETION ################################################################################ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:String, _word:String, symbol:String) -> void: @@ -220,8 +226,10 @@ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:Str func _get_start_code_completion(_CodeCompletionHelper:Node, TextNode:TextEdit) -> void: TextNode.add_code_completion_option(CodeEdit.KIND_PLAIN_TEXT, 'do', 'do ', event_color.lerp(TextNode.syntax_highlighter.normal_color, 0.3), _get_icon()) +#endregion + -#################### SYNTAX HIGHLIGHTING ####################################### +#region SYNTAX HIGHLIGHTING ################################################################################ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, line:String) -> Dictionary: @@ -233,3 +241,5 @@ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, li Highlighter.color_word(dict, Highlighter.boolean_operator_color, line, 'true') Highlighter.color_word(dict, Highlighter.boolean_operator_color, line, 'false') return dict + +#endregion diff --git a/addons/dialogic/Modules/Character/event_character.gd b/addons/dialogic/Modules/Character/event_character.gd index 752692bee..545bb95f9 100644 --- a/addons/dialogic/Modules/Character/event_character.gd +++ b/addons/dialogic/Modules/Character/event_character.gd @@ -95,8 +95,8 @@ var character_identifier: String: var regex := RegEx.create_from_string(r'(?join|update|leave)\s*(")?(?(?(2)[^"\n]*|[^(: \n]*))(?(2)"|)(\W*\((?.*)\))?(\s*(?[^\[]*))?(\s*\[(?.*)\])?') -################################################################################ -## EXECUTION + +#region EXECUTION ################################################################################ func _execute() -> void: @@ -191,6 +191,8 @@ func _execute() -> void: finish() +#endregion + #region INITIALIZE ############################################################################### @@ -200,6 +202,7 @@ func _init() -> void: set_default_color('Color2') event_category = "Main" event_sorting_index = 2 + help_page_path = "https://docs.dialogic.pro/event-character.html" func _get_icon() -> Resource: @@ -207,6 +210,7 @@ func _get_icon() -> Resource: #endregion + #region SAVING, LOADING, DEFAULTS ################################################################################ @@ -331,8 +335,8 @@ func is_valid_event(string:String) -> bool: #endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -475,8 +479,10 @@ func get_animation_suggestions(search_text:String='') -> Dictionary: func get_fade_suggestions(search_text:String='') -> Dictionary: return DialogicPortraitAnimationUtil.get_suggestions(search_text, fade_animation, "Default", DialogicPortraitAnimationUtil.AnimationType.CROSSFADE) +#endregion + -####################### CODE COMPLETION ######################################## +#region CODE COMPLETION ################################################################################ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:String, _word:String, symbol:String) -> void: @@ -553,8 +559,10 @@ func _get_start_code_completion(_CodeCompletionHelper:Node, TextNode:TextEdit) - TextNode.add_code_completion_option(CodeEdit.KIND_PLAIN_TEXT, 'leave', 'leave ', event_color, load('res://addons/dialogic/Editor/Images/Dropdown/leave.svg')) TextNode.add_code_completion_option(CodeEdit.KIND_PLAIN_TEXT, 'update', 'update ', event_color, load('res://addons/dialogic/Editor/Images/Dropdown/update.svg')) +#endregion + -#################### SYNTAX HIGHLIGHTING ####################################### +#region SYNTAX HIGHLIGHTING ################################################################################ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, line:String) -> Dictionary: @@ -582,3 +590,5 @@ func list_to_suggestions(list:Array) -> Dictionary: accum[value.label]["text_alt"] = [value.label.to_lower()] return accum, {}) + +#endregion diff --git a/addons/dialogic/Modules/Clear/event_clear.gd b/addons/dialogic/Modules/Clear/event_clear.gd index 5338162e1..3e89cda9a 100644 --- a/addons/dialogic/Modules/Clear/event_clear.gd +++ b/addons/dialogic/Modules/Clear/event_clear.gd @@ -15,8 +15,7 @@ var clear_music := true var clear_portrait_positions := true var clear_background := true -################################################################################ -## EXECUTE +#region EXECUTE ################################################################################ func _execute() -> void: @@ -62,9 +61,10 @@ func _execute() -> void: finish() +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -73,9 +73,10 @@ func _init() -> void: event_category = "Other" event_sorting_index = 2 +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func get_shortcode() -> String: @@ -95,9 +96,10 @@ func get_shortcode_parameters() -> Dictionary: "style" : {"property": "clear_style", "default": true}, } +#endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -114,3 +116,5 @@ func build_event_editor() -> void: add_body_edit('clear_music', ValueType.BOOL_BUTTON, {'icon':load("res://addons/dialogic/Modules/Clear/clear_music.svg"), 'tooltip':'Clear Audio'}) add_body_edit('clear_style', ValueType.BOOL_BUTTON, {'icon':load("res://addons/dialogic/Modules/Clear/clear_style.svg"), 'tooltip':'Clear Style'}) add_body_edit('clear_portrait_positions', ValueType.BOOL_BUTTON, {'icon':load("res://addons/dialogic/Modules/Clear/clear_positions.svg"), 'tooltip':'Clear Portrait Positions'}) + +#endregion diff --git a/addons/dialogic/Modules/Comment/event_comment.gd b/addons/dialogic/Modules/Comment/event_comment.gd index ad0b1dd2b..0633219bf 100644 --- a/addons/dialogic/Modules/Comment/event_comment.gd +++ b/addons/dialogic/Modules/Comment/event_comment.gd @@ -11,17 +11,17 @@ extends DialogicEvent var text := "" -################################################################################ -## EXECUTE +#region EXECUTE ################################################################################ func _execute() -> void: print("[Dialogic Comment] #", text) finish() +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -30,9 +30,10 @@ func _init() -> void: event_category = "Helpers" event_sorting_index = 0 +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func to_text() -> String: @@ -48,18 +49,23 @@ func is_valid_event(string:String) -> bool: return true return false +#endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: add_header_edit('text', ValueType.SINGLELINE_TEXT, {'left_text':'#', 'autofocus':true}) +#endregion -#################### SYNTAX HIGHLIGHTING ####################################### + +#region SYNTAX HIGHLIGHTING ################################################################################ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, _line:String) -> Dictionary: dict[0] = {'color':event_color.lerp(Highlighter.normal_color, 0.3)} return dict + +#endregion diff --git a/addons/dialogic/Modules/Condition/event_condition.gd b/addons/dialogic/Modules/Condition/event_condition.gd index 936a690cb..ce23ce4dd 100644 --- a/addons/dialogic/Modules/Condition/event_condition.gd +++ b/addons/dialogic/Modules/Condition/event_condition.gd @@ -14,8 +14,7 @@ var condition_type := ConditionTypes.IF var condition := "" -################################################################################ -## EXECUTE +#region EXECUTE ################################################################################ func _execute() -> void: @@ -35,9 +34,10 @@ func _execute() -> void: func _is_branch_starter() -> bool: return condition_type == ConditionTypes.IF +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -52,8 +52,10 @@ func _init() -> void: func _get_end_branch_control() -> Control: return load(get_script().resource_path.get_base_dir().path_join('ui_condition_end.tscn')).instantiate() -################################################################################ -## SAVING/LOADING +#endregion + + +#region SAVING/LOADING ################################################################################ func to_text() -> String: @@ -87,9 +89,10 @@ func is_valid_event(string:String) -> bool: return true return false +#endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -110,8 +113,10 @@ func build_event_editor() -> void: ], 'disabled':true}) add_header_edit('condition', ValueType.CONDITION, {}, 'condition_type != %s'%ConditionTypes.ELSE) +#endregion + -####################### CODE COMPLETION ######################################## +#region CODE COMPLETION ################################################################################ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:String, _word:String, symbol:String) -> void: @@ -124,8 +129,10 @@ func _get_start_code_completion(_CodeCompletionHelper:Node, TextNode:TextEdit) - TextNode.add_code_completion_option(CodeEdit.KIND_PLAIN_TEXT, 'elif', 'elif ', TextNode.syntax_highlighter.code_flow_color) TextNode.add_code_completion_option(CodeEdit.KIND_PLAIN_TEXT, 'else', 'else:\n ', TextNode.syntax_highlighter.code_flow_color) +#endregion -#################### SYNTAX HIGHLIGHTING ####################################### + +#region SYNTAX HIGHLIGHTING ################################################################################ @@ -135,3 +142,5 @@ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, li dict[line.find(word)+len(word)] = {"color":Highlighter.normal_color} dict = Highlighter.color_condition(dict, line) return dict + +#endregion diff --git a/addons/dialogic/Modules/Glossary/event_glossary.gd b/addons/dialogic/Modules/Glossary/event_glossary.gd index d8fce3ac2..e66a5ff91 100644 --- a/addons/dialogic/Modules/Glossary/event_glossary.gd +++ b/addons/dialogic/Modules/Glossary/event_glossary.gd @@ -5,16 +5,17 @@ extends DialogicEvent ## Event that does nothing right now. -################################################################################ -## EXECUTE + +#region EXECUTE ################################################################################ func _execute() -> void: pass +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -23,9 +24,10 @@ func _init() -> void: event_category = "Other" event_sorting_index = 0 +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func get_shortcode() -> String: return "glossary" @@ -34,9 +36,13 @@ func get_shortcode_parameters() -> Dictionary: return { } -################################################################################ -## EDITOR REPRESENTATION +#endregion + + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: pass + +#endregion diff --git a/addons/dialogic/Modules/History/event_history.gd b/addons/dialogic/Modules/History/event_history.gd index 180d7f095..f162ebe9f 100644 --- a/addons/dialogic/Modules/History/event_history.gd +++ b/addons/dialogic/Modules/History/event_history.gd @@ -12,8 +12,7 @@ enum Actions {CLEAR, PAUSE, RESUME} var action := Actions.PAUSE -################################################################################ -## EXECUTION +#region EXECUTION ################################################################################ func _execute() -> void: @@ -27,9 +26,10 @@ func _execute() -> void: finish() +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -38,9 +38,10 @@ func _init() -> void: event_category = "Other" event_sorting_index = 20 +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func get_shortcode() -> String: @@ -53,8 +54,10 @@ func get_shortcode_parameters() -> Dictionary: "suggestions": func(): return {"Clear":{'value':0, 'text_alt':['clear']}, "Pause":{'value':1, 'text_alt':['pause']}, "Resume":{'value':2, 'text_alt':['resume', 'start']}}}, } -################################################################################ -## EDITOR REPRESENTATION +#endregion + + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -74,3 +77,5 @@ func build_event_editor() -> void: }, ] }) + +#endregion diff --git a/addons/dialogic/Modules/Jump/event_jump.gd b/addons/dialogic/Modules/Jump/event_jump.gd index 9566e4600..267b2bac5 100644 --- a/addons/dialogic/Modules/Jump/event_jump.gd +++ b/addons/dialogic/Modules/Jump/event_jump.gd @@ -32,8 +32,7 @@ var timeline_identifier := "": ui_update_needed.emit() -################################################################################ -## EXECUTION +#region EXECUTION ################################################################################ func _execute() -> void: @@ -48,9 +47,10 @@ func _execute() -> void: else: dialogic.start_timeline(dialogic.current_timeline) +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -58,14 +58,16 @@ func _init() -> void: set_default_color('Color4') event_category = "Flow" event_sorting_index = 4 + help_page_path = "https://docs.dialogic.pro/jump-event.html" func _get_icon() -> Resource: return load(self.get_script().get_path().get_base_dir().path_join('icon_jump.png')) +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func to_text() -> String: var result := "jump " @@ -99,9 +101,10 @@ func get_shortcode_parameters() -> Dictionary: "label" : {"property": "label_name", "default": ""}, } +#endregion -################################################################################ -## EDITOR REPRESENTATION + +#region REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -139,8 +142,10 @@ func get_label_suggestions(_filter:String="") -> Dictionary: suggestions["{"+var_path+"}"] = {'value':"{"+var_path+"}", 'icon':load("res://addons/dialogic/Editor/Images/Pieces/variable.svg")} return suggestions +#endregion + -####################### CODE COMPLETION ######################################## +#region CODE COMPLETION ################################################################################ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:String, _word:String, symbol:String) -> void: @@ -156,11 +161,15 @@ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:Str func _get_start_code_completion(_CodeCompletionHelper:Node, TextNode:TextEdit) -> void: TextNode.add_code_completion_option(CodeEdit.KIND_PLAIN_TEXT, 'jump', 'jump ', event_color.lerp(TextNode.syntax_highlighter.normal_color, 0.3)) +#endregion -#################### SYNTAX HIGHLIGHTING ####################################### + +#region SYNTAX HIGHLIGHTING ################################################################################ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, line:String) -> Dictionary: dict[line.find('jump')] = {"color":event_color.lerp(Highlighter.normal_color, 0.3)} dict[line.find('jump')+4] = {"color":event_color.lerp(Highlighter.normal_color, 0.5)} return dict + +#endregion diff --git a/addons/dialogic/Modules/Jump/event_label.gd b/addons/dialogic/Modules/Jump/event_label.gd index e324739b6..2a72b5ac1 100644 --- a/addons/dialogic/Modules/Jump/event_label.gd +++ b/addons/dialogic/Modules/Jump/event_label.gd @@ -12,9 +12,7 @@ var name := "" var display_name := "" - -################################################################################ -## EXECUTE +#region EXECUTE ################################################################################ func _execute() -> void: @@ -29,8 +27,7 @@ func _execute() -> void: finish() -################################################################################ -## INITIALIZE +#region INITIALIZE ################################################################################ func _init() -> void: @@ -38,14 +35,16 @@ func _init() -> void: set_default_color('Color4') event_category = "Flow" event_sorting_index = 3 + help_page_path = "https://docs.dialogic.pro/jump-event.html" func _get_icon() -> Resource: return load(self.get_script().get_path().get_base_dir().path_join('icon_label.png')) +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func to_text() -> String: if display_name.is_empty(): @@ -89,26 +88,34 @@ func _get_property_original_translation(property_name:String) -> String: return display_name return '' -################################################################################ -## EDITOR REPRESENTATION +#endregion + + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: add_header_edit('name', ValueType.SINGLELINE_TEXT, {'left_text':'Label', 'autofocus':true}) add_body_edit('display_name', ValueType.SINGLELINE_TEXT, {'left_text':'Display Name:'}) +#endregion + -####################### CODE COMPLETION ######################################## +#region CODE COMPLETION ################################################################################ func _get_start_code_completion(_CodeCompletionHelper:Node, TextNode:TextEdit) -> void: TextNode.add_code_completion_option(CodeEdit.KIND_PLAIN_TEXT, 'label', 'label ', event_color.lerp(TextNode.syntax_highlighter.normal_color, 0.3)) +#endregion -#################### SYNTAX HIGHLIGHTING ####################################### + +#region SYNTAX HIGHLIGHTING ################################################################################ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, line:String) -> Dictionary: dict[line.find('label')] = {"color":event_color.lerp(Highlighter.normal_color, 0.3)} dict[line.find('label')+5] = {"color":event_color.lerp(Highlighter.normal_color, 0.5)} return dict + +#endregion diff --git a/addons/dialogic/Modules/Jump/event_return.gd b/addons/dialogic/Modules/Jump/event_return.gd index 33f02234d..1d24ed6d9 100644 --- a/addons/dialogic/Modules/Jump/event_return.gd +++ b/addons/dialogic/Modules/Jump/event_return.gd @@ -6,8 +6,7 @@ extends DialogicEvent -################################################################################ -## EXECUTION +#region EXECUTION ################################################################################ func _execute() -> void: @@ -16,9 +15,10 @@ func _execute() -> void: else: dialogic.end_timeline() +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -26,14 +26,16 @@ func _init() -> void: set_default_color('Color4') event_category = "Flow" event_sorting_index = 5 + help_page_path = "https://docs.dialogic.pro/jump-event.html" func _get_icon() -> Resource: return load(self.get_script().get_path().get_base_dir().path_join('icon_return.svg')) +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func to_text() -> String: return "return" @@ -48,26 +50,33 @@ func is_valid_event(string:String) -> bool: return true return false +#endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: add_header_label('Return') +#endregion + -####################### CODE COMPLETION ######################################## +#region CODE COMPLETION ################################################################################ func _get_start_code_completion(_CodeCompletionHelper:Node, TextNode:TextEdit) -> void: TextNode.add_code_completion_option(CodeEdit.KIND_PLAIN_TEXT, 'return', 'return\n', event_color.lerp(TextNode.syntax_highlighter.normal_color, 0.3)) +#endregion -#################### SYNTAX HIGHLIGHTING ####################################### + +#region SYNTAX HIGHLIGHTING ################################################################################ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, line:String) -> Dictionary: dict[line.find('return')] = {"color":event_color.lerp(Highlighter.normal_color, 0.3)} dict[line.find('return')+6] = {"color":event_color.lerp(Highlighter.normal_color, 0.5)} return dict + +#endregion diff --git a/addons/dialogic/Modules/Save/event_save.gd b/addons/dialogic/Modules/Save/event_save.gd index 4fed7a44a..cfc90a978 100644 --- a/addons/dialogic/Modules/Save/event_save.gd +++ b/addons/dialogic/Modules/Save/event_save.gd @@ -12,8 +12,7 @@ extends DialogicEvent var slot_name := "" -################################################################################ -## INITIALIZE +#region EXECUTE ################################################################################ func _execute() -> void: @@ -26,9 +25,10 @@ func _execute() -> void: dialogic.Save.save(slot_name) finish() +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -41,9 +41,10 @@ func _init() -> void: func _get_icon() -> Resource: return load(self.get_script().get_path().get_base_dir().path_join('icon.svg')) +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func get_shortcode() -> String: @@ -56,10 +57,13 @@ func get_shortcode_parameters() -> Dictionary: "slot" : {"property": "slot_name", "default": "Default"}, } +#endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: add_header_edit('slot_name', ValueType.SINGLELINE_TEXT, {'left_text':'Save to slot'}) + +#endregion diff --git a/addons/dialogic/Modules/Settings/event_setting.gd b/addons/dialogic/Modules/Settings/event_setting.gd index 16dfa14de..6d218460d 100644 --- a/addons/dialogic/Modules/Settings/event_setting.gd +++ b/addons/dialogic/Modules/Settings/event_setting.gd @@ -38,8 +38,8 @@ var mode := Modes.SET ## This is only used when initializing the event_variable. var _suppress_default_value: bool = false -################################################################################ -## INITIALIZE + +#region EXECUTE ################################################################################ func _execute() -> void: @@ -62,9 +62,10 @@ func _execute() -> void: dialogic.Settings.set(name, dialogic.VAR.get_variable(value)) finish() +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -77,9 +78,10 @@ func _init() -> void: func _get_icon() -> Resource: return load(self.get_script().get_path().get_base_dir().path_join('icon.svg')) +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func to_text() -> String: @@ -140,9 +142,10 @@ func from_text(string:String) -> void: func is_valid_event(string:String) -> bool: return string.begins_with('setting') +#endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -208,9 +211,10 @@ func get_value_suggestions(_filter:String) -> Dictionary: suggestions[var_path] = {'value':var_path, 'editor_icon':["ClassList", "EditorIcons"]} return suggestions +#endregion -####################### CODE COMPLETION ######################################## +#region CODE COMPLETION ################################################################################ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:String, _word:String, symbol:String) -> void: @@ -231,7 +235,10 @@ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:Str func _get_start_code_completion(_CodeCompletionHelper:Node, TextNode:TextEdit) -> void: TextNode.add_code_completion_option(CodeEdit.KIND_PLAIN_TEXT, 'setting', 'setting ', event_color) -#################### SYNTAX HIGHLIGHTING ####################################### +#endregion + + +#region SYNTAX HIGHLIGHTING ################################################################################ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, line:String) -> Dictionary: @@ -241,3 +248,5 @@ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, li dict = Highlighter.color_region(dict, Highlighter.string_color, line, '"', '"') dict = Highlighter.color_region(dict, Highlighter.variable_color, line, '{', '}') return dict + +#endregion diff --git a/addons/dialogic/Modules/Signal/event_signal.gd b/addons/dialogic/Modules/Signal/event_signal.gd index 2923f5890..69c51e3f7 100644 --- a/addons/dialogic/Modules/Signal/event_signal.gd +++ b/addons/dialogic/Modules/Signal/event_signal.gd @@ -14,8 +14,8 @@ var argument_type := ArgumentTypes.STRING ## The argument that will be provided with the signal. var argument: Variant = "" -################################################################################ -## EXECUTE + +#region EXECUTE ################################################################################ func _execute() -> void: @@ -31,9 +31,10 @@ func _execute() -> void: dialogic.emit_signal('signal_event', argument) finish() +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -43,10 +44,10 @@ func _init() -> void: event_sorting_index = 8 help_page_path = "https://docs.dialogic.pro/dialogic-signals.html#1-signal-event" +#endregion -################################################################################ -## SAVING/LOADING +#region SAVING/LOADING ################################################################################ func get_shortcode() -> String: @@ -61,8 +62,10 @@ func get_shortcode_parameters() -> Dictionary: "arg" : {"property": "argument", "default": ""} } -################################################################################ -## EDITOR REPRESENTATION +#endregion + + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -81,3 +84,5 @@ func build_event_editor() -> void: ]}) add_body_line_break('argument_type == ArgumentTypes.DICTIONARY') add_body_edit('argument', ValueType.DICTIONARY, {'left_text': 'Dictionary'},'argument_type == ArgumentTypes.DICTIONARY') + +#endregion diff --git a/addons/dialogic/Modules/Style/event_style.gd b/addons/dialogic/Modules/Style/event_style.gd index 9264b416d..2229ed21d 100644 --- a/addons/dialogic/Modules/Style/event_style.gd +++ b/addons/dialogic/Modules/Style/event_style.gd @@ -11,8 +11,7 @@ extends DialogicEvent var style_name := "" -################################################################################ -## EXECUTE +#region EXECUTE ################################################################################ func _execute() -> void: @@ -21,9 +20,10 @@ func _execute() -> void: await dialogic.get_tree().process_frame finish() +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -32,9 +32,10 @@ func _init() -> void: event_category = "Visuals" event_sorting_index = 1 +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func get_shortcode() -> String: return "style" @@ -46,9 +47,10 @@ func get_shortcode_parameters() -> Dictionary: "name" : {"property": "style_name", "default": "", 'suggestions':get_style_suggestions}, } +#endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -69,3 +71,5 @@ func get_style_suggestions(_filter := "") -> Dictionary: var style: DialogicStyle = load(i) suggestions[style.name] = {'value': style.name, 'editor_icon': ["PopupMenu", "EditorIcons"]} return suggestions + +#endregion diff --git a/addons/dialogic/Modules/TextInput/event_text_input.gd b/addons/dialogic/Modules/TextInput/event_text_input.gd index 387e375fd..ee40a3748 100644 --- a/addons/dialogic/Modules/TextInput/event_text_input.gd +++ b/addons/dialogic/Modules/TextInput/event_text_input.gd @@ -42,6 +42,8 @@ func _on_DialogicTextInput_input_confirmed(input:String) -> void: dialogic.current_state = DialogicGameHandler.States.IDLE finish() +#endregion + #region SETUP ################################################################################ @@ -52,6 +54,8 @@ func _init() -> void: event_category = "Logic" event_sorting_index = 6 +#endregion + #region SAVING/LOADING ################################################################################ @@ -85,6 +89,8 @@ func _get_property_original_translation(property_name:String) -> String: return default return "" +#endregion + #region EDITOR ################################################################################ @@ -111,3 +117,5 @@ func get_var_suggestions(filter: String = "") -> Dictionary: for var_path in DialogicUtil.list_variables(vars, "", DialogicUtil.VarTypes.STRING): suggestions[var_path] = {'value':var_path, 'icon':load("res://addons/dialogic/Editor/Images/Pieces/variable.svg")} return suggestions + +#endregion diff --git a/addons/dialogic/Modules/Variable/event_variable.gd b/addons/dialogic/Modules/Variable/event_variable.gd index f23c347db..8ec9630ef 100644 --- a/addons/dialogic/Modules/Variable/event_variable.gd +++ b/addons/dialogic/Modules/Variable/event_variable.gd @@ -68,8 +68,8 @@ var random_max: int = 100 var _suppress_default_value := false -################################################################################ -## EXECUTE + +#region EXECUTE ################################################################################ func _execute() -> void: @@ -126,9 +126,10 @@ func _execute() -> void: finish() +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -138,9 +139,10 @@ func _init() -> void: event_sorting_index = 0 help_page_path = "https://docs.dialogic.pro/variables.html#23-set-variable-event" +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func to_text() -> String: @@ -223,9 +225,10 @@ func from_text(string:String) -> void: func is_valid_event(string:String) -> bool: return string.begins_with('set') +#endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -352,9 +355,10 @@ func update_editor_warning() -> void: else: ui_update_warning.emit('') +#endregion -####################### CODE COMPLETION ######################################## +#region CODE COMPLETION ################################################################################ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:String, _word:String, symbol:String) -> void: @@ -380,8 +384,10 @@ func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:Str func _get_start_code_completion(_CodeCompletionHelper:Node, TextNode:TextEdit) -> void: TextNode.add_code_completion_option(CodeEdit.KIND_PLAIN_TEXT, 'set', 'set ', event_color.lerp(TextNode.syntax_highlighter.normal_color, 0.5)) +#endregion -#################### SYNTAX HIGHLIGHTING ####################################### + +#region SYNTAX HIGHLIGHTING ################################################################################ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, line:String) -> Dictionary: @@ -390,3 +396,5 @@ func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, li dict = Highlighter.color_region(dict, Highlighter.string_color, line, '"', '"', line.find('set')) dict = Highlighter.color_region(dict, Highlighter.variable_color, line, '{', '}', line.find('set')) return dict + +#endregion diff --git a/addons/dialogic/Modules/Voice/event_voice.gd b/addons/dialogic/Modules/Voice/event_voice.gd index ddc214f12..8c14d502a 100644 --- a/addons/dialogic/Modules/Voice/event_voice.gd +++ b/addons/dialogic/Modules/Voice/event_voice.gd @@ -19,8 +19,7 @@ var volume: float = 0 var audio_bus := "Master" -################################################################################ -## EXECUTE +#region EXECUTE ################################################################################ func _execute() -> void: @@ -37,9 +36,10 @@ func _execute() -> void: finish() # the rest is executed by a text event +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -48,9 +48,10 @@ func _init() -> void: event_category = "Audio" event_sorting_index = 5 +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func get_shortcode() -> String: @@ -65,9 +66,10 @@ func get_shortcode_parameters() -> Dictionary: "bus" : {"property": "audio_bus", "default": "Master"} } +#endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -80,3 +82,5 @@ func build_event_editor() -> void: add_header_edit('file_path', ValueType.AUDIO_PREVIEW) add_body_edit('volume', ValueType.NUMBER, {'left_text':'Volume:', 'mode':2}, '!file_path.is_empty()') add_body_edit('audio_bus', ValueType.SINGLELINE_TEXT, {'left_text':'Audio Bus:'}, '!file_path.is_empty()') + +#endregion diff --git a/addons/dialogic/Modules/Wait/event_wait.gd b/addons/dialogic/Modules/Wait/event_wait.gd index 86b4c70b5..3380ba175 100644 --- a/addons/dialogic/Modules/Wait/event_wait.gd +++ b/addons/dialogic/Modules/Wait/event_wait.gd @@ -16,8 +16,8 @@ var skippable := false var _tween: Tween -################################################################################ -## EXECUTE + +#region EXECUTE ################################################################################ func _execute() -> void: @@ -55,9 +55,10 @@ func _on_finish() -> void: finish() +#endregion -################################################################################ -## INITIALIZE + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -66,9 +67,10 @@ func _init() -> void: event_category = "Flow" event_sorting_index = 11 +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func get_shortcode() -> String: @@ -83,9 +85,10 @@ func get_shortcode_parameters() -> Dictionary: "skippable" : {"property": "skippable", "default": false}, } +#endregion -################################################################################ -## EDITOR REPRESENTATION + +#region EDITOR REPRESENTATION ################################################################################ func build_event_editor() -> void: @@ -94,3 +97,5 @@ func build_event_editor() -> void: add_header_label('second', 'time == 1') add_body_edit('hide_text', ValueType.BOOL, {'left_text':'Hide text box:'}) add_body_edit('skippable', ValueType.BOOL, {'left_text':'Skippable:'}) + +#endregion diff --git a/addons/dialogic/Modules/WaitInput/event_wait_input.gd b/addons/dialogic/Modules/WaitInput/event_wait_input.gd index 07515d029..a3dc23924 100644 --- a/addons/dialogic/Modules/WaitInput/event_wait_input.gd +++ b/addons/dialogic/Modules/WaitInput/event_wait_input.gd @@ -6,8 +6,8 @@ extends DialogicEvent var hide_textbox := true -################################################################################ -## EXECUTE + +#region EXECUTE ################################################################################ func _execute() -> void: @@ -18,8 +18,10 @@ func _execute() -> void: await dialogic.Inputs.dialogic_action finish() -################################################################################ -## INITIALIZE +#endregion + + +#region INITIALIZE ################################################################################ func _init() -> void: @@ -28,9 +30,10 @@ func _init() -> void: event_category = "Flow" event_sorting_index = 12 +#endregion -################################################################################ -## SAVING/LOADING + +#region SAVING/LOADING ################################################################################ func get_shortcode() -> String: @@ -46,3 +49,5 @@ func get_shortcode_parameters() -> Dictionary: func build_event_editor() -> void: add_header_label('Wait for input') add_body_edit('hide_textbox', ValueType.BOOL, {'left_text':'Hide text box:'}) + +#endregion From ac3d4ad499ba60f21544435b8d39b7ab8aad6a8a Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Mon, 8 Dec 2025 13:57:41 +0100 Subject: [PATCH 04/19] Set Version Button Hover Cursor --- addons/dialogic/Editor/Common/side_bar.tscn | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/dialogic/Editor/Common/side_bar.tscn b/addons/dialogic/Editor/Common/side_bar.tscn index 0666383b2..ab2453270 100644 --- a/addons/dialogic/Editor/Common/side_bar.tscn +++ b/addons/dialogic/Editor/Common/side_bar.tscn @@ -199,6 +199,7 @@ same_column_width = true [node name="CurrentVersion" type="Button" parent="VBoxPrimary" unique_id=2110656799] unique_name_in_owner = true layout_mode = 2 +mouse_default_cursor_shape = 2 text = "Some Version" flat = true clip_text = true From 3af2f9f13a890c45d011a68ef292d136f1f837bc Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Mon, 8 Dec 2025 14:11:23 +0100 Subject: [PATCH 05/19] Slightly adjust home page tab styling --- .../dialogic/Editor/HomePage/home_page.tscn | 127 +++++++----------- 1 file changed, 51 insertions(+), 76 deletions(-) diff --git a/addons/dialogic/Editor/HomePage/home_page.tscn b/addons/dialogic/Editor/HomePage/home_page.tscn index 967231e27..758fac6a5 100644 --- a/addons/dialogic/Editor/HomePage/home_page.tscn +++ b/addons/dialogic/Editor/HomePage/home_page.tscn @@ -1,9 +1,18 @@ -[gd_scene load_steps=21 format=3 uid="uid://cqy73hshqqgga"] +[gd_scene load_steps=17 format=3 uid="uid://cqy73hshqqgga"] [ext_resource type="Script" uid="uid://bl3vudjf3wn2x" path="res://addons/dialogic/Editor/HomePage/home_page.gd" id="1_6g38w"] [ext_resource type="Texture2D" uid="uid://cvmlp5nxb2rer" path="res://addons/dialogic/Editor/HomePage/icon_bg.png" id="1_ed1g1"] [ext_resource type="Texture2D" uid="uid://bt87p6qlso0ya" path="res://addons/dialogic/Editor/Images/dialogic-logo.svg" id="3_3leok"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ipcwk"] +draw_center = false +corner_radius_top_left = 15 +corner_radius_top_right = 15 +corner_radius_bottom_right = 15 +corner_radius_bottom_left = 15 +shadow_color = Color(0.38859996, 0.43326005, 0.58, 0.13725491) +shadow_size = 75 + [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_imi2d"] draw_center = false corner_radius_top_left = 15 @@ -55,53 +64,17 @@ corner_radius_bottom_left = 15 [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ce6uo"] content_margin_left = 7.0 -content_margin_top = 7.0 +content_margin_top = 10.0 content_margin_right = 7.0 content_margin_bottom = 14.0 -bg_color = Color(0.803922, 0.352941, 1, 0.141176) +bg_color = Color(1, 1, 1, 0.05882353) corner_radius_top_left = 10 corner_radius_top_right = 10 corner_radius_bottom_right = 10 corner_radius_bottom_left = 10 -[sub_resource type="FontVariation" id="FontVariation_elu6e"] -variation_embolden = 1.1 - -[sub_resource type="FontVariation" id="FontVariation_g0m61"] -variation_embolden = 1.43 -variation_transform = Transform2D(1, 0.343, 0, 1, 0, 0) - -[sub_resource type="FontVariation" id="FontVariation_5kbdj"] -variation_transform = Transform2D(1, 0.239, 0, 1, 0, 0) - [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_a8dvw"] -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ckyhx"] -content_margin_left = 4.0 -content_margin_top = 4.0 -content_margin_right = 4.0 -content_margin_bottom = 4.0 -bg_color = Color(0.470588, 0.196078, 0.6, 1) -corner_radius_top_left = 5 -corner_radius_top_right = 5 -corner_radius_bottom_right = 5 -corner_radius_bottom_left = 5 - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_l1doy"] -content_margin_left = 4.0 -content_margin_top = 4.0 -content_margin_right = 4.0 -content_margin_bottom = 4.0 -bg_color = Color(0.470588, 0.196078, 0.6, 1) -border_width_left = 1 -border_width_top = 1 -border_width_right = 1 -border_width_bottom = 1 -corner_radius_top_left = 5 -corner_radius_top_right = 5 -corner_radius_bottom_right = 5 -corner_radius_bottom_left = 5 - [node name="HomePage" type="TextureRect" unique_id=1709118815] self_modulate = Color(1, 1, 1, 0.2) clip_contents = true @@ -124,19 +97,23 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="HomePageBox" type="VBoxContainer" parent="CenterContainer" unique_id=2038439013] +[node name="PanelContainer" type="PanelContainer" parent="CenterContainer" unique_id=371856246] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_ipcwk") + +[node name="HomePageBox" type="VBoxContainer" parent="CenterContainer/PanelContainer" unique_id=2038439013] unique_name_in_owner = true custom_minimum_size = Vector2(600, 350) layout_mode = 2 theme_override_constants/separation = 0 -[node name="TopPanel" type="Panel" parent="CenterContainer/HomePageBox" unique_id=1010710484] +[node name="TopPanel" type="Panel" parent="CenterContainer/PanelContainer/HomePageBox" unique_id=1010710484] unique_name_in_owner = true custom_minimum_size = Vector2(0, 100) layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_imi2d") -[node name="Header2" type="Panel" parent="CenterContainer/HomePageBox/TopPanel" unique_id=477441375] +[node name="Header2" type="Panel" parent="CenterContainer/PanelContainer/HomePageBox/TopPanel" unique_id=477441375] clip_children = 1 clip_contents = true layout_mode = 1 @@ -149,7 +126,7 @@ size_flags_vertical = 3 size_flags_stretch_ratio = 0.4 theme_override_styles/panel = SubResource("StyleBoxFlat_n2afh") -[node name="BG" type="TextureRect" parent="CenterContainer/HomePageBox/TopPanel/Header2" unique_id=198765188] +[node name="BG" type="TextureRect" parent="CenterContainer/PanelContainer/HomePageBox/TopPanel/Header2" unique_id=198765188] modulate = Color(0.65098, 0.65098, 0.65098, 1) layout_mode = 1 anchors_preset = 15 @@ -162,7 +139,7 @@ size_flags_stretch_ratio = 0.3 texture = SubResource("GradientTexture2D_2klx3") expand_mode = 1 -[node name="Vignette" type="TextureRect" parent="CenterContainer/HomePageBox/TopPanel/Header2" unique_id=1688431700] +[node name="Vignette" type="TextureRect" parent="CenterContainer/PanelContainer/HomePageBox/TopPanel/Header2" unique_id=1688431700] modulate = Color(0, 0, 0, 1) layout_mode = 1 anchors_preset = 15 @@ -175,7 +152,7 @@ grow_vertical = 2 texture = SubResource("GradientTexture2D_u0aw3") expand_mode = 1 -[node name="Logo" type="TextureRect" parent="CenterContainer/HomePageBox/TopPanel" unique_id=1945233535] +[node name="Logo" type="TextureRect" parent="CenterContainer/PanelContainer/HomePageBox/TopPanel" unique_id=1945233535] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -192,7 +169,7 @@ texture = ExtResource("3_3leok") expand_mode = 1 stretch_mode = 5 -[node name="Label" type="Label" parent="CenterContainer/HomePageBox/TopPanel/Logo" unique_id=1415255007] +[node name="Label" type="Label" parent="CenterContainer/PanelContainer/HomePageBox/TopPanel/Logo" unique_id=1415255007] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -209,14 +186,15 @@ rotation = -0.201447 text = "2" label_settings = SubResource("LabelSettings_w8q1h") -[node name="BottomPanel" type="PanelContainer" parent="CenterContainer/HomePageBox" unique_id=330996494] +[node name="BottomPanel" type="PanelContainer" parent="CenterContainer/PanelContainer/HomePageBox" unique_id=330996494] unique_name_in_owner = true self_modulate = Color(0.1021275, 0.1021275, 0.1021275, 1) +show_behind_parent = true layout_mode = 2 size_flags_vertical = 3 theme_override_styles/panel = SubResource("StyleBoxFlat_p7ka2") -[node name="VersionLabel" type="Label" parent="CenterContainer/HomePageBox/BottomPanel" unique_id=949857528] +[node name="VersionLabel" type="Label" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel" unique_id=949857528] unique_name_in_owner = true modulate = Color(1, 1, 1, 0.501961) layout_mode = 2 @@ -225,122 +203,121 @@ theme_override_font_sizes/font_size = 10 text = "2.0-Alpha-19 WIP (Godot 4.3+)" horizontal_alignment = 2 -[node name="ScrollContainer" type="ScrollContainer" parent="CenterContainer/HomePageBox/BottomPanel" unique_id=557763215] +[node name="ScrollContainer" type="ScrollContainer" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel" unique_id=557763215] layout_mode = 2 -[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer" unique_id=15728145] +[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer" unique_id=15728145] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_constants/separation = 50 -[node name="CenterContainer" type="VBoxContainer" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer" unique_id=1137363955] +[node name="CenterContainer" type="VBoxContainer" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer" unique_id=1137363955] layout_mode = 2 size_flags_stretch_ratio = 0.4 -[node name="Label" type="Label" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=982557830] +[node name="Label" type="Label" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=982557830] layout_mode = 2 theme_type_variation = &"DialogicSection" theme_override_constants/line_spacing = 0 text = "Documentation" -[node name="WikiButton" type="LinkButton" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=1030865985] +[node name="WikiButton" type="LinkButton" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=1030865985] layout_mode = 2 theme_type_variation = &"DialogicLink" text = " Wiki" underline = 2 uri = "https://docs.dialogic.pro/" -[node name="WikiGettingStartedButton" type="LinkButton" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=2077412255] +[node name="WikiGettingStartedButton" type="LinkButton" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=2077412255] layout_mode = 2 theme_type_variation = &"DialogicLink" text = " Getting Started" underline = 2 uri = "https://docs.dialogic.pro/getting-started.html" -[node name="Separator" type="Control" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=783926543] +[node name="Separator" type="Control" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=783926543] custom_minimum_size = Vector2(0, 10) layout_mode = 2 -[node name="Label2" type="Label" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=2037021503] +[node name="Label2" type="Label" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=2037021503] layout_mode = 2 theme_type_variation = &"DialogicSection" text = "Get in touch" -[node name="BugRequestButton" type="LinkButton" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=1518203797] +[node name="BugRequestButton" type="LinkButton" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=1518203797] layout_mode = 2 theme_type_variation = &"DialogicLink" text = " Bug / Request" underline = 2 uri = "https://github.com/dialogic-godot/dialogic/issues/new/choose" -[node name="DiscordButton" type="LinkButton" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=637273404] +[node name="DiscordButton" type="LinkButton" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=637273404] layout_mode = 2 theme_type_variation = &"DialogicLink" text = " Discord" underline = 2 uri = "https://discord.gg/2hHQzkf2pX" -[node name="Website" type="LinkButton" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=379796324] +[node name="Website" type="LinkButton" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=379796324] layout_mode = 2 theme_type_variation = &"DialogicLink" text = " Website" underline = 2 uri = "https://dialogic.pro/" -[node name="DonateButton" type="LinkButton" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=997916665] +[node name="DonateButton" type="LinkButton" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer" unique_id=997916665] layout_mode = 2 theme_type_variation = &"DialogicLink" text = " Donate" underline = 2 uri = "https://www.patreon.com/JowanSpooner" -[node name="CenterContainer2" type="VBoxContainer" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer" unique_id=1248291817] +[node name="CenterContainer2" type="VBoxContainer" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer" unique_id=1248291817] layout_mode = 2 size_flags_horizontal = 3 theme_override_constants/separation = 15 -[node name="Control" type="Control" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2" unique_id=1975904286] +[node name="Control" type="Control" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2" unique_id=1975904286] layout_mode = 2 -[node name="WelcomeText" type="RichTextLabel" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2" unique_id=1779879348] +[node name="WelcomeText" type="RichTextLabel" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2" unique_id=1779879348] layout_mode = 2 theme_override_styles/normal = SubResource("StyleBoxEmpty_es88k") bbcode_enabled = true -text = "[center]Welcome to dialogic, a plugin that lets you easily create stories and dialogs for your game!" +text = "[center]Welcome to dialogic, a plugin that lets you easily create stories and dialogs for your game! + +If you are new, start by creating a timeline or character!" fit_content = true -[node name="RandomTipSection" type="VBoxContainer" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2" unique_id=21727726] +[node name="RandomTipSection" type="VBoxContainer" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2" unique_id=21727726] unique_name_in_owner = true layout_mode = 2 theme_override_constants/separation = -4 alignment = 1 -[node name="RandomTipLabel" type="Label" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2/RandomTipSection" unique_id=520311592] +[node name="RandomTipLabel" type="Label" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2/RandomTipSection" unique_id=520311592] unique_name_in_owner = true layout_mode = 2 theme_type_variation = &"DialogicSection" theme_override_colors/font_color = Color(0.42, 0.67, 0.96, 1) text = "Random Tip" -[node name="TipBox" type="PanelContainer" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2/RandomTipSection" unique_id=1833114158] +[node name="TipBox" type="PanelContainer" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2/RandomTipSection" unique_id=1833114158] unique_name_in_owner = true layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_ce6uo") -[node name="RandomTip" type="RichTextLabel" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2/RandomTipSection/TipBox" unique_id=603572674] +[node name="RandomTip" type="RichTextLabel" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2/RandomTipSection/TipBox" unique_id=603572674] unique_name_in_owner = true clip_contents = false layout_mode = 2 -theme_override_fonts/bold_font = SubResource("FontVariation_elu6e") -theme_override_fonts/bold_italics_font = SubResource("FontVariation_g0m61") -theme_override_fonts/italics_font = SubResource("FontVariation_5kbdj") theme_override_styles/normal = SubResource("StyleBoxEmpty_a8dvw") bbcode_enabled = true text = "[i]You can[/i] [b]create custom[/b] events, [i][b]subsystems, text effects and even editors for[/b][i] [code]dialogic!" fit_content = true -[node name="RandomTipMoreButton" type="Button" parent="CenterContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2/RandomTipSection/TipBox/RandomTip" unique_id=327297471] +[node name="RandomTipMoreButton" type="Button" parent="CenterContainer/PanelContainer/HomePageBox/BottomPanel/ScrollContainer/HBoxContainer/CenterContainer2/RandomTipSection/TipBox/RandomTip" unique_id=327297471] unique_name_in_owner = true layout_mode = 1 anchors_preset = 3 @@ -349,11 +326,9 @@ anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 offset_left = -30.0 -offset_top = 1.0 +offset_top = 2.0 offset_right = -8.0 -offset_bottom = 23.0 +offset_bottom = 24.0 grow_horizontal = 0 grow_vertical = 0 tooltip_text = "Check it out!" -theme_override_styles/normal = SubResource("StyleBoxFlat_ckyhx") -theme_override_styles/hover = SubResource("StyleBoxFlat_l1doy") From 4c4664fc61ee69aae532a3520a0c948c3d3166d6 Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Mon, 8 Dec 2025 15:24:35 +0100 Subject: [PATCH 06/19] Small fixes - makes sure sidebar tree margin is correct on load - makes key a variant, because it can be null --- addons/dialogic/Core/DialogicResourceUtil.gd | 6 +++--- addons/dialogic/Editor/Common/side_bar.tscn | 4 ++-- addons/dialogic/Editor/Common/sidebar.gd | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/addons/dialogic/Core/DialogicResourceUtil.gd b/addons/dialogic/Core/DialogicResourceUtil.gd index e5449c8c5..a15806168 100644 --- a/addons/dialogic/Core/DialogicResourceUtil.gd +++ b/addons/dialogic/Core/DialogicResourceUtil.gd @@ -106,7 +106,7 @@ static func resource_exists_from_identifier(identifier:String, extension:String) ## Editor Only static func change_unique_identifier(file_path:String, new_identifier:String) -> void: var directory := get_directory(file_path.get_extension()) - var key: String = directory.find_key(file_path) + var key: Variant = directory.find_key(file_path) while key != null: if key == new_identifier: break @@ -118,7 +118,7 @@ static func change_unique_identifier(file_path:String, new_identifier:String) -> static func change_resource_path(old_path:String, new_path:String) -> void: var directory := get_directory(new_path.get_extension()) - var key: String = directory.find_key(old_path) + var key: Variant = directory.find_key(old_path) while key != null: directory[key] = new_path key = directory.find_key(old_path) @@ -127,7 +127,7 @@ static func change_resource_path(old_path:String, new_path:String) -> void: static func remove_resource(file_path:String) -> void: var directory := get_directory(file_path.get_extension()) - var key: String = directory.find_key(file_path) + var key: Variant = directory.find_key(file_path) while key != null: directory.erase(key) key = directory.find_key(file_path) diff --git a/addons/dialogic/Editor/Common/side_bar.tscn b/addons/dialogic/Editor/Common/side_bar.tscn index ab2453270..fc1581b03 100644 --- a/addons/dialogic/Editor/Common/side_bar.tscn +++ b/addons/dialogic/Editor/Common/side_bar.tscn @@ -157,7 +157,7 @@ text = "Trim Folder Paths" unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 3 -theme_type_variation = &"DialogicSidebarTree" +theme_type_variation = &"TreeSecondary" allow_rmb_select = true hide_root = true scroll_horizontal_enabled = false @@ -190,7 +190,7 @@ unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 3 tooltip_text = "Label events in your timeline will appear here, allowing you to jump to them." -theme_type_variation = &"DialogicSidebarList" +theme_type_variation = &"ItemListSecondary" theme_override_styles/selected = SubResource("StyleBoxEmpty_gxwm6") theme_override_styles/selected_focus = SubResource("StyleBoxEmpty_n8rql") allow_reselect = true diff --git a/addons/dialogic/Editor/Common/sidebar.gd b/addons/dialogic/Editor/Common/sidebar.gd index b67594dbc..3e9b2ff9f 100644 --- a/addons/dialogic/Editor/Common/sidebar.gd +++ b/addons/dialogic/Editor/Common/sidebar.gd @@ -86,6 +86,10 @@ func _ready() -> void: %MainVSplit.split_offset = DialogicUtil.get_editor_setting("sidebar_v_split", 0) group_mode = DialogicUtil.get_editor_setting("sidebar_group_mode", 0) %GroupingOptions.select(%GroupingOptions.get_item_index(group_mode)) + if %GroupingOptions.get_item_id(%GroupingOptions.selected) == GroupMode.NONE: + %ResourceTree.add_theme_constant_override("item_margin", 0) + else: + %ResourceTree.remove_theme_constant_override("item_margin") %FolderColors.button_pressed = DialogicUtil.get_editor_setting("sidebar_use_folder_colors", true) %TrimFolderPaths.button_pressed = DialogicUtil.get_editor_setting("sidebar_trim_folder_paths", true) From 791c6f76a6a8ece8ee4a00dfa9114b742500231a Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Tue, 9 Dec 2025 15:59:04 +0100 Subject: [PATCH 07/19] Fix typo --- addons/dialogic/Modules/Text/subsystem_text.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/dialogic/Modules/Text/subsystem_text.gd b/addons/dialogic/Modules/Text/subsystem_text.gd index b4d1bec1d..2d943e06d 100644 --- a/addons/dialogic/Modules/Text/subsystem_text.gd +++ b/addons/dialogic/Modules/Text/subsystem_text.gd @@ -16,7 +16,7 @@ extends DialogicSubsystem @warning_ignore("unused_signal") # This is emitted by the text event. signal about_to_show_text(info:Dictionary) ## Emitted when a text event (or a new text section) starts displaying. -## This will be AFTER the textox animation, while [signal about_to_show_text] is before. +## This will be AFTER the textbox animation, while [signal about_to_show_text] is before. ## Gives a dictionary with the same values as [signal about_to_show_text] @warning_ignore("unused_signal") # This is emitted by the text event. signal text_started(info:Dictionary) From 4a8948e95df898c60a8be4489038264b9f427c5a Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Fri, 12 Dec 2025 19:48:20 +0100 Subject: [PATCH 08/19] Make sure fields in int mode enforce 1.0 step This was incorrect in the z-index field of the character event. --- addons/dialogic/Editor/Events/Fields/field_number.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/dialogic/Editor/Events/Fields/field_number.gd b/addons/dialogic/Editor/Events/Fields/field_number.gd index 0500483c8..c3f65ce64 100644 --- a/addons/dialogic/Editor/Events/Fields/field_number.gd +++ b/addons/dialogic/Editor/Events/Fields/field_number.gd @@ -35,6 +35,7 @@ func _ready() -> void: func _load_display_info(info: Dictionary) -> void: + mode = info.get('mode', mode) for option in info.keys(): match option: 'min': min_value = info[option] @@ -47,7 +48,8 @@ func _load_display_info(info: Dictionary) -> void: 'hide_step_button': %Spin.hide() 'tooltip': tooltip_text = info[option] - mode = info.get('mode', mode) + + func _set_value(new_value: Variant) -> void: _on_value_text_submitted(str(new_value), true) @@ -70,6 +72,7 @@ func use_float_mode() -> void: func use_int_mode() -> void: update_suffix("") enforce_step = true + step = 1.0 func use_decibel_mode() -> void: From 3637014e67da504b73fa0a0b9ab41ea7ba9552be Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Sat, 13 Dec 2025 20:32:25 +0100 Subject: [PATCH 09/19] Small fix to positioning of "2" in the logo on home tab --- .../dialogic/Editor/HomePage/home_page.tscn | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/addons/dialogic/Editor/HomePage/home_page.tscn b/addons/dialogic/Editor/HomePage/home_page.tscn index 758fac6a5..08ac4e51b 100644 --- a/addons/dialogic/Editor/HomePage/home_page.tscn +++ b/addons/dialogic/Editor/HomePage/home_page.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=3 uid="uid://cqy73hshqqgga"] +[gd_scene format=3 uid="uid://cqy73hshqqgga"] [ext_resource type="Script" uid="uid://bl3vudjf3wn2x" path="res://addons/dialogic/Editor/HomePage/home_page.gd" id="1_6g38w"] [ext_resource type="Texture2D" uid="uid://cvmlp5nxb2rer" path="res://addons/dialogic/Editor/HomePage/icon_bg.png" id="1_ed1g1"] @@ -48,8 +48,11 @@ variation_embolden = 2.0 [sub_resource type="LabelSettings" id="LabelSettings_w8q1h"] font = SubResource("FontVariation_vepxx") font_size = 40 -outline_size = 14 -outline_color = Color(0.0901961, 0.0901961, 0.0901961, 0.258824) +stacked_outline_count = 2 +stacked_outline_0/size = 6 +stacked_outline_0/color = Color(0.6229163, 0.3652656, 0.1965133, 1) +stacked_outline_1/size = 9 +stacked_outline_1/color = Color(0.7963555, 0.5017075, 0.35616115, 1) [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_p7ka2"] content_margin_left = 10.0 @@ -152,39 +155,43 @@ grow_vertical = 2 texture = SubResource("GradientTexture2D_u0aw3") expand_mode = 1 -[node name="Logo" type="TextureRect" parent="CenterContainer/PanelContainer/HomePageBox/TopPanel" unique_id=1945233535] +[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/PanelContainer/HomePageBox/TopPanel" unique_id=878918703] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -offset_left = 19.0 -offset_top = 10.0 -offset_right = -23.0 -offset_bottom = -10.0 +offset_left = 13.0 +offset_top = 12.0 +offset_right = -13.0 +offset_bottom = -12.0 grow_horizontal = 2 grow_vertical = 2 +alignment = 1 + +[node name="Logo" type="TextureRect" parent="CenterContainer/PanelContainer/HomePageBox/TopPanel/HBoxContainer" unique_id=1945233535] +layout_mode = 2 size_flags_vertical = 3 -size_flags_stretch_ratio = 0.3 +size_flags_stretch_ratio = 2.12 texture = ExtResource("3_3leok") -expand_mode = 1 +expand_mode = 3 stretch_mode = 5 -[node name="Label" type="Label" parent="CenterContainer/PanelContainer/HomePageBox/TopPanel/Logo" unique_id=1415255007] +[node name="Control" type="Control" parent="CenterContainer/PanelContainer/HomePageBox/TopPanel/HBoxContainer" unique_id=1496488220] +layout_mode = 2 + +[node name="Label" type="Label" parent="CenterContainer/PanelContainer/HomePageBox/TopPanel/HBoxContainer/Control" unique_id=1415255007] layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = 155.0 -offset_top = -37.0 -offset_right = 185.0 -offset_bottom = 21.0 -grow_horizontal = 2 -grow_vertical = 2 -rotation = -0.201447 +anchors_preset = -1 +anchor_top = 0.23500001 +anchor_bottom = 0.23500001 +offset_left = -8.0 +offset_top = -20.500002 +offset_right = 32.0 +offset_bottom = 42.5 +rotation = -0.30892327 text = "2" label_settings = SubResource("LabelSettings_w8q1h") +metadata/_edit_use_anchors_ = true [node name="BottomPanel" type="PanelContainer" parent="CenterContainer/PanelContainer/HomePageBox" unique_id=330996494] unique_name_in_owner = true From 1318800b02378aa0492a40c3ecf021cd207fb7e5 Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Sat, 13 Dec 2025 20:33:10 +0100 Subject: [PATCH 10/19] Allow creating timeline/character from right click in sidebar empty area --- addons/dialogic/Editor/Common/side_bar.tscn | 15 +++++-- addons/dialogic/Editor/Common/sidebar.gd | 50 +++++++++++++++------ 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/addons/dialogic/Editor/Common/side_bar.tscn b/addons/dialogic/Editor/Common/side_bar.tscn index fc1581b03..15cf86db0 100644 --- a/addons/dialogic/Editor/Common/side_bar.tscn +++ b/addons/dialogic/Editor/Common/side_bar.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://cwe3r2tbh2og1"] +[gd_scene format=3 uid="uid://cwe3r2tbh2og1"] [ext_resource type="Script" uid="uid://myogqmakusx3" 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"] @@ -19,6 +19,7 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 theme = SubResource("Theme_pn0f4") +split_offsets = PackedInt32Array(100) split_offset = 100 script = ExtResource("1_jnq65") @@ -106,7 +107,7 @@ theme_type_variation = &"FlatButton" unique_name_in_owner = true transparent_bg = true oversampling_override = 1.0 -position = Vector2i(890, 65) +position = Vector2i(812, 65) size = Vector2i(171, 115) visible = true transparent = true @@ -204,7 +205,11 @@ text = "Some Version" flat = true clip_text = true -[node name="RightClickMenu" type="PopupMenu" parent="." unique_id=1188370902] +[node name="RightClickItemMenu" type="PopupMenu" parent="." unique_id=1188370902] +unique_name_in_owner = true +size = Vector2i(164, 100) + +[node name="RightClickNoItemMenu" type="PopupMenu" parent="." unique_id=2120335967] unique_name_in_owner = true size = Vector2i(164, 100) @@ -215,4 +220,6 @@ size = Vector2i(164, 100) [connection signal="pressed" from="VBoxPrimary/Margin/MainVSplit/VBox/HBoxSearchSort/Options" to="." method="_on_options_pressed"] [connection signal="toggled" from="VBoxPrimary/Margin/MainVSplit/VBox/HBoxSearchSort/Options/OptionsPopup/OptionsPanel/VBox/FolderColors" to="." method="_on_folder_colors_toggled"] [connection signal="toggled" from="VBoxPrimary/Margin/MainVSplit/VBox/HBoxSearchSort/Options/OptionsPopup/OptionsPanel/VBox/TrimFolderPaths" to="." method="_on_trim_folder_paths_toggled"] -[connection signal="id_pressed" from="RightClickMenu" to="." method="_on_right_click_menu_id_pressed"] +[connection signal="empty_clicked" from="VBoxPrimary/Margin/MainVSplit/VBox/ResourceTree" to="." method="_on_resource_tree_empty_clicked"] +[connection signal="id_pressed" from="RightClickItemMenu" to="." method="_on_right_click_menu_id_pressed"] +[connection signal="id_pressed" from="RightClickNoItemMenu" to="." method="_on_right_click_no_item_menu_id_pressed"] diff --git a/addons/dialogic/Editor/Common/sidebar.gd b/addons/dialogic/Editor/Common/sidebar.gd index 3e9b2ff9f..4816f00b0 100644 --- a/addons/dialogic/Editor/Common/sidebar.gd +++ b/addons/dialogic/Editor/Common/sidebar.gd @@ -20,6 +20,9 @@ enum GroupMode { } var group_mode: GroupMode = GroupMode.TYPE +var custom_right_click_options := {} + + func _ready() -> void: if owner != null and owner.get_parent() is SubViewport: @@ -60,18 +63,19 @@ func _ready() -> void: ) ## RIGHT CLICK MENU - %RightClickMenu.clear() - %RightClickMenu.add_icon_item(get_theme_icon("Remove", "EditorIcons"), "Remove From List", 1) - %RightClickMenu.add_separator() - %RightClickMenu.add_icon_item(get_theme_icon("ActionCopy", "EditorIcons"), "Copy Identifier", 4) - %RightClickMenu.add_separator() - %RightClickMenu.add_icon_item( + %RightClickItemMenu.clear() + %RightClickItemMenu.add_icon_item(get_theme_icon("Remove", "EditorIcons"), "Remove From List", 1) + %RightClickItemMenu.add_separator() + %RightClickItemMenu.add_icon_item(get_theme_icon("ActionCopy", "EditorIcons"), "Copy Identifier", 4) + %RightClickItemMenu.add_separator() + %RightClickItemMenu.add_icon_item( get_theme_icon("Filesystem", "EditorIcons"), "Show in FileSystem", 2 ) - %RightClickMenu.add_icon_item( + %RightClickItemMenu.add_icon_item( get_theme_icon("ExternalLink", "EditorIcons"), "Open in External Program", 3 ) + ## SORT MENU %GroupingOptions.set_item_icon(0, get_theme_icon("AnimationTrackGroup", "EditorIcons")) %GroupingOptions.set_item_icon(1, get_theme_icon("Folder", "EditorIcons")) @@ -83,6 +87,16 @@ func _ready() -> void: if DialogicUtil.get_editor_setting("sidebar_collapsed", false): _hide_sidebar() + %RightClickNoItemMenu.clear() + custom_right_click_options.clear() + var idx := 0 + for i in find_parent("EditorView").get_node("%Toolbar").get_children(): + if not i is Button: continue + if not "new" in i.tooltip_text.to_lower(): continue + %RightClickNoItemMenu.add_icon_item(i.icon, i.tooltip_text, idx) + custom_right_click_options[idx] = {"button":i} + idx += 1 + %MainVSplit.split_offset = DialogicUtil.get_editor_setting("sidebar_v_split", 0) group_mode = DialogicUtil.get_editor_setting("sidebar_group_mode", 0) %GroupingOptions.select(%GroupingOptions.get_item_index(group_mode)) @@ -390,8 +404,8 @@ func _on_resources_tree_item_clicked(_pos: Vector2, mouse_button_index: int) -> MOUSE_BUTTON_RIGHT: if resource_tree.get_selected().get_metadata(0): - %RightClickMenu.popup_on_parent(Rect2(get_global_mouse_position(), Vector2())) - %RightClickMenu.set_meta("item_clicked", resource_tree.get_selected()) + %RightClickItemMenu.popup_on_parent(Rect2(get_global_mouse_position(), Vector2())) + %RightClickItemMenu.set_meta("item_clicked", resource_tree.get_selected()) func _on_resources_tree_item_collapsed(item:TreeItem) -> void: @@ -424,21 +438,21 @@ func remove_item_from_list(item: TreeItem) -> 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_clicked")) + remove_item_from_list(%RightClickItemMenu.get_meta("item_clicked")) 2: # OPEN IN FILESYSTEM EditorInterface.get_file_system_dock().navigate_to_path( - %RightClickMenu.get_meta("item_clicked").get_metadata(0) + %RightClickItemMenu.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) + %RightClickItemMenu.get_meta("item_clicked").get_metadata(0) ) ) 4: # COPY IDENTIFIER DisplayServer.clipboard_set( DialogicResourceUtil.get_unique_identifier_by_path( - %RightClickMenu.get_meta("item_clicked").get_metadata(0) + %RightClickItemMenu.get_meta("item_clicked").get_metadata(0) ) ) #endregion @@ -535,3 +549,13 @@ func _on_trim_folder_paths_toggled(toggled_on: bool) -> void: func _on_main_v_split_dragged(offset: int) -> void: DialogicUtil.set_editor_setting("sidebar_v_split", offset) + + +func _on_resource_tree_empty_clicked(click_position: Vector2, mouse_button_index: int) -> void: + if mouse_button_index == MOUSE_BUTTON_RIGHT: + %RightClickNoItemMenu.popup_on_parent(Rect2(get_global_mouse_position(), Vector2())) + + + +func _on_right_click_no_item_menu_id_pressed(id: int) -> void: + custom_right_click_options[id].button.pressed.emit() From 6d4fff3b2340375fd0660b896cbfa00cbd3fd520 Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Sat, 13 Dec 2025 20:35:06 +0100 Subject: [PATCH 11/19] Slightly adjust button naming & change "import portraits from folder" Import portraits from Folder now expects selecting a series of files instead of a folder, as it is more intuitve and flexible. Changes various icon button tooltips (E.g. New Timeline instead of Add Timeline) to be more in line with godot terminology --- .../CharacterEditor/character_editor.gd | 32 +++++++++---------- .../CharacterEditor/character_editor.tscn | 9 +++--- .../Editor/TimelineEditor/timeline_editor.gd | 2 +- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor.gd b/addons/dialogic/Editor/CharacterEditor/character_editor.gd index 675474d69..368255848 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor.gd +++ b/addons/dialogic/Editor/CharacterEditor/character_editor.gd @@ -29,7 +29,7 @@ func _register() -> void: ## Add an "add character" button var add_character_button: Button = editors_manager.add_icon_button( load("res://addons/dialogic/Editor/Images/Toolbar/add-character.svg"), - 'Add Character', + 'New Character', self) add_character_button.pressed.connect(_on_create_character_button_pressed) add_character_button.shortcut = Shortcut.new() @@ -315,26 +315,26 @@ func setup_portrait_list_tab() -> void: func open_portrait_folder_select() -> void: find_parent("EditorView").godot_file_dialog( import_portraits_from_folder, "*.svg, *.png", - EditorFileDialog.FILE_MODE_OPEN_DIR) + EditorFileDialog.FILE_MODE_OPEN_FILES, "Import Images From Folder") -func import_portraits_from_folder(path:String) -> void: +func import_portraits_from_folder(files:Array) -> void: var parent: TreeItem = %PortraitTree.get_root() if %PortraitTree.get_selected() and %PortraitTree.get_selected() != parent and %PortraitTree.get_selected().get_metadata(0).has('group'): parent = %PortraitTree.get_selected() - - var dir := DirAccess.open(path) - dir.list_dir_begin() - var file_name: String = dir.get_next() - var files := [] - while file_name != "": - if not dir.current_is_dir(): - var file_lower := file_name.to_lower() - if '.svg' in file_lower or '.png' in file_lower: - if not '.import' in file_lower: - files.append(file_name) - file_name = dir.get_next() +# + #var dir := DirAccess.open(path) + #dir.list_dir_begin() + #var file_name: String = dir.get_next() + #var files := [] + #while file_name != "": + #if not dir.current_is_dir(): + #var file_lower := file_name.to_lower() + #if '.svg' in file_lower or '.png' in file_lower: + #if not '.import' in file_lower: + #files.append(file_name) + #file_name = dir.get_next() var prefix: String = files[0] for file in files: @@ -347,7 +347,7 @@ func import_portraits_from_folder(path:String) -> void: for file in files: var item : TreeItem = %PortraitTree.add_portrait_item(file.trim_prefix(prefix).trim_suffix('.'+file.get_extension()), - {'scene':"",'export_overrides':{'image':var_to_str(path.path_join(file))}, 'scale':1, 'offset':Vector2(), 'mirror':false}, parent) + {'scene':"",'export_overrides':{'image':var_to_str(file)}, 'scale':1, 'offset':Vector2(), 'mirror':false}, parent) item.set_meta('new', true) ## Handle selection diff --git a/addons/dialogic/Editor/CharacterEditor/character_editor.tscn b/addons/dialogic/Editor/CharacterEditor/character_editor.tscn index 4553927c2..b93009919 100644 --- a/addons/dialogic/Editor/CharacterEditor/character_editor.tscn +++ b/addons/dialogic/Editor/CharacterEditor/character_editor.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://dlskc36c5hrwv"] +[gd_scene format=3 uid="uid://dlskc36c5hrwv"] [ext_resource type="Script" uid="uid://cwhe7tpe75oh7" path="res://addons/dialogic/Editor/CharacterEditor/character_editor.gd" id="2"] [ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="2_uhhqs"] @@ -160,19 +160,19 @@ text = "Portraits" [node name="AddPortraitButton" type="Button" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/Title" unique_id=1343539624] unique_name_in_owner = true layout_mode = 2 -tooltip_text = "Add portrait" +tooltip_text = "Add Empty Portrait" theme_type_variation = &"FlatButton" [node name="AddPortraitGroupButton" type="Button" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/Title" unique_id=554125997] unique_name_in_owner = true layout_mode = 2 -tooltip_text = "Add Group" +tooltip_text = "Add Portrait Group" theme_type_variation = &"FlatButton" [node name="ImportPortraitsButton" type="Button" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits/Title" unique_id=423626215] unique_name_in_owner = true layout_mode = 2 -tooltip_text = "Import images from folder" +tooltip_text = "Import Images as Portraits" theme_type_variation = &"FlatButton" [node name="PortraitListTools" type="HBoxContainer" parent="Scroll/VBox/MainHSplit/Split/HBoxContainer/MarginContainer/PortraitListSection/Portraits" unique_id=1864279451] @@ -411,6 +411,7 @@ custom_minimum_size = Vector2(0, 20) layout_mode = 2 [node name="NoCharacterScreen" type="PanelContainer" parent="." unique_id=190821474] +visible = false layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 diff --git a/addons/dialogic/Editor/TimelineEditor/timeline_editor.gd b/addons/dialogic/Editor/TimelineEditor/timeline_editor.gd index dc36bf823..d9963f27a 100644 --- a/addons/dialogic/Editor/TimelineEditor/timeline_editor.gd +++ b/addons/dialogic/Editor/TimelineEditor/timeline_editor.gd @@ -20,7 +20,7 @@ func _register() -> void: # add timeline button var add_timeline_button: Button = editors_manager.add_icon_button( load("res://addons/dialogic/Editor/Images/Toolbar/add-timeline.svg"), - "Add Timeline", + "New Timeline", self) add_timeline_button.pressed.connect(_on_create_timeline_button_pressed) add_timeline_button.shortcut = Shortcut.new() From c1b14a1df219ff9acfad1f49f443ff16c0c4d3b6 Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Sat, 13 Dec 2025 20:36:27 +0100 Subject: [PATCH 12/19] Disable auto-translate for the whole plugin interface When having godot in a different language, random parts in dialogic where translated, resulting in a very bad look. For now auto-translation should be disabled on the whole interface. --- addons/dialogic/Editor/editor_main.tscn | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/dialogic/Editor/editor_main.tscn b/addons/dialogic/Editor/editor_main.tscn index ccc860453..b853a7ae6 100644 --- a/addons/dialogic/Editor/editor_main.tscn +++ b/addons/dialogic/Editor/editor_main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=18 format=3 uid="uid://de6yhw4r8jqb3"] +[gd_scene format=3 uid="uid://de6yhw4r8jqb3"] [ext_resource type="Script" uid="uid://q24lthmavkvn" path="res://addons/dialogic/Editor/editor_main.gd" id="1_x88ov"] [ext_resource type="Script" uid="uid://cefv8yoo8q7k6" path="res://addons/dialogic/Editor/editors_manager.gd" id="2_pe2tl"] @@ -36,6 +36,7 @@ bg_color = Color(0.083385, 0.083385, 0.083385, 1) corner_detail = 4 [node name="EditorView" type="ScrollContainer" unique_id=708605923] +auto_translate_mode = 2 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -43,6 +44,7 @@ grow_horizontal = 2 grow_vertical = 2 size_flags_horizontal = 3 size_flags_vertical = 3 +tooltip_auto_translate_mode = 2 script = ExtResource("1_x88ov") [node name="EditorsManager" type="Control" parent="." unique_id=1465650293] @@ -61,12 +63,14 @@ grow_horizontal = 2 grow_vertical = 2 size_flags_vertical = 3 theme_override_constants/separation = 0 +split_offsets = PackedInt32Array(150) split_offset = 150 [node name="Sidebar" parent="EditorsManager/HSplit" unique_id=93560475 instance=ExtResource("3_lp6hj")] unique_name_in_owner = true custom_minimum_size = Vector2(20, 0) layout_mode = 2 +split_offsets = PackedInt32Array(0) split_offset = 0 [node name="VBox" type="VBoxContainer" parent="EditorsManager/HSplit" unique_id=1819816398] @@ -74,6 +78,7 @@ layout_mode = 2 theme_override_constants/separation = 0 [node name="Toolbar" type="HBoxContainer" parent="EditorsManager/HSplit/VBox" unique_id=757941712] +unique_name_in_owner = true layout_mode = 2 size_flags_vertical = 0 mouse_filter = 2 From 093792b805178ad1dd8c723613a62061ab7f8e30 Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Sat, 13 Dec 2025 20:45:20 +0100 Subject: [PATCH 13/19] Cleanup/Simplify autoload adding The autoload was re-added every time the plugin loaded, because godot now saves autoloads by UID and thus "Core" was never in the return value of the setting. I think it's fine to drop this small auto-upgrade. --- addons/dialogic/plugin.gd | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/addons/dialogic/plugin.gd b/addons/dialogic/plugin.gd index 75df7e64b..007230b84 100644 --- a/addons/dialogic/plugin.gd +++ b/addons/dialogic/plugin.gd @@ -39,12 +39,9 @@ func _enter_tree() -> void: inspector_plugin = load("res://addons/dialogic/Editor/Inspector/inspector_plugin.gd").new() add_inspector_plugin(inspector_plugin) - # Auto-update the singleton path for alpha users - # TODO remove at some point during beta or later - if not ProjectSettings.has_setting("autoload/"+PLUGIN_NAME) or not "Core" in ProjectSettings.get_setting("autoload/"+PLUGIN_NAME, ""): - if ProjectSettings.has_setting("autoload/"+PLUGIN_NAME): - remove_autoload_singleton(PLUGIN_NAME) + if not ProjectSettings.has_setting("autoload/"+PLUGIN_NAME): add_autoload_singleton(PLUGIN_NAME, PLUGIN_HANDLER_PATH) + print("[Dialogic] Dialogic was enabled, but autoload singleton was missing. It was automatically added again.") func _exit_tree() -> void: From e2dca3e6890bd274832f4b48647c247db889b427 Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Sat, 13 Dec 2025 21:21:05 +0100 Subject: [PATCH 14/19] Fix connection lines on choices The lines on choices where broken when choices where directly inside of each other or at the end of a timeline. --- .../VisualEditor/TimelineArea.gd | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd index ca6203a3b..bbadd5f82 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd @@ -29,7 +29,7 @@ func _ready() -> void: %Timeline.child_entered_tree.connect(add_extra_scroll_area_to_timeline) # This prevents the view to turn black if you are editing this scene in Godot - if find_parent('EditorView'): + if find_parent("EditorView"): %TimelineArea.get_theme_color("background_color", "CodeEdit") @@ -51,7 +51,7 @@ func _input(event:InputEvent) -> void: finish_dragging() -func _process(delta:float) -> void: +func _process(_delta:float) -> void: if !dragging: return @@ -87,7 +87,6 @@ func _draw() -> void: var color_multiplier := Color(1,1,1,0.25) var selected_color_multiplier := Color(1,1,1,1) - ## Draw Event Lines for idx in range($Timeline.get_child_count()): var block: Control = $Timeline.get_child(idx) @@ -104,8 +103,8 @@ func _draw() -> void: if not (block.has_any_enabled_body_content or block.resource.can_contain_events): continue - var icon_panel_height: int = block.get_node('%IconPanel').size.y - var rect_position: Vector2 = block.get_node('%IconPanel').global_position+Vector2(0,1)*block.get_node('%IconPanel').size+Vector2(0,-4) + var icon_panel_height: int = block.get_node("%IconPanel").size.y + var rect_position: Vector2 = block.get_node("%IconPanel").global_position+Vector2(0,1)*block.get_node("%IconPanel").size+Vector2(0,-4) var color: Color = block.resource.event_color if block.is_selected() or block.end_node and block.end_node.is_selected(): @@ -144,7 +143,7 @@ func _draw() -> void: var group_starter := true if idx != 0: var block_above := $Timeline.get_child(idx-1) - if block_above.resource.event_name == block.resource.event_name: + if block_above.resource.event_name == block.resource.event_name and block_above.current_indent_level == block.current_indent_level: group_starter = false if block_above.resource is DialogicEndBranchEvent and block_above.parent_node.resource.event_name == block.resource.event_name: group_starter = false @@ -152,24 +151,28 @@ func _draw() -> void: ## Draw small horizontal line on any event in group draw_rect(Rect2( rect_position.x-global_position.x-line_width, - rect_position.y-global_position.y-icon_panel_height/2, + rect_position.y-global_position.y-icon_panel_height/2.0, line_width, line_width), group_color) if group_starter: ## Find the last event in the group (or that events END BRANCH) + var target_indent: int = block.current_indent_level-1 var sub_idx := idx var group_end_idx := idx while sub_idx < $Timeline.get_child_count()-1: sub_idx += 1 - if $Timeline.get_child(sub_idx).current_indent_level == block.current_indent_level-1: + if $Timeline.get_child(sub_idx).current_indent_level == target_indent: group_end_idx = sub_idx-1 break + if sub_idx + 1 == $Timeline.get_child_count(): + group_end_idx = sub_idx + break var end_node := $Timeline.get_child(group_end_idx) - var offset := Vector2(-2*line_width, -icon_panel_height/2) + var offset := Vector2(-2*line_width, -icon_panel_height/2.0) var v_length: float = end_node.global_position.y - rect_position.y + icon_panel_height ## Draw vertical line @@ -197,7 +200,7 @@ func _draw() -> void: #region SPACE BELOW ################################################################################ -func add_extra_scroll_area_to_timeline(fake_arg:Variant=null) -> void: +func add_extra_scroll_area_to_timeline(_fake_arg:Variant=null) -> void: if %Timeline.get_children().size() > 4: %Timeline.custom_minimum_size.y = 0 %Timeline.size.y = 0 From 2e0807f317d01b94da65af7c55c53776d5cdabad Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Sat, 13 Dec 2025 21:34:47 +0100 Subject: [PATCH 15/19] Add a setting to events to prevent them from expanding on creation Though on most events with a body it's useful to have them open when first created, on some it's kinda annoying imo. So for now the label, choice, wait input will stay collapsed when created. My reasoning is a bit different for them. For label and wait input I think you mostly don't need those settings. But for choices it's mostly because you will often add a bunch of choices at once and then having them all expanded is unnecessary. --- addons/dialogic/Editor/Events/EventBlock/event_block.gd | 2 +- addons/dialogic/Modules/Choice/event_choice.gd | 1 + addons/dialogic/Modules/Jump/event_label.gd | 1 + addons/dialogic/Modules/WaitInput/event_wait_input.gd | 1 + addons/dialogic/Resources/event.gd | 4 +++- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/dialogic/Editor/Events/EventBlock/event_block.gd b/addons/dialogic/Editor/Events/EventBlock/event_block.gd index c021d19da..f591c9e2d 100644 --- a/addons/dialogic/Editor/Events/EventBlock/event_block.gd +++ b/addons/dialogic/Editor/Events/EventBlock/event_block.gd @@ -109,7 +109,7 @@ func initialize_logic() -> void: content_changed.connect(recalculate_field_visibility) - _on_ToggleBodyVisibility_toggled(resource.expand_by_default or resource.created_by_button) + _on_ToggleBodyVisibility_toggled(resource.expand_by_default or resource.created_by_button and not resource.collapse_on_create) #endregion diff --git a/addons/dialogic/Modules/Choice/event_choice.gd b/addons/dialogic/Modules/Choice/event_choice.gd index cbe15e366..c5d02cc1a 100644 --- a/addons/dialogic/Modules/Choice/event_choice.gd +++ b/addons/dialogic/Modules/Choice/event_choice.gd @@ -54,6 +54,7 @@ func _init() -> void: event_sorting_index = 0 can_contain_events = true wants_to_group = true + collapse_on_create = true # return a control node that should show on the END BRANCH node diff --git a/addons/dialogic/Modules/Jump/event_label.gd b/addons/dialogic/Modules/Jump/event_label.gd index 2a72b5ac1..826288069 100644 --- a/addons/dialogic/Modules/Jump/event_label.gd +++ b/addons/dialogic/Modules/Jump/event_label.gd @@ -36,6 +36,7 @@ func _init() -> void: event_category = "Flow" event_sorting_index = 3 help_page_path = "https://docs.dialogic.pro/jump-event.html" + collapse_on_create = true func _get_icon() -> Resource: diff --git a/addons/dialogic/Modules/WaitInput/event_wait_input.gd b/addons/dialogic/Modules/WaitInput/event_wait_input.gd index a3dc23924..b44901c3f 100644 --- a/addons/dialogic/Modules/WaitInput/event_wait_input.gd +++ b/addons/dialogic/Modules/WaitInput/event_wait_input.gd @@ -29,6 +29,7 @@ func _init() -> void: set_default_color('Color5') event_category = "Flow" event_sorting_index = 12 + collapse_on_create = true #endregion diff --git a/addons/dialogic/Resources/event.gd b/addons/dialogic/Resources/event.gd index d3116ab72..cdf35e3ec 100644 --- a/addons/dialogic/Resources/event.gd +++ b/addons/dialogic/Resources/event.gd @@ -63,8 +63,10 @@ var dialogic_color_name: = "" var event_sorting_index: int = 0 ## If true the event will not have a button in the visual editor sidebar var disable_editor_button := false -## If false the event will hide it's body by default. Recommended for most events +## If false the event will hide its body by default (when loaded). Recommended for most events var expand_by_default := false +## If true the event will hide its body when created. It's false by default, meaning when added the event is expanded. +var collapse_on_create := false ## The URL to open when right_click>Documentation is selected var help_page_path := "" ## Is the event block created by a button? From 0e1cd90d45851cf36d0500e7b7970a11c4409e99 Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Sun, 14 Dec 2025 01:37:38 +0100 Subject: [PATCH 16/19] Make use of EditorInterface singleton directly This is functionality since 4.2, so it should be fine to switch to it now. --- .../Editor/CharacterEditor/char_edit_p_section_main.gd | 2 +- addons/dialogic/Editor/Common/BrowserItem.gd | 2 +- addons/dialogic/Editor/Common/reference_manager_window.gd | 4 ++-- addons/dialogic/Editor/Common/update_install_window.gd | 4 ++-- addons/dialogic/Editor/Inspector/inspector_plugin.gd | 4 ++-- .../dialogic/Editor/Inspector/timeline_inspector_field.gd | 4 ++-- .../Editor/Settings/CoreSettingsPages/settings_general.gd | 2 +- .../Settings/CoreSettingsPages/settings_translation.gd | 6 +++--- .../TimelineEditor/TextEditor/syntax_highlighter.gd | 4 ++-- addons/dialogic/Editor/TimelineEditor/timeline_editor.gd | 2 +- addons/dialogic/Editor/editor_main.gd | 6 +++--- addons/dialogic/Editor/editors_manager.gd | 4 ++-- addons/dialogic/plugin.gd | 8 ++++---- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd index a4be43eb9..35d90c844 100644 --- a/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd +++ b/addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd @@ -28,7 +28,7 @@ func _load_portrait_data(data:Dictionary) -> void: func _on_open_scene_button_pressed() -> void: var data: Dictionary = selected_item.get_metadata(0) if ResourceLoader.exists(data.get("scene", "")): - DialogicUtil.get_dialogic_plugin().get_editor_interface().open_scene_from_path(data.get("scene", "")) + EditorInterface.open_scene_from_path(data.get("scene", "")) await get_tree().process_frame EditorInterface.set_main_screen_editor("2D") diff --git a/addons/dialogic/Editor/Common/BrowserItem.gd b/addons/dialogic/Editor/Common/BrowserItem.gd index 7bfb3cfc4..f4e0b6d5d 100644 --- a/addons/dialogic/Editor/Common/BrowserItem.gd +++ b/addons/dialogic/Editor/Common/BrowserItem.gd @@ -31,7 +31,7 @@ func load_info(info:Dictionary) -> void: %Image.stretch_mode = TextureRect.STRETCH_KEEP_CENTERED %Panel.self_modulate = get_theme_color("property_color_z", "Editor") elif info.preview_image[0].ends_with('scn'): - DialogicUtil.get_dialogic_plugin().get_editor_interface().get_resource_previewer().queue_resource_preview(info.preview_image[0], self, 'set_scene_preview', null) + EditorInterface.get_resource_previewer().queue_resource_preview(info.preview_image[0], self, 'set_scene_preview', null) elif ResourceLoader.exists(info.preview_image[0]): %Image.texture = load(info.preview_image[0]) elif info.preview_image[0].is_valid_html_color(): diff --git a/addons/dialogic/Editor/Common/reference_manager_window.gd b/addons/dialogic/Editor/Common/reference_manager_window.gd index c8d858155..d0675aaec 100644 --- a/addons/dialogic/Editor/Common/reference_manager_window.gd +++ b/addons/dialogic/Editor/Common/reference_manager_window.gd @@ -39,8 +39,8 @@ func _ready() -> void: hide() - get_parent().plugin_reference.get_editor_interface().get_file_system_dock().files_moved.connect(_on_file_moved) - get_parent().plugin_reference.get_editor_interface().get_file_system_dock().file_removed.connect(_on_file_removed) + EditorInterface.get_file_system_dock().files_moved.connect(_on_file_moved) + EditorInterface.get_file_system_dock().file_removed.connect(_on_file_removed) get_parent().get_node('ResourceRenameWarning').confirmed.connect(open) diff --git a/addons/dialogic/Editor/Common/update_install_window.gd b/addons/dialogic/Editor/Common/update_install_window.gd index 128c62ee2..702119359 100644 --- a/addons/dialogic/Editor/Common/update_install_window.gd +++ b/addons/dialogic/Editor/Common/update_install_window.gd @@ -13,7 +13,7 @@ func _ready() -> void: %LoadingIcon.texture = editor_view.get_theme_icon("KeyTrackScale", "EditorIcons") %InstallWarning.modulate = editor_view.get_theme_color("warning_color", "Editor") %CloseButton.icon = editor_view.get_theme_icon("Close", "EditorIcons") - DialogicUtil.get_dialogic_plugin().get_editor_interface().get_resource_filesystem().resources_reimported.connect(_on_resources_reimported) + EditorInterface.get_resource_filesystem().resources_reimported.connect(_on_resources_reimported) func open() -> void: @@ -172,7 +172,7 @@ func _on_install_mouse_exited() -> void: func _on_restart_pressed() -> void: - DialogicUtil.get_dialogic_plugin().get_editor_interface().restart_editor(true) + EditorInterface.restart_editor(true) func _on_close_button_pressed() -> void: diff --git a/addons/dialogic/Editor/Inspector/inspector_plugin.gd b/addons/dialogic/Editor/Inspector/inspector_plugin.gd index 0a40bc388..2bd6dcbd4 100644 --- a/addons/dialogic/Editor/Inspector/inspector_plugin.gd +++ b/addons/dialogic/Editor/Inspector/inspector_plugin.gd @@ -2,11 +2,11 @@ extends EditorInspectorPlugin -func _can_handle(object: Object) -> bool: +func _can_handle(_object: Object) -> bool: return true -func _parse_property(object: Object, type: Variant.Type, name: String, hint_type: PropertyHint, hint_string: String, usage_flags: int, wide: bool) -> bool: +func _parse_property(_object: Object, type: Variant.Type, name: String, hint_type: PropertyHint, hint_string: String, _usage_flags: int, _wide: bool) -> bool: if type == TYPE_OBJECT and hint_type == PROPERTY_HINT_RESOURCE_TYPE: if hint_string == "DialogicTimeline": var editor: EditorProperty = load("res://addons/dialogic/Editor/Inspector/timeline_inspector_field.gd").new() diff --git a/addons/dialogic/Editor/Inspector/timeline_inspector_field.gd b/addons/dialogic/Editor/Inspector/timeline_inspector_field.gd index 78274d149..682edf11c 100644 --- a/addons/dialogic/Editor/Inspector/timeline_inspector_field.gd +++ b/addons/dialogic/Editor/Inspector/timeline_inspector_field.gd @@ -30,7 +30,7 @@ func _init() -> void: button.pressed.connect(_on_button_pressed, CONNECT_DEFERRED) -func _on_field_value_changed(property:String, value:Variant) -> void: +func _on_field_value_changed(_property:String, value:Variant) -> void: # Ignore the signal if the property is currently being updated. if updating: return @@ -69,7 +69,7 @@ func _update_property() -> void: updating = false -func get_timeline_suggestions(filter:String) -> Dictionary: +func get_timeline_suggestions(_filter:String) -> Dictionary: var suggestions := {} var timeline_directory := DialogicResourceUtil.get_timeline_directory() for identifier in timeline_directory.keys(): diff --git a/addons/dialogic/Editor/Settings/CoreSettingsPages/settings_general.gd b/addons/dialogic/Editor/Settings/CoreSettingsPages/settings_general.gd index d44907dfc..b65ff88c8 100644 --- a/addons/dialogic/Editor/Settings/CoreSettingsPages/settings_general.gd +++ b/addons/dialogic/Editor/Settings/CoreSettingsPages/settings_general.gd @@ -165,7 +165,7 @@ func load_game_state(load_flag:=LoadFlags.FULL_LOAD) -> void: %ExtensionCreator.hide() %CreateExtensionButton.show() - find_parent('EditorView').plugin_reference.get_editor_interface().get_resource_filesystem().scan_sources() + EditorInterface.get_resource_filesystem().scan_sources() force_event_button_list_reload() diff --git a/addons/dialogic/Editor/Settings/CoreSettingsPages/settings_translation.gd b/addons/dialogic/Editor/Settings/CoreSettingsPages/settings_translation.gd index d882ec7fd..3bdfc6949 100644 --- a/addons/dialogic/Editor/Settings/CoreSettingsPages/settings_translation.gd +++ b/addons/dialogic/Editor/Settings/CoreSettingsPages/settings_translation.gd @@ -353,7 +353,7 @@ func update_csv_files() -> void: _silently_open_timeline(current_timeline) # Trigger reimport. - find_parent('EditorView').plugin_reference.get_editor_interface().get_resource_filesystem().scan_sources() + EditorInterface.get_resource_filesystem().scan_sources() var status_message := "Events created {new_events} found {updated_events} Names created {new_names} found {updated_names} @@ -575,7 +575,7 @@ func erase_translations() -> void: ProjectSettings.set_setting('internationalization/locale/translations', PackedStringArray(translation_files)) ProjectSettings.save() - find_parent('EditorView').plugin_reference.get_editor_interface().get_resource_filesystem().scan_sources() + EditorInterface.get_resource_filesystem().scan_sources() var status_message := "Timelines cleaned {cleaned_timelines} Events cleaned {cleaned_events} @@ -597,7 +597,7 @@ func erase_translations() -> void: _silently_open_timeline(current_timeline) # Trigger reimport. - find_parent('EditorView').plugin_reference.get_editor_interface().get_resource_filesystem().scan_sources() + EditorInterface.get_resource_filesystem().scan_sources() # Clear the internal settings. ProjectSettings.clear('dialogic/translation/intern/save_mode') diff --git a/addons/dialogic/Editor/TimelineEditor/TextEditor/syntax_highlighter.gd b/addons/dialogic/Editor/TimelineEditor/TextEditor/syntax_highlighter.gd index 2e9ee90df..845847633 100644 --- a/addons/dialogic/Editor/TimelineEditor/TextEditor/syntax_highlighter.gd +++ b/addons/dialogic/Editor/TimelineEditor/TextEditor/syntax_highlighter.gd @@ -32,13 +32,13 @@ var text_event: DialogicTextEvent = null func _init() -> void: update_colors() - DialogicUtil.get_dialogic_plugin().get_editor_interface().get_base_control().theme_changed.connect(update_colors) + EditorInterface.get_base_control().theme_changed.connect(update_colors) func update_colors() -> void: if not DialogicUtil.get_dialogic_plugin(): return - var editor_settings: EditorSettings = DialogicUtil.get_dialogic_plugin().get_editor_interface().get_editor_settings() + var editor_settings: EditorSettings = EditorInterface.get_editor_settings() normal_color = editor_settings.get('text_editor/theme/highlighting/text_color') translation_id_color = editor_settings.get('text_editor/theme/highlighting/comment_color') diff --git a/addons/dialogic/Editor/TimelineEditor/timeline_editor.gd b/addons/dialogic/Editor/TimelineEditor/timeline_editor.gd index d9963f27a..f52408c92 100644 --- a/addons/dialogic/Editor/TimelineEditor/timeline_editor.gd +++ b/addons/dialogic/Editor/TimelineEditor/timeline_editor.gd @@ -116,7 +116,7 @@ func play_timeline(index := -1) -> void: # Save the current opened timeline DialogicUtil.set_editor_setting('current_timeline_path', current_resource.resource_path) DialogicUtil.set_editor_setting('play_from_index', index) - DialogicUtil.get_dialogic_plugin().get_editor_interface().play_custom_scene("res://addons/dialogic/Editor/TimelineEditor/test_timeline_scene.tscn") + EditorInterface.play_custom_scene("res://addons/dialogic/Editor/TimelineEditor/test_timeline_scene.tscn") ## Method to switch from visual to text editor (and vice versa). Connected to the button in the sidebar. diff --git a/addons/dialogic/Editor/editor_main.gd b/addons/dialogic/Editor/editor_main.gd index 9f3424466..536ba8718 100644 --- a/addons/dialogic/Editor/editor_main.gd +++ b/addons/dialogic/Editor/editor_main.gd @@ -218,7 +218,7 @@ func update_theme_additions() -> void: new_theme.set_constant("separation", "DialogicMegaSeparator", 50) new_theme.set_type_variation("DialogicTextEventTextEdit", "CodeEdit") - var editor_settings := plugin_reference.get_editor_interface().get_editor_settings() + var editor_settings := EditorInterface.get_editor_settings() var text_panel := DCSS.inline({ "border-radius": 8, "background": @@ -273,7 +273,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") + EditorInterface.set_main_screen_editor("2D") ## Removes the main control from the window node and adds it to it's grandparent @@ -284,7 +284,7 @@ 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") + EditorInterface.set_main_screen_editor("Dialogic") window.get_parent().add_child(self) window.queue_free() diff --git a/addons/dialogic/Editor/editors_manager.gd b/addons/dialogic/Editor/editors_manager.gd index 029a9199f..5ef531ca8 100644 --- a/addons/dialogic/Editor/editors_manager.gd +++ b/addons/dialogic/Editor/editors_manager.gd @@ -63,8 +63,8 @@ func _ready() -> void: used_resources_cache = DialogicUtil.get_editor_setting('last_resources', []) sidebar.update_resource_list(used_resources_cache) - find_parent('EditorView').plugin_reference.get_editor_interface().get_file_system_dock().files_moved.connect(_on_file_moved) - find_parent('EditorView').plugin_reference.get_editor_interface().get_file_system_dock().file_removed.connect(_on_file_removed) + EditorInterface.get_file_system_dock().files_moved.connect(_on_file_moved) + EditorInterface.get_file_system_dock().file_removed.connect(_on_file_removed) hsplit.set("theme_override_constants/separation", get_theme_constant("base_margin", "Editor") * DialogicUtil.get_editor_scale()) diff --git a/addons/dialogic/plugin.gd b/addons/dialogic/plugin.gd index 007230b84..eade24b39 100644 --- a/addons/dialogic/plugin.gd +++ b/addons/dialogic/plugin.gd @@ -32,7 +32,7 @@ func _disable_plugin() -> void: func _enter_tree() -> void: editor_view = MainPanel.instantiate() editor_view.plugin_reference = self - editor_view.hide() + EditorInterface.get_editor_main_screen().add_child(editor_view) get_editor_interface().get_editor_main_screen().add_child(editor_view) _make_visible(false) @@ -82,7 +82,7 @@ func _make_visible(visible:bool) -> void: if editor_view.get_parent() is Window: if visible: - get_editor_interface().set_main_screen_editor("Script") + EditorInterface.set_main_screen_editor("Script") editor_view.show() editor_view.get_parent().grab_focus() else: @@ -127,7 +127,7 @@ func _editor_view_and_manager_exist() -> bool: ## Special Setup/Updates ## Methods that adds a dialogic_default_action if non exists func add_dialogic_default_action() -> void: - if ProjectSettings.has_setting('input/dialogic_default_action'): + if ProjectSettings.has_setting("input/dialogic_default_action"): return var input_enter: InputEventKey = InputEventKey.new() @@ -143,7 +143,7 @@ func add_dialogic_default_action() -> void: var input_controller: InputEventJoypadButton = InputEventJoypadButton.new() input_controller.button_index = JOY_BUTTON_A - ProjectSettings.set_setting('input/dialogic_default_action', {'deadzone':0.5, 'events':[input_enter, input_left_click, input_space, input_x, input_controller]}) + ProjectSettings.set_setting("input/dialogic_default_action", {"deadzone":0.5, "events":[input_enter, input_left_click, input_space, input_x, input_controller]}) ProjectSettings.save() # Create cache when project is compiled From 8c56279a251f15daae2a9eb589c670e5304eb06a Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Sun, 14 Dec 2025 01:38:05 +0100 Subject: [PATCH 17/19] Slightly adjust drawing of group lines --- .../dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd index bbadd5f82..9ca3fc1ac 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/TimelineArea.gd @@ -139,7 +139,7 @@ func _draw() -> void: color) if block.resource.wants_to_group: - var group_color: Color = block.resource.event_color*color_multiplier + var group_color: Color = block.resource.event_color*color_multiplier*0.7 var group_starter := true if idx != 0: var block_above := $Timeline.get_child(idx-1) From 6ffb7ccee16243c23ad34b4eece972df71ee38cc Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Sun, 14 Dec 2025 01:42:11 +0100 Subject: [PATCH 18/19] Improve VE line drawing, better UI/UX for empty & collapsed choices/ifs --- addons/dialogic/Editor/Events/BranchEnd.gd | 11 +-- addons/dialogic/Editor/Events/BranchEnd.tscn | 28 ++---- .../Editor/Events/EventBlock/event_block.gd | 87 +++++++++++++++---- .../Editor/Events/EventBlock/event_block.tscn | 48 ++++------ .../VisualEditor/timeline_editor_visual.gd | 32 ++++--- .../Modules/Choice/ui_choice_end.tscn | 11 ++- .../Modules/Condition/ui_condition_end.gd | 2 + .../Modules/Condition/ui_condition_end.tscn | 25 +++--- 8 files changed, 133 insertions(+), 111 deletions(-) diff --git a/addons/dialogic/Editor/Events/BranchEnd.gd b/addons/dialogic/Editor/Events/BranchEnd.gd index d43ebe345..e9938b467 100644 --- a/addons/dialogic/Editor/Events/BranchEnd.gd +++ b/addons/dialogic/Editor/Events/BranchEnd.gd @@ -15,6 +15,8 @@ var current_indent_level := 1 var selected := false func _ready() -> void: + if get_parent() is SubViewport: + return $Icon.icon = get_theme_icon("GuiSpinboxUpdown", "EditorIcons") $Spacer.custom_minimum_size.x = 90 * DialogicUtil.get_editor_scale() visual_deselect() @@ -49,14 +51,6 @@ func unhighlight() -> void: modulate = parent_node.resource.event_color -func update_hidden_events_indicator(hidden_events_count:int = 0) -> void: - $HiddenEventsLabel.visible = hidden_events_count > 0 - if hidden_events_count == 1: - $HiddenEventsLabel.text = "[1 event hidden]" - else: - $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 * DialogicUtil.get_editor_scale(), 0) @@ -82,4 +76,3 @@ func add_end_control(control:Control) -> void: if control.has_method('refresh'): control.refresh() end_control = control - diff --git a/addons/dialogic/Editor/Events/BranchEnd.tscn b/addons/dialogic/Editor/Events/BranchEnd.tscn index 63df64e63..208bd1a93 100644 --- a/addons/dialogic/Editor/Events/BranchEnd.tscn +++ b/addons/dialogic/Editor/Events/BranchEnd.tscn @@ -1,20 +1,8 @@ -[gd_scene load_steps=4 format=3 uid="uid://de13fdeebrkcb"] +[gd_scene format=3 uid="uid://de13fdeebrkcb"] [ext_resource type="Script" uid="uid://cyjmcay08lmr8" path="res://addons/dialogic/Editor/Events/BranchEnd.gd" id="1"] -[sub_resource type="Image" id="Image_6aqdp"] -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", -"height": 16, -"mipmaps": false, -"width": 16 -} - -[sub_resource type="ImageTexture" id="ImageTexture_44ap0"] -image = SubResource("Image_6aqdp") - -[node name="EndBranch" type="HBoxContainer"] +[node name="EndBranch" type="HBoxContainer" unique_id=1281051416] anchors_preset = 10 anchor_right = 1.0 offset_bottom = 24.0 @@ -22,16 +10,16 @@ grow_horizontal = 2 mouse_filter = 0 script = ExtResource("1") -[node name="Indent" type="Control" parent="."] +[node name="Indent" type="Control" parent="." unique_id=1267249634] layout_mode = 2 size_flags_vertical = 0 -[node name="Spacer" type="Control" parent="."] +[node name="Spacer" type="Control" parent="." unique_id=818747539] custom_minimum_size = Vector2(90, 0) layout_mode = 2 size_flags_vertical = 0 -[node name="Icon" type="Button" parent="."] +[node name="Icon" type="Button" parent="." unique_id=489933577] unique_name_in_owner = true custom_minimum_size = Vector2(20, 0) layout_mode = 2 @@ -39,10 +27,4 @@ size_flags_vertical = 4 tooltip_text = "Click and drag" focus_mode = 0 mouse_filter = 1 -icon = SubResource("ImageTexture_44ap0") 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 f591c9e2d..0ab7d00d3 100644 --- a/addons/dialogic/Editor/Events/EventBlock/event_block.gd +++ b/addons/dialogic/Editor/Events/EventBlock/event_block.gd @@ -26,7 +26,6 @@ var has_any_enabled_body_content := false # Whether contained events (e.g. in choices) are visible var collapsed := false - ## CONSTANTS const icon_size := 28 const indent_size := 22 @@ -35,6 +34,8 @@ const indent_size := 22 # List that stores visibility conditions var field_list := [] var current_indent_level := 1 +var contained_events := [] + #region UI AND LOGIC INITIALIZATION @@ -57,7 +58,7 @@ func initialize_ui() -> void: add_theme_constant_override("margin_bottom", DialogicUtil.get_editor_setting("event_block_margin", 0) * _scale) - $PanelContainer.self_modulate = get_theme_color("accent_color", "Editor") + %PanelContainer.self_modulate = get_theme_color("accent_color", "Editor") # Warning Icon %Warning.texture = get_theme_icon("NodeWarning", "EditorIcons") @@ -82,7 +83,7 @@ func initialize_ui() -> void: %IconPanel.custom_minimum_size = Vector2(icon_size, icon_size) * _scale %IconTexture.custom_minimum_size = %IconPanel.custom_minimum_size - var custom_style: StyleBoxFlat = %IconPanel.get_theme_stylebox('panel') + var custom_style: StyleBoxFlat = %IconPanel.get_theme_stylebox("panel") custom_style.set_corner_radius_all(5 * _scale) # Focus Mode @@ -93,16 +94,18 @@ func initialize_ui() -> void: # Collapse Button %ToggleChildrenVisibilityButton.toggled.connect(_on_collapse_toggled) - %ToggleChildrenVisibilityButton.icon = get_theme_icon("Collapse", "EditorIcons") + %ToggleChildrenVisibilityButton.icon = get_theme_icon("ExpandTree", "EditorIcons") %ToggleChildrenVisibilityButton.hide() %Body.add_theme_constant_override("margin_left", icon_size * _scale) visual_deselect() + update_contain_ui() + func initialize_logic() -> void: - resized.connect(get_parent().get_parent().queue_redraw) + resized.connect(func(): await get_tree().process_frame;get_parent().get_parent().queue_redraw()) resource.ui_update_needed.connect(_on_resource_ui_update_needed) resource.ui_update_warning.connect(set_warning) @@ -118,17 +121,17 @@ func initialize_logic() -> void: ################################################################################ func visual_select() -> void: - $PanelContainer.add_theme_stylebox_override('panel', load("res://addons/dialogic/Editor/Events/styles/selected_styleboxflat.tres")) + %PanelContainer.add_theme_stylebox_override("panel", load("res://addons/dialogic/Editor/Events/styles/selected_styleboxflat.tres")) selected = true %IconPanel.self_modulate = resource.event_color %IconTexture.modulate = get_theme_color("icon_saturation", "Editor") func visual_deselect() -> void: - $PanelContainer.add_theme_stylebox_override('panel', load("res://addons/dialogic/Editor/Events/styles/unselected_stylebox.tres")) + %PanelContainer.add_theme_stylebox_override("panel", load("res://addons/dialogic/Editor/Events/styles/unselected_stylebox.tres")) selected = false %IconPanel.self_modulate = resource.event_color.lerp(Color.DARK_SLATE_GRAY, 0.1) - %IconTexture.modulate = get_theme_color('font_color', 'Label') + %IconTexture.modulate = get_theme_color("font_color", "Label") func is_selected() -> bool: @@ -136,7 +139,7 @@ func is_selected() -> bool: func set_warning(text:String= "") -> void: - if !text.is_empty(): + if not text.is_empty(): %Warning.show() %Warning.tooltip_text = text else: @@ -146,6 +149,46 @@ func set_warning(text:String= "") -> void: func set_indent(indent: int) -> void: add_theme_constant_override("margin_left", indent_size * indent * DialogicUtil.get_editor_scale()) current_indent_level = indent + post_indent_update() + + +func post_indent_update() -> void: + %ToggleChildrenVisibilityButton.visible = end_node and contained_events + update_contain_ui() + + +func update_contain_ui(): + if end_node and ((contained_events and collapsed) or (not contained_events and not collapsed)): + add_theme_constant_override("margin_bottom", 30) + else: + add_theme_constant_override("margin_bottom", 0) + + +func _draw() -> void: + if selected and end_node and not contained_events and not collapsed: + draw_string( + get_theme_default_font(), + Vector2( + %HeaderContent.global_position.x-global_position.x, + %VBox.global_position.y-global_position.y+%VBox.size.y + get_theme_default_font_size()+10), + "Add Events Here", + HORIZONTAL_ALIGNMENT_LEFT, + -1, + get_theme_default_font_size(), get_theme_color("font_placeholder_color", "Editor")) + + if end_node and contained_events and collapsed: + var start_pos := Vector2( + %HeaderContent.global_position.x-global_position.x, + %VBox.global_position.y-global_position.y+%VBox.size.y+10) + var offset := Vector2() + var stylebox := StyleBoxFlat.new() + stylebox.set_corner_radius_all(4) + stylebox.bg_color = get_theme_color("disabled_bg_color", "Editor") + for i:DialogicEvent in contained_events: + if i is DialogicEndBranchEvent: continue + draw_style_box(stylebox, Rect2(start_pos+offset, Vector2(25,25))) + draw_texture_rect(i._get_icon(), Rect2(start_pos+offset, Vector2(25,25)), false, get_theme_color("font_placeholder_color", "Editor").lerp(i.event_color, 0.5)) + offset += Vector2(28, 0) #endregion @@ -315,13 +358,15 @@ func build_editor(build_header:bool = true, build_body:bool = false) -> void: expanded = false %Body.visible = false + update_contain_ui() + recalculate_field_visibility() func recalculate_field_visibility() -> void: has_any_enabled_body_content = false for p in field_list: - if !p.has('condition') or p.condition.is_empty(): + if not p.has("condition") or p.condition.is_empty(): if p.node != null: p.node.show() if p.location == 1: @@ -356,7 +401,7 @@ func _evaluate_visibility_condition(p: Dictionary) -> bool: else: result = false if expr.has_execute_failed(): - printerr("[Dialogic] Failed executing visibility condition for '",p.get('property', 'unnamed'),"': " + expr.get_error_text()) + printerr("[Dialogic] Failed executing visibility condition for '",p.get("property", "unnamed"),"': " + expr.get_error_text()) return result @@ -369,13 +414,13 @@ func get_field_node(property_name:String) -> Node: func _on_resource_ui_update_needed() -> void: for node_info in field_list: - if node_info.node and node_info.node.has_method('set_value'): + if node_info.node and node_info.node.has_method("set_value"): # Only set the value if the field is visible # # This prevents events with varied value types (event_setting, event_variable) # from injecting incorrect types into hidden fields, which then throw errors # in the console. - if node_info.has('condition') and not node_info.condition.is_empty(): + if node_info.has("condition") and not node_info.condition.is_empty(): if _evaluate_visibility_condition(node_info): node_info.node.set_value(resource.get(node_info.property)) else: @@ -388,16 +433,17 @@ func _on_resource_ui_update_needed() -> void: func _on_collapse_toggled(toggled:bool) -> void: collapsed = toggled - var timeline_editor: Node = find_parent('VisualEditor') + var timeline_editor: Node = 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 timeline_editor.indent_events() + %ToggleChildrenVisibilityButton.icon = get_theme_icon("ExpandTree", "EditorIcons") if toggled else get_theme_icon("CollapseTree", "EditorIcons") func _on_ToggleBodyVisibility_toggled(button_pressed:bool) -> void: - if button_pressed and !body_was_build: + if button_pressed and not body_was_build: build_editor(false, true) %ToggleBodyVisibilityButton.set_pressed_no_signal(button_pressed) @@ -409,8 +455,15 @@ func _on_ToggleBodyVisibility_toggled(button_pressed:bool) -> void: expanded = button_pressed %Body.visible = button_pressed - if find_parent('VisualEditor') != null: - find_parent('VisualEditor').indent_events() + + await get_tree().process_frame + await get_tree().process_frame + queue_redraw() + + if find_parent("TimelineArea") != null: + find_parent("TimelineArea").queue_redraw() + + func _on_EventNode_gui_input(event:InputEvent) -> void: diff --git a/addons/dialogic/Editor/Events/EventBlock/event_block.tscn b/addons/dialogic/Editor/Events/EventBlock/event_block.tscn index 540227356..6bc09da70 100644 --- a/addons/dialogic/Editor/Events/EventBlock/event_block.tscn +++ b/addons/dialogic/Editor/Events/EventBlock/event_block.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=3 uid="uid://bwaxj1n401fp4"] +[gd_scene format=3 uid="uid://bwaxj1n401fp4"] [ext_resource type="Script" uid="uid://dbncx2w0btjyx" path="res://addons/dialogic/Editor/Events/EventBlock/event_block.gd" id="1"] [ext_resource type="StyleBox" uid="uid://cl75ikyq2is7c" path="res://addons/dialogic/Editor/Events/styles/unselected_stylebox.tres" id="2_axj84"] @@ -11,30 +11,20 @@ corner_radius_top_right = 5 corner_radius_bottom_right = 5 corner_radius_bottom_left = 5 -[sub_resource type="Image" id="Image_cl0tj"] -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", -"height": 16, -"mipmaps": false, -"width": 16 -} - -[sub_resource type="ImageTexture" id="ImageTexture_rc1wh"] -image = SubResource("Image_cl0tj") - [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ee4ub"] -[node name="EventNode" type="MarginContainer"] +[node name="EventNode" type="MarginContainer" unique_id=76538949] anchors_preset = 10 anchor_right = 1.0 +offset_bottom = 34.0 grow_horizontal = 2 size_flags_horizontal = 3 size_flags_vertical = 9 focus_mode = 1 script = ExtResource("1") -[node name="PanelContainer" type="PanelContainer" parent="."] +[node name="PanelContainer" type="PanelContainer" parent="." unique_id=1573085599] +unique_name_in_owner = true self_modulate = Color(0, 0, 0, 1) layout_mode = 2 size_flags_horizontal = 3 @@ -42,18 +32,19 @@ size_flags_vertical = 3 mouse_filter = 2 theme_override_styles/panel = ExtResource("2_axj84") -[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] +[node name="VBox" type="VBoxContainer" parent="PanelContainer" unique_id=1513215857] +unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"] +[node name="Header" type="HBoxContainer" parent="PanelContainer/VBox" unique_id=430202985] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -[node name="IconPanel" type="Panel" parent="PanelContainer/VBoxContainer/Header"] +[node name="IconPanel" type="Panel" parent="PanelContainer/VBox/Header" unique_id=1917445070] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 4 @@ -62,7 +53,7 @@ mouse_filter = 1 mouse_default_cursor_shape = 6 theme_override_styles/panel = SubResource("StyleBoxFlat_otutu") -[node name="IconTexture" type="TextureRect" parent="PanelContainer/VBoxContainer/Header/IconPanel"] +[node name="IconTexture" type="TextureRect" parent="PanelContainer/VBox/Header/IconPanel" unique_id=329739635] unique_name_in_owner = true layout_mode = 1 anchors_preset = 15 @@ -76,7 +67,7 @@ texture = ExtResource("6") expand_mode = 1 stretch_mode = 5 -[node name="Warning" type="TextureRect" parent="PanelContainer/VBoxContainer/Header/IconPanel"] +[node name="Warning" type="TextureRect" parent="PanelContainer/VBox/Header/IconPanel" unique_id=610199099] unique_name_in_owner = true visible = false layout_mode = 0 @@ -84,45 +75,42 @@ offset_left = -5.5 offset_top = -11.0 offset_right = 12.1 offset_bottom = 6.6 -texture = SubResource("ImageTexture_rc1wh") stretch_mode = 5 -[node name="HeaderContent" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Header"] +[node name="HeaderContent" type="HBoxContainer" parent="PanelContainer/VBox/Header" unique_id=450894660] unique_name_in_owner = true layout_mode = 2 -[node name="ToggleBodyVisibilityButton" type="Button" parent="PanelContainer/VBoxContainer/Header"] +[node name="ToggleBodyVisibilityButton" type="Button" parent="PanelContainer/VBox/Header" unique_id=1546027131] unique_name_in_owner = true custom_minimum_size = Vector2(20, 0) layout_mode = 2 size_flags_horizontal = 0 tooltip_text = "Fold/Unfold Settings" theme_override_styles/normal = SubResource("StyleBoxEmpty_ee4ub") -theme_override_styles/hover = SubResource("StyleBoxEmpty_ee4ub") theme_override_styles/pressed = SubResource("StyleBoxEmpty_ee4ub") +theme_override_styles/hover = SubResource("StyleBoxEmpty_ee4ub") theme_override_styles/disabled = SubResource("StyleBoxEmpty_ee4ub") theme_override_styles/focus = SubResource("StyleBoxEmpty_ee4ub") toggle_mode = true -icon = SubResource("ImageTexture_rc1wh") flat = true -[node name="ToggleChildrenVisibilityButton" type="Button" parent="PanelContainer/VBoxContainer/Header"] +[node name="ToggleChildrenVisibilityButton" type="Button" parent="PanelContainer/VBox/Header" unique_id=2142489134] unique_name_in_owner = true visible = false layout_mode = 2 size_flags_horizontal = 10 tooltip_text = "Collapse Contained Events" toggle_mode = true -icon = SubResource("ImageTexture_rc1wh") flat = true -[node name="Body" type="MarginContainer" parent="PanelContainer/VBoxContainer"] +[node name="Body" type="MarginContainer" parent="PanelContainer/VBox" unique_id=447556959] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 theme_override_constants/margin_left = 4 -[node name="BodyContent" type="VBoxContainer" parent="PanelContainer/VBoxContainer/Body"] +[node name="BodyContent" type="VBoxContainer" parent="PanelContainer/VBox/Body" unique_id=1278785126] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 @@ -130,4 +118,4 @@ size_flags_vertical = 3 mouse_filter = 2 [connection signal="gui_input" from="." to="." method="_on_EventNode_gui_input"] -[connection signal="toggled" from="PanelContainer/VBoxContainer/Header/ToggleBodyVisibilityButton" to="." method="_on_ToggleBodyVisibility_toggled"] +[connection signal="toggled" from="PanelContainer/VBox/Header/ToggleBodyVisibilityButton" to="." method="_on_ToggleBodyVisibility_toggled"] diff --git a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd index 816b86616..b4121c4be 100644 --- a/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd +++ b/addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd @@ -98,6 +98,7 @@ func load_timeline(resource:DialogicTimeline) -> void: page += 1 set_meta("batch_count", len(_batches)) batch_loaded.emit() + # Reset the scroll position %TimelineArea.scroll_vertical = 0 @@ -893,6 +894,8 @@ func indent_events() -> void: # will be applied to the indent after the current event var delayed_indent: int = 0 + var current_contain_events := [] + for block in event_list: if (not "resource" in block): continue @@ -900,39 +903,40 @@ func indent_events() -> void: if (not currently_hidden) and block.resource.can_contain_events and block.end_node and block.collapsed: currently_hidden = true hidden_until = block.end_node - hidden_count = 0 elif currently_hidden and block == hidden_until: - block.update_hidden_events_indicator(hidden_count) currently_hidden = false hidden_until = null elif currently_hidden: block.hide() - hidden_count += 1 else: block.show() - if block.resource is DialogicEndBranchEvent: - block.update_hidden_events_indicator(0) - delayed_indent = 0 - - if block.resource.can_contain_events: - delayed_indent = 1 + delayed_indent = 0 if block.resource.wants_to_group: indent += 1 - elif block.resource is DialogicEndBranchEvent: + if block.resource is DialogicEndBranchEvent: block.parent_node_changed() delayed_indent -= 1 if block.parent_node.resource.wants_to_group: delayed_indent -= 1 + if block.parent_node.resource.can_contain_events: + var contained : Array = current_contain_events.pop_back() + contained[0].contained_events = contained[1] + if current_contain_events: + current_contain_events[-1][1].append(block.resource) + if block.resource.can_contain_events: + delayed_indent = 1 + current_contain_events.append([block, []]) if indent >= 0: - block.set_indent(indent) + block.set_indent.call_deferred(indent) else: - block.set_indent(0) + block.set_indent.call_deferred(0) indent += delayed_indent + await get_tree().process_frame await get_tree().process_frame %TimelineArea.queue_redraw() @@ -956,8 +960,8 @@ func _on_event_popup_menu_id_pressed(id:int) -> void: OS.shell_open(item.resource.help_page_path) elif id == 3: - find_parent('EditorView').plugin_reference.get_editor_interface().set_main_screen_editor('Script') - find_parent('EditorView').plugin_reference.get_editor_interface().edit_script(item.resource.get_script(), 1, 1) + EditorInterface.set_main_screen_editor('Script') + EditorInterface.edit_script(item.resource.get_script(), 1, 1) elif id == 4 or id == 5: if id == 4: offset_blocks_by_index(selected_items, -1) diff --git a/addons/dialogic/Modules/Choice/ui_choice_end.tscn b/addons/dialogic/Modules/Choice/ui_choice_end.tscn index 835a65c6d..e8cc5733a 100644 --- a/addons/dialogic/Modules/Choice/ui_choice_end.tscn +++ b/addons/dialogic/Modules/Choice/ui_choice_end.tscn @@ -1,8 +1,8 @@ -[gd_scene load_steps=2 format=3 uid="uid://cn0wbb2lk0s22"] +[gd_scene format=3 uid="uid://cn0wbb2lk0s22"] [ext_resource type="Script" uid="uid://d28x7h2ufh3dd" path="res://addons/dialogic/Modules/Choice/ui_choice_end.gd" id="1_7qd85"] -[node name="Choice_End" type="HBoxContainer"] +[node name="Choice_End" type="HBoxContainer" unique_id=2095981025] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -11,10 +11,13 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_7qd85") -[node name="AddChoice" type="Button" parent="."] +[node name="AddChoice" type="Button" parent="." unique_id=444970161] layout_mode = 2 +theme_type_variation = &"FlatButton" +text = "Add Choice" -[node name="Label" type="Label" parent="."] +[node name="Label" type="Label" parent="." unique_id=110625294] +visible = false layout_mode = 2 [connection signal="pressed" from="AddChoice" to="." method="_on_add_choice_pressed"] diff --git a/addons/dialogic/Modules/Condition/ui_condition_end.gd b/addons/dialogic/Modules/Condition/ui_condition_end.gd index 4a5ac1d0e..8419c5628 100644 --- a/addons/dialogic/Modules/Condition/ui_condition_end.gd +++ b/addons/dialogic/Modules/Condition/ui_condition_end.gd @@ -5,6 +5,8 @@ var parent_resource: DialogicEvent = null func _ready() -> void: + $AddElif.icon = get_theme_icon("Add", "EditorIcons") + $AddElse.icon = get_theme_icon("Add", "EditorIcons") $AddElif.button_up.connect(add_elif) $AddElse.button_up.connect(add_else) diff --git a/addons/dialogic/Modules/Condition/ui_condition_end.tscn b/addons/dialogic/Modules/Condition/ui_condition_end.tscn index 00c36ba84..375eebb1e 100644 --- a/addons/dialogic/Modules/Condition/ui_condition_end.tscn +++ b/addons/dialogic/Modules/Condition/ui_condition_end.tscn @@ -1,26 +1,23 @@ -[gd_scene load_steps=2 format=3 uid="uid://dpt6fwem03sqw"] +[gd_scene format=3 uid="uid://dpt6fwem03sqw"] [ext_resource type="Script" uid="uid://hiahx6lrlm17" path="res://addons/dialogic/Modules/Condition/ui_condition_end.gd" id="1_sh52m"] -[node name="Condition_End" type="HBoxContainer"] +[node name="Condition_End" type="HBoxContainer" unique_id=1831482933] offset_right = 90.0 offset_bottom = 23.0 script = ExtResource("1_sh52m") -[node name="Label" type="Label" parent="."] -offset_top = 2.0 -offset_right = 141.0 -offset_bottom = 28.0 +[node name="Label" type="Label" parent="." unique_id=573368376] +visible = false +layout_mode = 2 text = "End of condition X" -[node name="AddElif" type="Button" parent="."] -offset_left = 145.0 -offset_right = 212.0 -offset_bottom = 31.0 +[node name="AddElif" type="Button" parent="." unique_id=375367039] +layout_mode = 2 +theme_type_variation = &"FlatButton" text = "Add Elif" -[node name="AddElse" type="Button" parent="."] -offset_left = 216.0 -offset_right = 290.0 -offset_bottom = 31.0 +[node name="AddElse" type="Button" parent="." unique_id=434472256] +layout_mode = 2 +theme_type_variation = &"FlatButton" text = "Add Else" From 5f9e07db776a4ff3011e7ed79a34da8cdb70258c Mon Sep 17 00:00:00 2001 From: Jowan-Spooner Date: Sun, 14 Dec 2025 01:43:22 +0100 Subject: [PATCH 19/19] More attempts at cleaning up Plugin Initilization logic --- addons/dialogic/plugin.gd | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/addons/dialogic/plugin.gd b/addons/dialogic/plugin.gd index eade24b39..e1069d503 100644 --- a/addons/dialogic/plugin.gd +++ b/addons/dialogic/plugin.gd @@ -2,15 +2,17 @@ extends EditorPlugin ## Preload the main panel scene -const MainPanel := preload("res://addons/dialogic/Editor/editor_main.tscn") +const MainPanel := preload("uid://de6yhw4r8jqb3") const PLUGIN_NAME := "Dialogic" const PLUGIN_HANDLER_PATH := "res://addons/dialogic/Core/DialogicGameHandler.gd" -const PLUGIN_ICON_PATH := "res://addons/dialogic/Editor/Images/plugin-icon.svg" +const PLUGIN_ICON_PATH := "uid://dybg3l5pwetne" +const PLUGIN_INSPECTOR_PATH := "uid://bok1je25mskp7" ## References used by various other scripts to quickly reference these things var editor_view: Control # the root of the dialogic editor var inspector_plugin: EditorInspectorPlugin = null + ## Initialization func _init() -> void: self.name = "DialogicPlugin" @@ -21,7 +23,6 @@ func _init() -> void: ## Activation & Editor Setup func _enable_plugin() -> void: - add_autoload_singleton(PLUGIN_NAME, PLUGIN_HANDLER_PATH) add_dialogic_default_action() @@ -30,23 +31,19 @@ func _disable_plugin() -> void: func _enter_tree() -> void: + add_autoload_singleton(PLUGIN_NAME, PLUGIN_HANDLER_PATH) + editor_view = MainPanel.instantiate() editor_view.plugin_reference = self EditorInterface.get_editor_main_screen().add_child(editor_view) - get_editor_interface().get_editor_main_screen().add_child(editor_view) _make_visible(false) - inspector_plugin = load("res://addons/dialogic/Editor/Inspector/inspector_plugin.gd").new() + inspector_plugin = load(PLUGIN_INSPECTOR_PATH).new() add_inspector_plugin(inspector_plugin) - if not ProjectSettings.has_setting("autoload/"+PLUGIN_NAME): - add_autoload_singleton(PLUGIN_NAME, PLUGIN_HANDLER_PATH) - print("[Dialogic] Dialogic was enabled, but autoload singleton was missing. It was automatically added again.") - func _exit_tree() -> void: if editor_view: - remove_control_from_bottom_panel(editor_view) editor_view.queue_free() if inspector_plugin: