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

Fix property groups overriding real properties #85486

Merged

Conversation

paulloz
Copy link
Member

@paulloz paulloz commented Nov 28, 2023

With the following script, each rebuild reverts the exported value to its default.

public partial class Foo : Node
{
    [ExportGroup("Test")]
    [Export]
    private string Test;
}

The same thing happens in GDScript. With the following script, modifying the default value in the code overwrites any value defined through the inspector.

extends Node

@export_group("test")
@export
var test : String = "Hello World!"

It is triggered by the group using the same name as the actual property (changing the group names above prevents the weird behaviour).

@paulloz paulloz requested a review from a team as a code owner November 28, 2023 19:57
@AThousandShips AThousandShips added this to the 4.3 milestone Nov 28, 2023
core/object/script_language.cpp Outdated Show resolved Hide resolved
core/object/script_language.cpp Outdated Show resolved Hide resolved
@paulloz paulloz force-pushed the fix/property-groups-shadowing branch from ee81a32 to decf3b2 Compare November 28, 2023 20:34
@akien-mga akien-mga added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Nov 29, 2023
Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I think.

@akien-mga akien-mga merged commit 75d7aab into godotengine:master Dec 5, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@YuriSizov
Copy link
Contributor

Cherry-picked for 4.2.1.

@YuriSizov YuriSizov removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Dec 5, 2023
@paulloz paulloz deleted the fix/property-groups-shadowing branch April 19, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants