mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Allow editor plugins to modify run arguments
This commit is contained in:
@@ -531,6 +531,13 @@ bool EditorPlugin::build() {
|
||||
return success;
|
||||
}
|
||||
|
||||
void EditorPlugin::run_scene(const String &p_scene, Vector<String> &r_args) {
|
||||
Vector<String> new_args;
|
||||
if (GDVIRTUAL_CALL(_run_scene, p_scene, r_args, new_args)) {
|
||||
r_args = new_args;
|
||||
}
|
||||
}
|
||||
|
||||
void EditorPlugin::queue_save_layout() {
|
||||
EditorNode::get_singleton()->save_editor_layout_delayed();
|
||||
}
|
||||
@@ -665,6 +672,7 @@ void EditorPlugin::_bind_methods() {
|
||||
GDVIRTUAL_BIND(_set_window_layout, "configuration");
|
||||
GDVIRTUAL_BIND(_get_window_layout, "configuration");
|
||||
GDVIRTUAL_BIND(_build);
|
||||
GDVIRTUAL_BIND(_run_scene, "scene", "args");
|
||||
GDVIRTUAL_BIND(_enable_plugin);
|
||||
GDVIRTUAL_BIND(_disable_plugin);
|
||||
|
||||
|
||||
@@ -133,6 +133,7 @@ protected:
|
||||
GDVIRTUAL1(_set_window_layout, Ref<ConfigFile>)
|
||||
GDVIRTUAL1(_get_window_layout, Ref<ConfigFile>)
|
||||
GDVIRTUAL0R(bool, _build)
|
||||
GDVIRTUAL2RC(Vector<String>, _run_scene, String, Vector<String>)
|
||||
GDVIRTUAL0(_enable_plugin)
|
||||
GDVIRTUAL0(_disable_plugin)
|
||||
|
||||
@@ -202,6 +203,7 @@ public:
|
||||
virtual void get_window_layout(Ref<ConfigFile> p_layout);
|
||||
virtual void edited_scene_changed() {} // if changes are pending in editor, apply them
|
||||
virtual bool build(); // builds with external tools. Returns true if safe to continue running scene.
|
||||
virtual void run_scene(const String &p_scene, Vector<String> &r_args);
|
||||
|
||||
EditorInterface *get_editor_interface();
|
||||
ScriptCreateDialog *get_script_create_dialog();
|
||||
|
||||
Reference in New Issue
Block a user