Documentation
¶
Overview ¶
Package EditorSettings provides methods for working with EditorSettings object instances.
Index ¶
- Constants
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AddPropertyInfo(info 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
- type PropertyInfo
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 [param section] and [param key] specified. If the metadata doesn't exist, [param default] will be returned instead. See also [method set_project_metadata].
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
Object that holds the project-independent editor settings. These settings are generally visible in the [b]Editor > Editor Settings[/b] menu. 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: [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. settings.get_setting("some/property") var list_of_settings = settings.get_property_list() [/gdscript] [csharp] EditorSettings settings = EditorInterface.Singleton.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<Godot.Collections.Dictionary> listOfSettings = settings.GetPropertyList(); [/csharp] [/codeblocks] [b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_editor_settings].
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 PropertyInfo)
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] [codeblocks] [gdscript] var settings = EditorInterface.get_editor_settings() 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" }
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]
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 [param setting_prefix] exist in the set of changed settings. See also [method get_changed_settings].
func (Instance) GetChangedSettings ¶
Gets an array of the settings which have been changed since the last save. Note that internally [code]changed_settings[/code] is cleared after a successful save, so generally the most appropriate place to use this method is when processing [constant NOTIFICATION_EDITOR_SETTINGS_CHANGED].
func (Instance) GetFavorites ¶
Returns the list of favorite files and directories for this project.
func (Instance) GetProjectMetadata ¶
Returns project-specific metadata for the [param section] and [param key] specified. If the metadata doesn't exist, [param default] will be returned instead. See also [method set_project_metadata].
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 [param name]. This is equivalent to using [method Object.get] on the EditorSettings instance.
func (Instance) HasSetting ¶
Returns [code]true[/code] if the setting specified by [param name] exists, [code]false[/code] otherwise.
func (Instance) MarkSettingChanged ¶
Marks the passed editor setting as being changed, see [method get_changed_settings]. Only settings which exist (see [method has_setting]) 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 [param name] with the input actions defined in [param 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 [param name] to [param value]. This is used to provide a value for the Revert button in the Editor Settings. If [param update_current] is [code]true[/code], the setting is reset to [param value] as well.
func (Instance) SetProjectMetadata ¶
Sets project-specific metadata with the [param section], [param key] and [param data] specified. This metadata is stored outside the project folder and therefore won't be checked into version control. See also [method get_project_metadata].
func (Instance) SetRecentDirs ¶
Sets the list of recently visited folders in the file dialog for this project.
func (Instance) SetSetting ¶
Sets the [param value] of the setting specified by [param name]. This is equivalent to using [method Object.set] on the EditorSettings instance.