From 7ff135b0158e0b5dd7a85d98aecd7ff0975e7e43 Mon Sep 17 00:00:00 2001 From: kobewi Date: Sat, 15 May 2021 23:48:59 +0200 Subject: Consistently prefix bound virtual methods with _ --- doc/classes/AnimationNode.xml | 118 +++--- doc/classes/Control.xml | 206 +++++----- doc/classes/EditorImportPlugin.xml | 50 +-- doc/classes/EditorInspectorPlugin.xml | 92 ++--- doc/classes/EditorNode3DGizmo.xml | 138 +++---- doc/classes/EditorNode3DGizmoPlugin.xml | 162 ++++---- doc/classes/EditorPlugin.xml | 522 ++++++++++++------------- doc/classes/EditorProperty.xml | 18 +- doc/classes/EditorResourcePicker.xml | 34 -- doc/classes/EditorResourcePreviewGenerator.xml | 16 +- doc/classes/EditorScenePostImport.xml | 20 +- doc/classes/EditorSyntaxHighlighter.xml | 2 +- doc/classes/EditorTranslationParserPlugin.xml | 14 +- doc/classes/FileSystemDock.xml | 34 -- doc/classes/ResourceFormatLoader.xml | 12 +- doc/classes/ResourceFormatSaver.xml | 8 +- doc/classes/ScriptEditor.xml | 34 -- doc/classes/ScriptEditorBase.xml | 2 +- doc/classes/Tree.xml | 2 +- doc/classes/Viewport.xml | 2 +- 20 files changed, 689 insertions(+), 797 deletions(-) (limited to 'doc') diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index 8204b456d9..fddd8989ab 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -11,6 +11,65 @@ https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html + + + + + Gets the text caption for this node (used by some editors). + + + + + + + + + Gets a child node by index (used by editors inheriting from [AnimationRootNode]). + + + + + + + Gets all children nodes in order as a [code]name: node[/code] dictionary. Only useful when inheriting [AnimationRootNode]. + + + + + + + + + Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. + + + + + + + Gets the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to [method Object.get_property_list]. + + + + + + + Returns [code]true[/code] whether you want the blend tree editor to display filter editing on this node. + + + + + + + + + + + User-defined callback called when a custom node is processed. The [code]time[/code] parameter is a relative delta, unless [code]seek[/code] is [code]true[/code], in which case it is absolute. + Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory. + This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called). + + @@ -77,29 +136,6 @@ Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from [AnimationRootNode] instead, else editors will not display your node for addition. - - - - - Gets the text caption for this node (used by some editors). - - - - - - - - - Gets a child node by index (used by editors inheriting from [AnimationRootNode]). - - - - - - - Gets all children nodes in order as a [code]name: node[/code] dictionary. Only useful when inheriting [AnimationRootNode]. - - @@ -125,29 +161,6 @@ Gets the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. - - - - - - - Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. - - - - - - - Gets the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to [method Object.get_property_list]. - - - - - - - Returns [code]true[/code] whether you want the blend tree editor to display filter editing on this node. - - @@ -157,19 +170,6 @@ Returns [code]true[/code] whether a given path is filtered. - - - - - - - - - User-defined callback called when a custom node is processed. The [code]time[/code] parameter is a relative delta, unless [code]seek[/code] is [code]true[/code], in which case it is absolute. - Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory. - This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called). - - diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 9c61fca598..33969cf4c3 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -22,6 +22,34 @@ https://github.com/godotengine/godot-demo-projects/tree/master/gui + + + + + + + + + Godot calls this method to test if [code]data[/code] from a control's [method _get_drag_data] can be dropped at [code]position[/code]. [code]position[/code] is local to this control. + This method should only be used to test the data. Process the data in [method _drop_data]. + [codeblocks] + [gdscript] + func _can_drop_data(position, data): + # Check position if it is relevant to you + # Otherwise, just check data + return typeof(data) == TYPE_DICTIONARY and data.has("expected") + [/gdscript] + [csharp] + public override bool CanDropData(Vector2 position, object data) + { + // Check position if it is relevant to you + // Otherwise, just check data + return data is Godot.Collections.Dictionary && (data as Godot.Collections.Dictionary).Contains("expected"); + } + [/csharp] + [/codeblocks] + + @@ -30,6 +58,61 @@ If not overridden, defaults to [code]false[/code]. + + + + + + + + + Godot calls this method to pass you the [code]data[/code] from a control's [method _get_drag_data] result. Godot first calls [method _can_drop_data] to test if [code]data[/code] is allowed to drop at [code]position[/code] where [code]position[/code] is local to this control. + [codeblocks] + [gdscript] + func _can_drop_data(position, data): + return typeof(data) == TYPE_DICTIONARY and data.has("color") + func _drop_data(position, data): + var color = data["color"] + [/gdscript] + [csharp] + public override bool CanDropData(Vector2 position, object data) + { + return data is Godot.Collections.Dictionary && (data as Godot.Collections.Dictionary).Contains("color"); + } + public override void DropData(Vector2 position, object data) + { + Color color = (Color)(data as Godot.Collections.Dictionary)["color"]; + } + [/csharp] + [/codeblocks] + + + + + + + + + Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method _can_drop_data] and [method _drop_data]. [code]position[/code] is local to this control. Drag may be forced with [method force_drag]. + A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method. + [codeblocks] + [gdscript] + func _get_drag_data(position): + var mydata = make_data() # This is your custom method generating the drag data. + set_drag_preview(make_preview(mydata)) # This is your custom method generating the preview of the drag data. + return mydata + [/gdscript] + [csharp] + public override object GetDragData(Vector2 position) + { + object mydata = MakeData(); // This is your custom method generating the drag data. + SetDragPreview(MakePreview(mydata)); // This is your custom method generating the preview of the drag data. + return mydata; + } + [/csharp] + [/codeblocks] + + @@ -68,13 +151,24 @@ [/csharp] [/codeblocks] The event won't trigger if: - * clicking outside the control (see [method has_point]); + * clicking outside the control (see [method _has_point]); * control has [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; * control is obstructed by another [Control] on top of it, which doesn't have [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; * control's parent has [member mouse_filter] set to [constant MOUSE_FILTER_STOP] or has accepted the event; * it happens outside parent's rectangle and the parent has either [member rect_clip_content] or [method _clips_input] enabled. + + + + + + + Virtual method to be implemented by the user. Returns whether the given [code]point[/code] is inside this control. + If not overridden, default behavior is checking if the point is within control's Rect. + [b]Note:[/b] If you want to check if a point is inside the control, you can use [code]get_rect().has_point(point)[/code]. + + @@ -249,63 +343,6 @@ [/codeblocks] - - - - - - - - - Godot calls this method to test if [code]data[/code] from a control's [method get_drag_data] can be dropped at [code]position[/code]. [code]position[/code] is local to this control. - This method should only be used to test the data. Process the data in [method drop_data]. - [codeblocks] - [gdscript] - func can_drop_data(position, data): - # Check position if it is relevant to you - # Otherwise, just check data - return typeof(data) == TYPE_DICTIONARY and data.has("expected") - [/gdscript] - [csharp] - public override bool CanDropData(Vector2 position, object data) - { - // Check position if it is relevant to you - // Otherwise, just check data - return data is Godot.Collections.Dictionary && (data as Godot.Collections.Dictionary).Contains("expected"); - } - [/csharp] - [/codeblocks] - - - - - - - - - - - Godot calls this method to pass you the [code]data[/code] from a control's [method get_drag_data] result. Godot first calls [method can_drop_data] to test if [code]data[/code] is allowed to drop at [code]position[/code] where [code]position[/code] is local to this control. - [codeblocks] - [gdscript] - func can_drop_data(position, data): - return typeof(data) == TYPE_DICTIONARY and data.has("color") - func drop_data(position, data): - var color = data["color"] - [/gdscript] - [csharp] - public override bool CanDropData(Vector2 position, object data) - { - return data is Godot.Collections.Dictionary && (data as Godot.Collections.Dictionary).Contains("color"); - } - public override void DropData(Vector2 position, object data) - { - Color color = (Color)(data as Godot.Collections.Dictionary)["color"]; - } - [/csharp] - [/codeblocks] - - @@ -328,8 +365,8 @@ - Forces drag and bypasses [method get_drag_data] and [method set_drag_preview] by passing [code]data[/code] and [code]preview[/code]. Drag will start even if the mouse is neither over nor pressed on this control. - The methods [method can_drop_data] and [method drop_data] must be implemented on controls that want to receive drop data. + Forces drag and bypasses [method _get_drag_data] and [method set_drag_preview] by passing [code]data[/code] and [code]preview[/code]. Drag will start even if the mouse is neither over nor pressed on this control. + The methods [method _can_drop_data] and [method _drop_data] must be implemented on controls that want to receive drop data. @@ -364,32 +401,6 @@ Returns the mouse cursor shape the control displays on mouse hover. See [enum CursorShape]. - - - - - - - Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method can_drop_data] and [method drop_data]. [code]position[/code] is local to this control. Drag may be forced with [method force_drag]. - A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method. - [codeblocks] - [gdscript] - func get_drag_data(position): - var mydata = make_data() # This is your custom method generating the drag data. - set_drag_preview(make_preview(mydata)) # This is your custom method generating the preview of the drag data. - return mydata - [/gdscript] - [csharp] - public override object GetDragData(Vector2 position) - { - object mydata = MakeData(); // This is your custom method generating the drag data. - SetDragPreview(MakePreview(mydata)); // This is your custom method generating the preview of the drag data. - return mydata; - } - [/csharp] - [/codeblocks] - - @@ -577,17 +588,6 @@ Returns [code]true[/code] if this is the current focused control. See [member focus_mode]. - - - - - - - Virtual method to be implemented by the user. Returns whether the given [code]point[/code] is inside this control. - If not overridden, default behavior is checking if the point is within control's Rect. - [b]Note:[/b] If you want to check if a point is inside the control, you can use [code]get_rect().has_point(point)[/code]. - - @@ -856,7 +856,7 @@ Forwards the handling of this control's drag and drop to [code]target[/code] control. - Forwarding can be implemented in the target control similar to the methods [method get_drag_data], [method can_drop_data], and [method drop_data] but with two differences: + Forwarding can be implemented in the target control similar to the methods [method _get_drag_data], [method _can_drop_data], and [method _drop_data] but with two differences: 1. The function name must be suffixed with [b]_fw[/b] 2. The function must take an extra argument that is the control doing the forwarding [codeblocks] @@ -871,13 +871,13 @@ # TargetControl.gd extends Control - func can_drop_data_fw(position, data, from_control): + func _can_drop_data_fw(position, data, from_control): return true - func drop_data_fw(position, data, from_control): + func _drop_data_fw(position, data, from_control): my_handle_data(data) # Your handler method. - func get_drag_data_fw(position, from_control): + func _get_drag_data_fw(position, from_control): set_drag_preview(my_preview) return my_data() [/gdscript] @@ -922,12 +922,12 @@ - Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended. + Shows the given control at the mouse pointer. A good time to call this method is in [method _get_drag_data]. The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended. [codeblocks] [gdscript] export (Color, RGBA) var color = Color(1, 0, 0, 1) - func get_drag_data(position): + func _get_drag_data(position): # Use a control that is not in the tree var cpb = ColorPickerButton.new() cpb.color = color diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml index 663eb0ff5c..a532e9bc2b 100644 --- a/doc/classes/EditorImportPlugin.xml +++ b/doc/classes/EditorImportPlugin.xml @@ -5,45 +5,45 @@ EditorImportPlugins provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. Register your [EditorPlugin] with [method EditorPlugin.add_import_plugin]. - EditorImportPlugins work by associating with specific file extensions and a resource type. See [method get_recognized_extensions] and [method get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].godot/imported[/code] directory. + EditorImportPlugins work by associating with specific file extensions and a resource type. See [method _get_recognized_extensions] and [method _get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].godot/imported[/code] directory. Below is an example EditorImportPlugin that imports a [Mesh] from a file with the extension ".special" or ".spec": [codeblocks] [gdscript] tool extends EditorImportPlugin - func get_importer_name(): + func _get_importer_name(): return "my.special.plugin" - func get_visible_name(): + func _get_visible_name(): return "Special Mesh" - func get_recognized_extensions(): + func _get_recognized_extensions(): return ["special", "spec"] - func get_save_extension(): + func _get_save_extension(): return "mesh" - func get_resource_type(): + func _get_resource_type(): return "Mesh" - func get_preset_count(): + func _get_preset_count(): return 1 - func get_preset_name(i): + func _get_preset_name(i): return "Default" - func get_import_options(i): + func _get_import_options(i): return [{"name": "my_option", "default_value": false}] - func import(source_file, save_path, options, platform_variants, gen_files): + func _import(source_file, save_path, options, platform_variants, gen_files): var file = File.new() if file.open(source_file, File.READ) != OK: return FAILED var mesh = ArrayMesh.new() # Fill the Mesh with data read in "file", left as an exercise to the reader. - var filename = save_path + "." + get_save_extension() + var filename = save_path + "." + _get_save_extension() return ResourceSaver.save(filename, mesh) [/gdscript] [csharp] @@ -113,7 +113,7 @@ https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html - + @@ -122,21 +122,21 @@ Gets the options and default values for the preset at this index. Returns an Array of Dictionaries with the following keys: [code]name[/code], [code]default_value[/code], [code]property_hint[/code] (optional), [code]hint_string[/code] (optional), [code]usage[/code] (optional). - + Gets the order of this importer to be run when importing resources. Higher values will be called later. Use this to ensure the importer runs after the dependencies are already imported. - + Gets the unique name of the importer. - + @@ -147,7 +147,7 @@ This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. For example: [codeblocks] [gdscript] - func get_option_visibility(option, options): + func _get_option_visibility(option, options): # Only show the lossy quality setting if the compression mode is set to "Lossy". if option == "compress/lossy_quality" and options.has("compress/mode"): return int(options["compress/mode"]) == COMPRESS_LOSSY # This is a constant that you set @@ -170,14 +170,14 @@ Return [code]true[/code] to make all options always visible. - + - Gets the number of initial presets defined by the plugin. Use [method get_import_options] to get the default options for the preset and [method get_preset_name] to get the name of the preset. + Gets the number of initial presets defined by the plugin. Use [method _get_import_options] to get the default options for the preset and [method _get_preset_name] to get the name of the preset. - + @@ -186,42 +186,42 @@ Gets the name of the options preset at this index. - + Gets the priority of this plugin for the recognized extension. Higher priority plugins will be preferred. The default priority is [code]1.0[/code]. - + Gets the list of file extensions to associate with this loader (case-insensitive). e.g. [code]["obj"][/code]. - + Gets the Godot resource type associated with this loader. e.g. [code]"Mesh"[/code] or [code]"Animation"[/code]. - + Gets the extension used to save this resource in the [code].godot/imported[/code] directory. - + Gets the name to display in the import window. You should choose this name as a continuation to "Import as", e.g. "Import as Special Mesh". - + diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index b092a53676..c992d0fbb4 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -6,101 +6,95 @@ These plugins allow adding custom property editors to [EditorInspector]. Plugins are registered via [method EditorPlugin.add_inspector_plugin]. - When an object is edited, the [method can_handle] function is called and must return [code]true[/code] if the object type is supported. - If supported, the function [method parse_begin] will be called, allowing to place custom controls at the beginning of the class. - Subsequently, the [method parse_category] and [method parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too. - Finally, [method parse_end] will be called. + When an object is edited, the [method _can_handle] function is called and must return [code]true[/code] if the object type is supported. + If supported, the function [method _parse_begin] will be called, allowing to place custom controls at the beginning of the class. + Subsequently, the [method _parse_category] and [method _parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too. + Finally, [method _parse_end] will be called. On each of these calls, the "add" functions can be called. - - + + - + - Adds a custom control, not necessarily a property editor. + Returns [code]true[/code] if this object can be handled by this plugin. - + - - - - - Adds a property editor, this must inherit [EditorProperty]. + Called to allow adding controls at the beginning of the list. - + - - - - - + - Adds an editor that allows modifying multiple properties, this must inherit [EditorProperty]. + Called to allow adding controls at the beginning of the category. - - + + - - - Returns [code]true[/code] if this object can be handled by this plugin. + Called to allow adding controls at the end of the list. - - + + - + + + + + + + + + - Called to allow adding controls at the beginning of the list. + Called to allow adding property specific editors to the inspector. Usually these inherit [EditorProperty]. Returning [code]true[/code] removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one. - + - - - + - Called to allow adding controls at the beginning of the category. + Adds a custom control, not necessarily a property editor. - + + + + + - Called to allow adding controls at the end of the list. + Adds a property editor, this must inherit [EditorProperty]. - - + + - - - - - - - + - + - + - Called to allow adding property specific editors to the inspector. Usually these inherit [EditorProperty]. Returning [code]true[/code] removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one. + Adds an editor that allows modifying multiple properties, this must inherit [EditorProperty]. diff --git a/doc/classes/EditorNode3DGizmo.xml b/doc/classes/EditorNode3DGizmo.xml index 45541b9263..dcc6d6ef12 100644 --- a/doc/classes/EditorNode3DGizmo.xml +++ b/doc/classes/EditorNode3DGizmo.xml @@ -9,13 +9,76 @@ + + + + + + + + + + + Commit a handle being edited (handles must have been previously added by [method add_handles]). + If the [code]cancel[/code] parameter is [code]true[/code], an option to restore the edited value to the original is provided. + + + + + + + + + Gets the name of an edited handle (handles must have been previously added by [method add_handles]). + Handles can be named for reference to the user when editing. + + + + + + + + + Gets actual value of a handle. This value can be anything and used for eventually undoing the motion when calling [method _commit_handle]. + + + + + + + + + Returns [code]true[/code] if the handle at index [code]index[/code] is highlighted by being hovered with the mouse. + + + + + + + This function is called when the [Node3D] this gizmo refers to changes (the [method Node3D.update_gizmo] is called). + + + + + + + + + + + + + This function is used when the user drags a gizmo handle (previously added with [method add_handles]) in screen coordinates. + The [Camera3D] is also provided so screen coordinates can be converted to raycasts. + + - Adds the specified [code]segments[/code] to the gizmo's collision shape for picking. Call this function during [method redraw]. + Adds the specified [code]segments[/code] to the gizmo's collision shape for picking. Call this function during [method _redraw]. @@ -24,7 +87,7 @@ - Adds collision triangles to the gizmo for picking. A [TriangleMesh] can be generated from a regular [Mesh] too. Call this function during [method redraw]. + Adds collision triangles to the gizmo for picking. A [TriangleMesh] can be generated from a regular [Mesh] too. Call this function during [method _redraw]. @@ -40,7 +103,7 @@ Adds a list of handles (points) which can be used to deform the object being edited. - There are virtual functions which will be called upon editing of these handles. Call this function during [method redraw]. + There are virtual functions which will be called upon editing of these handles. Call this function during [method _redraw]. @@ -55,7 +118,7 @@ - Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this function during [method redraw]. + Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this function during [method _redraw]. @@ -70,7 +133,7 @@ - Adds a mesh to the gizmo with the specified [code]billboard[/code] state, [code]skeleton[/code] and [code]material[/code]. If [code]billboard[/code] is [code]true[/code], the mesh will rotate to always face the camera. Call this function during [method redraw]. + Adds a mesh to the gizmo with the specified [code]billboard[/code] state, [code]skeleton[/code] and [code]material[/code]. If [code]billboard[/code] is [code]true[/code], the mesh will rotate to always face the camera. Call this function during [method _redraw]. @@ -83,7 +146,7 @@ - Adds an unscaled billboard for visualization. Call this function during [method redraw]. + Adds an unscaled billboard for visualization. Call this function during [method _redraw]. @@ -93,39 +156,6 @@ Removes everything in the gizmo including meshes, collisions and handles. - - - - - - - - - - - Commit a handle being edited (handles must have been previously added by [method add_handles]). - If the [code]cancel[/code] parameter is [code]true[/code], an option to restore the edited value to the original is provided. - - - - - - - - - Gets the name of an edited handle (handles must have been previously added by [method add_handles]). - Handles can be named for reference to the user when editing. - - - - - - - - - Gets actual value of a handle. This value can be anything and used for eventually undoing the motion when calling [method commit_handle]. - - @@ -140,36 +170,6 @@ Returns the Node3D node associated with this gizmo. - - - - - - - Returns [code]true[/code] if the handle at index [code]index[/code] is highlighted by being hovered with the mouse. - - - - - - - This function is called when the [Node3D] this gizmo refers to changes (the [method Node3D.update_gizmo] is called). - - - - - - - - - - - - - This function is used when the user drags a gizmo handle (previously added with [method add_handles]) in screen coordinates. - The [Camera3D] is also provided so screen coordinates can be converted to raycasts. - - diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml index 34657a1c08..5551326533 100644 --- a/doc/classes/EditorNode3DGizmoPlugin.xml +++ b/doc/classes/EditorNode3DGizmoPlugin.xml @@ -10,25 +10,14 @@ https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html - - - - - - - - - Adds a new material to the internal material list for the plugin. It can then be accessed with [method get_material]. Should not be overridden. - - - + Override this method to define whether the gizmo can be hidden or not. Returns [code]true[/code] if not overridden. - + @@ -43,69 +32,23 @@ Override this method to commit gizmo handles. Called for this plugin's active gizmos. - + - Override this method to return a custom [EditorNode3DGizmo] for the spatial nodes of your choice, return [code]null[/code] for the rest of nodes. See also [method has_gizmo]. - - - - - - - - - - - - - Creates a handle material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_handles]. Should not be overridden. - You can optionally provide a texture to use instead of the default icon. - - - - - - - - - - - - - - - Creates an icon material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_unscaled_billboard]. Should not be overridden. - - - - - - - - - - - - - - - - - Creates an unshaded material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_mesh] and [method EditorNode3DGizmo.add_lines]. Should not be overridden. + Override this method to return a custom [EditorNode3DGizmo] for the spatial nodes of your choice, return [code]null[/code] for the rest of nodes. See also [method _has_gizmo]. - + Override this method to provide the name that will appear in the gizmo visibility menu. - + @@ -116,7 +59,7 @@ Override this method to provide gizmo's handle names. Called for this plugin's active gizmos. - + @@ -127,18 +70,7 @@ Gets actual value of a handle from gizmo. Called for this plugin's active gizmos. - - - - - - - - - Gets material from the internal list of materials. If an [EditorNode3DGizmo] is provided, it will try to get the corresponding variant (selected and/or editable). - - - + @@ -146,7 +78,7 @@ All built-in editor gizmos return a priority of [code]-1[/code]. If not overridden, this method will return [code]0[/code], which means custom gizmos will automatically override built-in gizmos. - + @@ -155,7 +87,7 @@ Override this method to define which Node3D nodes have a gizmo from this plugin. Whenever a [Node3D] node is added to a scene this method is called, if it returns [code]true[/code] the node gets a generic [EditorNode3DGizmo] assigned and is added to this plugin's list of active gizmos. - + @@ -166,14 +98,14 @@ Gets whether a handle is highlighted or not. Called for this plugin's active gizmos. - + Override this method to define whether Node3D with this gizmo should be selectable even when the gizmo is hidden. - + @@ -182,7 +114,7 @@ Callback to redraw the provided gizmo. Called for this plugin's active gizmos. - + @@ -197,6 +129,74 @@ Update the value of a handle after it has been updated. Called for this plugin's active gizmos. + + + + + + + + + Adds a new material to the internal material list for the plugin. It can then be accessed with [method get_material]. Should not be overridden. + + + + + + + + + + + + + Creates a handle material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_handles]. Should not be overridden. + You can optionally provide a texture to use instead of the default icon. + + + + + + + + + + + + + + + Creates an icon material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_unscaled_billboard]. Should not be overridden. + + + + + + + + + + + + + + + + + Creates an unshaded material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_mesh] and [method EditorNode3DGizmo.add_lines]. Should not be overridden. + + + + + + + + + + + Gets material from the internal list of materials. If an [EditorNode3DGizmo] is provided, it will try to get the corresponding variant (selected and/or editable). + + diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 6c40b7aa9d..2736414cb1 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -10,185 +10,7 @@ https://docs.godotengine.org/en/latest/tutorials/plugins/editor/index.html - - - - - - - - - Adds a script at [code]path[/code] to the Autoload list as [code]name[/code]. - - - - - - - - - - - Adds a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_bottom_panel] and free it with [method Node.queue_free]. - - - - - - - - - - - Adds a custom control to a container (see [enum CustomControlContainer]). There are many locations where custom controls can be added in the editor UI. - Please remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it). - When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_container] and free it with [method Node.queue_free]. - - - - - - - - - - - Adds the control to a specific dock slot (see [enum DockSlot] for options). - If the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions. - When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_docks] and free it with [method Node.queue_free]. - - - - - - - - - - - - - - - Adds a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed. - When given node or resource is selected, the base type will be instanced (e.g. "Node3D", "Control", "Resource"), then the script will be loaded and set to this object. - You can use the virtual method [method handles] to check if your custom object is being edited by checking the script or using the [code]is[/code] keyword. - During run-time, this will be a simple object with a script so this function does not need to be called then. - - - - - - - - - Adds a [Script] as debugger plugin to the Debugger. The script must extend [EditorDebuggerPlugin]. - - - - - - - - - Registers a new [EditorExportPlugin]. Export plugins are used to perform tasks when the project is being exported. - See [method add_inspector_plugin] for an example of how to register a plugin. - - - - - - - - - Registers a new [EditorImportPlugin]. Import plugins are used to import custom and unsupported assets as a custom [Resource] type. - [b]Note:[/b] If you want to import custom 3D asset formats use [method add_scene_import_plugin] instead. - See [method add_inspector_plugin] for an example of how to register a plugin. - - - - - - - - - Registers a new [EditorInspectorPlugin]. Inspector plugins are used to extend [EditorInspector] and provide custom configuration tools for your object's properties. - [b]Note:[/b] Always use [method remove_inspector_plugin] to remove the registered [EditorInspectorPlugin] when your [EditorPlugin] is disabled to prevent leaks and an unexpected behavior. - [codeblocks] - [gdscript] - const MyInspectorPlugin = preload("res://addons/your_addon/path/to/your/script.gd") - var inspector_plugin = MyInspectorPlugin.new() - - func _enter_tree(): - add_inspector_plugin(inspector_plugin) - - func _exit_tree(): - remove_inspector_plugin(inspector_plugin) - [/gdscript] - [/codeblocks] - - - - - - - - - Registers a new [EditorSceneImporter]. Scene importers are used to import custom 3D asset formats as scenes. - - - - - - - - - Registers a new [EditorNode3DGizmoPlugin]. Gizmo plugins are used to add custom gizmos to the 3D preview viewport for a [Node3D]. - See [method add_inspector_plugin] for an example of how to register a plugin. - - - - - - - - - - - Adds a custom menu item to [b]Project > Tools[/b] named [code]name[/code]. When clicked, the provided [code]callable[/code] will be called. - - - - - - - - - - - Adds a custom submenu under [b]Project > Tools >[/b] [code]name[/code]. [code]submenu[/code] should be an object of class [PopupMenu]. Use [code]remove_tool_menu_item(name)[/code] on plugin clean up to remove the menu. - - - - - - - - - Registers a custom translation parser plugin for extracting translatable strings from custom files. - - - - - - - - - Hooks a callback into the undo/redo action creation when a property is modified in the inspector. This allows, for example, to save other properties that may be lost when a given property is modified. - The callback should have 4 arguments: [Object] [code]undo_redo[/code], [Object] [code]modified_object[/code], [String] [code]property[/code] and [Variant] [code]new_value[/code]. They are, respectively, the [UndoRedo] object used by the inspector, the currently modified object, the name of the modified property and the new value the property is about to take. - - - + @@ -196,29 +18,29 @@ This is used, for example, in shader editors to let the plugin know that it must apply the shader code being written by the user to the object. - + This method is called when the editor is about to run the project. The plugin can then perform required operations before the project runs. - This method must return a boolean. If this method returns [code]false[/code], the project will not run. The run is aborted immediately, so this also prevents all other plugins' [method build] methods from running. + This method must return a boolean. If this method returns [code]false[/code], the project will not run. The run is aborted immediately, so this also prevents all other plugins' [method _build] methods from running. - + Clear all the state and reset the object being edited to zero. This ensures your plugin does not keep editing a currently existing node, or a node from the wrong scene. - + Called by the engine when the user disables the [EditorPlugin] in the Plugin tab of the project settings window. - + @@ -227,14 +49,14 @@ This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object. - + Called by the engine when the user enables the [EditorPlugin] in the Plugin tab of the project settings window. - + @@ -243,11 +65,11 @@ Called by the engine when the 2D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. [codeblocks] [gdscript] - func forward_canvas_draw_over_viewport(overlay): + func _forward_canvas_draw_over_viewport(overlay): # Draw a circle at cursor position. overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.white) - func forward_canvas_gui_input(event): + func _forward_canvas_gui_input(event): if event is InputEventMouseMotion: # Redraw viewport when cursor is moved. update_overlays() @@ -274,27 +96,27 @@ [/codeblocks] - + - This method is the same as [method forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + This method is the same as [method _forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled]. - + - Called when there is a root node in the current edited scene, [method handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: + Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: [codeblocks] [gdscript] # Prevents the InputEvent to reach other Editor classes - func forward_canvas_gui_input(event): + func _forward_canvas_gui_input(event): return true [/gdscript] [csharp] @@ -309,7 +131,7 @@ [codeblocks] [gdscript] # Consumes InputEventMouseMotion and forwards other InputEvent types. - func forward_canvas_gui_input(event): + func _forward_canvas_gui_input(event): return event is InputEventMouseMotion [/gdscript] [csharp] @@ -322,7 +144,7 @@ [/codeblocks] - + @@ -331,11 +153,11 @@ Called by the engine when the 3D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. [codeblocks] [gdscript] - func forward_spatial_draw_over_viewport(overlay): + func _forward_spatial_draw_over_viewport(overlay): # Draw a circle at cursor position. overlay.draw_circle(overlay.get_local_mouse_position(), 64) - func forward_spatial_gui_input(camera, event): + func _forward_spatial_gui_input(camera, event): if event is InputEventMouseMotion: # Redraw viewport when cursor is moved. update_overlays() @@ -362,17 +184,17 @@ [/codeblocks] - + - This method is the same as [method forward_spatial_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + This method is the same as [method _forward_spatial_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled]. - + @@ -380,11 +202,11 @@ - Called when there is a root node in the current edited scene, [method handles] is implemented and an [InputEvent] happens in the 3D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: + Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 3D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: [codeblocks] [gdscript] # Prevents the InputEvent to reach other Editor classes. - func forward_spatial_gui_input(camera, event): + func _forward_spatial_gui_input(camera, event): return true [/gdscript] [csharp] @@ -399,7 +221,7 @@ [codeblocks] [gdscript] # Consumes InputEventMouseMotion and forwards other InputEvent types. - func forward_spatial_gui_input(camera, event): + func _forward_spatial_gui_input(camera, event): return event is InputEventMouseMotion [/gdscript] [csharp] @@ -412,21 +234,14 @@ [/codeblocks] - + This is for editors that edit script-based objects. You can return a list of breakpoints in the format ([code]script:line[/code]), for example: [code]res://path_to_script.gd:25[/code]. - - - - - Returns the [EditorInterface] object that gives you control over Godot editor's window and its functionalities. - - - + @@ -435,7 +250,7 @@ Ideally, the plugin icon should be white with a transparent background and 16x16 pixels in size. [codeblocks] [gdscript] - func get_plugin_icon(): + func _get_plugin_icon(): # You can use a custom icon: return preload("res://addons/my_plugin/my_plugin_icon.svg") # Or use a built-in icon: @@ -453,7 +268,7 @@ [/codeblocks] - + @@ -461,29 +276,14 @@ For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons. - - - - - Gets the Editor's dialogue used for making scripts. - [b]Note:[/b] Users can configure it before use. - - - + Gets the state of your plugin editor. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns). - - - - - Gets the undo/redo object. Most actions in the editor can be undoable, so use this object to make sure this happens when it's worth it. - - - + @@ -492,44 +292,260 @@ Gets the GUI layout of the plugin. This is used to save the project's editor layout when [method queue_save_layout] is called or the editor layout was changed(For example changing the position of a dock). - + - Implement this function if your plugin edits a specific type of object (Resource or Node). If you return [code]true[/code], then you will get the functions [method edit] and [method make_visible] called when the editor requests them. If you have declared the methods [method forward_canvas_gui_input] and [method forward_spatial_gui_input] these will be called too. + Implement this function if your plugin edits a specific type of object (Resource or Node). If you return [code]true[/code], then you will get the functions [method _edit] and [method _make_visible] called when the editor requests them. If you have declared the methods [method _forward_canvas_gui_input] and [method _forward_spatial_gui_input] these will be called too. - + Returns [code]true[/code] if this is a main screen editor plugin (it goes in the workspace selector together with [b]2D[/b], [b]3D[/b], [b]Script[/b] and [b]AssetLib[/b]). - + + + + This function will be called when the editor is requested to become visible. It is used for plugins that edit a specific object type. + Remember that you have to manage the visibility of all your editor controls manually. - + - + + This method is called after the editor saves the project or when it's closed. It asks the plugin to save edited external scenes/resources. + + + + + + + Restore the state saved by [method _get_state]. - + - + + + + + + Adds a script at [code]path[/code] to the Autoload list as [code]name[/code]. + + + + + + + + + + + Adds a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_bottom_panel] and free it with [method Node.queue_free]. + + + + + + + + + + + Adds a custom control to a container (see [enum CustomControlContainer]). There are many locations where custom controls can be added in the editor UI. + Please remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it). + When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_container] and free it with [method Node.queue_free]. + + + + + + + + + + + Adds the control to a specific dock slot (see [enum DockSlot] for options). + If the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions. + When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_docks] and free it with [method Node.queue_free]. + + + + + + + + + + + + + + + Adds a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed. + When given node or resource is selected, the base type will be instanced (e.g. "Node3D", "Control", "Resource"), then the script will be loaded and set to this object. + You can use the virtual method [method _handles] to check if your custom object is being edited by checking the script or using the [code]is[/code] keyword. + During run-time, this will be a simple object with a script so this function does not need to be called then. + + + + + + + + + Adds a [Script] as debugger plugin to the Debugger. The script must extend [EditorDebuggerPlugin]. + + + + + + + + + Registers a new [EditorExportPlugin]. Export plugins are used to perform tasks when the project is being exported. + See [method add_inspector_plugin] for an example of how to register a plugin. + + + + + + + + + Registers a new [EditorImportPlugin]. Import plugins are used to import custom and unsupported assets as a custom [Resource] type. + [b]Note:[/b] If you want to import custom 3D asset formats use [method add_scene_import_plugin] instead. + See [method add_inspector_plugin] for an example of how to register a plugin. + + + + + + + + + Registers a new [EditorInspectorPlugin]. Inspector plugins are used to extend [EditorInspector] and provide custom configuration tools for your object's properties. + [b]Note:[/b] Always use [method remove_inspector_plugin] to remove the registered [EditorInspectorPlugin] when your [EditorPlugin] is disabled to prevent leaks and an unexpected behavior. + [codeblocks] + [gdscript] + const MyInspectorPlugin = preload("res://addons/your_addon/path/to/your/script.gd") + var inspector_plugin = MyInspectorPlugin.new() + + func _enter_tree(): + add_inspector_plugin(inspector_plugin) + + func _exit_tree(): + remove_inspector_plugin(inspector_plugin) + [/gdscript] + [/codeblocks] + + + + + + + + + Registers a new [EditorSceneImporter]. Scene importers are used to import custom 3D asset formats as scenes. + + + + + + + + + Registers a new [EditorNode3DGizmoPlugin]. Gizmo plugins are used to add custom gizmos to the 3D preview viewport for a [Node3D]. + See [method add_inspector_plugin] for an example of how to register a plugin. + + + + + + + + + + + Adds a custom menu item to [b]Project > Tools[/b] named [code]name[/code]. When clicked, the provided [code]callable[/code] will be called. + + + + + + + + + + + Adds a custom submenu under [b]Project > Tools >[/b] [code]name[/code]. [code]submenu[/code] should be an object of class [PopupMenu]. Use [code]remove_tool_menu_item(name)[/code] on plugin clean up to remove the menu. + + + + + + + + + Registers a custom translation parser plugin for extracting translatable strings from custom files. + + + + + + + + + Hooks a callback into the undo/redo action creation when a property is modified in the inspector. This allows, for example, to save other properties that may be lost when a given property is modified. + The callback should have 4 arguments: [Object] [code]undo_redo[/code], [Object] [code]modified_object[/code], [String] [code]property[/code] and [Variant] [code]new_value[/code]. They are, respectively, the [UndoRedo] object used by the inspector, the currently modified object, the name of the modified property and the new value the property is about to take. + + + + + + + Returns the [EditorInterface] object that gives you control over Godot editor's window and its functionalities. + + + + + + + Gets the Editor's dialogue used for making scripts. + [b]Note:[/b] Users can configure it before use. + + + + + + + Gets the undo/redo object. Most actions in the editor can be undoable, so use this object to make sure this happens when it's worth it. + + + + + + + + + + + + - This function will be called when the editor is requested to become visible. It is used for plugins that edit a specific object type. - Remember that you have to manage the visibility of all your editor controls manually. @@ -667,34 +683,18 @@ Removes a callback previsously added by [method add_undo_redo_inspector_hook_callback]. - - - - - This method is called after the editor saves the project or when it's closed. It asks the plugin to save edited external scenes/resources. - - - Enables calling of [method forward_canvas_force_draw_over_viewport] for the 2D editor and [method forward_spatial_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. + Enables calling of [method _forward_canvas_force_draw_over_viewport] for the 2D editor and [method _forward_spatial_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. - Use this method if you always want to receive inputs from 3D view screen inside [method forward_spatial_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene. - - - - - - - - - Restore the state saved by [method get_state]. + Use this method if you always want to receive inputs from 3D view screen inside [method _forward_spatial_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene. @@ -703,14 +703,14 @@ - Restore the plugin GUI layout saved by [method get_window_layout]. + Restore the plugin GUI layout saved by [method _get_window_layout]. - Updates the overlays of the 2D and 3D editor viewport. Causes methods [method forward_canvas_draw_over_viewport], [method forward_canvas_force_draw_over_viewport], [method forward_spatial_draw_over_viewport] and [method forward_spatial_force_draw_over_viewport] to be called. + Updates the overlays of the 2D and 3D editor viewport. Causes methods [method _forward_canvas_draw_over_viewport], [method _forward_canvas_force_draw_over_viewport], [method _forward_spatial_draw_over_viewport] and [method _forward_spatial_force_draw_over_viewport] to be called. diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml index fd9fae435b..549d2c1628 100644 --- a/doc/classes/EditorProperty.xml +++ b/doc/classes/EditorProperty.xml @@ -9,6 +9,13 @@ + + + + + When this virtual function is called, you must update your editor. + + @@ -44,7 +51,7 @@ - Gets the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin.parse_property]), then this will return the property. + Gets the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin._parse_property]), then this will return the property. @@ -63,13 +70,6 @@ Adds controls with this function if you want them on the bottom (below the label). - - - - - When this virtual function is called, you must update your editor. - - @@ -101,7 +101,7 @@ - Emit it if you want multiple properties modified at the same time. Do not use if added via [method EditorInspectorPlugin.parse_property]. + Emit it if you want multiple properties modified at the same time. Do not use if added via [method EditorInspectorPlugin._parse_property]. diff --git a/doc/classes/EditorResourcePicker.xml b/doc/classes/EditorResourcePicker.xml index 30c73daa77..508b546ef3 100644 --- a/doc/classes/EditorResourcePicker.xml +++ b/doc/classes/EditorResourcePicker.xml @@ -10,30 +10,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -41,16 +17,6 @@ Returns a list of all allowed types and subtypes corresponding to the [member base_type]. If the [member base_type] is empty, an empty list is returned. - - - - - - - - - - diff --git a/doc/classes/EditorResourcePreviewGenerator.xml b/doc/classes/EditorResourcePreviewGenerator.xml index c191c9db12..3594474e36 100644 --- a/doc/classes/EditorResourcePreviewGenerator.xml +++ b/doc/classes/EditorResourcePreviewGenerator.xml @@ -9,15 +9,15 @@ - + - If this function returns [code]true[/code], the generator will call [method generate] or [method generate_from_path] for small previews as well. + If this function returns [code]true[/code], the generator will call [method _generate] or [method _generate_from_path] for small previews as well. By default, it returns [code]false[/code]. - + @@ -30,7 +30,7 @@ Care must be taken because this function is always called from a thread (not the main thread). - + @@ -38,20 +38,20 @@ - Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call [method generate]. + Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call [method _generate]. Returning an empty texture is an OK way to fail and let another generator take care. Care must be taken because this function is always called from a thread (not the main thread). - + - If this function returns [code]true[/code], the generator will automatically generate the small previews from the normal preview texture generated by the methods [method generate] or [method generate_from_path]. + If this function returns [code]true[/code], the generator will automatically generate the small previews from the normal preview texture generated by the methods [method _generate] or [method _generate_from_path]. By default, it returns [code]false[/code]. - + diff --git a/doc/classes/EditorScenePostImport.xml b/doc/classes/EditorScenePostImport.xml index 789366c2a4..d2b5e84ff7 100644 --- a/doc/classes/EditorScenePostImport.xml +++ b/doc/classes/EditorScenePostImport.xml @@ -5,14 +5,14 @@ Imported scenes can be automatically modified right after import by setting their [b]Custom Script[/b] Import property to a [code]tool[/code] script that inherits from this class. - The [method post_import] callback receives the imported scene's root node and returns the modified version of the scene. Usage example: + The [method _post_import] callback receives the imported scene's root node and returns the modified version of the scene. Usage example: [codeblocks] [gdscript] tool # Needed so it runs in editor. extends EditorScenePostImport # This sample changes all node names. # Called right after the scene is imported and gets the root node. - func post_import(scene): + func _post_import(scene): # Change all node names to "modified_[oldnodename]" iterate(scene) return scene # Remember to return the imported scene @@ -55,14 +55,7 @@ https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_scenes.html#custom-script - - - - - Returns the source file path which got imported (e.g. [code]res://scene.dae[/code]). - - - + @@ -71,6 +64,13 @@ Called after the scene was imported. This method must return the modified version of the scene. + + + + + Returns the source file path which got imported (e.g. [code]res://scene.dae[/code]). + + diff --git a/doc/classes/EditorSyntaxHighlighter.xml b/doc/classes/EditorSyntaxHighlighter.xml index b80e81928f..d81b25345f 100644 --- a/doc/classes/EditorSyntaxHighlighter.xml +++ b/doc/classes/EditorSyntaxHighlighter.xml @@ -5,7 +5,7 @@ Base syntax highlighter resource all editor syntax highlighters extend from, it is used in the [ScriptEditor]. - Add a syntax highlighter to an individual script by calling [method ScriptEditorBase.add_syntax_highlighter]. To apply to all scripts on open, call [method ScriptEditor.register_syntax_highlighter] + Add a syntax highlighter to an individual script by calling [method ScriptEditorBase._add_syntax_highlighter]. To apply to all scripts on open, call [method ScriptEditor.register_syntax_highlighter] diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml index 349d2ec934..a9f4e90e72 100644 --- a/doc/classes/EditorTranslationParserPlugin.xml +++ b/doc/classes/EditorTranslationParserPlugin.xml @@ -4,7 +4,7 @@ Plugin for adding custom parsers to extract strings that are to be translated from custom files (.csv, .json etc.). - Plugins are registered via [method EditorPlugin.add_translation_parser_plugin] method. To define the parsing and string extraction logic, override the [method parse_file] method in script. + Plugins are registered via [method EditorPlugin.add_translation_parser_plugin] method. To define the parsing and string extraction logic, override the [method _parse_file] method in script. Add the extracted strings to argument [code]msgids[/code] or [code]msgids_context_plural[/code] if context or plural is used. When adding to [code]msgids_context_plural[/code], you must add the data using the format [code]["A", "B", "C"][/code], where [code]A[/code] represents the extracted string, [code]B[/code] represents the context, and [code]C[/code] represents the plural version of the extracted string. If you want to add only context but not plural, put [code]""[/code] for the plural slot. The idea is the same if you only want to add plural but not context. See the code below for concrete examples. The extracted strings will be written into a POT file selected by user under "POT Generation" in "Localization" tab in "Project Settings" menu. @@ -14,7 +14,7 @@ tool extends EditorTranslationParserPlugin - func parse_file(path, msgids, msgids_context_plural): + func _parse_file(path, msgids, msgids_context_plural): var file = File.new() file.open(path, File.READ) var text = file.get_as_text() @@ -23,7 +23,7 @@ msgids.append(s) #print("Extracted string: " + s) - func get_recognized_extensions(): + func _get_recognized_extensions(): return ["csv"] [/gdscript] [csharp] @@ -76,12 +76,12 @@ For example: [codeblocks] [gdscript] - func parse_file(path, msgids, msgids_context_plural): + func _parse_file(path, msgids, msgids_context_plural): var res = ResourceLoader.load(path, "Script") var text = res.source_code # Parsing logic. - func get_recognized_extensions(): + func _get_recognized_extensions(): return ["gd"] [/gdscript] [csharp] @@ -102,14 +102,14 @@ - + Gets the list of file extensions to associate with this parser, e.g. [code]["csv"][/code]. - + diff --git a/doc/classes/FileSystemDock.xml b/doc/classes/FileSystemDock.xml index c553f90e37..15f92e90e3 100644 --- a/doc/classes/FileSystemDock.xml +++ b/doc/classes/FileSystemDock.xml @@ -7,40 +7,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/classes/ResourceFormatLoader.xml b/doc/classes/ResourceFormatLoader.xml index aed194095b..6abe5c813b 100644 --- a/doc/classes/ResourceFormatLoader.xml +++ b/doc/classes/ResourceFormatLoader.xml @@ -11,7 +11,7 @@ - + @@ -23,14 +23,14 @@ [b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just return [code]"Resource"[/code] for them. - + Gets the list of extensions for files this loader is able to read. - + @@ -40,7 +40,7 @@ [b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just return [code]"Resource"[/code] for them. - + @@ -50,7 +50,7 @@ [b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just handle [code]"Resource"[/code] for them. - + @@ -66,7 +66,7 @@ The [code]cache_mode[/code] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. - + diff --git a/doc/classes/ResourceFormatSaver.xml b/doc/classes/ResourceFormatSaver.xml index edbf8d73f8..df71e05d02 100644 --- a/doc/classes/ResourceFormatSaver.xml +++ b/doc/classes/ResourceFormatSaver.xml @@ -10,16 +10,16 @@ - + - Returns the list of extensions available for saving the resource object, provided it is recognized (see [method recognize]). + Returns the list of extensions available for saving the resource object, provided it is recognized (see [method _recognize]). - + @@ -28,7 +28,7 @@ Returns whether the given resource object can be saved by this saver. - + diff --git a/doc/classes/ScriptEditor.xml b/doc/classes/ScriptEditor.xml index 28620bd29b..31dbf7453f 100644 --- a/doc/classes/ScriptEditor.xml +++ b/doc/classes/ScriptEditor.xml @@ -9,30 +9,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -47,16 +23,6 @@ Returns a [Script] that is currently active in editor. - - - - - - - - - - diff --git a/doc/classes/ScriptEditorBase.xml b/doc/classes/ScriptEditorBase.xml index e5c4c32450..a135062bd8 100644 --- a/doc/classes/ScriptEditorBase.xml +++ b/doc/classes/ScriptEditorBase.xml @@ -9,7 +9,7 @@ - + diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index c31467c67e..fe83bf9c2d 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -361,7 +361,7 @@ The number of columns. - The drop mode as an OR combination of flags. See [enum DropModeFlags] constants. Once dropping is done, reverts to [constant DROP_MODE_DISABLED]. Setting this during [method Control.can_drop_data] is recommended. + The drop mode as an OR combination of flags. See [enum DropModeFlags] constants. Once dropping is done, reverts to [constant DROP_MODE_DISABLED]. Setting this during [method Control._can_drop_data] is recommended. This controls the drop sections, i.e. the decision and drawing of possible drop locations based on the mouse position. diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 2f3782c517..96d63b27ad 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -111,7 +111,7 @@ - Returns the drag data from the GUI, that was previously returned by [method Control.get_drag_data]. + Returns the drag data from the GUI, that was previously returned by [method Control._get_drag_data]. -- cgit v1.2.3