dialogic-godot / dialogic

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

Fix history not evaluating variables in names #2136

Closed Atlinx closed 2 months ago

Atlinx commented 2 months ago

Added get_character_name_text method to the text subsystem. This method evaluates and translates character's name and returns the final text that should be displayed. It's now used in the text event, character event, and in the update_name_label of the text subsystem.

Fixes #2127

https://github.com/dialogic-godot/dialogic/assets/25368491/79452ce9-e4bc-4c39-a4e4-8bad22a6ca0c

Jowan-Spooner commented 2 months ago

Looks good to me. Please use static typing as outlined in the styleguide https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html. I've made the necessary changes and also named the method get_character_name_parsed (text was to generic for my taste ;)) and moved it to the helper section.

Thanks a lot for the PR!