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

Text problem Bb Code Enabled / disabled #36711

Closed
Tracked by #39144
Torguen opened this issue Mar 1, 2020 · 2 comments · Fixed by #39148
Closed
Tracked by #39144

Text problem Bb Code Enabled / disabled #36711

Torguen opened this issue Mar 1, 2020 · 2 comments · Fixed by #39148
Milestone

Comments

@Torguen
Copy link

Torguen commented Mar 1, 2020

Godot version:
3.2.1 RC1 mono

OS/device including version:
win10 64

Issue description:
Deactivating the option Bb Code "Enabled" does not make the written text appear again.

Steps to reproduce:
1-Enter some text in the "Text" box.
The text is displayed.

2-In the Bb Code section click on "Enabled".
Now the text disappears from the screen.

3-Deactivate the option Bb Code "Enabled" again.
The text is not displayed again.

In the GIF, ENTER was pressed in the "Text" box after step 3 for the text to be seen again.

8colores

Minimal reproduction project:
textTest.zip

@timothyqiu
Copy link
Member

The main cause of the "issue" is that the text property is not stored, it's just an easy way to update / inspect the tag stack.

When enabling BBCode, the current bbcode property is used to update the tag stack. Since the bbcode property is empty, the tag stack becomes empty. Disabling BBCode does nothing to the tag stack, it only affects the setter of bbcode property. So toggling BBCode's enabled property won't make the content non-empty.

Maybe the documentation needs to make it clear.

@Ydjeen
Copy link

Ydjeen commented Mar 9, 2020

There is some inconsistency in how two text fields from Inspector interact with a text, shown in a view-port and how the text is stored, i.e., how text behaves after the scene is reloaded.

  • First of all, the text that is displayed in a view-port is always the text that was last edited.
    For example, i've put some text into BBCode text field and then some into normal one. Second one will be completly ignored, but is still shown in the view-port.
    richtextlabel_before_save

  • Second, if some text is present in the BBCode text field, only it will be saved. In other words, after the scene is reopened, text from BBCode text field will be duplicated in the usual text field and it will be displayed in the view-port. This behavior is described in documentation, but i still find it somehow not intuitive.

  • And also this bug with the BBCode checkbox, mentioned by Torguen.

I would like to know, if the two text fields are really necessary ?

The way i see it - there should be only one text field, and the BBCode check-box should only inform a renderer how the text should be drawn - as a simple text tag, or should it be parsed taking into account the BBCode markup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants