dialogic-godot / dialogic

💬 Create Dialogs, Visual Novels, RPGs, and manage Characters with Godot to create your Game!
https://dialogic.pro
MIT License
4.05k stars 239 forks source link

Add Character Prefixes and Suffixes to Text Events #2460

Closed CakeVR closed 2 weeks ago

CakeVR commented 1 month ago

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.

Jowan-Spooner commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

Cool. Looks good to me now!