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 for Inspector not running code in @tool scripts until restart #66381 #92099

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hilderin
Copy link
Contributor

@Hilderin Hilderin commented May 19, 2024

This PR should fix the problem where adding @tool in a GDScript where there are getters and setters does not work until the editor is restarted #66381.
I figured out that the problem was caused by creating a PlaceHolderInstance when the script is not a tool and nothing was converting it to a GDScriptInstance when adding @tool. The inverse was probably also a problem when removing the @tool.

It's my first time working with the GDScript, so I certainly missed something especially that my fix was real simple to implement. I did not test extensively.

I did not modify anything to fix the same issue with C# script. I'll wait your feedback before trying the same fix with C#.

@Hilderin Hilderin requested a review from a team as a code owner May 19, 2024 01:38
@Hilderin Hilderin force-pushed the fix_tool_script_not_running_until_restart branch from 8ba1180 to ef6e94d Compare May 19, 2024 02:19
@dalexeev dalexeev added this to the 4.3 milestone May 19, 2024
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.

Inspector not running code in @tool scripts until restart
2 participants