-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Edit a script in the editor not emit signal "changed" #47615
Comments
According to the documentation: https://docs.godotengine.org/en/stable/classes/class_scripteditor.html#signals One thing you might be able to do is get the source code of the script and do a comparison to determine if it was modified or not. https://docs.godotengine.org/en/stable/classes/class_script.html#class-script-method-get-script-property-list |
@codecustard i now this this is the reason why i use To detect source changes i need a history of the script but this is also not available. best regards ;) |
@MikeSchulze, Is there any documentation on the 'script_changed' and 'changed' signals? The only documentation I could find was the 'script_changed' signal for objects which would trigger whenever the object's script is changed, so if it has script1 attached and you attach script2, it would trigger. https://docs.godotengine.org/en/stable/classes/class_object.html#class-object Although I could be wrong, if you have anything to point out that says otherwise.... So in that case I would think that it is functioning as intended. If that's the case you would have to create your own signal that checks the script source code for changes and trigger your custom signal that way. This could also be an added feature (if I'm wrong that it doesn't exist) as it would definitely be beneficial, but it's uncommon to be changing scripts that I'm not sure it would be a good idea to have a signal that constantly polls the source code. |
Would love to have ScriptEditor emit a signal on file save with a parameter that identifies the saved file. I think that would address most of the requests I've seen where people are creating plug-ins that need to keep tract of script/file changes. Should not be a breaking change. |
Godot version:
Godot Engine v3.2.4.beta4.official
OS/device including version:
Windows 10/ MacOS
Issue description:
I want to detect a script is changed via editor to handle a custom save action to save only changed scripts.
I working on a unit test api and it needs to save all changed resources before run.
For now i use a workaround to save all opend files over the menu action.
And I want to print out which file is saved, i do this for now by:
But it contains all opened files.
So i try to register for "changed" signal to collect a set of changed files form the editor.
But no signal
changed
orscript_changed
is emitedSteps to reproduce:
No "changed" signal is emited
Minimal reproduction project:
plugin-edit-script.zip
The text was updated successfully, but these errors were encountered: