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

Merge pull request #107862 from Naros/scripteditor-clear-docs-from-script

Expose `ScriptEditor.clear_docs_from_script`
Thaddeus Crews преди 3 месеца
родител
ревизия
e5ece3c514
променени са 2 файла, в които са добавени 10 реда и са изтрити 1 реда
  1. 9 1
      doc/classes/ScriptEditor.xml
  2. 1 0
      editor/plugins/script_editor_plugin.cpp

+ 9 - 1
doc/classes/ScriptEditor.xml

@@ -10,6 +10,14 @@
 	<tutorials>
 	</tutorials>
 	<methods>
+		<method name="clear_docs_from_script">
+			<return type="void" />
+			<param index="0" name="script" type="Script" />
+			<description>
+				Removes the documentation for the given [param script].
+				[b]Note:[/b] This should be called whenever the script is changed to keep the open documentation state up to date.
+			</description>
+		</method>
 		<method name="get_breakpoints">
 			<return type="PackedStringArray" />
 			<description>
@@ -103,7 +111,7 @@
 			<return type="void" />
 			<param index="0" name="script" type="Script" />
 			<description>
-				Updates the documentation for the given [param script] if the script's documentation is currently open.
+				Updates the documentation for the given [param script].
 				[b]Note:[/b] This should be called whenever the script is changed to keep the open documentation state up to date.
 			</description>
 		</method>

+ 1 - 0
editor/plugins/script_editor_plugin.cpp

@@ -4153,6 +4153,7 @@ void ScriptEditor::_bind_methods() {
 
 	ClassDB::bind_method(D_METHOD("goto_help", "topic"), &ScriptEditor::goto_help);
 	ClassDB::bind_method(D_METHOD("update_docs_from_script", "script"), &ScriptEditor::update_docs_from_script);
+	ClassDB::bind_method(D_METHOD("clear_docs_from_script", "script"), &ScriptEditor::clear_docs_from_script);
 
 	ADD_SIGNAL(MethodInfo("editor_script_changed", PropertyInfo(Variant::OBJECT, "script", PROPERTY_HINT_RESOURCE_TYPE, "Script")));
 	ADD_SIGNAL(MethodInfo("script_close", PropertyInfo(Variant::OBJECT, "script", PROPERTY_HINT_RESOURCE_TYPE, "Script")));