Skip to content

Commit af9730b

Browse files
Changed some UI and redesigned character editor layout (#1674)
* Changed some UI and redesigned character editor Co-authored-by: Jowan-Spooner <[email protected]>
1 parent 89aaa0e commit af9730b

File tree

12 files changed

+227
-196
lines changed

12 files changed

+227
-196
lines changed

addons/dialogic/Editor/CharacterEditor/character_editor.gd

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ func _ready() -> void:
126126

127127
%RealPreviewPivot.texture = get_theme_icon("EditorPivot", "EditorIcons")
128128

129+
%MainSettingsCollapse.icon = get_theme_icon("GuiVisibilityVisible", "EditorIcons")
130+
131+
await find_parent('EditorView').ready
132+
129133
# Add general tabs
130134
add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_section_general.tscn").instantiate(), %MainSettingsSections)
131135
add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.tscn").instantiate(), %MainSettingsSections)
@@ -161,7 +165,7 @@ func add_settings_section(edit:Control, parent:Node) -> void:
161165
button.pressed.connect(_on_section_button_pressed.bind(button))
162166
button.focus_mode = Control.FOCUS_NONE
163167
button.icon = get_theme_icon("CodeFoldDownArrow", "EditorIcons")
164-
button.add_theme_color_override('icon_normal_color', get_theme_color("accent_color", "Editor"))
168+
button.add_theme_color_override('icon_normal_color', get_theme_color("font_color", "DialogicSection"))
165169
parent.add_child(button)
166170
parent.add_child(edit)
167171
parent.add_child(HSeparator.new())
@@ -542,3 +546,15 @@ func _on_fit_preview_toggle_toggled(button_pressed):
542546

543547
func _on_reference_manger_button_pressed():
544548
editors_manager.reference_manager.open()
549+
550+
551+
func _on_main_settings_collapse_toggled(button_pressed):
552+
%MainSettingsTitle.visible = !button_pressed
553+
%MainSettingsScroll.visible = !button_pressed
554+
# %MainHSplit.collapsed = button_pressed
555+
if button_pressed:
556+
%MainSettings.hide()
557+
%MainSettingsCollapse.icon = get_theme_icon("GuiVisibilityHidden", "EditorIcons")
558+
else:
559+
%MainSettings.show()
560+
%MainSettingsCollapse.icon = get_theme_icon("GuiVisibilityVisible", "EditorIcons")

addons/dialogic/Editor/CharacterEditor/character_editor.tscn

Lines changed: 124 additions & 88 deletions
Large diffs are not rendered by default.

addons/dialogic/Editor/Common/side_bar.tscn

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
[gd_scene load_steps=3 format=3 uid="uid://cwe3r2tbh2og1"]
1+
[gd_scene load_steps=5 format=3 uid="uid://cwe3r2tbh2og1"]
22

33
[ext_resource type="Script" path="res://addons/dialogic/Editor/Common/sidebar.gd" id="1_jnq65"]
44

55
[sub_resource type="Theme" id="Theme_pn0f4"]
66
VBoxContainer/constants/separation = 4
77

8+
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_gxwm6"]
9+
10+
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_n8rql"]
11+
812
[node name="SideBar" type="VSplitContainer"]
913
custom_minimum_size = Vector2(100, 130)
1014
anchors_preset = 15
@@ -47,6 +51,8 @@ unique_name_in_owner = true
4751
layout_mode = 2
4852
size_flags_horizontal = 3
4953
text = "No resource"
54+
horizontal_alignment = 1
55+
vertical_alignment = 1
5056
text_overrun_behavior = 1
5157

5258
[node name="Search" type="LineEdit" parent="VBox/Margin/VSplitContainer/VBox"]
@@ -71,6 +77,9 @@ size_flags_vertical = 3
7177
unique_name_in_owner = true
7278
layout_mode = 2
7379
size_flags_vertical = 3
80+
theme_override_styles/selected = SubResource("StyleBoxEmpty_gxwm6")
81+
theme_override_styles/selected_focus = SubResource("StyleBoxEmpty_n8rql")
82+
allow_reselect = true
7483
same_column_width = true
7584

7685
[node name="CurrentVersion" type="Label" parent="VBox"]

addons/dialogic/Editor/Common/sidebar.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ func _ready():
3030

3131
%CurrentResource.add_theme_stylebox_override('normal', get_theme_stylebox('normal', 'LineEdit'))
3232

33+
%ContentList.add_theme_color_override("font_hovered_color", get_theme_color("warning_color", "Editor"))
34+
%ContentList.add_theme_color_override("font_selected_color", get_theme_color("property_color_z", "Editor"))
35+
3336
## MARGINS
3437
$VBox/Margin.set("theme_override_constants/margin_left", 4 * editor_scale)
3538
$VBox/Margin.set("theme_override_constants/margin_bottom", 4 * editor_scale)

addons/dialogic/Editor/Common/toolbar.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func add_icon_button(icon: Texture, tooltip: String) -> Button:
2424
button.flat = true
2525
button.size_flags_vertical = Control.SIZE_SHRINK_BEGIN
2626
button.add_theme_color_override('icon_hover_color', get_theme_color('warning_color', 'Editor'))
27+
button.add_theme_stylebox_override('focus', StyleBoxEmpty.new())
2728
add_child(button)
2829
move_child(button, -2)
2930
return button

addons/dialogic/Editor/Settings/settings_translation.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func _ready() -> void:
3434
%TransRemove.pressed.connect(_on_erase_translations_pressed)
3535

3636

37+
3738
func _refresh() -> void:
3839
loading = true
3940
%TransEnabled.button_pressed = ProjectSettings.get_setting('dialogic/translation/enabled', false)

addons/dialogic/Editor/Settings/settings_translation.tscn

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
[gd_scene load_steps=8 format=3 uid="uid://chpb1mj03xjxv"]
1+
[gd_scene load_steps=7 format=3 uid="uid://chpb1mj03xjxv"]
22

33
[ext_resource type="Script" path="res://addons/dialogic/Editor/Settings/settings_translation.gd" id="1_dvmyi"]
44
[ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="2_k2lou"]
55
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/ComplexPicker.tscn" id="3_dq4j2"]
66
[ext_resource type="PackedScene" uid="uid://7mvxuaulctcq" path="res://addons/dialogic/Editor/Events/Fields/FilePicker.tscn" id="4_kvsma"]
77

8-
[sub_resource type="Image" id="Image_2imc3"]
8+
[sub_resource type="Image" id="Image_o33h3"]
99
data = {
1010
"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),
1111
"format": "RGBA8",
@@ -14,22 +14,8 @@ data = {
1414
"width": 16
1515
}
1616

17-
[sub_resource type="ImageTexture" id="ImageTexture_udy8i"]
18-
image = SubResource("Image_2imc3")
19-
20-
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ije5k"]
21-
content_margin_left = 4.0
22-
content_margin_top = 0.0
23-
content_margin_right = 4.0
24-
content_margin_bottom = 0.0
25-
bg_color = Color(0.1, 0.1, 0.1, 0.6)
26-
border_width_bottom = 2
27-
border_color = Color(0, 0, 0, 0.6)
28-
corner_radius_top_left = 3
29-
corner_radius_top_right = 3
30-
corner_radius_bottom_right = 3
31-
corner_radius_bottom_left = 3
32-
corner_detail = 5
17+
[sub_resource type="ImageTexture" id="ImageTexture_w0vi3"]
18+
image = SubResource("Image_o33h3")
3319

3420
[node name="Translations" type="VBoxContainer"]
3521
anchors_preset = 15
@@ -87,7 +73,7 @@ text = "Testing locale"
8773
layout_mode = 2
8874
tooltip_text = "Change this locale to test your game in a different language (only in-editor).
8975
Equivalent of the testing local project setting. "
90-
texture = SubResource("ImageTexture_udy8i")
76+
texture = SubResource("ImageTexture_w0vi3")
9177
hint_text = "Change this locale to test your game in a different language (only in-editor).
9278
Equivalent of the testing local project setting. "
9379

@@ -125,7 +111,7 @@ text = "Default locale"
125111
[node name="HintTooltip" parent="TranslationSettings/VBoxContainer/Grid/VBox" instance=ExtResource("2_k2lou")]
126112
layout_mode = 2
127113
tooltip_text = "This should be the local of the language your game is written in."
128-
texture = SubResource("ImageTexture_udy8i")
114+
texture = SubResource("ImageTexture_w0vi3")
129115
hint_text = "This should be the local of the language your game is written in."
130116

131117
[node name="OrigLocale" parent="TranslationSettings/VBoxContainer/Grid" instance=ExtResource("3_dq4j2")]
@@ -143,7 +129,7 @@ text = "Translation file mode"
143129
layout_mode = 2
144130
tooltip_text = "You can either create one csv with all the strings from the whole
145131
project or one csv file per timeline (will be placed next to that timeline). "
146-
texture = SubResource("ImageTexture_udy8i")
132+
texture = SubResource("ImageTexture_w0vi3")
147133
hint_text = "You can either create one csv with all the strings from the whole
148134
project or one csv file per timeline (will be placed next to that timeline). "
149135

@@ -167,14 +153,13 @@ text = "Translations folder"
167153
[node name="HintTooltip3" parent="TranslationSettings/VBoxContainer/Grid/TransFile" instance=ExtResource("2_k2lou")]
168154
layout_mode = 2
169155
tooltip_text = "Choose a folder general translations will be saved to. "
170-
texture = SubResource("ImageTexture_udy8i")
156+
texture = SubResource("ImageTexture_w0vi3")
171157
hint_text = "Choose a folder general translations will be saved to. "
172158

173159
[node name="TransFolderPicker" parent="TranslationSettings/VBoxContainer/Grid" instance=ExtResource("4_kvsma")]
174160
unique_name_in_owner = true
175161
layout_mode = 2
176162
size_flags_horizontal = 3
177-
theme_override_styles/panel = SubResource("StyleBoxFlat_ije5k")
178163
file_mode = 2
179164

180165
[node name="HSeparator6" type="VSeparator" parent="TranslationSettings"]
@@ -195,7 +180,7 @@ text = "Actions"
195180
[node name="HintTooltip4" parent="TranslationSettings/VBoxContainer2/HBoxContainer" instance=ExtResource("2_k2lou")]
196181
layout_mode = 2
197182
tooltip_text = "Check the Information to learn more about the individual actions."
198-
texture = SubResource("ImageTexture_udy8i")
183+
texture = SubResource("ImageTexture_w0vi3")
199184
hint_text = "Check the Information to learn more about the individual actions."
200185

201186
[node name="Actions" type="GridContainer" parent="TranslationSettings/VBoxContainer2"]
@@ -210,7 +195,7 @@ text = "Update CSV files"
210195
[node name="HintTooltip5" parent="TranslationSettings/VBoxContainer2/Actions" instance=ExtResource("2_k2lou")]
211196
layout_mode = 2
212197
tooltip_text = "Will check all timelines for events that haven't been added to the csv file(s) and adds them. "
213-
texture = SubResource("ImageTexture_udy8i")
198+
texture = SubResource("ImageTexture_w0vi3")
214199
hint_text = "Will check all timelines for events that haven't been added to the csv file(s) and adds them. "
215200

216201
[node name="CollectTranslations" type="Button" parent="TranslationSettings/VBoxContainer2/Actions"]
@@ -224,7 +209,7 @@ tooltip_text = "When you've added translations to a csv file,
224209
godot will import them as .translation files.
225210
These have to be added to a list (Project Settings > Localization)
226211
and this is a quick way to do so."
227-
texture = SubResource("ImageTexture_udy8i")
212+
texture = SubResource("ImageTexture_w0vi3")
228213
hint_text = "When you've added translations to a csv file,
229214
godot will import them as .translation files.
230215
These have to be added to a list (Project Settings > Localization)
@@ -246,7 +231,7 @@ layout_mode = 2
246231
tooltip_text = "Be very careful with this button. It will try to delete any
247232
.csv and .translation files that are related to dialogic.
248233
It will also remove translation ids from all events. "
249-
texture = SubResource("ImageTexture_udy8i")
234+
texture = SubResource("ImageTexture_w0vi3")
250235
hint_text = "Be very careful with this button. It will try to delete any
251236
.csv and .translation files that are related to dialogic.
252237
It will also remove translation ids from all events. "
@@ -263,7 +248,8 @@ layout_mode = 2
263248
layout_mode = 2
264249
size_flags_horizontal = 3
265250

266-
[node name="Title2" type="Label" parent="InfoSection/Setup"]
251+
[node name="SetupTitle" type="Label" parent="InfoSection/Setup"]
252+
unique_name_in_owner = true
267253
layout_mode = 2
268254
theme_type_variation = &"DialogicSection"
269255
text = "Setting up translations"
@@ -284,7 +270,8 @@ layout_mode = 2
284270
layout_mode = 2
285271
size_flags_horizontal = 3
286272

287-
[node name="Title" type="Label" parent="InfoSection/Workflow"]
273+
[node name="WorkflowTitle" type="Label" parent="InfoSection/Workflow"]
274+
unique_name_in_owner = true
288275
layout_mode = 2
289276
theme_type_variation = &"DialogicSection"
290277
text = "How to work with translations"

addons/dialogic/Editor/TimelineEditor/VisualEditor/timeline_editor_visual.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ func add_event_node(event_resource:DialogicEvent, at_index:int = -1, auto_select
854854
piece.content_changed.connect(something_changed)
855855
if event_resource.event_name == "Label":
856856
piece.content_changed.connect(update_content_list)
857+
piece.tree_exited.connect(update_content_list)
857858
if at_index == -1:
858859
if len(selected_items) != 0:
859860
selected_items[0].add_sibling(piece)

addons/dialogic/Editor/editor_main.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func update_theme_additions():
5353
theme.set_type_variation('DialogicSubTitle', 'Label')
5454
theme.set_font('font', 'DialogicSubTitle', get_theme_font("title", "EditorFonts"))
5555
theme.set_font_size('font_size', 'DialogicSubTitle', get_theme_font_size("doc_size", "EditorFonts"))
56+
theme.set_color('font_color', 'DialogicSubTitle', get_theme_color('accent_color', 'Editor'))
5657

5758
theme.set_type_variation('DialogicPanelA', 'PanelContainer')
5859
var panel_style := DCSS.inline({
@@ -120,7 +121,7 @@ func update_theme_additions():
120121

121122
theme.set_type_variation('DialogicSection', 'Label')
122123
theme.set_font('font', 'DialogicSection', get_theme_font("main_msdf", "EditorFonts"))
123-
theme.set_color('font_color', 'DialogicSection', get_theme_color("accent_color", "Editor"))
124+
theme.set_color('font_color', 'DialogicSection', get_theme_color("property_color_z", "Editor"))
124125
theme.set_font_size('font_size', 'DialogicSection', get_theme_font_size("doc_size", "EditorFonts"))
125126

126127
theme.set_type_variation('DialogicSettingsSection', 'DialogicSection')

0 commit comments

Comments
 (0)