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

Rich text labels resetting unexpectedly when scene tree modified in game Godot 4.3-stable #96937

Closed
elfkan opened this issue Sep 12, 2024 · 4 comments · Fixed by #97061
Closed

Comments

@elfkan
Copy link

elfkan commented Sep 12, 2024

Tested versions

  • Reproducible in: 4.3.stable, - Not reproducible in: 4.2 stable, 4.1.stable, and earlier godot versions

System information

Godot v4.3.stable - Windows 10.0.19045 - GLES3 (Compatibility) - NVIDIA GeForce MX250 (NVIDIA; 31.0.15.4629) - Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz (8 Threads)

Issue description

image

For reference, I am using above code to change in-game scenes. This has worked for all versions until now and this property has been crucial for my project.
As of now, rich text labels are being reverted to default when above function switches to another mini-scene, then back.

Below is the edited rich text label using parsed bbcode(I tested and the code that edits the text does not run when switched back)
image

Now when the first function is called twice to change to another section then back, it turns into this, which is what it looks like initially and in the editor. No other nodes are affected except rich text labels.

image

Interestingly enough, with one of my rich text labels that was edited through a multi-threaded-process, it seems to keep the edits even with the scene change, however, the other rich text labels in that scene revert back to default.

Steps to reproduce

1: Create scene with rich text label
2: Add functionality to parse bbcode and change the text
3: Create a main scene
4: Use supplied function

For the project!
1: click the change scene button
2: click the change rich text button
3: click the change scene button twice
4: see the result

Minimal reproduction project (MRP)

richlabelbug.zip

@elfkan elfkan changed the title Rich text labels resetting when scene tree modified in game Godot 4.3 Rich text labels resetting when scene tree modified in game Godot 4.3-stable Sep 12, 2024
@elfkan elfkan changed the title Rich text labels resetting when scene tree modified in game Godot 4.3-stable Rich text labels resetting unexpectedly when scene tree modified in game Godot 4.3-stable Sep 13, 2024
@AThousandShips AThousandShips added this to the 4.4 milestone Sep 13, 2024
@AThousandShips
Copy link
Member

Can confirm and bisecting now

@AThousandShips
Copy link
Member

AThousandShips commented Sep 13, 2024

Looks like a regression from:

CC @YeldhamDev

As a workaround you can disable auto translation, but I would say this is still a bug and the text shouldn't overwrite just on entering tree like this, but needs some discussion on what is the expected behavior and how to approach it

However there is a clear regression, as enabling the old auto translate option (in a build from [e31b253] or earlier) does not replicate this bug, so this has changed, i.e. enabling the old auto translate setting does not cause this, but having the new setting set to inherit does

@elfkan
Copy link
Author

elfkan commented Sep 13, 2024

Thank you!

Just for my 2 cents, it is a lot easier for a dev to reset the text through code on scene change rather than store a string that resulted through an expensive function, and then make the top node call the scene to change the text back to desired display. Especially when most other gui elements follow the same rules.

@AThousandShips
Copy link
Member

At minimum the change in behavior needs to be evaluated and we need to see if that was a known consequence of this, can't find anything in the discussion on that PR that implies that this was expected, so I think this was unintentional

I'd say that entering the tree again shouldn't reset the text like this, but it could be related to the assignment of the bbcode like this or parsing, but it's unexpected and should at least be documented if it is considered an acceptable limitation or even desired behavior, but I'd say it's at least surprising and unusual and especially a significant change from the previous behavior

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

Successfully merging a pull request may close this issue.

3 participants