From e9206a55ead7fe4e38dc4db51ebf9618c56fafb3 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Wed, 19 May 2021 15:19:07 +0300 Subject: Use EditorResourcePicker in the Inspector --- doc/classes/EditorResourcePicker.xml | 35 +++++++++++++++++++++++++++++++++-- doc/classes/EditorScriptPicker.xml | 21 +++++++++++++++++++++ doc/classes/EditorSpinSlider.xml | 2 ++ 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 doc/classes/EditorScriptPicker.xml (limited to 'doc/classes') diff --git a/doc/classes/EditorResourcePicker.xml b/doc/classes/EditorResourcePicker.xml index e31a681b8b..30c73daa77 100644 --- a/doc/classes/EditorResourcePicker.xml +++ b/doc/classes/EditorResourcePicker.xml @@ -4,8 +4,8 @@ Godot editor's control for selecting [Resource] type properties. - This is a [Control] node similar to the one used in the Inspector dock when editing [Resource]s. It provides options for creating, loading, saving and converting resources. - [b]Note:[/b] It does not include an editor for the resource. + This [Control] node is used in the editor's Inspector dock to allow editing of [Resource] type properties. It provides options for creating, loading, saving and converting resources. Can be used with [EditorInspectorPlugin] to recreate the same behavior. + [b]Note:[/b] This [Control] does not include any editor for the resource, as editing is controlled by the Inspector dock itself or sub-Inspectors. @@ -51,6 +51,34 @@ + + + + + + + This virtual method can be implemented to handle context menu items not handled by default. See [method set_create_options]. + + + + + + + + + This virtual method is called when updating the context menu of [EditorResourcePicker]. Implement this method to override the "New ..." items with your own options. [code]menu_node[/code] is a reference to the [PopupMenu] node. + [b]Note:[/b] Implement [method handle_menu_selected] to handle these custom items. + + + + + + + + + Sets the toggle mode state for the main button. Works only if [member toggle_mode] is set to [code]true[/code]. + + @@ -62,6 +90,9 @@ The edited resource value. + + If [code]true[/code], the main button with the resource preview works in the toggle mode. Use [method set_toggle_pressed] to manually set the state. + diff --git a/doc/classes/EditorScriptPicker.xml b/doc/classes/EditorScriptPicker.xml new file mode 100644 index 0000000000..8334676d92 --- /dev/null +++ b/doc/classes/EditorScriptPicker.xml @@ -0,0 +1,21 @@ + + + + Godot editor's control for selecting the [code]script[/code] property of a [Node]. + + + Similar to [EditorResourcePicker] this [Control] node is used in the editor's Inspector dock, but only to edit the [code]script[/code] property of a [Node]. Default options for creating new resources of all possible subtypes are replaced with dedicated buttons that open the "Attach Node Script" dialog. Can be used with [EditorInspectorPlugin] to recreate the same behavior. + [b]Note:[/b] You must set the [member script_owner] for the custom context menu items to work. + + + + + + + + The owner [Node] of the script property that holds the edited resource. + + + + + diff --git a/doc/classes/EditorSpinSlider.xml b/doc/classes/EditorSpinSlider.xml index 381f4fae04..f2c5a00640 100644 --- a/doc/classes/EditorSpinSlider.xml +++ b/doc/classes/EditorSpinSlider.xml @@ -1,8 +1,10 @@ + Godot editor's control for editing numertic values. + This [Control] node is used in the editor's Inspector dock to allow editing of numeric values. Can be used with [EditorInspectorPlugin] to recreate the same behavior. -- cgit v1.2.3