-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Character Editor UI improvement suggestion (#1565)
* Big character editor update * Allow custom portrait settings + communication between sections Also re-adds the mood per portrait functionality. * Respect export range for integers This will help both for custom portrait exports and also in the theme editor. * Fix broken signal
- Loading branch information
1 parent
53ca34c
commit ae6ed99
Showing
38 changed files
with
849 additions
and
720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.tscn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[gd_scene load_steps=2 format=3] | ||
|
||
[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.gd" id="1_isys8"] | ||
|
||
[node name="Exports" type="VBoxContainer"] | ||
custom_minimum_size = Vector2(0, 35) | ||
offset_right = 367.0 | ||
offset_bottom = 82.0 | ||
script = ExtResource("1_isys8") | ||
|
||
[node name="Label" type="Label" parent="."] | ||
layout_mode = 2 | ||
text = "There are no exported variables to override. Add @export properties to the root script of your scene and make sure it's in @tool mode." | ||
autowrap_mode = 3 | ||
|
||
[node name="Grid" type="GridContainer" parent="."] | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
size_flags_vertical = 3 | ||
theme_override_constants/h_separation = 10 | ||
columns = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.tscn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://crke8suvv52c6"] | ||
|
||
[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.gd" id="1_76vf2"] | ||
[ext_resource type="PackedScene" uid="uid://dtimnsj014cu" path="res://addons/dialogic/Editor/Events/Fields/Vector2.tscn" id="2_c8kyi"] | ||
|
||
[node name="Layout" type="HFlowContainer"] | ||
offset_right = 428.0 | ||
offset_bottom = 128.0 | ||
size_flags_horizontal = 3 | ||
size_flags_vertical = 3 | ||
script = ExtResource("1_76vf2") | ||
|
||
[node name="Label3" type="Label" parent="."] | ||
layout_mode = 2 | ||
text = "Ignore Main Scale: " | ||
|
||
[node name="IgnoreScale" type="CheckBox" parent="."] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
tooltip_text = "This portrait will ignore the main scale." | ||
|
||
[node name="HBoxContainer" type="HBoxContainer" parent="."] | ||
layout_mode = 2 | ||
|
||
[node name="Label" type="Label" parent="HBoxContainer"] | ||
layout_mode = 2 | ||
text = "Scale:" | ||
|
||
[node name="PortraitScale" type="SpinBox" parent="HBoxContainer"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
tooltip_text = "A scale to be applied on top of the main scale | ||
(unless ignore main scale is pressed)." | ||
value = 100.0 | ||
allow_greater = true | ||
suffix = "%" | ||
|
||
[node name="HBoxContainer2" type="HBoxContainer" parent="."] | ||
layout_mode = 2 | ||
|
||
[node name="Label2" type="Label" parent="HBoxContainer2"] | ||
layout_mode = 2 | ||
text = "Offset:" | ||
|
||
[node name="PortraitOffset" parent="HBoxContainer2" instance=ExtResource("2_c8kyi")] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
tooltip_text = "Offset that is applied on top of the main portrait offset." | ||
|
||
[node name="MirrorOption" type="HBoxContainer" parent="."] | ||
layout_mode = 2 | ||
|
||
[node name="Label" type="Label" parent="MirrorOption"] | ||
layout_mode = 2 | ||
text = "Mirror:" | ||
|
||
[node name="PortraitMirror" type="CheckBox" parent="MirrorOption"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
tooltip_text = "Mirroring that is applied on top of the main portrait mirror." | ||
|
||
[connection signal="toggled" from="IgnoreScale" to="." method="_on_ignore_scale_toggled"] | ||
[connection signal="value_changed" from="HBoxContainer/PortraitScale" to="." method="_on_portrait_scale_value_changed"] | ||
[connection signal="value_changed" from="HBoxContainer2/PortraitOffset" to="." method="_on_portrait_offset_value_changed"] | ||
[connection signal="toggled" from="MirrorOption/PortraitMirror" to="." method="_on_portrait_mirror_toggled"] |
39 changes: 39 additions & 0 deletions
39
addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@tool | ||
extends DialogicCharacterEditorPortraitSection | ||
|
||
## Tab that allows setting an image file on a portrait. | ||
|
||
|
||
func _ready() -> void: | ||
%ImagePicker.file_filter = "*.png, *.svg" | ||
%ImagePicker.resource_icon = get_theme_icon('Image', 'EditorIcons') | ||
|
||
%ScenePicker.file_filter = "*.tscn, *.scn; Scenes" | ||
%ScenePicker.resource_icon = get_theme_icon('PackedScene', 'EditorIcons') | ||
%ScenePicker.placeholder = 'Default scene' | ||
|
||
|
||
func _load_portrait_data(data:Dictionary) -> void: | ||
%ScenePicker.set_value(data.get('scene', '')) | ||
%ImagePicker.set_value(data.get('image', '')) | ||
update_image_picker_visibility(data['scene'].is_empty()) | ||
|
||
|
||
func _on_image_picker_value_changed(prop_name:String, value:String): | ||
var data:Dictionary = selected_item.get_metadata(0) | ||
data['image'] = value | ||
changed.emit() | ||
update_preview.emit() | ||
|
||
|
||
func _on_scene_picker_value_changed(prop_name:String, value:String) -> void: | ||
var data:Dictionary = selected_item.get_metadata(0) | ||
data['scene'] = value | ||
update_image_picker_visibility(data['scene'].is_empty()) | ||
update_preview.emit() | ||
changed.emit() | ||
|
||
|
||
func update_image_picker_visibility(show= true) -> void: | ||
%ImagePicker.visible = show | ||
%ImageLabel.visible = show |
80 changes: 80 additions & 0 deletions
80
addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.tscn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
[gd_scene load_steps=7 format=3 uid="uid://djq4aasoihexj"] | ||
|
||
[ext_resource type="Script" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd" id="1_ht8lu"] | ||
[ext_resource type="PackedScene" uid="uid://7mvxuaulctcq" path="res://addons/dialogic/Editor/Events/Fields/FilePicker.tscn" id="2_k8xs0"] | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rimrq"] | ||
content_margin_left = 4.0 | ||
content_margin_top = 0.0 | ||
content_margin_right = 4.0 | ||
content_margin_bottom = 0.0 | ||
bg_color = Color(0.1, 0.1, 0.1, 0.6) | ||
border_width_bottom = 2 | ||
border_color = Color(0, 0, 0, 0.6) | ||
corner_radius_top_left = 3 | ||
corner_radius_top_right = 3 | ||
corner_radius_bottom_right = 3 | ||
corner_radius_bottom_left = 3 | ||
corner_detail = 5 | ||
|
||
[sub_resource type="Image" id="Image_4x7i8"] | ||
data = { | ||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 131, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 128, 128, 4, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 93, 93, 55, 255, 97, 97, 58, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 98, 98, 47, 255, 97, 97, 42, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 94, 94, 46, 255, 93, 93, 236, 255, 93, 93, 233, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 93, 93, 252, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0), | ||
"format": "RGBA8", | ||
"height": 16, | ||
"mipmaps": false, | ||
"width": 16 | ||
} | ||
|
||
[sub_resource type="ImageTexture" id="ImageTexture_y34ar"] | ||
image = SubResource("Image_4x7i8") | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bvmrg"] | ||
content_margin_left = 4.0 | ||
content_margin_top = 0.0 | ||
content_margin_right = 4.0 | ||
content_margin_bottom = 0.0 | ||
bg_color = Color(0.1, 0.1, 0.1, 0.6) | ||
border_width_bottom = 2 | ||
border_color = Color(0, 0, 0, 0.6) | ||
corner_radius_top_left = 3 | ||
corner_radius_top_right = 3 | ||
corner_radius_bottom_right = 3 | ||
corner_radius_bottom_left = 3 | ||
corner_detail = 5 | ||
|
||
[node name="General" type="GridContainer"] | ||
offset_right = 298.0 | ||
offset_bottom = 86.0 | ||
size_flags_horizontal = 3 | ||
columns = 2 | ||
script = ExtResource("1_ht8lu") | ||
|
||
[node name="Label2" type="Label" parent="."] | ||
layout_mode = 2 | ||
text = "Scene: " | ||
|
||
[node name="ScenePicker" parent="." instance=ExtResource("2_k8xs0")] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
theme_override_styles/panel = SubResource("StyleBoxFlat_rimrq") | ||
file_filter = "*.tscn, *.scn; Scenes" | ||
placeholder = "Default scene" | ||
resource_icon = SubResource("ImageTexture_y34ar") | ||
|
||
[node name="ImageLabel" type="Label" parent="."] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
text = "Image: " | ||
|
||
[node name="ImagePicker" parent="." instance=ExtResource("2_k8xs0")] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
theme_override_styles/panel = SubResource("StyleBoxFlat_bvmrg") | ||
file_filter = "*.png, *.svg" | ||
resource_icon = SubResource("ImageTexture_y34ar") | ||
|
||
[connection signal="value_changed" from="ScenePicker" to="." method="_on_scene_picker_value_changed"] | ||
[connection signal="value_changed" from="ImagePicker" to="." method="_on_image_picker_value_changed"] |
2 changes: 1 addition & 1 deletion
2
...terEditor/character_editor_tab_general.gd → ...racterEditor/char_edit_section_general.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.