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

Best practices godot interfaces #6831

Closed
wants to merge 4 commits into from
Closed

Best practices godot interfaces #6831

wants to merge 4 commits into from

Conversation

thiagola92
Copy link
Contributor

Update one code block in Godot Interfaces

Comment on lines 60 to 61
@export var const_script: Script:
set = set_const_script
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@export var const_script: Script:
set = set_const_script
@export var const_script : Script:
set = set_const_script

Looks all good except this one. This seems pretty hard to read to me, not sure how to improve it. And should there be a space before the type for consistency, like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Style guide doesn't mention space between variable and colon <variable>: <type> but i'm not sure in this case with set/get.

@mhilbrunner mhilbrunner added enhancement area:manual Issues and PRs related to the Manual/Tutorials section of the documentation labels Feb 27, 2023
@thiagola92
Copy link
Contributor Author

thiagola92 commented Feb 27, 2023

Updated setter from

@export var const_script: Script:
    set = set_const_script
func set_const_script(value):
    if Engine.is_editor_hint():
        const_script = value

to

@export var const_script: Script:
    set(value):
        if Engine.is_editor_hint():
            const_script = value

@Piralein
Copy link
Member

Piralein commented Aug 10, 2023

This PR was unfortunately superseded by #7640.

I'm sorry we missed the duplicate.
Thank you for your contribution nonetheless.

@Piralein Piralein closed this Aug 10, 2023
@thiagola92 thiagola92 deleted the best-practices-godot-interfaces branch September 7, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archived area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants