You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Expose ScriptEditor::edit to scripting
Exposes a method in `EditorInterface` to open scripts on a specified
line and column. This method handles if the internal or the external
editor should be used.
(cherry picked from commit 9535831866)
This commit is contained in:
committed by
Rémi Verschelde
parent
eb309b75ce
commit
229489f7b7
@@ -165,6 +165,10 @@ void EditorInterface::edit_node(Node *p_node) {
|
||||
EditorNode::get_singleton()->edit_node(p_node);
|
||||
}
|
||||
|
||||
void EditorInterface::edit_script(const Ref<Script> &p_script, int p_line, int p_col, bool p_grab_focus) {
|
||||
ScriptEditor::get_singleton()->edit(p_script, p_line, p_col, p_grab_focus);
|
||||
}
|
||||
|
||||
void EditorInterface::open_scene_from_path(const String &scene_path) {
|
||||
if (EditorNode::get_singleton()->is_changing_scene()) {
|
||||
return;
|
||||
@@ -318,6 +322,7 @@ void EditorInterface::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_editor_scale"), &EditorInterface::get_editor_scale);
|
||||
ClassDB::bind_method(D_METHOD("edit_resource", "resource"), &EditorInterface::edit_resource);
|
||||
ClassDB::bind_method(D_METHOD("edit_node", "node"), &EditorInterface::edit_node);
|
||||
ClassDB::bind_method(D_METHOD("edit_script", "script", "line", "column", "grab_focus"), &EditorInterface::edit_script, DEFVAL(-1), DEFVAL(0), DEFVAL(true));
|
||||
ClassDB::bind_method(D_METHOD("open_scene_from_path", "scene_filepath"), &EditorInterface::open_scene_from_path);
|
||||
ClassDB::bind_method(D_METHOD("reload_scene_from_path", "scene_filepath"), &EditorInterface::reload_scene_from_path);
|
||||
ClassDB::bind_method(D_METHOD("play_main_scene"), &EditorInterface::play_main_scene);
|
||||
|
||||
Reference in New Issue
Block a user