Skip to content

Commit

Permalink
Event UI updates (#1477)
Browse files Browse the repository at this point in the history
- newly organized event categories
- newly organized event colors
- fixed event button sidebar not switching to small mode
- added save icon
  • Loading branch information
Jowan-Spooner authored Mar 20, 2023
1 parent cbb6915 commit d6bf596
Show file tree
Hide file tree
Showing 22 changed files with 86 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func load_event_buttons() -> void:
%RightSidebar.custom_minimum_size.x = 50 * _scale

$View.split_offset = -ProjectSettings.get_setting('dialogic/editor/visual_timeline_editor_sidebar', 200)
sidebar_collapsed = !%RightSidebar.size.y < 120
sidebar_collapsed = !%RightSidebar.size.y < 150*_scale
_on_right_sidebar_resized()

################################################################################
Expand Down Expand Up @@ -901,7 +901,8 @@ func _on_event_popup_menu_index_pressed(index:int) -> void:


func _on_right_sidebar_resized() -> void:
if %RightSidebar.size.x < 120 and !sidebar_collapsed:
var _scale := DialogicUtil.get_editor_scale()
if %RightSidebar.size.x < 150*_scale and !sidebar_collapsed:
sidebar_collapsed = true
for con in %RightSidebar.get_node('EventContainer').get_children():
if con.get_child_count() == 0:
Expand All @@ -912,7 +913,7 @@ func _on_right_sidebar_resized() -> void:
for button in con.get_children():
button.toggle_name(false)

elif %RightSidebar.size.x > 120 and sidebar_collapsed:
elif %RightSidebar.size.x > 150*_scale and sidebar_collapsed:
sidebar_collapsed = false
for con in %RightSidebar.get_node('EventContainer').get_children():
if con.get_child_count() == 0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_phyjj"]
content_margin_top = 10.0

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_y5dg1"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ncv0v"]

[sub_resource type="Theme" id="Theme_ycwn2"]
PopupMenu/colors/font_color_hover = Color(0.44, 0.73, 0.98, 1)
PopupMenu/styles/hover = SubResource("StyleBoxEmpty_y5dg1")
PopupMenu/styles/hover = SubResource("StyleBoxEmpty_ncv0v")
PopupMenu/styles/panel = ExtResource("4_cqp1m")

[sub_resource type="Image" id="Image_5sal8"]
[sub_resource type="Image" id="Image_wmnvf"]
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",
Expand All @@ -25,8 +25,8 @@ data = {
"width": 16
}

[sub_resource type="ImageTexture" id="ImageTexture_cm3pl"]
image = SubResource("Image_5sal8")
[sub_resource type="ImageTexture" id="ImageTexture_o5wl4"]
image = SubResource("Image_wmnvf")

[node name="TimelineVisualEditor" type="MarginContainer"]
anchors_preset = 15
Expand Down Expand Up @@ -66,22 +66,22 @@ unique_name_in_owner = true
theme = SubResource("Theme_ycwn2")
item_count = 6
item_0/text = "Documentation"
item_0/icon = SubResource("ImageTexture_cm3pl")
item_0/icon = SubResource("ImageTexture_o5wl4")
item_0/id = 0
item_1/text = ""
item_1/id = -1
item_1/separator = true
item_2/text = "Move up"
item_2/icon = SubResource("ImageTexture_cm3pl")
item_2/icon = SubResource("ImageTexture_o5wl4")
item_2/id = 2
item_3/text = "Move down"
item_3/icon = SubResource("ImageTexture_cm3pl")
item_3/icon = SubResource("ImageTexture_o5wl4")
item_3/id = 3
item_4/text = ""
item_4/id = -1
item_4/separator = true
item_5/text = "Delete"
item_5/icon = SubResource("ImageTexture_cm3pl")
item_5/icon = SubResource("ImageTexture_o5wl4")
item_5/id = 5
script = ExtResource("4_ugiq6")

Expand All @@ -100,6 +100,7 @@ size_flags_vertical = 3
layout_mode = 2

[node name="Label" type="Label" parent="View/RightSidebar/EventContainer/HBoxContainer6"]
visible = false
layout_mode = 2
text = "Main"

Expand All @@ -115,6 +116,7 @@ size_flags_horizontal = 3
layout_mode = 2

[node name="Label2" type="Label" parent="View/RightSidebar/EventContainer/HBoxContainer5"]
visible = false
layout_mode = 2
text = "Logic"

Expand All @@ -130,6 +132,7 @@ size_flags_horizontal = 3
layout_mode = 2

[node name="Label3" type="Label" parent="View/RightSidebar/EventContainer/HBoxContainer3"]
visible = false
layout_mode = 2
text = "Timeline"

Expand All @@ -145,8 +148,9 @@ size_flags_horizontal = 3
layout_mode = 2

[node name="Label4" type="Label" parent="View/RightSidebar/EventContainer/HBoxContainer4"]
visible = false
layout_mode = 2
text = "Audio/Visual"
text = "Audio"

[node name="HSeparator2" type="HSeparator" parent="View/RightSidebar/EventContainer/HBoxContainer4"]
layout_mode = 2
Expand All @@ -160,6 +164,7 @@ size_flags_horizontal = 3
layout_mode = 2

[node name="Label5" type="Label" parent="View/RightSidebar/EventContainer/HBoxContainer"]
visible = false
layout_mode = 2
text = "Godot"

Expand All @@ -175,6 +180,7 @@ size_flags_horizontal = 3
layout_mode = 2

[node name="Label6" type="Label" parent="View/RightSidebar/EventContainer/OtherContainer"]
visible = false
layout_mode = 2
text = "Other"

Expand All @@ -186,6 +192,22 @@ size_flags_horizontal = 3
layout_mode = 2
size_flags_horizontal = 3

[node name="HelpersContainer" type="HBoxContainer" parent="View/RightSidebar/EventContainer"]
layout_mode = 2

[node name="Label6" type="Label" parent="View/RightSidebar/EventContainer/HelpersContainer"]
visible = false
layout_mode = 2
text = "Helpers"

[node name="HSeparator2" type="HSeparator" parent="View/RightSidebar/EventContainer/HelpersContainer"]
layout_mode = 2
size_flags_horizontal = 3

[node name="FlexContainer6" type="HFlowContainer" parent="View/RightSidebar/EventContainer"]
layout_mode = 2
size_flags_horizontal = 3

[node name="Spacer" type="Control" parent="View/RightSidebar/EventContainer"]
layout_mode = 2

Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Events/Audio/event_music.gd
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func _execute() -> void:
func _init() -> void:
event_name = "Music"
set_default_color('Color5')
event_category = Category.AudioVisual
event_category = Category.Audio
event_sorting_index = 2
expand_by_default = false

Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Events/Audio/event_sound.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func _execute() -> void:
func _init() -> void:
event_name = "Sound"
set_default_color('Color5')
event_category = Category.AudioVisual
event_category = Category.Audio
event_sorting_index = 3
expand_by_default = false
help_page_path = "https://dialogic.coppolaemilio.com"
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Events/Background/event_background.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func _execute() -> void:
func _init() -> void:
event_name = "Background"
set_default_color('Color4')
event_category = Category.AudioVisual
event_category = Category.Other
event_sorting_index = 0
expand_by_default = false

Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Events/Character/event_position.gd
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func _execute() -> void:
func _init() -> void:
event_name = "Position"
set_default_color('Color2')
event_category = Category.Main
event_category = Category.Other
event_sorting_index = 2
continue_at_end = true
expand_by_default = false
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Events/Comment/event_comment.gd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func _execute() -> void:
func _init() -> void:
event_name = "Comment"
set_default_color('Color6')
event_category = Category.Other
event_category = Category.Helpers
event_sorting_index = 0
continue_at_end = true

Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Events/End/event_end.gd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func _execute() -> void:

func _init() -> void:
event_name = "End Timeline"
set_default_color('Color4')
set_default_color('Color6')
event_category = Category.Timeline
event_sorting_index = 10

Expand Down
4 changes: 2 additions & 2 deletions addons/dialogic/Events/History/event_history.gd
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func _execute() -> void:
func _init() -> void:
event_name = "History"
set_default_color('Color6')
event_category = Category.AudioVisual
event_sorting_index = 0
event_category = Category.Other
event_sorting_index = 20
expand_by_default = false


Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Events/Jump/event_jump.gd
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func _execute() -> void:

func _init() -> void:
event_name = "Jump"
set_default_color('Color2')
set_default_color('Color3')
event_category = Category.Timeline
event_sorting_index = 0
expand_by_default = false
Expand Down
2 changes: 1 addition & 1 deletion addons/dialogic/Events/Jump/event_label.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func _execute() -> void:

func _init() -> void:
event_name = "Label"
set_default_color('Color2')
set_default_color('Color3')
event_category = Category.Timeline
event_sorting_index = 1
continue_at_end = true
Expand Down
10 changes: 7 additions & 3 deletions addons/dialogic/Events/Save/event_save.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ func _execute() -> void:

func _init() -> void:
event_name = "Save"
set_default_color('Color2')
event_category = Category.Main
event_sorting_index = 2
set_default_color('Color6')
event_category = Category.Other
event_sorting_index = 9


func _get_icon() -> Resource:
return load(self.get_script().get_path().get_base_dir().path_join('icon.svg'))


################################################################################
Expand Down
Binary file removed addons/dialogic/Events/Save/icon.png
Binary file not shown.
4 changes: 4 additions & 0 deletions addons/dialogic/Events/Save/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@

importer="texture"
type="CompressedTexture2D"
uid="uid://coabkkekk3b4g"
path="res://.godot/imported/icon.png-c42c50734f47bed2d2ddba82118ea0a9.ctex"
uid="uid://cmqqld2fujx40"
path="res://.godot/imported/icon.svg-d48e3eb131b5c46521cf6a16183eb5dd.ctex"
metadata={
"editor_dark_theme": true,
"editor_scale": 1.0,
"has_editor_variant": true,
"vram_texture": false
}

[deps]

source_file="res://addons/dialogic/Events/Save/icon.png"
dest_files=["res://.godot/imported/icon.png-c42c50734f47bed2d2ddba82118ea0a9.ctex"]
source_file="res://addons/dialogic/Events/Save/icon.svg"
dest_files=["res://.godot/imported/icon.svg-d48e3eb131b5c46521cf6a16183eb5dd.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
Expand All @@ -32,3 +35,6 @@ process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=true
editor/convert_colors_with_editor_theme=true
4 changes: 2 additions & 2 deletions addons/dialogic/Events/Style/event_style.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ func _execute() -> void:
func _init() -> void:
event_name = "Change Style"
set_default_color('Color4')
event_category = Category.AudioVisual
event_sorting_index = 4
event_category = Category.Other
event_sorting_index = 1


################################################################################
Expand Down
4 changes: 3 additions & 1 deletion addons/dialogic/Events/Text/event_text.gd
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,16 @@ func build_event_editor():
{'file_extension' : '.dch',
'suggestions_func' : get_character_suggestions,
'empty_text' : '(No one)',
'icon' : load("res://addons/dialogic/Editor/Images/Resources/character.svg")})
'icon' : load("res://addons/dialogic/Editor/Images/Resources/character.svg")}, 'do_any_characters_exist()')
add_header_edit('portrait', ValueType.ComplexPicker, '', '',
{'suggestions_func' : get_portrait_suggestions,
'placeholder' : "(Don't change)",
'icon' : load("res://addons/dialogic/Editor/Images/Resources/portrait.svg")},
'character != null and !has_no_portraits()')
add_body_edit('text', ValueType.MultilineText)

func do_any_characters_exist() -> bool:
return !DialogicUtil.list_resources_of_type(".dch").is_empty()

func has_no_portraits() -> bool:
return character and character.portraits.is_empty()
Expand Down
12 changes: 6 additions & 6 deletions addons/dialogic/Events/TextInput/event_text_input.gd
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ func _on_DialogicTextInput_input_confirmed(input:String) -> void:

func _init() -> void:
event_name = "Text Input"
set_default_color('Color1')
event_category = Category.Godot
set_default_color('Color3')
event_category = Category.Other
event_sorting_index = 6
continue_at_end = true
expand_by_default = false
Expand Down Expand Up @@ -76,13 +76,13 @@ func get_shortcode_parameters() -> Dictionary:
################################################################################

func build_event_editor() -> void:
add_header_label('Show an input field. The value will be stored to')
add_header_label('Shows an input field. The value will be stored to')
add_header_edit('variable', ValueType.ComplexPicker, '', '',
{'suggestions_func' : get_var_suggestions,
'editor_icon' : ["ClassList", "EditorIcons"]})
add_body_edit('text', ValueType.SinglelineText, 'text:')
add_body_edit('placeholder', ValueType.SinglelineText, 'placeholder:')
add_body_edit('default', ValueType.SinglelineText, 'default:')
add_body_edit('text', ValueType.SinglelineText, 'Text:')
add_body_edit('placeholder', ValueType.SinglelineText, 'Placeholder:')
add_body_edit('default', ValueType.SinglelineText, 'Default:')
add_body_edit('allow_empty', ValueType.Bool, 'Allow empty:')


Expand Down
4 changes: 2 additions & 2 deletions addons/dialogic/Events/Variable/event_variable.gd
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ func _execute() -> void:

func _init() -> void:
event_name = "Set Variable"
set_default_color('Color1')
event_category = Category.Godot
set_default_color('Color3')
event_category = Category.Logic
event_sorting_index = 0
expand_by_default = false

Expand Down
4 changes: 2 additions & 2 deletions addons/dialogic/Events/Voice/event_voice.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func _execute() -> void:

func _init() -> void:
event_name = "Voice"
set_default_color('Color1')
event_category = Category.AudioVisual
set_default_color('Color5')
event_category = Category.Audio
event_sorting_index = 5
expand_by_default = false

Expand Down
4 changes: 2 additions & 2 deletions addons/dialogic/Events/Wait/event_wait.gd
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func _execute() -> void:
func _init() -> void:
event_name = "Wait"
set_default_color('Color6')
event_category = Category.Timeline
event_sorting_index = 5
event_category = Category.Other
event_sorting_index = 10
expand_by_default = false


Expand Down
Loading

0 comments on commit d6bf596

Please sign in to comment.