AnidemDex / Godot-DialogPlugin

🗨️ A Dialog Node for Godot Engine
MIT License
213 stars 11 forks source link

`DialogNode.show_text()` don't show the node when using it #52

Closed AnidemDex closed 2 years ago

AnidemDex commented 2 years ago

OS

No response

Godot Version

No response

Plugin Version

1.0 (lastest)

Issue description

As the title says, dialog node show_text should show the node when you use that method. No idea why I forgot to add that behaviour since the method name supposes to show the node.

Thanks to babypandabear3 on Discord server for pointing this out.

Steps to reproduce

call show_text("asdf") in a valid DialogNode instance.

Workaround

# Assuming that dialog_node is a valid DialogNode instance
dialog_node.show()
dialog_node.show_text("asdf")
AnidemDex commented 2 years ago

In adition to this, if you got this error

 E 0:00:00.897   get_wordwrap_string_size: Condition "p_width <= 0" is true. Returned: Vector2(0, get_height())
  <C++ Source>  scene/resources/font.cpp:484 @ get_wordwrap_string_size()
  <Stack Trace> dialog_node.gd:145 @ _scroll_to_new_line()
                dialog_node.gd:104 @ _update_displayed_text()

Is due the node is hidden before trying to add text