I have a dialogue that uses [do my_func()] in the middle of a line.
This function use await, so the dialogue pauses while it's running.
I use the portrait example Balloon, modified so that the player can click the dialogue or press a button to trigger skip_typing() for the current line of dialogue if they read faster than the typing speed I set (similar to the standard way dialogue works in a lot of RPGs : first press = have the whole line of dialogue appear instantly, second press = go to next line.)
If the player do that while my_func is running (ie. during the "await"), the dialogue will call my_func() again AND skip_typing correctly, rather than just skip_typing.
Affected version
Dialogue Manager version: 2.39.1
Godot version: 4.2.2.stable.official [15073afe3]
To Reproduce
Steps to reproduce the behavior:
Have the following dialogue : "Character: Blablabla. [do my_func()] Blabla."
In your balloon, add the following code to the beginning of your _on_balloon_gui_input(event) function :
if event is InputEventMouseButton and event.is_pressed() and event.button_index == 1:
dialogue_label.skip_typing()
Run the scene and trigger the dialogue. While the character is waiting (for the function to be done) after saying Blablabla, click the balloon.
After 3 seconds you should see "test" being printed twice in the Output tab.
Expected behavior
When running skip_typing() after the dialogue already called the function, it should simply skip to the end of the line as usual, without calling the function again.
PS
I fixed my issue by using "do!" since it didn't matter in my case that the dialogue waited for the function to run (and if it did there's other workarounds) so this bug isn't an issue for me, I'm just reporting it to inform about it.
Describe the bug
I have a dialogue that uses [do my_func()] in the middle of a line. This function use await, so the dialogue pauses while it's running.
I use the portrait example Balloon, modified so that the player can click the dialogue or press a button to trigger skip_typing() for the current line of dialogue if they read faster than the typing speed I set (similar to the standard way dialogue works in a lot of RPGs : first press = have the whole line of dialogue appear instantly, second press = go to next line.)
If the player do that while my_func is running (ie. during the "await"), the dialogue will call my_func() again AND skip_typing correctly, rather than just skip_typing.
Affected version
To Reproduce Steps to reproduce the behavior:
Have the following dialogue : "Character: Blablabla. [do my_func()] Blabla."
Have the following function :
In your balloon, add the following code to the beginning of your _on_balloon_gui_input(event) function :
Run the scene and trigger the dialogue. While the character is waiting (for the function to be done) after saying Blablabla, click the balloon.
After 3 seconds you should see "test" being printed twice in the Output tab.
Expected behavior When running skip_typing() after the dialogue already called the function, it should simply skip to the end of the line as usual, without calling the function again.
PS I fixed my issue by using "do!" since it didn't matter in my case that the dialogue waited for the function to run (and if it did there's other workarounds) so this bug isn't an issue for me, I'm just reporting it to inform about it.