From dce37b84b7fa4c6347605aa0e848f09c21c4ee6b Mon Sep 17 00:00:00 2001 From: Jowan-Spooner <42868150+Jowan-Spooner@users.noreply.github.com> Date: Tue, 29 Aug 2023 20:04:22 +0200 Subject: [PATCH] Make left_text and right_text arguments part of info-dict (#1696) --- addons/dialogic/Modules/Audio/event_music.gd | 13 ++++---- addons/dialogic/Modules/Audio/event_sound.gd | 9 ++--- .../Modules/Background/event_background.gd | 14 ++++---- .../Modules/CallNode/event_call_node.gd | 14 ++++---- .../Modules/Character/event_character.gd | 33 ++++++++++--------- .../Modules/Character/event_position.gd | 8 ++--- .../dialogic/Modules/Choice/event_choice.gd | 11 ++++--- .../dialogic/Modules/Comment/event_comment.gd | 2 +- .../Modules/Condition/event_condition.gd | 4 +-- .../dialogic/Modules/History/event_history.gd | 2 +- addons/dialogic/Modules/Jump/event_jump.gd | 4 +-- addons/dialogic/Modules/Jump/event_label.gd | 2 +- addons/dialogic/Modules/Save/event_save.gd | 2 +- .../Modules/Settings/event_setting.gd | 12 +++---- .../dialogic/Modules/Signal/event_signal.gd | 3 +- addons/dialogic/Modules/Style/event_style.gd | 5 +-- addons/dialogic/Modules/Text/event_text.gd | 6 ++-- .../Modules/TextInput/event_text_input.gd | 10 +++--- .../Modules/Variable/event_variable.gd | 19 ++++++----- addons/dialogic/Modules/Voice/event_voice.gd | 10 +++--- addons/dialogic/Modules/Wait/event_wait.gd | 4 +-- .../Modules/WaitInput/event_wait_input.gd | 2 +- addons/dialogic/Resources/event.gd | 12 +++---- 23 files changed, 105 insertions(+), 96 deletions(-) diff --git a/addons/dialogic/Modules/Audio/event_music.gd b/addons/dialogic/Modules/Audio/event_music.gd index 95156f783..e2ca0bdbf 100644 --- a/addons/dialogic/Modules/Audio/event_music.gd +++ b/addons/dialogic/Modules/Audio/event_music.gd @@ -68,14 +68,15 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('file_path', ValueType.FILE, 'Play', '', - {'file_filter' : "*.mp3, *.ogg, *.wav; Supported Audio Files", + add_header_edit('file_path', ValueType.FILE, { + 'left_text' : 'Play', + 'file_filter' : "*.mp3, *.ogg, *.wav; Supported Audio Files", 'placeholder' : "No music", 'editor_icon' : ["AudioStreamPlayer", "EditorIcons"]}) - add_body_edit('fade_length', ValueType.FLOAT, 'Fade Time:') - add_body_edit('volume', ValueType.DECIBEL, 'Volume:', '', {}, '!file_path.is_empty()') - add_body_edit('audio_bus', ValueType.SINGLELINE_TEXT, 'Audio Bus:', '', {}, '!file_path.is_empty()') - add_body_edit('loop', ValueType.BOOL, 'Loop:', '', {}, '!file_path.is_empty()') + add_body_edit('fade_length', ValueType.FLOAT, {'left_text':'Fade Time:'}) + add_body_edit('volume', ValueType.DECIBEL, {'left_text':'Volume:'}, '!file_path.is_empty()') + add_body_edit('audio_bus', ValueType.SINGLELINE_TEXT, {'left_text':'Audio Bus:'}, '!file_path.is_empty()') + add_body_edit('loop', ValueType.BOOL, {'left_text':'Loop:'}, '!file_path.is_empty()') func get_bus_suggestions() -> Dictionary: diff --git a/addons/dialogic/Modules/Audio/event_sound.gd b/addons/dialogic/Modules/Audio/event_sound.gd index 0375ef490..cf1d796fd 100644 --- a/addons/dialogic/Modules/Audio/event_sound.gd +++ b/addons/dialogic/Modules/Audio/event_sound.gd @@ -66,12 +66,13 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('file_path', ValueType.FILE, 'Play', '', - {'file_filter' : '*.mp3, *.ogg, *.wav; Supported Audio Files', + add_header_edit('file_path', ValueType.FILE, + {'left_text' : 'Play', + 'file_filter' : '*.mp3, *.ogg, *.wav; Supported Audio Files', 'placeholder' : "Select file", 'editor_icon' : ["AudioStreamPlayer", "EditorIcons"]}) - add_body_edit('volume', ValueType.DECIBEL, 'Volume:', '', {}, '!file_path.is_empty()') - add_body_edit('audio_bus', ValueType.SINGLELINE_TEXT, 'Audio Bus:', '', {}, '!file_path.is_empty()') + add_body_edit('volume', ValueType.DECIBEL, {'left_text':'Volume:'}, '!file_path.is_empty()') + add_body_edit('audio_bus', ValueType.SINGLELINE_TEXT, {'left_text':'Audio Bus:'}, '!file_path.is_empty()') func get_bus_suggestions() -> Dictionary: var bus_name_list := {} diff --git a/addons/dialogic/Modules/Background/event_background.gd b/addons/dialogic/Modules/Background/event_background.gd index a21ac9856..0d32195c3 100644 --- a/addons/dialogic/Modules/Background/event_background.gd +++ b/addons/dialogic/Modules/Background/event_background.gd @@ -61,14 +61,16 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('argument', ValueType.FILE, 'Show', '', - {'file_filter':'*.jpg, *.jpeg, *.png, *.webp, *.tga, *svg, *.bmp, *.dds, *.exr, *.hdr; Supported Image Files', + add_header_edit('argument', ValueType.FILE, + {'left_text' : 'Show', + 'file_filter':'*.jpg, *.jpeg, *.png, *.webp, *.tga, *svg, *.bmp, *.dds, *.exr, *.hdr; Supported Image Files', 'placeholder': "No background", 'editor_icon':["Image", "EditorIcons"]}, 'scene == ""') - add_header_edit('argument', ValueType.SINGLELINE_TEXT, 'Argument:', '', {}, 'scene != ""') - add_body_edit("fade", ValueType.FLOAT, "Fade Time: ") - add_body_edit("scene", ValueType.FILE, 'Scene:', '', - {'file_filter':'*.tscn, *.scn; Scene Files', + add_header_edit('argument', ValueType.SINGLELINE_TEXT, {'left_text':'Argument:'}, 'scene != ""') + add_body_edit("fade", ValueType.FLOAT, {'left_text':'Fade Time:'}) + add_body_edit("scene", ValueType.FILE, + {'left_text' :'Scene:', + 'file_filter':'*.tscn, *.scn; Scene Files', 'placeholder': "Default scene", 'editor_icon':["PackedScene", "EditorIcons"]}) diff --git a/addons/dialogic/Modules/CallNode/event_call_node.gd b/addons/dialogic/Modules/CallNode/event_call_node.gd index 4bbfad039..26c203e21 100644 --- a/addons/dialogic/Modules/CallNode/event_call_node.gd +++ b/addons/dialogic/Modules/CallNode/event_call_node.gd @@ -106,11 +106,11 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('method', ValueType.SINGLELINE_TEXT, 'Call method') - add_header_edit('path', ValueType.SINGLELINE_TEXT, 'in object') - add_body_edit('inline', ValueType.BOOL, 'Inline Command:', '', {'tooltip':"If enabled, the method won't be called instantly. Only when a signal is emmited inside the following text event will it be called."}) - add_body_edit('inline_signal_argument', ValueType.SINGLELINE_TEXT, 'Inline Signal Argument', '', {'tooltip':"For example if set to 'Hello' the method can be called with [signal=Hello] in the next text event."}, 'inline == true') - add_body_edit('inline_single_use', ValueType.BOOL, 'Single Use:', '', {'tooltip':"By default calling via in-text signal only works once. Uncheck this to make the event keep listening. \nThis only stays valid during this dialog."}, 'inline == true') - add_body_edit('wait', ValueType.BOOL, 'Wait:', '', {'tooltip':'Will wait for the method to finish. Only relevant for methods with `await` in them.'}, 'inline == false') + add_header_edit('method', ValueType.SINGLELINE_TEXT, {'left_text':'Call method'}) + add_header_edit('path', ValueType.SINGLELINE_TEXT, {'left_text':'in object'}) + add_body_edit('inline', ValueType.BOOL, {'left_text':'Inline Command:', 'tooltip':"If enabled, the method won't be called instantly. Only when a signal is emmited inside the following text event will it be called."}) + add_body_edit('inline_signal_argument', ValueType.SINGLELINE_TEXT, {'left_text':'Inline Signal Argument', 'tooltip':"For example if set to 'Hello' the method can be called with [signal=Hello] in the next text event."}, 'inline == true') + add_body_edit('inline_single_use', ValueType.BOOL, {'left_text':'Single Use:','tooltip':"By default calling via in-text signal only works once. Uncheck this to make the event keep listening. \nThis only stays valid during this dialog."}, 'inline == true') + add_body_edit('wait', ValueType.BOOL, {'left_text':'Wait:', 'tooltip':'Will wait for the method to finish. Only relevant for methods with `await` in them.'}, 'inline == false') add_body_line_break() - add_body_edit('arguments', ValueType.STRING_ARRAY, 'Arguments:') + add_body_edit('arguments', ValueType.STRING_ARRAY, {'left_text':'Arguments:'}) diff --git a/addons/dialogic/Modules/Character/event_character.gd b/addons/dialogic/Modules/Character/event_character.gd index 1498e8b9a..ff697e868 100644 --- a/addons/dialogic/Modules/Character/event_character.gd +++ b/addons/dialogic/Modules/Character/event_character.gd @@ -331,7 +331,7 @@ func is_valid_event(string:String) -> bool: ################################################################################ func build_event_editor() -> void: - add_header_edit('action', ValueType.FIXED_OPTION_SELECTOR, '', '', { + add_header_edit('action', ValueType.FIXED_OPTION_SELECTOR, { 'selector_options': [ { 'label': 'Join', @@ -350,7 +350,7 @@ func build_event_editor() -> void: } ] }) - add_header_edit('_character_from_directory', ValueType.COMPLEX_PICKER, '', '', + add_header_edit('_character_from_directory', ValueType.COMPLEX_PICKER, {'placeholder' : 'Character', 'file_extension' : '.dch', 'suggestions_func' : get_character_suggestions, @@ -358,43 +358,44 @@ func build_event_editor() -> void: 'autofocus' : true}) # add_header_button('', _on_character_edit_pressed, 'Edit character', ["ExternalLink", "EditorIcons"], 'character != null and _character_from_directory != "--All--"') - add_header_edit('set_portrait', ValueType.BOOL, '', '', + add_header_edit('set_portrait', ValueType.BOOL, {'icon':load("res://addons/dialogic/Modules/Character/update_portrait.svg"), 'tooltip':'Change Portrait'}, "action == Actions.UPDATE") - add_header_edit('portrait', ValueType.COMPLEX_PICKER, '', '', + add_header_edit('portrait', ValueType.COMPLEX_PICKER, {'placeholder' : 'Default', 'collapse_when_empty':true, 'suggestions_func' : get_portrait_suggestions, 'icon' : load("res://addons/dialogic/Editor/Images/Resources/portrait.svg")}, 'should_show_portrait_selector()') - add_header_edit('set_position', ValueType.BOOL, '', '', + add_header_edit('set_position', ValueType.BOOL, {'icon': load("res://addons/dialogic/Modules/Character/update_position.svg"), 'tooltip':'Change Position'}, "action == Actions.UPDATE") add_header_label('at position', 'character != null and !has_no_portraits() and action == Actions.JOIN') add_header_label('to position', 'character != null and !has_no_portraits() and action == Actions.UPDATE and set_position') - add_header_edit('position', ValueType.INTEGER, '', '', {}, + add_header_edit('position', ValueType.INTEGER, {}, 'character != null and !has_no_portraits() and action != %s and (action != Actions.UPDATE or set_position)' %Actions.LEAVE) # Body - add_body_edit('animation_name', ValueType.COMPLEX_PICKER, 'Animation:', '', - {'suggestions_func' : get_animation_suggestions, + add_body_edit('animation_name', ValueType.COMPLEX_PICKER, + {'left_text' : 'Animation:', + 'suggestions_func' : get_animation_suggestions, 'editor_icon' : ["Animation", "EditorIcons"], 'placeholder' : 'Default', 'enable_pretty_name' : true}, 'should_show_animation_options()') - add_body_edit('animation_length', ValueType.FLOAT, 'Length:', '', {}, + add_body_edit('animation_length', ValueType.FLOAT, {'left_text':'Length:'}, 'should_show_animation_options() and !animation_name.is_empty()') - add_body_edit('animation_wait', ValueType.BOOL, 'Await end:', '', {}, + add_body_edit('animation_wait', ValueType.BOOL, {'left_text':'Await end:'}, 'should_show_animation_options() and !animation_name.is_empty()') - add_body_edit('animation_repeats', ValueType.INTEGER, 'Repeat:', '', {}, + add_body_edit('animation_repeats', ValueType.INTEGER, {'left_text':'Repeat:'}, 'should_show_animation_options() and !animation_name.is_empty() and action == %s)' %Actions.UPDATE) add_body_line_break() - add_body_edit('position_move_time', ValueType.FLOAT, 'Movement duration:', '', {}, + add_body_edit('position_move_time', ValueType.FLOAT, {'left_text':'Movement duration:'}, 'action == %s and set_position' %Actions.UPDATE) - add_body_edit('set_z_index', ValueType.BOOL, '', '', {'icon':load("res://addons/dialogic/Modules/Character/update_z_index.svg"), 'tooltip':'Change Z-Index'}, "action == Actions.UPDATE") - add_body_edit('z_index', ValueType.INTEGER, 'Z-index:', "",{}, + add_body_edit('set_z_index', ValueType.BOOL, {'icon':load("res://addons/dialogic/Modules/Character/update_z_index.svg"), 'tooltip':'Change Z-Index'}, "action == Actions.UPDATE") + add_body_edit('z_index', ValueType.INTEGER, {'left_text':'Z-index:'}, 'action != %s and (action != Actions.UPDATE or set_z_index)' %Actions.LEAVE) - add_body_edit('set_mirrored', ValueType.BOOL, '', '', {'icon':load("res://addons/dialogic/Modules/Character/update_mirror.svg"), 'tooltip':'Change Mirroring'}, "action == Actions.UPDATE") - add_body_edit('mirrored', ValueType.BOOL, 'Mirrored:', "",{}, + add_body_edit('set_mirrored', ValueType.BOOL, {'icon':load("res://addons/dialogic/Modules/Character/update_mirror.svg"), 'tooltip':'Change Mirroring'}, "action == Actions.UPDATE") + add_body_edit('mirrored', ValueType.BOOL, {'left_text':'Mirrored:'}, 'action != %s and (action != Actions.UPDATE or set_mirrored)' %Actions.LEAVE) diff --git a/addons/dialogic/Modules/Character/event_position.gd b/addons/dialogic/Modules/Character/event_position.gd index 2ce5b4ba2..32f8f120a 100644 --- a/addons/dialogic/Modules/Character/event_position.gd +++ b/addons/dialogic/Modules/Character/event_position.gd @@ -77,7 +77,7 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('action', ValueType.FIXED_OPTION_SELECTOR, '', '', { + add_header_edit('action', ValueType.FIXED_OPTION_SELECTOR, { 'selector_options': [ { 'label': 'Change', @@ -97,10 +97,10 @@ func build_event_editor(): } ] }) - add_header_edit("position", ValueType.INTEGER, "position", '', {}, + add_header_edit("position", ValueType.INTEGER, {'left_text':"position"}, 'action != Actions.RESET_ALL') add_header_label('to (absolute)', 'action == Actions.SET_ABSOLUTE') add_header_label('by (relative)', 'action == Actions.SET_RELATIVE') - add_header_edit("vector", ValueType.VECTOR2, "", '', {}, + add_header_edit("vector", ValueType.VECTOR2, {}, 'action != Actions.RESET and action != Actions.RESET_ALL') - add_body_edit("movement_time", ValueType.FLOAT, "AnimationTime:", "(0 for instant)") + add_body_edit("movement_time", ValueType.FLOAT, {'left_text':"AnimationTime:", "right_text":"(0 for instant)"}) diff --git a/addons/dialogic/Modules/Choice/event_choice.gd b/addons/dialogic/Modules/Choice/event_choice.gd index ef278f3e1..a67751545 100644 --- a/addons/dialogic/Modules/Choice/event_choice.gd +++ b/addons/dialogic/Modules/Choice/event_choice.gd @@ -135,9 +135,9 @@ func _get_property_original_translation(property:String) -> String: ################################################################################ func build_event_editor() -> void: - add_header_edit("text", ValueType.SINGLELINE_TEXT, '','', {'autofocus':true}) - add_body_edit("condition", ValueType.CONDITION, 'if ') - add_body_edit("else_action", ValueType.FIXED_OPTION_SELECTOR, 'else ', '', { + add_header_edit("text", ValueType.SINGLELINE_TEXT, {'autofocus':true}) + add_body_edit("condition", ValueType.CONDITION, {'left_text':'if '}) + add_body_edit("else_action", ValueType.FIXED_OPTION_SELECTOR, {'left_text':'else ', 'selector_options': [ { 'label': 'Default', @@ -152,8 +152,9 @@ func build_event_editor() -> void: 'value': ElseActions.DISABLE, } ]}, '!condition.is_empty()') - add_body_edit("disabled_text", ValueType.SINGLELINE_TEXT, 'Disabled text:', '', - {'placeholder':'(Empty for same)'}, 'allow_alt_text()') + add_body_edit("disabled_text", ValueType.SINGLELINE_TEXT, { + 'left_text':'Disabled text:', + 'placeholder':'(Empty for same)'}, 'allow_alt_text()') func allow_alt_text() -> bool: diff --git a/addons/dialogic/Modules/Comment/event_comment.gd b/addons/dialogic/Modules/Comment/event_comment.gd index 25cbf31f6..aed8a0a98 100644 --- a/addons/dialogic/Modules/Comment/event_comment.gd +++ b/addons/dialogic/Modules/Comment/event_comment.gd @@ -56,7 +56,7 @@ func is_valid_event(string:String) -> bool: ################################################################################ func build_event_editor(): - add_header_edit('text', ValueType.SINGLELINE_TEXT, '#','',{'autofocus':true}) + add_header_edit('text', ValueType.SINGLELINE_TEXT, {'left_text':'#', 'autofocus':true}) #################### SYNTAX HIGHLIGHTING ####################################### diff --git a/addons/dialogic/Modules/Condition/event_condition.gd b/addons/dialogic/Modules/Condition/event_condition.gd index e589633b0..f8719c345 100644 --- a/addons/dialogic/Modules/Condition/event_condition.gd +++ b/addons/dialogic/Modules/Condition/event_condition.gd @@ -105,7 +105,7 @@ func is_valid_event(string:String) -> bool: ################################################################################ func build_event_editor(): - add_header_edit('condition_type', ValueType.FIXED_OPTION_SELECTOR, '', '', { + add_header_edit('condition_type', ValueType.FIXED_OPTION_SELECTOR, { 'selector_options': [ { 'label': 'IF', @@ -120,7 +120,7 @@ func build_event_editor(): 'value': ConditionTypes.ELSE, } ], 'disabled':true}) - add_header_edit('condition', ValueType.CONDITION, '', '', {}, 'condition_type != %s'%ConditionTypes.ELSE) + add_header_edit('condition', ValueType.CONDITION, {}, 'condition_type != %s'%ConditionTypes.ELSE) ####################### CODE COMPLETION ######################################## diff --git a/addons/dialogic/Modules/History/event_history.gd b/addons/dialogic/Modules/History/event_history.gd index 7eabc2ebb..1dd02c226 100644 --- a/addons/dialogic/Modules/History/event_history.gd +++ b/addons/dialogic/Modules/History/event_history.gd @@ -59,7 +59,7 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('action', ValueType.FIXED_OPTION_SELECTOR, '', '', { + add_header_edit('action', ValueType.FIXED_OPTION_SELECTOR, { 'selector_options': [ { 'label': 'Pause History', diff --git a/addons/dialogic/Modules/Jump/event_jump.gd b/addons/dialogic/Modules/Jump/event_jump.gd index 1d18827d3..ac7189f8b 100644 --- a/addons/dialogic/Modules/Jump/event_jump.gd +++ b/addons/dialogic/Modules/Jump/event_jump.gd @@ -101,14 +101,14 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('_timeline_file', ValueType.COMPLEX_PICKER, 'Jump to', '', { + add_header_edit('_timeline_file', ValueType.COMPLEX_PICKER, {'left_text':'Jump to', 'file_extension': '.dtl', 'suggestions_func': get_timeline_suggestions, 'editor_icon': ["TripleBar", "EditorIcons"], 'empty_text': '(this timeline)', 'autofocus':true }) - add_header_edit("label_name", ValueType.COMPLEX_PICKER, "at", '', { + add_header_edit("label_name", ValueType.COMPLEX_PICKER, {'left_text':"at", 'empty_text':'the beginning', 'suggestions_func':get_label_suggestions, 'editor_icon':["ArrowRight", "EditorIcons"]}) diff --git a/addons/dialogic/Modules/Jump/event_label.gd b/addons/dialogic/Modules/Jump/event_label.gd index b093acd01..069392745 100644 --- a/addons/dialogic/Modules/Jump/event_label.gd +++ b/addons/dialogic/Modules/Jump/event_label.gd @@ -70,7 +70,7 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('name', ValueType.SINGLELINE_TEXT, '', '', {'autofocus':true}) + add_header_edit('name', ValueType.SINGLELINE_TEXT, {'left_text':'Label', 'autofocus':true}) ####################### CODE COMPLETION ######################################## diff --git a/addons/dialogic/Modules/Save/event_save.gd b/addons/dialogic/Modules/Save/event_save.gd index 5925d5f3c..fc212b595 100644 --- a/addons/dialogic/Modules/Save/event_save.gd +++ b/addons/dialogic/Modules/Save/event_save.gd @@ -62,4 +62,4 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('slot_name', ValueType.SINGLELINE_TEXT, 'Save to slot') + add_header_edit('slot_name', ValueType.SINGLELINE_TEXT, {'left_text':'Save to slot'}) diff --git a/addons/dialogic/Modules/Settings/event_setting.gd b/addons/dialogic/Modules/Settings/event_setting.gd index f9048aada..9de9878bc 100644 --- a/addons/dialogic/Modules/Settings/event_setting.gd +++ b/addons/dialogic/Modules/Settings/event_setting.gd @@ -122,7 +122,7 @@ func is_valid_event(string:String) -> bool: ################################################################################ func build_event_editor(): - add_header_edit('mode', ValueType.FIXED_OPTION_SELECTOR, '', '', { + add_header_edit('mode', ValueType.FIXED_OPTION_SELECTOR, { 'selector_options': [{ 'label': 'Set', 'value': Modes.SET, @@ -138,8 +138,8 @@ func build_event_editor(): }, ]}) - add_header_edit('name', ValueType.COMPLEX_PICKER, '', '', {'placeholder':'Type setting', 'suggestions_func':get_settings_suggestions}, 'mode != 2') - add_header_edit('_value_type', ValueType.FIXED_OPTION_SELECTOR, 'to', '', { + add_header_edit('name', ValueType.COMPLEX_PICKER, {'placeholder':'Type setting', 'suggestions_func':get_settings_suggestions}, 'mode != 2') + add_header_edit('_value_type', ValueType.FIXED_OPTION_SELECTOR, {'left_text':'to', 'selector_options': [ { 'label': 'String', @@ -160,9 +160,9 @@ func build_event_editor(): }], 'symbol_only':true}, '!name.is_empty() and mode == 0') - add_header_edit('value', ValueType.SINGLELINE_TEXT, '', '', {}, '!name.is_empty() and (_value_type == 0 or _value_type == 3) and mode == 0') - add_header_edit('value', ValueType.FLOAT, '', '', {}, '!name.is_empty() and _value_type == 1 and mode == 0') - add_header_edit('value', ValueType.COMPLEX_PICKER, '', '', + add_header_edit('value', ValueType.SINGLELINE_TEXT, {}, '!name.is_empty() and (_value_type == 0 or _value_type == 3) and mode == 0') + add_header_edit('value', ValueType.FLOAT, {}, '!name.is_empty() and _value_type == 1 and mode == 0') + add_header_edit('value', ValueType.COMPLEX_PICKER, {'suggestions_func' : get_value_suggestions, 'placeholder':'Select Variable'}, '!name.is_empty() and _value_type == 2 and mode == 0') diff --git a/addons/dialogic/Modules/Signal/event_signal.gd b/addons/dialogic/Modules/Signal/event_signal.gd index 2c6e7b730..51e47241f 100644 --- a/addons/dialogic/Modules/Signal/event_signal.gd +++ b/addons/dialogic/Modules/Signal/event_signal.gd @@ -51,5 +51,4 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('argument', ValueType.SINGLELINE_TEXT, - 'Emit with argument', '', {'autofocus':true}) + add_header_edit('argument', ValueType.SINGLELINE_TEXT, {'left_text':'Emit with argument', 'autofocus':true}) diff --git a/addons/dialogic/Modules/Style/event_style.gd b/addons/dialogic/Modules/Style/event_style.gd index 3417005ca..8abe730dc 100644 --- a/addons/dialogic/Modules/Style/event_style.gd +++ b/addons/dialogic/Modules/Style/event_style.gd @@ -53,8 +53,9 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('style_name', ValueType.COMPLEX_PICKER, 'Use style', '', - {'placeholder' : 'Default', + add_header_edit('style_name', ValueType.COMPLEX_PICKER, { + 'left_text' :'Use style', + 'placeholder' : 'Default', 'suggestions_func' : get_style_suggestions, 'editor_icon' : ["PopupMenu", "EditorIcons"], 'autofocus' : true}) diff --git a/addons/dialogic/Modules/Text/event_text.gd b/addons/dialogic/Modules/Text/event_text.gd index 8bb8ee328..e226743d3 100644 --- a/addons/dialogic/Modules/Text/event_text.gd +++ b/addons/dialogic/Modules/Text/event_text.gd @@ -224,18 +224,18 @@ func _get_property_original_translation(property:String) -> String: ################################################################################ func build_event_editor(): - add_header_edit('_character_from_directory', ValueType.COMPLEX_PICKER, '', '', + add_header_edit('_character_from_directory', ValueType.COMPLEX_PICKER, {'file_extension' : '.dch', 'suggestions_func' : get_character_suggestions, 'empty_text' : '(No one)', 'icon' : load("res://addons/dialogic/Editor/Images/Resources/character.svg")}, 'do_any_characters_exist()') - add_header_edit('portrait', ValueType.COMPLEX_PICKER, '', '', + add_header_edit('portrait', ValueType.COMPLEX_PICKER, {'suggestions_func' : get_portrait_suggestions, 'placeholder' : "(Don't change)", 'icon' : load("res://addons/dialogic/Editor/Images/Resources/portrait.svg"), 'collapse_when_empty':true,}, 'character != null and !has_no_portraits()') - add_body_edit('text', ValueType.MULTILINE_TEXT, "", "", {'autofocus':true}) + add_body_edit('text', ValueType.MULTILINE_TEXT, {'autofocus':true}) func do_any_characters_exist() -> bool: return !DialogicUtil.list_resources_of_type(".dch").is_empty() diff --git a/addons/dialogic/Modules/TextInput/event_text_input.gd b/addons/dialogic/Modules/TextInput/event_text_input.gd index 48f20d8ac..2b3146780 100644 --- a/addons/dialogic/Modules/TextInput/event_text_input.gd +++ b/addons/dialogic/Modules/TextInput/event_text_input.gd @@ -77,14 +77,14 @@ func get_shortcode_parameters() -> Dictionary: func build_event_editor() -> void: add_header_label('Show an input and store it in') - add_header_edit('variable', ValueType.COMPLEX_PICKER, '', '', + add_header_edit('variable', ValueType.COMPLEX_PICKER, {'suggestions_func' : get_var_suggestions, 'icon' : load("res://addons/dialogic/Editor/Images/Pieces/variable.svg"), 'placeholder':'Select Variable'}) - add_body_edit('text', ValueType.SINGLELINE_TEXT, 'Text:') - add_body_edit('placeholder', ValueType.SINGLELINE_TEXT, 'Placeholder:') - add_body_edit('default', ValueType.SINGLELINE_TEXT, 'Default:') - add_body_edit('allow_empty', ValueType.BOOL, 'Allow empty:') + add_body_edit('text', ValueType.SINGLELINE_TEXT, {'left_text':'Text:'}) + add_body_edit('placeholder', ValueType.SINGLELINE_TEXT, {'left_text':'Placeholder:'}) + add_body_edit('default', ValueType.SINGLELINE_TEXT, {'left_text':'Default:'}) + add_body_edit('allow_empty', ValueType.BOOL, {'left_text':'Allow empty:'}) func get_var_suggestions(filter:String) -> Dictionary: diff --git a/addons/dialogic/Modules/Variable/event_variable.gd b/addons/dialogic/Modules/Variable/event_variable.gd index 0c1a1b5c3..4c1b057cd 100644 --- a/addons/dialogic/Modules/Variable/event_variable.gd +++ b/addons/dialogic/Modules/Variable/event_variable.gd @@ -166,12 +166,13 @@ func is_valid_event(string:String) -> bool: ################################################################################ func build_event_editor(): - add_header_edit('name', ValueType.COMPLEX_PICKER, 'Set', '', - {'suggestions_func' : get_var_suggestions, + add_header_edit('name', ValueType.COMPLEX_PICKER, { + 'left_text' : 'Set', + 'suggestions_func' : get_var_suggestions, 'icon' : load("res://addons/dialogic/Editor/Images/Pieces/variable.svg"), 'placeholder' :'Select Variable'} ) - add_header_edit('operation', ValueType.FIXED_OPTION_SELECTOR, '', '', { + add_header_edit('operation', ValueType.FIXED_OPTION_SELECTOR, { 'selector_options': [ { 'label': 'to be', @@ -196,7 +197,7 @@ func build_event_editor(): } ] }, '!name.is_empty()') - add_header_edit('_value_type', ValueType.FIXED_OPTION_SELECTOR, '', '', { + add_header_edit('_value_type', ValueType.FIXED_OPTION_SELECTOR, { 'selector_options': [ { 'label': 'String', @@ -221,14 +222,14 @@ func build_event_editor(): }], 'symbol_only':true}, '!name.is_empty()') - add_header_edit('value', ValueType.SINGLELINE_TEXT, '', '', {}, '!name.is_empty() and (_value_type == 0 or _value_type == 3) ') - add_header_edit('value', ValueType.FLOAT, '', '', {}, '!name.is_empty() and _value_type == 1') - add_header_edit('value', ValueType.COMPLEX_PICKER, '', '', + add_header_edit('value', ValueType.SINGLELINE_TEXT, {}, '!name.is_empty() and (_value_type == 0 or _value_type == 3) ') + add_header_edit('value', ValueType.FLOAT, {}, '!name.is_empty() and _value_type == 1') + add_header_edit('value', ValueType.COMPLEX_PICKER, {'suggestions_func' : get_value_suggestions, 'placeholder':'Select Variable'}, '!name.is_empty() and _value_type == 2') add_header_label('a number between', '_value_type == 4') - add_header_edit('random_min', ValueType.INTEGER, '', 'and', {}, '!name.is_empty() and _value_type == 4') - add_header_edit('random_max', ValueType.INTEGER, '', '', {}, '!name.is_empty() and _value_type == 4') + add_header_edit('random_min', ValueType.INTEGER, {'right_text':'and'}, '!name.is_empty() and _value_type == 4') + add_header_edit('random_max', ValueType.INTEGER, {}, '!name.is_empty() and _value_type == 4') add_header_button('', _on_variable_editor_pressed, 'Variable Editor', ["ExternalLink", "EditorIcons"]) func get_var_suggestions(filter:String) -> Dictionary: diff --git a/addons/dialogic/Modules/Voice/event_voice.gd b/addons/dialogic/Modules/Voice/event_voice.gd index 55375791b..cf443dc9f 100644 --- a/addons/dialogic/Modules/Voice/event_voice.gd +++ b/addons/dialogic/Modules/Voice/event_voice.gd @@ -61,9 +61,11 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('file_path', ValueType.FILE, 'Set', 'as the next voice audio', - {'file_filter' : "*.mp3, *.ogg, *.wav", + add_header_edit('file_path', ValueType.FILE, { + 'left_text' : 'Set', + 'right_text' : 'as the next voice audio', + 'file_filter' : "*.mp3, *.ogg, *.wav", 'placeholder' : "Select file", 'editor_icon' : ["AudioStreamPlayer", "EditorIcons"]}) - add_body_edit('volume', ValueType.DECIBEL, 'Volume:', '', {}, '!file_path.is_empty()') - add_body_edit('audio_bus', ValueType.SINGLELINE_TEXT, 'Audio Bus:', '', {}, '!file_path.is_empty()') + add_body_edit('volume', ValueType.DECIBEL, {'left_text':'Volume:'}, '!file_path.is_empty()') + add_body_edit('audio_bus', ValueType.SINGLELINE_TEXT, {'left_text':'Audio Bus:'}, '!file_path.is_empty()') diff --git a/addons/dialogic/Modules/Wait/event_wait.gd b/addons/dialogic/Modules/Wait/event_wait.gd index 8094ba581..e427c44c9 100644 --- a/addons/dialogic/Modules/Wait/event_wait.gd +++ b/addons/dialogic/Modules/Wait/event_wait.gd @@ -61,7 +61,7 @@ func get_shortcode_parameters() -> Dictionary: ################################################################################ func build_event_editor(): - add_header_edit('time', ValueType.FLOAT, 'Wait','', {'autofocus':true}) + add_header_edit('time', ValueType.FLOAT, {'left_text':'Wait', 'autofocus':true}) add_header_label('seconds', 'time != 1') add_header_label('second', 'time == 1') - add_body_edit('hide_text', ValueType.BOOL, 'Hide text box:') + add_body_edit('hide_text', ValueType.BOOL, {'left_text':'Hide text box:'}) diff --git a/addons/dialogic/Modules/WaitInput/event_wait_input.gd b/addons/dialogic/Modules/WaitInput/event_wait_input.gd index 118280c9e..09e8cb937 100644 --- a/addons/dialogic/Modules/WaitInput/event_wait_input.gd +++ b/addons/dialogic/Modules/WaitInput/event_wait_input.gd @@ -45,4 +45,4 @@ func get_shortcode_parameters() -> Dictionary: func build_event_editor(): add_header_label('Wait for input') - add_body_edit('hide_textbox', ValueType.BOOL, 'Hide text box:') + add_body_edit('hide_textbox', ValueType.BOOL, {'left_text':'Hide text box:'}) diff --git a/addons/dialogic/Resources/event.gd b/addons/dialogic/Resources/event.gd index b992c865b..a722ad258 100644 --- a/addons/dialogic/Resources/event.gd +++ b/addons/dialogic/Resources/event.gd @@ -405,7 +405,7 @@ func add_header_label(text:String, condition:String = "") -> void: }) -func add_header_edit(variable:String, editor_type = ValueType.LABEL, left_text:String = "", right_text:String = "", extra_info:Dictionary = {}, condition:String = "") -> void: +func add_header_edit(variable:String, editor_type = ValueType.LABEL, extra_info:Dictionary = {}, condition:String = "") -> void: editor_list.append({ "name" : variable, "type" : typeof(get(variable)), @@ -413,8 +413,8 @@ func add_header_edit(variable:String, editor_type = ValueType.LABEL, left_text:S "usage" : PROPERTY_USAGE_DEFAULT, "dialogic_type" : editor_type, "display_info" : extra_info, - "left_text" : left_text, - "right_text" : right_text, + "left_text" : extra_info.get('left_text', ''), + "right_text" : extra_info.get('right_text', ''), "condition" : condition, }) @@ -431,7 +431,7 @@ func add_header_button(text:String, callable:Callable, tooltip:String, icon: Var }) -func add_body_edit(variable:String, editor_type = ValueType.LABEL, left_text:String= "", right_text:String="", extra_info:Dictionary = {}, condition:String = "") -> void: +func add_body_edit(variable:String, editor_type = ValueType.LABEL, extra_info:Dictionary = {}, condition:String = "") -> void: editor_list.append({ "name" : variable, "type" : typeof(get(variable)), @@ -439,8 +439,8 @@ func add_body_edit(variable:String, editor_type = ValueType.LABEL, left_text:Str "usage" : PROPERTY_USAGE_DEFAULT, "dialogic_type" : editor_type, "display_info" : extra_info, - "left_text" : left_text, - "right_text" : right_text, + "left_text" : extra_info.get('left_text', ''), + "right_text" : extra_info.get('right_text', ''), "condition" : condition, })