EditorSettings

Inherits: Resource < Reference < Object

Category: Core

Brief Description

Object that holds the project-independent editor settings.

Methods

voidadd_property_info ( Dictionary info )
voiderase ( String property )
PoolStringArrayget_favorites ( ) const
Variantget_project_metadata ( String section, String key, Variant default=null ) const
Stringget_project_settings_dir ( ) const
PoolStringArrayget_recent_dirs ( ) const
Variantget_setting ( String name ) const
Stringget_settings_dir ( ) const
boolhas_setting ( String name ) const
boolproperty_can_revert ( String name )
Variantproperty_get_revert ( String name )
voidset_favorites ( PoolStringArray dirs )
voidset_initial_value ( String name, Variant value, bool update_current )
voidset_project_metadata ( String section, String key, Variant data )
voidset_recent_dirs ( PoolStringArray dirs )
voidset_setting ( String name, Variant value )

Signals

  • settings_changed ( )

Description

Object that holds the project-independent editor settings. These settings are generally visible in the Editor Settings menu.

Accessing the settings is done by using the regular Object API, such as:

  1. settings.set(prop,value)
  2. settings.get(prop)
  3. list_of_settings = settings.get_property_list()

Method Descriptions

Add a custom property info to a property. The dictionary must contain: name:String(the name of the property) and type:int(see TYPE_* in @GlobalScope), and optionally hint:int(see PROPERTY_HINT_* in @GlobalScope), hint_string:String.

Example:

  1. editor_settings.set("category/property_name", 0)
  2. var property_info = {
  3. "name": "category/property_name",
  4. "type": TYPE_INT,
  5. "hint": PROPERTY_HINT_ENUM,
  6. "hint_string": "one,two,three"
  7. }
  8. editor_settings.add_property_info(property_info)

  • void erase ( String property )

Erase a given setting (pass full property path).


Get the list of favorite files and directories for this project.



  • String get_project_settings_dir ( ) const

Get the specific project settings path. Projects all have a unique sub-directory inside the settings path where project specific settings are saved.


Get the list of recently visited folders in the file dialog for this project.



  • String get_settings_dir ( ) const

Get 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





Set the list of favorite files and directories for this project.




Set the list of recently visited folders in the file dialog for this project.