EditorResourcePicker

package
v0.0.0-...-fa94a0d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

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.

Note: This Control does not include any editor for the resource, as editing is controlled by the Inspector dock itself or sub-Inspectors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsEditorResourcePicker() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this [Extension]See Interface for methods that can be overridden by T.

func (*Extension[T]) AsBoxContainer

func (self *Extension[T]) AsBoxContainer() BoxContainer.Instance

func (*Extension[T]) AsCanvasItem

func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance

func (*Extension[T]) AsContainer

func (self *Extension[T]) AsContainer() Container.Instance

func (*Extension[T]) AsControl

func (self *Extension[T]) AsControl() Control.Instance

func (*Extension[T]) AsEditorResourcePicker

func (self *Extension[T]) AsEditorResourcePicker() Instance

func (*Extension[T]) AsHBoxContainer

func (self *Extension[T]) AsHBoxContainer() HBoxContainer.Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

type Instance [1]gdclass.EditorResourcePicker

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsBoxContainer

func (self Instance) AsBoxContainer() BoxContainer.Instance

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsContainer

func (self Instance) AsContainer() Container.Instance

func (Instance) AsControl

func (self Instance) AsControl() Control.Instance

func (Instance) AsEditorResourcePicker

func (self Instance) AsEditorResourcePicker() Instance

func (Instance) AsHBoxContainer

func (self Instance) AsHBoxContainer() HBoxContainer.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) BaseType

func (self Instance) BaseType() string

func (Instance) Editable

func (self Instance) Editable() bool

func (Instance) EditedResource

func (self Instance) EditedResource() Resource.Instance

func (Instance) GetAllowedTypes

func (self Instance) GetAllowedTypes() []string

Returns a list of all allowed types and subtypes corresponding to the BaseType. If the BaseType is empty, an empty list is returned.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) OnResourceChanged

func (self Instance) OnResourceChanged(cb func(resource Resource.Instance), flags ...Signal.Flags)

func (Instance) OnResourceSelected

func (self Instance) OnResourceSelected(cb func(resource Resource.Instance, inspect bool), flags ...Signal.Flags)

func (Instance) SetBaseType

func (self Instance) SetBaseType(value string)

func (Instance) SetEditable

func (self Instance) SetEditable(value bool)

func (Instance) SetEditedResource

func (self Instance) SetEditedResource(value Resource.Instance)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetToggleMode

func (self Instance) SetToggleMode(value bool)

func (Instance) SetTogglePressed

func (self Instance) SetTogglePressed(pressed bool)

Sets the toggle mode state for the main button. Works only if ToggleMode is set to true.

func (Instance) ToggleMode

func (self Instance) ToggleMode() bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type Interface

type Interface interface {
	// This virtual method is called when updating the context menu of [EditorResourcePicker]. Implement this method to override the "New ..." items with your own options. 'menu_node' is a reference to the [PopupMenu] node.
	//
	// Note: Implement [HandleMenuSelected] to handle these custom items.
	//
	// [EditorResourcePicker]: https://pkg.go.dev/graphics.gd/classdb/EditorResourcePicker
	// [HandleMenuSelected]: https://pkg.go.dev/graphics.gd/classdb/EditorResourcePicker#Interface
	// [PopupMenu]: https://pkg.go.dev/graphics.gd/classdb/PopupMenu
	SetCreateOptions(menu_node Object.Instance)
	// This virtual method can be implemented to handle context menu items not handled by default. See [SetCreateOptions].
	//
	// [SetCreateOptions]: https://pkg.go.dev/graphics.gd/classdb/EditorResourcePicker#Interface
	HandleMenuSelected(id int) bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL