[][src]Struct gdnative_bindings::EditorSettings

pub struct EditorSettings { /* fields omitted */ }

tools class EditorSettings inherits Resource (reference counted).

Official documentation

See the documentation of this class in the Godot engine's official documentation.

Memory management

The lifetime of this object is automatically managed through reference counting.

Class hierarchy

EditorSettings inherits methods from:

Tool

This class is used to interact with Godot's editor.

Safety

All types in the Godot API have "interior mutability" in Rust parlance. To enforce that the official thread-safety guidelines are followed, the typestate pattern is used in the Ref and TRef smart pointers, and the Instance API. The typestate Access in these types tracks whether the access is unique, shared, or exclusive to the current thread. For more information, see the type-level documentation on Ref.

Implementations

impl EditorSettings[src]

Constants

impl EditorSettings[src]

pub fn add_property_info(&self, info: Dictionary)[src]

Adds a custom property info to a property. The dictionary must contain:
				- [code]name[/code]: [String] (the name of the property)
				- [code]type[/code]: [int] (see [enum Variant.Type])
				- optionally [code]hint[/code]: [int] (see [enum PropertyHint]) and [code]hint_string[/code]: [String]
				[b]Example:[/b]
				[codeblock]
				editor_settings.set("category/property_name", 0)

				var property_info = {
				    "name": "category/property_name",
				    "type": TYPE_INT,
				    "hint": PROPERTY_HINT_ENUM,
				    "hint_string": "one,two,three"
				}

				editor_settings.add_property_info(property_info)
				[/codeblock]

pub fn erase(&self, property: impl Into<GodotString>)[src]

Erases the setting whose name is specified by [code]property[/code].

pub fn get_favorites(&self) -> StringArray[src]

Returns the list of favorite files and directories for this project.

pub fn get_project_metadata(
    &self,
    section: impl Into<GodotString>,
    key: impl Into<GodotString>,
    default: impl OwnedToVariant
) -> Variant
[src]

Returns project-specific metadata for the [code]section[/code] and [code]key[/code] specified. If the metadata doesn't exist, [code]default[/code] will be returned instead. See also [method set_project_metadata].

Default Arguments

  • default - null

pub fn get_project_settings_dir(&self) -> GodotString[src]

Returns the project-specific settings path. Projects all have a unique subdirectory inside the settings path where project-specific settings are saved.

pub fn get_recent_dirs(&self) -> StringArray[src]

Returns the list of recently visited folders in the file dialog for this project.

pub fn get_setting(&self, name: impl Into<GodotString>) -> Variant[src]

Returns the value of the setting specified by [code]name[/code]. This is equivalent to using [method Object.get] on the EditorSettings instance.

pub fn get_settings_dir(&self) -> GodotString[src]

Gets the global settings path for the engine. Inside this path, you can find some standard paths such as:
				[code]settings/tmp[/code] - Used for temporary storage of files
				[code]settings/templates[/code] - Where export templates are located

pub fn has_setting(&self, name: impl Into<GodotString>) -> bool[src]

Returns [code]true[/code] if the setting specified by [code]name[/code] exists, [code]false[/code] otherwise.

pub fn property_can_revert(&self, name: impl Into<GodotString>) -> bool[src]

Returns [code]true[/code] if the setting specified by [code]name[/code] can have its value reverted to the default value, [code]false[/code] otherwise. When this method returns [code]true[/code], a Revert button will display next to the setting in the Editor Settings.

pub fn property_get_revert(&self, name: impl Into<GodotString>) -> Variant[src]

Returns the default value of the setting specified by [code]name[/code]. This is the value that would be applied when clicking the Revert button in the Editor Settings.

pub fn set_favorites(&self, dirs: StringArray)[src]

Sets the list of favorite files and directories for this project.

pub fn set_initial_value(
    &self,
    name: impl Into<GodotString>,
    value: impl OwnedToVariant,
    update_current: bool
)
[src]

Sets the initial value of the setting specified by [code]name[/code] to [code]value[/code]. This is used to provide a value for the Revert button in the Editor Settings. If [code]update_current[/code] is true, the current value of the setting will be set to [code]value[/code] as well.

pub fn set_project_metadata(
    &self,
    section: impl Into<GodotString>,
    key: impl Into<GodotString>,
    data: impl OwnedToVariant
)
[src]

Sets project-specific metadata with the [code]section[/code], [code]key[/code] and [code]data[/code] specified. This metadata is stored outside the project folder and therefore won't be checked into version control. See also [method get_project_metadata].

pub fn set_recent_dirs(&self, dirs: StringArray)[src]

Sets the list of recently visited folders in the file dialog for this project.

pub fn set_setting(
    &self,
    name: impl Into<GodotString>,
    value: impl OwnedToVariant
)
[src]

Sets the [code]value[/code] of the setting specified by [code]name[/code]. This is equivalent to using [method Object.set] on the EditorSettings instance.

Methods from Deref<Target = Resource>

pub fn duplicate(&self, subresources: bool) -> Option<Ref<Resource, Shared>>[src]

Duplicates the resource, returning a new resource. By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing [code]true[/code] to the [code]subresources[/code] argument which will copy the subresources.
				[b]Note:[/b] If [code]subresources[/code] is [code]true[/code], this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared.

Default Arguments

  • subresources - false

pub fn get_local_scene(&self) -> Option<Ref<Node, Shared>>[src]

If [member resource_local_to_scene] is enabled and the resource was loaded from a [PackedScene] instantiation, returns the local scene where this resource's unique copy is in use. Otherwise, returns [code]null[/code].

pub fn name(&self) -> GodotString[src]

The name of the resource. This is an optional identifier.

pub fn path(&self) -> GodotString[src]

The path to the resource. In case it has its own file, it will return its filepath. If it's tied to the scene, it will return the scene's path, followed by the resource's index.

pub fn get_rid(&self) -> Rid[src]

Returns the RID of the resource (or an empty RID). Many resources (such as [Texture], [Mesh], etc) are high-level abstractions of resources stored in a server, so this function will return the original RID.

pub fn is_local_to_scene(&self) -> bool[src]

If [code]true[/code], the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene.

pub fn set_local_to_scene(&self, enable: bool)[src]

If [code]true[/code], the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene.

pub fn set_name(&self, name: impl Into<GodotString>)[src]

The name of the resource. This is an optional identifier.

pub fn set_path(&self, path: impl Into<GodotString>)[src]

The path to the resource. In case it has its own file, it will return its filepath. If it's tied to the scene, it will return the scene's path, followed by the resource's index.

pub fn setup_local_to_scene(&self)[src]

This method is called when a resource with [member resource_local_to_scene] enabled is loaded from a [PackedScene] instantiation. Its behavior can be customized by overriding [method _setup_local_to_scene] from script.
				For most resources, this method performs no base logic. [ViewportTexture] performs custom logic to properly set the proxy texture and flags in the local viewport.

pub fn take_over_path(&self, path: impl Into<GodotString>)[src]

Sets the path of the resource, potentially overriding an existing cache entry for this path. This differs from setting [member resource_path], as the latter would error out if another resource was already cached for the given path.

Trait Implementations

impl Debug for EditorSettings[src]

impl Deref for EditorSettings[src]

type Target = Resource

The resulting type after dereferencing.

impl DerefMut for EditorSettings[src]

impl GodotObject for EditorSettings[src]

type RefKind = RefCounted

The memory management kind of this type. This modifies the behavior of the Ref smart pointer. See its type-level documentation for more information. Read more

impl Sealed for EditorSettings[src]

impl SubClass<Object> for EditorSettings[src]

impl SubClass<Reference> for EditorSettings[src]

impl SubClass<Resource> for EditorSettings[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SubClass<T> for T where
    T: GodotObject
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.