Inherits: Resource < Reference < Object
Object that holds the project-independent editor settings.
Object that holds the project-independent editor settings. These settings are generally visible in the Editor > Editor Settings menu.
Property names use slash delimiters to distinguish sections. Setting values can be of any Variant type. It's recommended to use snake_case for editor settings to be consistent with the Godot editor itself.
Accessing the settings can be done using the following methods, such as:
# `settings.set("some/property", value)` also works as this class overrides `_set()` internally.
settings.set_setting("some/property",value)
# `settings.get("some/property", value)` also works as this class overrides `_get()` internally.
settings.get_setting("some/property")
var list_of_settings = settings.get_property_list()
Note: This class shouldn't be instantiated directly. Instead, access the singleton using EditorInterface.get_editor_settings.
| void | add_property_info ( Dictionary info ) |
| void | erase ( String property ) |
| PoolStringArray | get_favorites ( ) const |
| Variant | get_project_metadata ( String section, String key, Variant default=null ) const |
| String | get_project_settings_dir ( ) const |
| PoolStringArray | get_recent_dirs ( ) const |
| Variant | get_setting ( String name ) const |
| String | get_settings_dir ( ) const |
| bool | has_setting ( String name ) const |
| bool | property_can_revert ( String name ) |
| Variant | property_get_revert ( String name ) |
| void | set_favorites ( PoolStringArray dirs ) |
| void | set_initial_value ( String name, Variant value, bool update_current ) |
| void | set_project_metadata ( String section, String key, Variant data ) |
| void | set_recent_dirs ( PoolStringArray dirs ) |
| void | set_setting ( String name, Variant value ) |
Emitted after any editor setting has changed.
Adds a custom property info to a property. The dictionary must contain:
name: String (the name of the property)type: int (see Variant.Type)hint: int (see PropertyHint) and hint_string: String
Example:
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)
Erases the setting whose name is specified by property.
Returns the list of favorite files and directories for this project.
Returns project-specific metadata for the section and key specified. If the metadata doesn't exist, default will be returned instead. See also set_project_metadata.
Returns the project-specific settings path. Projects all have a unique subdirectory inside the settings path where project-specific settings are saved.
Returns the list of recently visited folders in the file dialog for this project.
Returns the value of the setting specified by name. This is equivalent to using Object.get on the EditorSettings instance.
Gets the global settings path for the engine. Inside this path, you can find some standard paths such as:
settings/tmp - Used for temporary storage of files
settings/templates - Where export templates are located
Returns true if the setting specified by name exists, false otherwise.
Returns true if the setting specified by name can have its value reverted to the default value, false otherwise. When this method returns true, a Revert button will display next to the setting in the Editor Settings.
Returns the default value of the setting specified by name. This is the value that would be applied when clicking the Revert button in the Editor Settings.
Sets the list of favorite files and directories for this project.
Sets the initial value of the setting specified by name to value. This is used to provide a value for the Revert button in the Editor Settings. If update_current is true, the current value of the setting will be set to value as well.
Sets project-specific metadata with the section, key and data specified. This metadata is stored outside the project folder and therefore won't be checked into version control. See also get_project_metadata.
Sets the list of recently visited folders in the file dialog for this project.
Sets the value of the setting specified by name. This is equivalent to using Object.set on the EditorSettings instance.
© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/3.2/classes/class_editorsettings.html