Skip to content

Commit f8b4378

Browse files
Add empty mode for character editor (#1517)
Makes it so when no character is opened you don't see the empty character editor and instead a prompt to create or open a character.
1 parent 677ab9b commit f8b4378

File tree

4 files changed

+98
-23
lines changed

4 files changed

+98
-23
lines changed

addons/dialogic/Editor/CharacterEditor/character_editor.gd

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,8 @@ func _register() -> void:
3232
load("res://addons/dialogic/Editor/Images/Toolbar/add-character.svg"),
3333
'Add Character',
3434
self)
35-
add_character_button.pressed.connect(
36-
editors_manager.show_add_resource_dialog.bind(
37-
new_character,
38-
'*.dch; DialogicCharacter',
39-
'Create new character',
40-
'character',
41-
))
35+
add_character_button.pressed.connect(_on_create_timeline_button_pressed)
36+
$NoCharacterScreen.show()
4237

4338

4439
# Called when a character is opened somehow
@@ -66,6 +61,8 @@ func _open_resource(resource:Resource) -> void:
6661

6762
loading = false
6863
character_loaded.emit(resource.resource_path)
64+
65+
$NoCharacterScreen.hide()
6966

7067

7168
func _save() -> void:
@@ -116,6 +113,8 @@ func _ready() -> void:
116113
get_parent().set_tab_title(get_index(), 'Character')
117114
get_parent().set_tab_icon(get_index(), load("res://addons/dialogic/Editor/Images/Resources/character.svg"))
118115

116+
$NoCharacterScreen.color = get_theme_color("dark_color_2", "Editor")
117+
119118
setup_portrait_list_tab()
120119

121120
setup_portrait_settings_tab()
@@ -125,7 +124,7 @@ func _ready() -> void:
125124
_on_PreviewMode_item_selected(%PreviewMode.selected)
126125

127126
## General Styling
128-
var panel_style = DCSS.inline({
127+
var panel_style := DCSS.inline({
129128
'border-radius': 3,
130129
'border': 0,
131130
'border_color':get_theme_color("dark_color_3", "Editor"),
@@ -512,3 +511,12 @@ func _on_full_preview_available_rect_resized():
512511
if current_preview_mode == PreviewModes.Full:
513512
update_preview()
514513

514+
515+
func _on_create_timeline_button_pressed():
516+
editors_manager.show_add_resource_dialog(
517+
new_character,
518+
'*.dch; DialogicCharacter',
519+
'Create new character',
520+
'character',
521+
)
522+

addons/dialogic/Editor/CharacterEditor/character_editor.tscn

Lines changed: 78 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_scene load_steps=15 format=3 uid="uid://dlskc36c5hrwv"]
1+
[gd_scene load_steps=19 format=3 uid="uid://dlskc36c5hrwv"]
22

33
[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/character_editor.gd" id="2"]
44
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn" id="2_01va3"]
@@ -30,7 +30,7 @@ corner_radius_top_right = 2
3030
corner_radius_bottom_right = 2
3131
corner_radius_bottom_left = 2
3232

33-
[sub_resource type="Image" id="Image_cjbmo"]
33+
[sub_resource type="Image" id="Image_s8imb"]
3434
data = {
3535
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0),
3636
"format": "RGBA8",
@@ -40,11 +40,51 @@ data = {
4040
}
4141

4242
[sub_resource type="ImageTexture" id="ImageTexture_mpcxh"]
43-
image = SubResource("Image_cjbmo")
43+
image = SubResource("Image_s8imb")
4444

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

47-
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q0yo5"]
47+
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_k4a75"]
48+
content_margin_left = 4.0
49+
content_margin_top = 0.0
50+
content_margin_right = 4.0
51+
content_margin_bottom = 0.0
52+
bg_color = Color(0.1, 0.1, 0.1, 0.6)
53+
border_width_bottom = 2
54+
border_color = Color(0, 0, 0, 0.6)
55+
corner_radius_top_left = 3
56+
corner_radius_top_right = 3
57+
corner_radius_bottom_right = 3
58+
corner_radius_bottom_left = 3
59+
corner_detail = 5
60+
61+
[sub_resource type="Image" id="Image_d7ala"]
62+
data = {
63+
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0),
64+
"format": "RGBA8",
65+
"height": 16,
66+
"mipmaps": false,
67+
"width": 16
68+
}
69+
70+
[sub_resource type="ImageTexture" id="ImageTexture_kntou"]
71+
image = SubResource("Image_d7ala")
72+
73+
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8kdal"]
74+
content_margin_left = 4.0
75+
content_margin_top = 0.0
76+
content_margin_right = 4.0
77+
content_margin_bottom = 0.0
78+
bg_color = Color(0.1, 0.1, 0.1, 0.6)
79+
border_width_bottom = 2
80+
border_color = Color(0, 0, 0, 0.6)
81+
corner_radius_top_left = 3
82+
corner_radius_top_right = 3
83+
corner_radius_bottom_right = 3
84+
corner_radius_bottom_left = 3
85+
corner_detail = 5
86+
87+
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mnrmp"]
4888
content_margin_left = 4.0
4989
content_margin_top = 4.0
5090
content_margin_right = 4.0
@@ -366,8 +406,9 @@ text = "Image: "
366406
unique_name_in_owner = true
367407
layout_mode = 2
368408
size_flags_horizontal = 3
409+
theme_override_styles/panel = SubResource("StyleBoxFlat_k4a75")
369410
file_filter = "*.png, *.svg"
370-
resource_icon = SubResource("ImageTexture_mpcxh")
411+
resource_icon = SubResource("ImageTexture_kntou")
371412

372413
[node name="Scene" type="ScrollContainer" parent="Split/RightSection/PortraitSettingsSection"]
373414
visible = false
@@ -396,9 +437,10 @@ text = "Scene: "
396437
unique_name_in_owner = true
397438
layout_mode = 2
398439
size_flags_horizontal = 3
440+
theme_override_styles/panel = SubResource("StyleBoxFlat_8kdal")
399441
file_filter = "*.tscn"
400442
placeholder = "Default scene"
401-
resource_icon = SubResource("ImageTexture_mpcxh")
443+
resource_icon = SubResource("ImageTexture_kntou")
402444

403445
[node name="Label2" type="Label" parent="Split/RightSection/PortraitSettingsSection/Scene/Flow/GridContainer"]
404446
layout_mode = 2
@@ -470,7 +512,7 @@ layout_mode = 2
470512
visible = false
471513
custom_minimum_size = Vector2(0, 35)
472514
layout_mode = 2
473-
theme_override_styles/panel = SubResource("StyleBoxFlat_q0yo5")
515+
theme_override_styles/panel = SubResource("StyleBoxFlat_mnrmp")
474516
horizontal_scroll_mode = 0
475517
script = ExtResource("7_4enie")
476518

@@ -481,6 +523,34 @@ size_flags_vertical = 3
481523
theme_override_constants/h_separation = 10
482524
columns = 2
483525

526+
[node name="NoCharacterScreen" type="ColorRect" parent="."]
527+
layout_mode = 2
528+
size_flags_horizontal = 3
529+
color = Color(0.145098, 0.145098, 0.145098, 1)
530+
531+
[node name="CenterContainer" type="CenterContainer" parent="NoCharacterScreen"]
532+
layout_mode = 1
533+
anchors_preset = 15
534+
anchor_right = 1.0
535+
anchor_bottom = 1.0
536+
grow_horizontal = 2
537+
grow_vertical = 2
538+
539+
[node name="VBoxContainer" type="VBoxContainer" parent="NoCharacterScreen/CenterContainer"]
540+
custom_minimum_size = Vector2(250, 0)
541+
layout_mode = 2
542+
543+
[node name="Label" type="Label" parent="NoCharacterScreen/CenterContainer/VBoxContainer"]
544+
layout_mode = 2
545+
text = "No character opened.
546+
Create a character or double-click one in the file system dock."
547+
horizontal_alignment = 1
548+
autowrap_mode = 3
549+
550+
[node name="CreateTimelineButton" type="Button" parent="NoCharacterScreen/CenterContainer/VBoxContainer"]
551+
layout_mode = 2
552+
text = "Create New Character"
553+
484554
[connection signal="button_clicked" from="Split/Editor/PortraitListSection/Portraits/Panel/PortraitTree" to="." method="_on_portrait_tree_button_clicked"]
485555
[connection signal="resized" from="Split/RightSection/PortraitPreviewSection/FullPreviewAvailableRect" to="." method="_on_full_preview_available_rect_resized"]
486556
[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Image/Flow/GridContainer/ImagePicker" to="Split/RightSection/PortraitSettingsSection/Image" method="_on_image_picker_value_changed"]
@@ -490,3 +560,4 @@ columns = 2
490560
[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer2/PortraitOffsetX" to="Split/RightSection/PortraitSettingsSection/Layout" method="_on_portrait_offset_x_value_changed"]
491561
[connection signal="value_changed" from="Split/RightSection/PortraitSettingsSection/Layout/Flow/HBoxContainer2/PortraitOffsetY" to="Split/RightSection/PortraitSettingsSection/Layout" method="_on_portrait_offset_y_value_changed"]
492562
[connection signal="toggled" from="Split/RightSection/PortraitSettingsSection/Layout/Flow/MirrorOption/PortraitMirror" to="Split/RightSection/PortraitSettingsSection/Layout" method="_on_portrait_mirror_toggled"]
563+
[connection signal="pressed" from="NoCharacterScreen/CenterContainer/VBoxContainer/CreateTimelineButton" to="." method="_on_create_timeline_button_pressed"]

addons/dialogic/Editor/Common/sidebar.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ func _on_resources_list_item_selected(index:int) -> void:
9191
editors_manager.edit_resource(load(%ResourcesList.get_item_metadata(index)))
9292

9393

94-
func _on_resources_list_item_clicked(index: int, at_position: Vector2, mouse_button_index: int):
94+
func _on_resources_list_item_clicked(index: int, at_position: Vector2, mouse_button_index: int) -> void:
9595
# If clicked with the middle mouse button, remove the item from the list
9696
if mouse_button_index == 3:
97-
var new_list = []
97+
var new_list := []
9898
for entry in ProjectSettings.get_setting('dialogic/editor/last_resources', []):
9999
if entry != %ResourcesList.get_item_metadata(index):
100100
new_list.append(entry)

addons/dialogic/Editor/TimelineEditor/timeline_editor.gd

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@ func _register() -> void:
2020
load("res://addons/dialogic/Editor/Images/Toolbar/add-timeline.svg"),
2121
"Add Timeline",
2222
self)
23-
add_timeline_button.pressed.connect(editors_manager.show_add_resource_dialog.bind(
24-
new_timeline,
25-
'*.dtl; DialogicTimeline',
26-
'Create new timeline',
27-
'timeline',
28-
))
23+
add_timeline_button.pressed.connect(_on_create_timeline_button_pressed)
2924
# play timeline button
3025
var play_timeline_button: Button = editors_manager.add_custom_button(
3126
"Play Timeline",
@@ -142,6 +137,7 @@ func _ready():
142137
get_parent().set_tab_title(get_index(), 'Timeline')
143138
get_parent().set_tab_icon(get_index(), get_theme_icon("TripleBar", "EditorIcons"))
144139

140+
145141
func _on_create_timeline_button_pressed():
146142
editors_manager.show_add_resource_dialog(
147143
new_timeline,

0 commit comments

Comments
 (0)