-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
[3.x] Backport Accept global classes for MainLoop
type in project settings
#52438
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main.cpp
hasn't changed much when comparing to master
, so it should be safe to merge, the code looks correct to me in 3.x
(haven't tested). Someone from the core developers would have to run CI checks to confirm that this PR compiles.
2029a89
to
f2a3af4
Compare
} else { // Not based on script path. | ||
if (!editor && !ClassDB::class_exists(main_loop_type) && ScriptServer::is_global_class(main_loop_type)) { | ||
String script_path = ScriptServer::get_global_class_path(main_loop_type); | ||
Ref<Script> script_res = ResourceLoader::load(script_path, "Script", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Ref<Script> script_res = ResourceLoader::load(script_path);
+ Ref<Script> script_res = ResourceLoader::load(script_path, "Script", true);
script_res should be load without any cache
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this shouldn't matter much because not a lot of resources get loaded at engine startup to worry about this I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most of the time, the loading of custom main loop is fine.
some times. if I clike Run Button very fast after opening the editor. then my custom main loop script seems load failed.
After this error happening, script wont be reload until I reopen the editor.
tested by setting no_cache=true here still won't fix this problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this feature may just reveal editor problem. According to error, the base type is basically ""
, which probably means that editor settings could not get loaded (maybe when the file gets locked for reading, and cannot be read again until the previous Godot process shuts down completely).
Thanks! |
This PR backports the feature that acceptting global classes for
MainLoop
type in project settings, introduced in #41190 on master.