Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide portrait picker if character has none or only one portrait #1425

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion addons/dialogic/Events/Character/event_character.gd
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ func build_event_editor() -> void:
{'empty_text' : 'Default',
'suggestions_func' : get_portrait_suggestions,
'icon' : load("res://addons/dialogic/Editor/Images/Resources/portrait.svg")},
'character != null and !has_no_portraits() and action_type != %s' %ActionTypes.Leave)
'should_show_portrait_selector()')
add_header_edit('position', ValueType.Integer, ' at position', '', {},
'character != null and !has_no_portraits() and action_type != %s' %ActionTypes.Leave)

Expand Down Expand Up @@ -396,6 +396,9 @@ func build_event_editor() -> void:
func should_show_animation_options() -> bool:
return (character != null and !character.portraits.is_empty()) or _character_from_directory == '--All--'

func should_show_portrait_selector() -> bool:
return character != null and len(character.portraits) > 1 and action_type != ActionTypes.Leave

func has_no_portraits() -> bool:
return character and character.portraits.is_empty()

Expand Down