Преглед на файлове

Bind goto_line function for Script Editor #9153
- added doc for ScriptEditor:goto_line

mawenzy преди 6 години
родител
ревизия
d87021de93
променени са 2 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 9 0
      doc/classes/ScriptEditor.xml
  2. 1 0
      editor/plugins/script_editor_plugin.cpp

+ 9 - 0
doc/classes/ScriptEditor.xml

@@ -57,6 +57,15 @@
 				Returns an array with all [Script] objects which are currently open in editor.
 			</description>
 		</method>
+		<method name="goto_line">
+			<return type="void">
+			</return>
+			<argument index="0" name="line_number" type="int">
+			</argument>
+			<description>
+				Goes to the specified line in the current script.
+			</description>
+		</method>
 		<method name="open_script_create_dialog">
 			<return type="void">
 			</return>

+ 1 - 0
editor/plugins/script_editor_plugin.cpp

@@ -2883,6 +2883,7 @@ void ScriptEditor::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("can_drop_data_fw", "point", "data", "from"), &ScriptEditor::can_drop_data_fw);
 	ClassDB::bind_method(D_METHOD("drop_data_fw", "point", "data", "from"), &ScriptEditor::drop_data_fw);
 
+	ClassDB::bind_method(D_METHOD("goto_line", "line_number"), &ScriptEditor::_goto_script_line2);
 	ClassDB::bind_method(D_METHOD("get_current_script"), &ScriptEditor::_get_current_script);
 	ClassDB::bind_method(D_METHOD("get_open_scripts"), &ScriptEditor::_get_open_scripts);
 	ClassDB::bind_method(D_METHOD("open_script_create_dialog", "base_name", "base_path"), &ScriptEditor::open_script_create_dialog);