2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2020-02-01 02:03:48 +01:00
<class name= "EditorSettings" inherits= "Resource" version= "4.0" >
2017-09-12 22:42:36 +02:00
<brief_description >
Object that holds the project-independent editor settings.
</brief_description>
<description >
2019-06-22 01:04:47 +02:00
Object that holds the project-independent editor settings. These settings are generally visible in the [b]Editor > Editor Settings[/b] menu.
2020-07-17 11:34:18 +02:00
Property names use slash delimiters to distinguish sections. Setting values can be of any [Variant] type. It's recommended to use [code]snake_case[/code] for editor settings to be consistent with the Godot editor itself.
Accessing the settings can be done using the following methods, such as:
2020-09-13 14:45:36 +02:00
[codeblocks]
[gdscript]
var settings = EditorInterface.get_editor_settings()
# `settings.set("some/property", 10)` also works as this class overrides `_set()` internally.
settings.set_setting("some/property", 10)
# `settings.get("some/property")` also works as this class overrides `_get()` internally.
2020-07-17 11:34:18 +02:00
settings.get_setting("some/property")
var list_of_settings = settings.get_property_list()
2020-09-13 14:45:36 +02:00
[/gdscript]
[csharp]
EditorSettings settings = GetEditorInterface().GetEditorSettings();
// `settings.set("some/property", value)` also works as this class overrides `_set()` internally.
settings.SetSetting("some/property", Value);
// `settings.get("some/property", value)` also works as this class overrides `_get()` internally.
settings.GetSetting("some/property");
Godot.Collections.Array listOfSettings = settings.GetPropertyList();
[/csharp]
[/codeblocks]
2020-04-14 22:09:21 +02:00
[b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_editor_settings].
2017-09-12 22:42:36 +02:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "add_property_info" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "info" type= "Dictionary" />
2017-09-12 22:42:36 +02:00
<description >
2019-12-06 23:09:20 +01:00
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]
2019-06-22 01:04:47 +02:00
[b]Example:[/b]
2020-09-13 14:45:36 +02:00
[codeblocks]
[gdscript]
var settings = EditorInterface.get_editor_settings()
settings.set("category/property_name", 0)
2017-09-12 22:42:36 +02:00
var property_info = {
"name": "category/property_name",
"type": TYPE_INT,
"hint": PROPERTY_HINT_ENUM,
"hint_string": "one,two,three"
}
2020-09-13 14:45:36 +02:00
settings.add_property_info(property_info)
[/gdscript]
[csharp]
var settings = GetEditorInterface().GetEditorSettings();
settings.Set("category/property_name", 0);
var propertyInfo = new Godot.Collections.Dictionary
{
{"name", "category/propertyName"},
{"type", Variant.Type.Int},
{"hint", PropertyHint.Enum},
{"hint_string", "one,two,three"}
};
settings.AddPropertyInfo(propertyInfo);
[/csharp]
[/codeblocks]
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "erase" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "property" type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2020-07-17 11:34:18 +02:00
Erases the setting whose name is specified by [code]property[/code].
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-09-18 14:02:59 +02:00
<method name= "get_favorites" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "PackedStringArray" />
2017-09-12 22:42:36 +02:00
<description >
2020-07-17 11:34:18 +02:00
Returns the list of favorite files and directories for this project.
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-05-16 17:23:20 +02:00
<method name= "get_project_metadata" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Variant" />
<argument index= "0" name= "section" type= "String" />
<argument index= "1" name= "key" type= "String" />
<argument index= "2" name= "default" type= "Variant" default= "null" />
2018-05-16 17:23:20 +02:00
<description >
2020-07-17 11:34:18 +02:00
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].
2018-05-16 17:23:20 +02:00
</description>
</method>
2018-05-28 14:53:15 +02:00
<method name= "get_project_settings_dir" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2020-07-17 11:34:18 +02:00
Returns the project-specific settings path. Projects all have a unique subdirectory inside the settings path where project-specific settings are saved.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_recent_dirs" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "PackedStringArray" />
2017-09-12 22:42:36 +02:00
<description >
2020-07-17 11:34:18 +02:00
Returns the list of recently visited folders in the file dialog for this project.
2017-09-12 22:42:36 +02:00
</description>
</method>
2017-10-11 23:54:43 +02:00
<method name= "get_setting" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Variant" />
<argument index= "0" name= "name" type= "String" />
2017-10-11 23:54:43 +02:00
<description >
2020-07-17 11:34:18 +02:00
Returns the value of the setting specified by [code]name[/code]. This is equivalent to using [method Object.get] on the EditorSettings instance.
2017-10-11 23:54:43 +02:00
</description>
</method>
<method name= "has_setting" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "name" type= "String" />
2017-10-11 23:54:43 +02:00
<description >
2020-07-17 11:34:18 +02:00
Returns [code]true[/code] if the setting specified by [code]name[/code] exists, [code]false[/code] otherwise.
2017-10-11 23:54:43 +02:00
</description>
</method>
<method name= "property_can_revert" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "name" type= "String" />
2017-10-11 23:54:43 +02:00
<description >
2020-07-17 11:34:18 +02:00
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.
2017-10-11 23:54:43 +02:00
</description>
</method>
<method name= "property_get_revert" >
2021-07-30 15:28:05 +02:00
<return type= "Variant" />
<argument index= "0" name= "name" type= "String" />
2017-10-11 23:54:43 +02:00
<description >
2020-07-17 11:34:18 +02:00
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.
2017-10-11 23:54:43 +02:00
</description>
</method>
2021-02-19 13:35:31 +01:00
<method name= "set_builtin_action_override" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "name" type= "String" />
<argument index= "1" name= "actions_list" type= "Array" />
2021-02-19 13:35:31 +01:00
<description >
</description>
</method>
2018-09-18 14:02:59 +02:00
<method name= "set_favorites" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "dirs" type= "PackedStringArray" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Sets the list of favorite files and directories for this project.
2017-09-12 22:42:36 +02:00
</description>
</method>
2017-10-11 23:54:43 +02:00
<method name= "set_initial_value" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "name" type= "StringName" />
<argument index= "1" name= "value" type= "Variant" />
<argument index= "2" name= "update_current" type= "bool" />
2017-10-11 23:54:43 +02:00
<description >
2020-07-17 11:34:18 +02:00
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.
2017-10-11 23:54:43 +02:00
</description>
</method>
2018-05-16 17:23:20 +02:00
<method name= "set_project_metadata" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "section" type= "String" />
<argument index= "1" name= "key" type= "String" />
<argument index= "2" name= "data" type= "Variant" />
2018-05-16 17:23:20 +02:00
<description >
2020-07-17 11:34:18 +02:00
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].
2018-05-16 17:23:20 +02:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "set_recent_dirs" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "dirs" type= "PackedStringArray" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Sets the list of recently visited folders in the file dialog for this project.
2017-09-12 22:42:36 +02:00
</description>
</method>
2017-10-11 23:54:43 +02:00
<method name= "set_setting" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "name" type= "String" />
<argument index= "1" name= "value" type= "Variant" />
2017-10-11 23:54:43 +02:00
<description >
2020-07-17 11:34:18 +02:00
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.
2017-10-11 23:54:43 +02:00
</description>
</method>
2017-09-12 22:42:36 +02:00
</methods>
<signals >
<signal name= "settings_changed" >
<description >
2020-07-17 11:34:18 +02:00
Emitted after any editor setting has changed.
2017-09-12 22:42:36 +02:00
</description>
</signal>
</signals>
<constants >
2019-07-05 10:28:59 +02:00
<constant name= "NOTIFICATION_EDITOR_SETTINGS_CHANGED" value= "10000" >
2020-07-17 11:34:18 +02:00
Emitted after any editor setting has changed. It's used by various editor plugins to update their visuals on theme changes or logic on configuration changes.
2019-07-05 10:28:59 +02:00
</constant>
2017-09-12 22:42:36 +02:00
</constants>
</class>