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

Add Character Prefixes and Suffixes to Text Events #2460

Merged
merged 11 commits into from
Nov 11, 2024

Conversation

CakeVR
Copy link
Collaborator

@CakeVR CakeVR commented Oct 29, 2024

This new Feature allows to set text segments before and after a text spoken by a character.

For instance, you can set the or " for your quotation marks or use rich tags, such as colour.

Copy link
Contributor

@salianifo salianifo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is such a handy feature!

@Jowan-Spooner
Copy link
Member

I very much like this.
I'd remove the placeholder quotation marks in the line edits, because with just a symbol it's a bit unclear that it's a placeholder.

I'd also recommend doing it like this:

	if current_character:
		var character_prefix: String = current_character.custom_info.get(DialogicCharacterPrefixSuffixSection.PREFIX_CUSTOM_KEY, DialogicCharacterPrefixSuffixSection.DEFAULT_PREFIX)
		var character_suffix: String = current_character.custom_info.get(DialogicCharacterPrefixSuffixSection.SUFFIX_CUSTOM_KEY, DialogicCharacterPrefixSuffixSection.DEFAULT_SUFFIX)
		text = character_prefix + text + character_suffix
					
	text_node.reveal_text(text, additional)

Because this way the modified version is what is getting returned by Dialogic.Text.update_dialog_text() and thus also what is stored in the simple history.

Or is there a reason you didn't do it that way?

@CakeVR
Copy link
Collaborator Author

CakeVR commented Nov 11, 2024

I very much like this. I'd remove the placeholder quotation marks in the line edits, because with just a symbol it's a bit unclear that it's a placeholder.

I'd also recommend doing it like this:

	if current_character:
		var character_prefix: String = current_character.custom_info.get(DialogicCharacterPrefixSuffixSection.PREFIX_CUSTOM_KEY, DialogicCharacterPrefixSuffixSection.DEFAULT_PREFIX)
		var character_suffix: String = current_character.custom_info.get(DialogicCharacterPrefixSuffixSection.SUFFIX_CUSTOM_KEY, DialogicCharacterPrefixSuffixSection.DEFAULT_SUFFIX)
		text = character_prefix + text + character_suffix
					
	text_node.reveal_text(text, additional)

Because this way the modified version is what is getting returned by Dialogic.Text.update_dialog_text() and thus also what is stored in the simple history.

Or is there a reason you didn't do it that way?

Thanks! I have applied your suggestions.

@Jowan-Spooner
Copy link
Member

Cool. Looks good to me now!

@Jowan-Spooner Jowan-Spooner merged commit b21dce8 into dialogic-godot:main Nov 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants