Allow editor plugins to modify run arguments

This commit is contained in:
David Snopek
2025-06-18 10:12:34 -05:00
parent d705613db3
commit fe27a72cb5
6 changed files with 37 additions and 1 deletions

View File

@ -314,13 +314,17 @@ void EditorRunBar::_run_scene(const String &p_scene_path, const Vector<String> &
if (!EditorNode::get_singleton()->call_build()) {
return;
}
Vector<String> args = p_run_args;
EditorNode::get_singleton()->call_run_scene(run_filename, args);
// Use the existing URI, in case it is overridden by the CLI.
String uri = EditorDebuggerNode::get_singleton()->get_server_uri();
if (uri.is_empty()) {
uri = "tcp://";
}
EditorDebuggerNode::get_singleton()->start(uri);
Error error = editor_run.run(run_filename, write_movie_file, p_run_args);
Error error = editor_run.run(run_filename, write_movie_file, args);
if (error != OK) {
EditorDebuggerNode::get_singleton()->stop();
EditorNode::get_singleton()->show_accept(TTR("Could not start subprocess(es)!"), TTR("OK"));