EditorSettings
Editor environment settings, separate from game project settings.
Obtain the current object through EditorInterface.Singleton.GetEditorSettings(). Read optional keys through HasSetting() and GetSetting(), accounting for the Variant type. Do not dispose the borrowed singleton.
C# IDE selection lives in dotnet/editor/external_editor; the general Text Editor handler uses a different setting branch. Reading a value neither launches an IDE, verifies its installation nor builds a project.
External editor setup and diagnosis.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
EditorSettingsConstructor
public EditorSettings();Methods24
AddPropertyInfovoid
public void AddPropertyInfo(Reckfell.Collections.Dictionary info);Adds a custom property info to a property. The dictionary must contain:
var settings = GetEditorInterface().GetEditorSettings();
settings.Set("category/property_name", 0);
var propertyInfo = new Reckfell.Collections.Dictionary
{
{ "name", "category/propertyName" },
{ "type", Variant.Type.Int },
{ "hint", PropertyHint.Enum },
{ "hint_string", "one,two,three" },
};
settings.AddPropertyInfo(propertyInfo);| Name | Type | Default |
|---|---|---|
info | Reckfell.Collections.Dictionary | — |
AddShortcutvoid
public void AddShortcut(string path, Shortcut shortcut);Adds a shortcut whose path is specified by path.
The path determines how the shortcut is organized and displayed in the editor's shortcut settings. The path format affects the display as follows:
"name"(no slash): Creates a category namednamewith the shortcut displayed asname."category/name"(single slash): Displays asnamein thecategorysection."category/name/extra"(multiple slashes): Extra path components are ignored, so this behaves the same as"category/name". Note: Shortcuts are only saved to the editor settings if they differ from their original/default state. This means empty shortcuts that were originally empty will not persist between editor sessions and must be re-added. If a shortcut with the samepathalready exists, this method will update it with the newshortcutinstead of creating a duplicate.
| Name | Type | Default |
|---|---|---|
path | string | — |
shortcut | Shortcut | — |
CheckChangedSettingsInGroupbool
public bool CheckChangedSettingsInGroup(string settingPrefix);Checks if any settings with the prefix setting_prefix exist in the set of changed settings. See also EditorSettings.GetChangedSettings.
| Name | Type | Default |
|---|---|---|
settingPrefix | string | — |
boolErasevoid
public void Erase(string property);Erases the setting whose name is specified by property.
| Name | Type | Default |
|---|---|---|
property | string | — |
GetChangedSettingsstring[]
public string[] GetChangedSettings();Gets an array of the settings which have been changed since the last save. Note that internally changed_settings is cleared after a successful save, so generally the most appropriate place to use this method is when processing EditorSettings.NotificationEditorSettingsChanged.
string[]GetFavoritesstring[]
public string[] GetFavorites();Returns the list of favorite files and directories for this project.
string[]GetProjectMetadataVariant
public Variant GetProjectMetadata(string section, string key, Variant @default = default);Returns project-specific metadata for the section and key specified. If the metadata doesn't exist, default will be returned instead. See also EditorSettings.SetProjectMetadata.
| Name | Type | Default |
|---|---|---|
section | string | — |
key | string | — |
default | Variant | default |
VariantGetRecentDirsstring[]
public string[] GetRecentDirs();Returns the list of recently visited folders in the file dialog for this project.
string[]GetSettingVariant
public Variant GetSetting(string name);Read an editor setting by its exact path. Call HasSetting() first for an optional key and check the Variant type before conversion. dotnet/editor/ and text_editor/external/ settings belong to different handlers.
| Name | Type | Default |
|---|---|---|
name | string | — |
nameThe exact editor setting key, not its localized UI label.
VariantThe current setting value as a Variant.
GetShortcutShortcut
public Shortcut GetShortcut(string path);Returns the shortcut specified by path. Tries to find a built-in action if no shortcut with the provided path is found in the shortcut list. If found, adds it to the list and returns it, otherwise returns null.
| Name | Type | Default |
|---|---|---|
path | string | — |
ShortcutGetShortcutListstring[]
public string[] GetShortcutList();Returns the list of stored shortcut paths.
string[]HasSettingbool
public bool HasSetting(string name);Check whether a setting exists in the editor object. Use before GetSetting() for optional integration settings. A key does not establish that a program is installed or that an IDE launch succeeded.
| Name | Type | Default |
|---|---|---|
name | string | — |
nameThe exact setting path, for example dotnet/editor/external_editor.
booltrue when the setting key exists.
HasShortcutbool
public bool HasShortcut(string path);Returns true if the shortcut specified by path exists, false otherwise.
| Name | Type | Default |
|---|---|---|
path | string | — |
boolIsShortcutbool
public bool IsShortcut(string path, InputEvent @event);Returns true if the shortcut specified by path matches the event specified by event, false otherwise.
| Name | Type | Default |
|---|---|---|
path | string | — |
event | InputEvent | — |
boolMarkSettingChangedvoid
public void MarkSettingChanged(string setting);Marks the passed editor setting as being changed, see EditorSettings.GetChangedSettings. Only settings which exist (see EditorSettings.HasSetting) will be accepted.
| Name | Type | Default |
|---|---|---|
setting | string | — |
RemoveShortcutvoid
public void RemoveShortcut(string path);Removes the shortcut specified by path.
| Name | Type | Default |
|---|---|---|
path | string | — |
SetBuiltinActionOverridevoid
public void SetBuiltinActionOverride(string name, Reckfell.Collections.Array<InputEvent> actionsList);Overrides the built-in editor action name with the input actions defined in actions_list.
| Name | Type | Default |
|---|---|---|
name | string | — |
actionsList | Reckfell.Collections.Array<InputEvent> | — |
SetFavorites2 overloads
public void SetFavorites(ReadOnlySpan<string> dirs);Sets the list of favorite files and directories for this project.
| Name | Type | Default |
|---|---|---|
dirs | ReadOnlySpan<string> | — |
public void SetFavorites(string[] dirs);Sets the list of favorite files and directories for this project.
| Name | Type | Default |
|---|---|---|
dirs | string[] | — |
SetInitialValuevoid
public void SetInitialValue(StringName name, Variant value, bool updateCurrent);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 setting is reset to value as well.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
value | Variant | — |
updateCurrent | bool | — |
SetProjectMetadatavoid
public void SetProjectMetadata(string section, string key, Variant data);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 EditorSettings.GetProjectMetadata.
| Name | Type | Default |
|---|---|---|
section | string | — |
key | string | — |
data | Variant | — |
SetRecentDirs2 overloads
public void SetRecentDirs(ReadOnlySpan<string> dirs);Sets the list of recently visited folders in the file dialog for this project.
| Name | Type | Default |
|---|---|---|
dirs | ReadOnlySpan<string> | — |
public void SetRecentDirs(string[] dirs);Sets the list of recently visited folders in the file dialog for this project.
| Name | Type | Default |
|---|---|---|
dirs | string[] | — |
SetSettingvoid
public void SetSetting(string name, Variant value);Sets the value of the setting specified by name. This is equivalent to using ReckfellObject.Set on the EditorSettings instance.
| Name | Type | Default |
|---|---|---|
name | string | — |
value | Variant | — |
Signals and events1
SettingsChangedEvent
public event Action SettingsChanged;Emitted after any editor setting has changed.
Fields and constants1
NotificationEditorSettingsChangedField
public const long NotificationEditorSettingsChanged = 10000;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.