EditorSettings¶
Inherits: Resource < Reference < Object
Object that holds the project-independent editor settings.
Description¶
Object that holds the project-independent editor settings. These settings are generally visible in the Editor > Editor Settings menu.
Accessing the settings is done by using the regular Object API, such as:
settings.set(prop,value)
settings.get(prop)
list_of_settings = settings.get_property_list()
Note: This class shouldn’t be instantiated directly. Instead, access the singleton using EditorInterface.get_editor_settings.
Methods¶
void | add_property_info ( Dictionary info ) |
void | erase ( String property ) |
PoolStringArray | get_favorites ( ) const |
Variant | get_project_metadata ( String section, String key, Variant default=null ) const |
String | get_project_settings_dir ( ) const |
PoolStringArray | get_recent_dirs ( ) const |
Variant | get_setting ( String name ) const |
String | get_settings_dir ( ) const |
bool | has_setting ( String name ) const |
bool | property_can_revert ( String name ) |
Variant | property_get_revert ( String name ) |
void | set_favorites ( PoolStringArray dirs ) |
void | set_initial_value ( String name, Variant value, bool update_current ) |
void | set_project_metadata ( String section, String key, Variant data ) |
void | set_recent_dirs ( PoolStringArray dirs ) |
void | set_setting ( String name, Variant value ) |
Constants¶
Method Descriptions¶
- void add_property_info ( Dictionary info )
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) andhint_string
: String
Example:
editor_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"
}
editor_settings.add_property_info(property_info)
- void erase ( String property )
Erase a given setting (pass full property path).
- PoolStringArray get_favorites ( ) const
Gets the list of favorite files and directories for this project.
- String get_project_settings_dir ( ) const
Gets the specific project settings path. Projects all have a unique sub-directory inside the settings path where project specific settings are saved.
- PoolStringArray get_recent_dirs ( ) const
Gets the list of recently visited folders in the file dialog for this project.
- String get_settings_dir ( ) const
Gets 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
- void set_favorites ( PoolStringArray dirs )
Sets the list of favorite files and directories for this project.
- void set_recent_dirs ( PoolStringArray dirs )
Sets the list of recently visited folders in the file dialog for this project.