Documentation
¶
Overview ¶
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 any 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:
package main import ( "graphics.gd/classdb/EditorInterface" "graphics.gd/variant/Object" ) func ExampleEditorSettings() { var settings = EditorInterface.GetEditorSettings() settings.SetSetting("some/property", 10) settings.GetSetting("some/property") var list_of_settings = Object.GetPropertyList(settings) _ = list_of_settings }
Note: This class shouldn't be instantiated directly. Instead, access the singleton using graphics.gd/classdb/EditorInterface.GetEditorSettings.
Index ¶
- Constants
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AddPropertyInfo(info Object.PropertyInfo)
- func (self Instance) AsEditorSettings() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) CheckChangedSettingsInGroup(setting_prefix string) bool
- func (self Instance) Erase(property string)
- func (self Instance) GetChangedSettings() []string
- func (self Instance) GetFavorites() []string
- func (self Instance) GetProjectMetadata(section string, key string) any
- func (self Instance) GetRecentDirs() []string
- func (self Instance) GetSetting(name string) any
- func (self Instance) HasSetting(name string) bool
- func (self Instance) ID() ID
- func (self Instance) MarkSettingChanged(setting string)
- func (self Instance) OnSettingsChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) SetBuiltinActionOverride(name string, actions_list []InputEvent.Instance)
- func (self Instance) SetFavorites(dirs []string)
- func (self Instance) SetInitialValue(name string, value any, update_current bool)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetProjectMetadata(section string, key string, data any)
- func (self Instance) SetRecentDirs(dirs []string)
- func (self Instance) SetSetting(name string, value any)
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
const NotificationEditorSettingsChanged Object.Notification = 10000 //gd:EditorSettings.NOTIFICATION_EDITOR_SETTINGS_CHANGED
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 Expanded ¶
type Expanded [1]gdclass.EditorSettings
func (Expanded) GetProjectMetadata ¶
Returns project-specific metadata for the 'section' and 'key' specified. If the metadata doesn't exist, 'default' will be returned instead. See also Instance.SetProjectMetadata.
type Extension ¶
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
func (*Extension[T]) AsEditorSettings ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
type 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.
type Instance ¶
type Instance [1]gdclass.EditorSettings
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 (Instance) AddPropertyInfo ¶
func (self Instance) AddPropertyInfo(info Object.PropertyInfo)
Adds a custom property info to a property. The dictionary must contain:
- name: string (the name of the property)
- type: int (see [Variant.Type])
- optionally hint: int (see [PropertyHint]) and hint_string: string
func (Instance) AsEditorSettings ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) CheckChangedSettingsInGroup ¶
Checks if any settings with the prefix 'setting_prefix' exist in the set of changed settings. See also Instance.GetChangedSettings.
func (Instance) 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 NotificationEditorSettingsChanged.
func (Instance) GetFavorites ¶
Returns the list of favorite files and directories for this project.
func (Instance) GetProjectMetadata ¶
Returns project-specific metadata for the 'section' and 'key' specified. If the metadata doesn't exist, 'default' will be returned instead. See also Instance.SetProjectMetadata.
func (Instance) GetRecentDirs ¶
Returns the list of recently visited folders in the file dialog for this project.
func (Instance) GetSetting ¶
Returns the value of the setting specified by 'name'. This is equivalent to using graphics.gd/classdb/Object.Instance.Get on the EditorSettings instance.
func (Instance) HasSetting ¶
Returns true if the setting specified by 'name' exists, false otherwise.
func (Instance) MarkSettingChanged ¶
Marks the passed editor setting as being changed, see Instance.GetChangedSettings. Only settings which exist (see Instance.HasSetting) will be accepted.
func (Instance) OnSettingsChanged ¶
func (Instance) SetBuiltinActionOverride ¶
func (self Instance) SetBuiltinActionOverride(name string, actions_list []InputEvent.Instance)
Overrides the built-in editor action 'name' with the input actions defined in 'actions_list'.
func (Instance) SetFavorites ¶
Sets the list of favorite files and directories for this project.
func (Instance) SetInitialValue ¶
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.
func (Instance) SetProjectMetadata ¶
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 Instance.GetProjectMetadata.
func (Instance) SetRecentDirs ¶
Sets the list of recently visited folders in the file dialog for this project.
func (Instance) SetSetting ¶
Sets the 'value' of the setting specified by 'name'. This is equivalent to using graphics.gd/classdb/Object.Instance.Set on the EditorSettings instance.